Authorization API
API reference
Get Status

This endpoint provides information about the status of a credit authorization approval flow for an authorization identified by an id supplied in the URL.

Endpoint

GET /authorization/{id}

Response

200 OK - Credit Authorization Completed

This response is returned when the synchronous part of the credit authorization approval flow, including the ID validation process, has been completed.

Note: After approval, Avarda performs additional background processing. Order Management methods cannot be used until this processing is completed. Use this endpoint to find out about the state of this processing The InBackOffice field in the response indicates whether the processing is finished (see also Flow Details note).

NameData TypeDescription
StatusStringStatus of the authorization
0 = Credit approved
1 = Credit rejected by Avarda
2 = Credit reservation cancelled due to ID validation timeout
3 = Authorization failed due to internal error
CreditLimitDecimalApproved credit limit - used only when Status=0(Credit approved)
InBackOfficeBooleanIndicates whether the background processing is completed (see note above).
ErrorCodeIntError code - used only when Status is not 0(Credit approved)
ErrorMessageStringError message - used only when Status is not 0(Credit approved). Localized in language of the Customer passed in credit request (userLanguageCode)
AuthorizationIDString (GUID)ID of the credit authorization
RequestObjectA copy of original credit authorization request body

List of errors

ErrorCodeError Message (English)
1..7See Credit rejected list of error
50User did not complete ID validation in time
51User failed ID Validation with the identity provider
52During ID validation the user authenticated with a SSN different than the one in the original credit request
100Service timeout, please try later again
101Service internal error, please try later or contact the support desk

Example

{
    "status": 0,
    "creditLimit": 150.0,
    "inBackOffice": false,
    "forced": false,
    "errorCode": null,
    "errorMessage": null,
    "authorizationId": "85a9340dde6641f3897d5d6b49fa49d0",
    "request": {
        "customer": {
            "identificationNumber": "193404016234",
            "userLanguageCode": 246,
            "phone": "0705485413",
            "email": "ove@abc.se"
        },
        "invoicingAddress": {
            "firstName": "Ove",
            "lastName": "Lindahl",
            "addressLine1": "Åsögatan 56",
            "addressLine2": null,
            "city": "Stockholm",
            "zip": "11829"
        },
        "deliveryAddress": {
            "country": "Sweeden",
            "firstName": "Parvaneh",
            "lastName": "Kourosh",
            "addressLine1": "Åsögatan 58",
            "addressLine2": null,
            "city": "Stockholm",
            "zip": "11830"
        },
        "useDifferentDeliveryAddress": true,
        "items": [
            {
                "description": "Beach shirt",
                "notes": null,
                "amount": 100.0,
                "taxCode": null,
                "taxAmount": 12.0,
                "productGroup": null,
                "quantity": 1
            },
            {
                "description": "Travel shorts",
                "notes": null,
                "amount": 50.0,
                "taxCode": null,
                "taxAmount": 24.0,
                "productGroup": null,
                "quantity": 1
            }
        ],
        "orderReference": "ST-3242-239",
        "posId": "A35",
        "description": null,
        "emailInvoice": null,
        "forcedDistributionMethod": null,
        "loyaltyNumber": null,
        "forceCreditDecision": false,
        "idValidationCallbackUrl": "http://beachware.com/api/id-validation"
    }
}

202 Accepted - Waiting for ID Validation Completion

This response is returned when the ID validation process has not yet been completed by the Customer.

NameData TypeDescription
RedirectUrlStringID Validation provider link
IdValidationStatusStringState of ID Validation
0 = In progress
1 = Cancelled by Customer or ID provider error
2 = Validated SSN does not match SSN in request
AuthorizationIDString (GUID)ID of the credit authorization
RequestObjectA copy of original credit authorization request body

Note: If IdValidationStatus is 1 or 2, the RedirectUrl link can be reused to retry the ID validation (see Detailed Flow).

Example

{
    "redirectUrl": "https://idp-bankid.avarda.com/connect/authorize?response_type=code&state=9xRGFeJgNuJ_RdP-MsbHlw&code_challenge=8WbbgCdreGpC962E6tvEtJLP4UdNao5V7WStfFsIpnM&code_challenge_method=S256&client_id=auth-api&scope=openid%20profile&redirect_uri=https%3A%2F%2Flocalhost%3A5001%2Fidcallback%2Fbankidswe&login_hint=198808183092&ui_locales=fi&authorization_id=6a23a60d-f59e-4dcc-871a-0ca7fd294590",
    "forced": false,
    "idValidationStatus": 0,
    "authorizationId": "51a233e5b0c04adb9be0bc5b356cc384",
    "request": {
        "customer": {
            "identificationNumber": "193404016234",
            "userLanguageCode": 246,
            "phone": "0705485413",
            "email": "ove@abc.se"
        },
        "invoicingAddress": {
            "firstName": "Ove",
            "lastName": "Lindahl",
            "addressLine1": "Åsögatan 56",
            "addressLine2": null,
            "city": "Stockholm",
            "zip": "11829"
        },
        "deliveryAddress": {
            "country": "Sweeden",
            "firstName": "Parvaneh",
            "lastName": "Kourosh",
            "addressLine1": "Åsögatan 58",
            "addressLine2": null,
            "city": "Stockholm",
            "zip": "11830"
        },
        "useDifferentDeliveryAddress": true,
        "items": [
            {
                "description": "Beach shirt",
                "notes": null,
                "amount": 100.0,
                "taxCode": null,
                "taxAmount": 12.0,
                "productGroup": null,
                "quantity": 1
            },
            {
                "description": "Travel shorts",
                "notes": null,
                "amount": 100.0,
                "taxCode": null,
                "taxAmount": 24.0,
                "productGroup": null,
                "quantity": 1
            }
        ],
        "orderReference": "ST-3242-239",
        "posId": "A35",
        "description": null,
        "emailInvoice": null,
        "forcedDistributionMethod": null,
        "loyaltyNumber": null,
        "forceCreditDecision": false,
        "idValidationCallbackUrl": "http://beachware.com/api/id-validation"
    }
}

404 Not Found - Invalid Authorization ID

This response is returned when no credit authorization exists for the specified ID.