albis.updateApplication - ALBIS-GROUP/LeaseKitSDK-JS GitHub Wiki
albis.updateApplication(values, albisToken) ⇒ ResponseUpdateApplication
updateApplication(values, albisToken) updates an application. Warning: empty/null values will overwrite atributes to empty/null. If you wouldn't like to overwrite value to empty/null then please fill the attribute with proper data
Kind: instance method of Albis
Returns: ResponseUpdateApplication - response object
| Param | Type | Description |
|---|---|---|
| values | Object |
An object with application data |
| values.id | number |
application number, which will be updated |
| values.contactByEmail | boolean |
indicator that the leasing contract should be sent to the lessee by e-mail after approval |
| values.contractType | number |
contract type |
| values.downPayment | number |
down payment |
| values.iban | string |
iban |
| values.lessee | Object |
lessee data |
| values.lessee.city | string |
lessee city |
| values.lessee.email | string |
lessee email |
| values.lessee.legalForm | number |
lessee legal form |
| values.lessee.name | string |
lessee name |
| values.lessee.phoneNumber | string |
lessee phone number |
| values.lessee.street | string |
lessee street |
| values.lessee.zipCode | string |
lessee zip code |
| values.leaseTerm | number |
lease term (returned from getRates() method) |
| values.object | string |
name of the object (80 char max) |
| values.paymentMethod | number |
payment method |
| values.productGroup | number |
product group |
| values.promotionId | string |
promotionId (returned from getRates() if conditions matched any promotion) |
| values.provision | string |
defines how much commission, retailer wants to receives for each deal. Possible values min: 0, max: 5. Default 0 |
| values.purchasePrice | number |
purchase price (object value) |
| values.receiverEndpoint | string |
endpoint address where requests about application/documentation updates should be delivered |
| values.receiverFailEmails | Array.<String> |
array of string emails where info about connection with reveiver endpoint should be delivered |
| values.receiverToken | string |
a string, which can be used by a client to ensure that the notification concerns his application |
| values.rate | number |
rate (returned from getRates() method) |
| values.reference | string |
application reference (helper for shop employees) |
| values.residualValuePercent | number |
required if contract type equals 2 |
| albisToken | Object |
object with Albis token, which lets to communicate with SDK API (returned from getAlbisToken() method) |
Example
Albis.updateApplication(
{
"applicationId": 272076,
"contactByEmail": true,
"contractType": 1,
"downPayment": 1000,
"iban": "DE88100900001234567892",
"leaseTerm": 54,
"lessee": {
"name": "John Doe",
"legalForm": 1,
"street": "Fifth Avenue 10",
"zipCode": "50000",
"city": "Wroclaw",
"email": "[email protected]",
"phoneNumber": "123456789"
},
"object": "Skoda",
"paymentMethod": 2,
"productGroup": 1,
"provision": 2,
"promotionId": "zyx",
"purchasePrice": 50000,
"rate": 10,
"reference": "abc321321",
"receiverEndpoint": "https://companyName/shop1",
"receiverFailEmails": ["[email protected]", "[email protected]"]
},
{ token: '12345' })Kind: global typedef
Properties
| Name | Type | Description |
|---|---|---|
| response.result | null |
null |
| response.jsonrpc | string |
"2.0" |
| response.id | number |
json rpc lib id |
| response.receiverToken | string |
receiver token (if used in input params), a string, which can be used by a client to ensure that the notification concerns his application |