The API is designed to streamline the checkout process by allowing users to easily utilize previously used bank account information at a merchant’s checkout, aiming to enhance payment conversion, decrease transaction time, and encourage repeat usage. The API also offers a list of banks for users to choose from during checkout. Consumers of the API can decide whether to display clickable bank accounts and banks, only banks, or only accounts.

Overview

A full Azura Core Deposit flow includes these requests:

  • AzuraDeposit (mandatory)

  • RemoveAzuraAccount (optional)

  • Deposit (mandatory)

The AzuraDeposit request provides an Azura SessionID, which must be included in subsequent requests.

AzuraDeposit

The AzuraDeposit request provides checkout components without needing to start an order with Trustly.

🚧

Legal requirements

In compliance with legal requirements, if a clickable bank account or bank is presented during the checkout process, it is imperative to prominently display the terms and conditions and privacy policy. This ensures transparency and informs users of their rights and obligations before proceeding with the transaction.

It's important to note that the terms and conditions and privacy policy may vary between countries, as each country may have its own regulations governing these documents. Therefore, it is essential to display the terms and conditions and privacy policy relevant to the country to which the banks and bank accounts belong.

If no bank accounts or banks are presented in the merchant's checkout for selection, it is not necessary to display the terms and conditions and privacy policy.

Request example

{
  "method": "AzuraDeposit",
  "params": {
    "Signature": "f4ThjuMqbsdG6u ... S16VbzD4h==",
    "UUID": "258a2184-2842-b485-25ca-293525152425",
    "Data": {
      "Username": "merchant_username",
      "Password": "merchant_password",
      "MessageID": "your_unique_request_id",
      "Attributes": {
        "Email": "[email protected]",
        "MobilePhone": "+46709876543",
        "EndUserID": "12345",
        "Country": "SE",
        "Locale": "sv_SE",
        "Currency": "SEK"
      }
    }
  },
  "version": "1.1"
}

Request parameters

Parameter nameDescriptionRequiredTypeExample
UsernameThe username.YesTextJoe
PasswordThe password.YesTextSecret
MessageIDYour unique ID for the request.YesText12345678

Attributes

The 'Attributes' parameter is an object containing attributes.

Note: New attributes may be added in future API versions, but existing ones will never be removed.

Attribute nameDescriptionRequiredTypeExample
EmailThe email of the consumer. NoText[email protected]
MobilePhoneThe mobile phone number of the end-user in international format.NoText+46071234567
EndUserIDID, username, hash or anything uniquely identifying the end-user requesting the deposit.Preferably the same ID/username as used in the merchant's own backoffice in order to simplify for the merchant's support department.NoText12345
CountryThe ISO 3166-1-alpha-2 code of the end-user's country.YesTextSE
CurrencyThe currency of the end-user's account in the merchant's system.YesTextSEK
RequestKYCOnly for Gaming
If it's set to 1, it means requiring KYC.
NoNumeric1
PSPMerchantOnly for Express Merchant Onboarding
Human-readable identifier of the consumer-facing merchant (e.g. legal name or trade name).

Note: It is required for using Express Merchant Onboarding and aggregate traffic under a master processing account. It is also mandatory for E-wallets used directly in your checkout, where you use Trustly to transfer funds from the customer's e-money account ("funding stage") into your e-money account.
NoTextMerchant Ltd.
RequestDirectDebitMandateOnly for Trustly Direct Debit.
Request a direct debit mandate from the selected account. 1 or 0. See section "Direct Debit Mandates" below for details.
NoNumeric1
QuickDepositOnly for Trustly Direct Debit.
In order to let the consumer choose to sign up for a recurring mandate, the attribute QuickDeposit with the value "1" shall be included in the call.
NoNumeric1

Response examples

The response might include an end-user's bank accounts if they have previously used Trustly.

📘

Note: When no accounts are found, the accounts array is empty.

