albis.saveApplication - ALBIS-GROUP/LeaseKitSDK-JS GitHub Wiki
albis.saveApplication(values, albisToken) ⇒ ResponseSaveApplication
saveApplication(values, albisToken) saves an application
Kind: instance method of Albis
Returns: ResponseSaveApplication - response - response object
| Param | Type | Description |
|---|---|---|
| values | Object |
An object with application data |
| [values.contactByEmail] | boolean |
indicator that the leasing contract should be sent to the lessee by e-mail after approval. TRUE/FALSE, Default:FALSE (optional) |
| values.contractType | number |
contract type (result of getContractTypes() method) |
| [values.downPayment] | number |
down payment (optional) |
| [values.iban] | string |
IBAN of account to be charged with contract instalments (may be entered with spaces) (optional) |
| 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.lessee.manager | Object |
lessee's manager data |
| values.lessee.manager.birthDate | string |
lessee's manager birth date (format required: "YYYY-MM-DD") |
| values.lessee.manager.city | string |
lessee's manager city |
| [values.lessee.manager.faxNumber] | string |
lessee's manager phone number (optional) |
| values.lessee.manager.firstName | string |
lessee's manager first name |
| values.lessee.manager.lastName | string |
lessee's manager last name |
| [values.lessee.manager.phoneNumber] | string |
lessee's manager phone number (optional) |
| values.lessee.manager.salutation | integer |
lessee's manager salutation form id (result of getSalutations() method) |
| values.lessee.manager.street | string |
lessee's manager street |
| values.lessee.manager.zipCode | string |
lessee's manager 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 (result of getPaymentMethods() method) |
| values.productGroup | number |
product group (is a part of "credentials". Can be assigned by Albis only) |
| [values.promotionId] | string |
lease term (returned from getRates() if conditions matched any promotion) (optional) |
| values.purchasePrice | number |
purchase price (object value) |
| values.rate | number |
rate (returned from getRates() method) |
| [values.reference] | string |
application reference (helper for shop employees) (optional) |
| [values.receiverEndpoint] | string |
endpoint address where requests about application/documentation updates should be delivered (optional) |
| [values.receiverFailEmails] | Array.<String> |
array of string emails where info about connection with reveiver endpoint should be delivered (optional) |
| [values.receiverToken] | string |
a string, which can be used by a client to ensure that the notification concerns his application (optional) |
| [values.residualValuePercent] | number |
required if contract type equals 2 (optional) |
| [values.serviceFee] | number |
required if contract type equals 7 or 12 (optional) |
| albisToken | Object |
object with Albis token, which lets to communicate with SDK API (returned from getAlbisToken() method) |
Example
Albis.saveApplication(
{
contactByEmail: true,
contractType: 1,
downPayment: 500,
finalPayment: 150,
iban: 'DE88100900001234567892',
lessee: {
name: 'Antonina',
street: 'Lichtenrade',
city: 'Berlin',
zipCode: '50000',
phoneNumber: '+48500000000',
email: '[email protected]',
legalForm: 1,
manager: {
salutation: 1,
firstName: 'Johanna',
lastName: 'Surname',
street: 'Piłsudskiego',
zipCode: '50000',
city: 'Hamburg',
birthDate: '1990-12-30'
},
},
leaseTerm: 12,
object: 'Fridge VW',
paymentMethod: 1,
productGroup: 1,
promotionId: 'xyz',
purchasePrice: 5000,
rate: 300,
rateWithInsurance: 323,
reference: 'abc123',
ssv: true,
receiverToken: '123abc',
receiverEndpoint: 'company.com/endpoint',
receiverFailEmails: ['[email protected]', '[email protected]']
},
{token: '12345'})Kind: global typedef
Properties
| Name | Type | Description |
|---|---|---|
| response.id | string |
json rpc lib id |
| response.jsonrpc | string |
json rpc version number ("2.0") |
| response.result | number |
a unique number of the application |
| 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 |