This documentation page contains information common for the following endpoints:
POST authorization/direct-invoice
POST authorization/loan
POST authorization/invoice
POST authorization/part-payment
Most request properties are shared across all these endpoints. These common properties are listed in the Request Common Properties section. Additional endpoint-specific properties are detailed in their respective sections.
All endpoints return the same response objects, which are documented in the Responses section.
Request Common Properties
Name | Data Type | Mandatory/Default Value | Description |
---|---|---|---|
Customer | Customer | Mandatory | Customer personal information |
InvoicingAddress | Address | Mandatory | Address for the Invoice |
DeliveryAddress | Address | Optional | Mandatory if UseDifferentDeliveryAddress = true |
UseDifferentDeliveryAddress | Boolean | Optional, false | If delivery address is different from invoicing address |
Items | Array of Item | Mandatory | A list of items representing the individual rows on an invoice. Individual items may have a negative value but the total sum of all items must be positive. |
OrderReference | String(50) | Mandatory | Partner custom ID reference. |
PosID | String(10) | Mandatory | ID of point of sales. To identify locations or stores. |
Description | String(100) | Optional | Free text description of the order |
EmailInvoice | Boolean | Optional | If to send the invoice by email. If not specified the default value from Partner configuration is used. |
ForcedDistributionMethod | Enumeration | Optional | If specified it overrides EmailInvoice property and the default value from Partner configuration. Possible values: 1 = No print 2 = Send printed 3 = Send email 4 = Partner handled |
LoyaltyNumber | String(10) | Optional | Currently only stored, reserved for future needs |
IdValidationCallbackUrl | String | Optional | Optional ID validation redirect URL. If used, it overrides the default URL specified in the partner site configuration |
Customer
Name | Data Type | Mandatory/Default Value | Description |
---|---|---|---|
IdentificationNumber | String | Mandatory | Social security number or national ID number (depending on market) |
UserLanguageCode | Int | Mandatory | Customer languages - used in returned informational and error message (based on country ISO codes (opens in a new tab)) 208 = Dk 246 = Fi 578 = No 752 = Se 826 = En |
Phone | String(15) | Mandatory | Customer mobile phone number. Validation according to country of origin. |
String(60) | Mandatory |
Address
Name | Data Type | Mandatory/Default Value | Description |
---|---|---|---|
FirstName | String(40) | Mandatory | |
LastName | String(40) | Mandatory | |
AddressLine1 | String(40) | Mandatory | Typically a street name and street number |
AddressLine2 | String(40) | Optional | |
City | String(30) | Mandatory | |
Zip | String | Mandatory | Format is validated depending on the market |
Item
Name | Data Type | Mandatory/Default Value | Description |
---|---|---|---|
Description | String(35) | Mandatory | Item description - typically placed on an invoice line |
Notes | String(35) | Optional | Additional notes - might not be displayed on the invoice. |
Amount | Decimal | Mandatory | The single item amount. Can be negative, zero or positive. The tax amount should be included in this amount. |
TaxCode | String(20) | Optional | The tax code to be displayed on the invoice. The value should be in %. If the tax code is 25% send in 25. |
TaxAmount | Decimal | Optional, 0.00 | The item tax amount. Can be zero or positive. |
ProductGroup | String(50) | Optional | Currently only stored, reserved for future needs |
Quantity | Int | Optional, 1 | The number of items - Amount is multiplied by Quantity to get the total amount |
Responses
The format of the response HTTP status and the response body depends on the outcome of the credit decision - see Flow Details
201 Created
- Credit Approved - ID Validation Not Required
Name | Data Type | Description |
---|---|---|
CreditLimit | Decimal | Credit amount granted |
AuthorizationId | String (GUID) | Unique ID of the credit authorization - use in subsequent Status or Order Management calls |
Example
202 Accepted
- Credit Approved - ID Validation Required
Name | Data Type | Description |
---|---|---|
Forced | Boolean | |
RedirectUrl | Decimal | Link to redirect the Customer for ID validation |
AuthorizationId | String (GUID) | Unique ID of the credit authorization - use in subsequent Status or Order Management calls |
Example
400 Bad Request
- Invalid Request Data
The response is in a standard RFC 9457 (opens in a new tab) format and contains list of validation errors in plain English. Note that it is expected that the Partner validates the data on its own UI. The validation on Authorization API is provided as a safeguard of the last resort and the validation messages are intended as a hint for the developers - therefore they are not localized into the Customer language.
Example
422 Unprocessable Entity
- Credit Authorization Rejected
Name | Data Type | Description |
---|---|---|
ErrorCode | Int | Type of the error |
ErrorMessage | String | Error details localized to Customer language |
AuthorizationId | String (GUID) | ID of the rejected credit authorization for future references |
Example
List of Errors
ErrorCode | ErrorMessage (English) |
---|---|
1,2 | Credit not approved please try different payment method |
3 | Credit not approved please check that name and address details match registered address |
4 | Credit not approved due to incorrect amount |
5,6 | The application cannot be granted due to an invalid personal identity number. Please check your social security number or choose another payment method at checkout |
7 | Invalid email format |
The ErrorMessage
provides a hint as to why the credit was rejected. The ErrorCode
further narrows down the reason; however, this code is only meaningful to Avarda. If you need to investigate a particular rejected authorization, pass the code to Avarda support for assistance.
500 Internal Server Error
- Technical Error
Name | Data Type | Description |
---|---|---|
ErrorCode | Int | Type of the error |
ErrorMessage | String | Error details |
AuthorizationId | String (GUID) | ID of the failed credit authorization |
Example