{
  "result": {
    "signature": "4F8hjuMqbsH0Ku ... S16VbzRsw==",
    "uuid": "258a2184-2842-b485-25ca-293525152425",
    "method": "AzuraDeposit",
    "version": "1.1",
    "data": {
      "azurasessionid": "a7e1f6e8-67d4-4ea5-8d4b-36dbf6927e8f",
      "accounts":[
       {
        "accountid": "123456789",
        "accountnumbermasked": "**** 392",
        "accountnumberlastdigits": "392",
        "bank": {
          "bankcountry": "SE",
          "bankcode": "SWED",
          "bankname": "Swedbank",
          "banklogoround": "https://asset.trustly.com/assets/se/swed.svg"
        }       
       }
      ],
      "trustlyinfo": {
        "trustlylogo1": "https://assets.trustly.com/black-background-logo.svg",
        "trustlylogo2": "https://assets.trustly.com/white-background-logo.svg",
        "trustlylogo3": "https://assets.trustly.com/green-background-logo.svg",
        "trustlylogo4": "https://assets.trustly.com/no-background-logo.svg"
      },
      "countries": [
        {
          "countrycode": "SE",
          "termsandconditions": {
            "sv": "http://trustly.com/terms/SE/sv.pdf",
            "en": "http://trustly.com/terms/SE/en.pdf"
          },
          "privacypolicy": {
            "sv": "http://trustly.com/privacy/SE/sv.pdf",
            "en": "http://trustly.com/privacy/SE/en.pdf"
          },
          "banks": [
            {
              "bankcountry": "SE",
              "bankcode": "SWED",
              "bankname": "Swedbank", 
              "bankid": "sweden.swed",
              "outoforder": false, 
              "banklogoround": "https://asset.trustly.com/swed_round.svg"
            },
            {
              "bankcountry": "SE",
              "bankcode": "NDEA",
              "bankname": "Nordea",
              "bankid": "sweden.ndea",
              "outoforder": false, 
              "banklogoround": "https://asset.trustly.com/ndea_round.svg"
            }
          ]
        }
      ]
    }
  }
}
{
  "result": {
    "signature": "4F8hjuMqbsH0Ku ... S16VbzRsw==",
    "uuid": "258a2184-2842-b485-25ca-293525152425",
    "method": "AzuraDeposit",
    "version": "1.1",
    "data": {
      "azurasessionid": "a7e1f6e8-67d4-4ea5-8d4b-36dbf6927e8f",
      "accounts":[],
      "trustlyinfo": {
        "trustlylogo1": "https://assets.trustly.com/black-background-logo.svg",
        "trustlylogo2": "https://assets.trustly.com/white-background-logo.svg",
        "trustlylogo3": "https://assets.trustly.com/green-background-logo.svg",
        "trustlylogo4": "https://assets.trustly.com/no-background-logo.svg"
      },     
      "countries": [
        {
          "countrycode": "SE",
          "termsandconditions": {
            "sv": "http://trustly.com/terms/SE/sv.pdf",
            "en": "http://trustly.com/terms/SE/en.pdf"
          },
          "privacypolicy": {
            "sv": "http://trustly.com/privacy/SE/sv.pdf",
            "en": "http://trustly.com/privacy/SE/en.pdf"
          },
          "banks": [
            {
              "bankcountry": "SE",
              "bankcode": "SWED",
              "bankname": "Swedbank", 
              "bankid": "sweden.swed",
              "outoforder": false, 
              "banklogoround": "https://asset.trustly.com/swed_round.svg"
            },
            {
              "bankcountry": "SE",
              "bankcode": "NDEA",
              "bankname": "Nordea", 
              "bankid": "sweden.ndea",
              "outoforder": false, 
              "banklogoround": "https://asset.trustly.com/ndea_round.svg"
            }
          ]
        }
      ]
    }
  }
}

Response attributes

The response provides an object with the following attributes:

Attribute nameDescriptionType
azurasessionidID that you will send in the next call.Text
accountsArray of objects containing information about the found accounts, sorted with the best match listed first. See table below for details.Array
trustlyinfoTrustly assets.Object
countriesA list of countries and their banks, which can be utilized to display bank logos in the checkout.Object

Account attributes

This table outlines the attributes of an account present within the accounts array.

Attribute nameDescriptionType
accountidIdentifies the suggested account. You will send this account id in the next call if the user chose to continue with this account.Text
accountnumbermaskedA masked representation of the account number.Text
accountnumberlastdigitsThe last digits of the account number.Text
bankAn object with bank data. See table below for details.Object

Bank attributes

This table outlines the attributes of a bank

Attribute nameDescriptionType
bankcountryCountry code for the suggested account. ISO 3166-1 alpha-2Text
bankcodeBank code for the suggested account. This is 4 uppercase chars.Text
banknameName of the bank.Text
bankidThe ID of the bank. This ID should be used when initiating the deposit using SELECT_BANK action.Text
outoforderIf the bank is out of order. If true it should not be possible to select the bank in the merchant´s checkout.Boolean
banklogoroundLink to bank logo of the bank.Text

Country attributes

This table outlines the attributes of a country

Attribute nameDescriptionType
countrycodeCountry code ISO 3166-1 alpha-2Text
termsandconditionsAn object with mappings from two letter ISO 639 language code to a link to Trustly’s terms and conditions.Object
privacypolicyAn object with mappings from two letter ISO 639 language code to a link to Trustly’s privacy policy.Object
banksAvailable banks in this country.Array

RemoveAzuraAccount

The RemoveAzuraAccount request removes the specified account from Azura. It's optional and doesn't trigger a deposit with Trustly, enabling the removal of the end-user without navigating to the Trustly checkout.

Request example

{
  "method": "RemoveAzuraAccount",
  "version": "1.1",
  "params": {
    "Signature": "f4ThjuMqbsdG6u ... S16VbzD4h==",
    "UUID": "258a2184-2842-b485-25ca-293525152425",
    "MessageID": "your_unique_request_id",
    "Data": {
      "Username": "merchant_username",
      "Password": "merchant_password",
      "MessageID": "your_unique_request_id",
      "Attributes": {
        "AzuraSessionID": "55410fc4-d4f4-4725-b5c6-62131761dc6e",
        "AccountID": "123456789"
      }
    }
  }
}

Request parameters

Parameter nameDescriptionRequiredTypeExample
UsernameThe username.YesTextJoe
PasswordThe password.YesTextSecret
MessageIDYour unique ID for the request.YesText12345678

Attributes

The 'Attributes' parameter is an object containing attributes.

Attribute nameDescriptionRequiredTypeExample
AzuraSessionIDSame value that was returned in the response to the initial call to AzuraDeposit.YesText55410fc4-d4f4-4725-b5c6-62131761dc6e
AccountIDID of the account to be removed. This should be the same value as returned in the response to the initial AzuraDeposit call.YesText123456789

Response example

{
  "result": {
    "signature": "4F8hjuMqbsH0Ku ... S16VbzRsw==",
    "uuid": "258a2184-2842-b485-25ca-293525152425",
    "method": "RemoveAzuraAccount",
    "data": {
      "result": "1"
    }
  },
  "version": "1.1"
}
{
  "result": {
    "signature": "4F8hjuMqbsH0Ku ... S16VbzRsw==",
    "uuid": "258a2184-2842-b485-25ca-293525152425",
    "method": "RemoveAzuraAccount",
    "data": {
      "result": "0",
      "rejected": "ERROR_ACCOUNT_NOT_FOUND"
    }
  },
  "version": "1.1"
}

Response attributes

The response provides an object with the following attributes:

Attribute nameDescriptionType
result1 if the account was removed. 0 if it was not. If not removed there will be an additional error code in the rejected field.Text
rejectedIf the account was not removed there will be an error code here. Any of:

ERROR_ACCOUNT_NOT_FOUND - No account exists with this id.

ERROR_AZURA_SESSION_NOT_FOUND - If the session could not be found.
Text

Deposit

The Deposit request starts the deposit process at Trustly. It includes the same parameters as a standard deposit request, along with an additional Azura object containing attributes.

For more details on the deposit request, refer to: https://eu.developers.trustly.com/doc/reference/deposit.

Request examples

The deposit request must always include the Azura object if an AzuraDeposit method has been called earlier. It can include either an account or a bank to use for the deposit or just start a deposit without preselecting anything.

{
  "method": "Deposit",
  "params": {
    "Signature": "f4ThjuMqbsdG6u ... S16VbzD4h==",
    "UUID": "55410fc4-d4f4-4725-b5c6-62131761dc6e",
    "Data": {
      "Attributes": {
        "Azura": {
          "AzuraSessionID": "55410fc4-d4f4-4725-b5c6-62131761dc6e",
          "Action": "SELECT_ACCOUNT",
          "AccountID": "12345678"
        }
      }
    }
  }
}
{
  "method": "Deposit",
  "params": {
    "Signature": "f4ThjuMqbsdG6u ... S16VbzD4h==",
    "UUID": "55410fc4-d4f4-4725-b5c6-62131761dc6e",
    "Data": {
      "Attributes": {
        "Azura": {
          "AzuraSessionID": "55410fc4-d4f4-4725-b5c6-62131761dc6e",
          "Action": "SELECT_BANK",
          "BankID": "sweden.swed"
        }
      }
    }
  }
}
{
  "method": "Deposit",
  "params": {
    "Signature": "f4ThjuMqbsdG6u ... S16VbzD4h==",
    "UUID": "55410fc4-d4f4-4725-b5c6-62131761dc6e",
    "Data": {
      "Attributes": {
        "Azura": {
          "AzuraSessionID": "55410fc4-d4f4-4725-b5c6-62131761dc6e",
          "Action": "NO_SELECTION"
        }
      }
    }
  }
}

Request parameters

This table lists only the Azura-specific parameters. Refer to the deposit documentation for details on other parameters.

🚧

Please ensure that the parameters used in the deposit call exactly match those specified in the corresponding AzuraDeposit call. For instance, if AzuraDeposit was called with 'Country': 'SE' and 'Currency': 'SEK', the deposit call must use the same values.

Parameter nameDescriptionRequiredTypeExample
AzuraSessionIDSame value that was returned in the response to the initial call to AzuraDeposit.YesText55410fc4-d4f4-4725-b5c6-62131761dc6e
ActionSELECT_ACCOUNT: Deposit will have specified account preselected.

SELECT_BANK: Deposit will have specified bank preselected.

NO_SELECTION: Deposit will not have a preselected account or bank.
YesTextSELECT_ACCOUNT
AccountIDId of the account that user wants to use. Should be the value from the field ‘accountid’ that is returned from the AzuraDeposit call.Yes, if action is ‘SELECT_ACCOUNT’Text12345678
BankIDId of the bank to use. Should be the value from the field ‘bankid’ that is returned from the AzuraDeposit call.Yes, if action is ‘SELECT_BANK’Textsweden.swed

Response

The response includes the same data as a standard deposit. For more details on deposit responses, refer to: https://eu.developers.trustly.com/doc/reference/deposit#response-example.

Error codes

Error NumError CodeDescription
620ERROR_UNKNOWNThere could be several reasons for this error, please reach out to your Trustly contact for details.
622ERROR_INVALID_CURRENCY_CODEThe currency code is invalid. See Currencies page for valid currencies.
623ERROR_INVALID_PARAMETERSSome value or parameter in the deposit call does not match the expected format.
737ERROR_INVALID_COUNTRYThe Country code sent in the API call is invalid.
755ERROR_INVALID_ACCOUNT_IDThe AccountID sent in the API call is invalid.
759ERROR_AZURA_SESSION_EXPIREDThe AzuraSessionID has expired. The session is only live for 30 minutes. 
760ERROR_AZURA_ACCOUNT_NOT_FOUNDThe AccountID was not found.