> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://amer.developers.trustly.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://amer.developers.trustly.com/_mcp/server.

# Establish a new Transaction for authorization

POST https://sandbox.trustly.one/api/v1/establish
Content-Type: application/json

This endpoint creates a new unauthorized transaction and returns a URL to be provided for a user to authorize the transaction. After the user has authorized the transaction with a bank, the transaction can be used with other Trustly APIs to retrieve account data or process payments.

For more details and descriptions of the fields supported by this endpoint see [Establish Data object](doc:features/establish-data-object).

> **Note for Money Transfer** 
> If your application is configured for "Money Transfer" many properties in the `customer`, `beneficiary` and `beneficiaryAccount` objects will be required. 
> See [Send money](/integrate/send-money) for more details.

Reference: https://amer.developers.trustly.com/api-reference/api/transactions/post-establish

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Trustly API
  version: 1.0.0
paths:
  /establish:
    post:
      operationId: post-establish
      summary: Establish a new Transaction for authorization
      description: >-
        This endpoint creates a new unauthorized transaction and returns a URL
        to be provided for a user to authorize the transaction. After the user
        has authorized the transaction with a bank, the transaction can be used
        with other Trustly APIs to retrieve account data or process payments.


        For more details and descriptions of the fields supported by this
        endpoint see [Establish Data
        object](doc:features/establish-data-object).


        > **Note for Money Transfer** 

        > If your application is configured for "Money Transfer" many properties
        in the `customer`, `beneficiary` and `beneficiaryAccount` objects will
        be required. 

        > See [Send money](/integrate/send-money) for more details.
      tags:
        - subpackage_transactions
      parameters:
        - name: createTransaction
          in: query
          description: >-
            If true, Trustly will return a transactionId that can be used with
            other API's. Either createTransaction or notify is required.
          required: false
          schema:
            type: boolean
        - name: notify
          in: query
          description: >-
            If true, Trustly will notify the User via SMS or Email with a URL
            that can be used to complete the transaction. Either
            createTransaction or notify is required.
          required: false
          schema:
            type: boolean
        - name: channel
          in: query
          description: >-
            Comma separated list of notification channels. Currently only sms
            and email are supported. Example: sms,email will send a notification
            via SMS and email to the User. Required if notify is true.
          required: false
          schema:
            type: string
        - name: Authorization
          in: header
          description: ''
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EstablishData'
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              type: object
              properties:
                merchantId:
                  type: string
                  description: Your Trustly-provided Merchant ID.
                accessId:
                  type: string
                  description: Your Trustly-provided client application access ID.
                amount:
                  type: string
                  description: >-
                    The amount of the transaction. This represents the maximum
                    amount of the transactions that can be processed with the
                    Authorization. If the amount is 0.00, there will be no upper
                    bound on the transaction. (10 characters with support for 2
                    decimal places)
                currency:
                  $ref: >-
                    #/components/schemas/EstablishPostRequestBodyContentApplicationJsonSchemaCurrency
                  description: 3-letter ISO Currency Code.
                description:
                  type: string
                  description: >-
                    A summary description of the order. Do not pass Consumer PII
                    (name, email address, etc) in this field.
                returnUrl:
                  type: string
                  description: >-
                    The URL where the user should be redirected to when the user
                    successfully authorizes the transaction (must be a valid URL
                    or function).
                cancelUrl:
                  type: string
                  description: >-
                    The URL where the user should be redirected to if the user
                    exits or the transaction is canceled (must be a valid URL or
                    function).
                notificationUrl:
                  type: string
                  description: >-
                    Notification URL to use for notifications associated with
                    this transaction. This overrides the notification URL
                    configured by Trustly during onboarding.
                paymentType:
                  $ref: >-
                    #/components/schemas/EstablishPostRequestBodyContentApplicationJsonSchemaPaymentType
                  description: >-
                    Specifies the type of transaction to create. Possible values
                    are Instant, Deferred, Disbursement, Recurring,
                    Verification, and Retrieval. Default is Retrieval.

                     **Note:** If your application is configured for "Money Transfer" and utilizes the "Instant" `paymentType` several properties under `customer`, `beneficiary` and `beneficiaryAccount` will be required. 
                    > See [Send money](/integrate/send-money) for more details.
                requestSignature:
                  type: string
                  description: Request Signature used to secure the request.
                displayAmount:
                  type: number
                  format: double
                  description: >-
                    Optionally displays the provided transaction amount to the
                    user throughout the Lightbox experience.
                merchantReference:
                  type: string
                  description: >-
                    A unique identifier that you create to represent the
                    Transaction in the Trustly system.
                customer:
                  $ref: '#/components/schemas/Customer'
                account:
                  $ref: >-
                    #/components/schemas/EstablishPostRequestBodyContentApplicationJsonSchemaAccount
                  description: >-
                    Account information. Required if paymentType is Verification
                    and a transactionId is not included.
                beneficiary:
                  $ref: >-
                    #/components/schemas/EstablishPostRequestBodyContentApplicationJsonSchemaBeneficiary
                beneficiaryAccount:
                  $ref: >-
                    #/components/schemas/EstablishPostRequestBodyContentApplicationJsonSchemaBeneficiaryAccount
                  description: >-
                    Financial institution account associated with the ultimate
                    beneficiary of a transaction. Required when using
                    `paymentType: Instant` for [Money
                    Transfer](/integrate/send-money)
                kycType:
                  type: string
                  description: >-
                    Specifies the KYC (Know Your Customer) type. This field is
                    optional and can only be used by merchants configured for
                    [Trustly ID](/integrate/retrieve-data/trustly-id).
                metadata:
                  $ref: >-
                    #/components/schemas/EstablishPostRequestBodyContentApplicationJsonSchemaMetadata
                  description: >-
                    Provide additional use case-specific properties in this
                    object.
              required:
                - merchantId
                - accessId
                - currency
                - returnUrl
                - cancelUrl
                - requestSignature
                - merchantReference
servers:
  - url: https://sandbox.trustly.one/api/v1
    description: Sandbox
components:
  schemas:
    EstablishPostRequestBodyContentApplicationJsonSchemaCurrency:
      type: string
      enum:
        - USD
        - CAD
      description: 3-letter ISO Currency Code.
      title: EstablishPostRequestBodyContentApplicationJsonSchemaCurrency
    EstablishPostRequestBodyContentApplicationJsonSchemaPaymentType:
      type: string
      enum:
        - Retrieval
        - Deferred
        - Disbursement
        - Instant
        - Recurring
        - Verification
      description: >-
        Specifies the type of transaction to create. Possible values are
        Instant, Deferred, Disbursement, Recurring, Verification, and Retrieval.
        Default is Retrieval.

         **Note:** If your application is configured for "Money Transfer" and utilizes the "Instant" `paymentType` several properties under `customer`, `beneficiary` and `beneficiaryAccount` will be required. 
        > See [Send money](/integrate/send-money) for more details.
      title: EstablishPostRequestBodyContentApplicationJsonSchemaPaymentType
    Address:
      type: object
      properties:
        address1:
          type: string
          description: Address line 1 (e.g., street or PO Box)
        address2:
          type: string
          description: Address line 2 (e.g., apartment, suite or unit number)
        city:
          type: string
          description: City, district, town or village
        state:
          type: string
          description: State, province or region code
        zip:
          type: string
          description: ZIP or Postal Code
        country:
          type: string
          description: >-
            2 character [ISO Country
            code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
      required:
        - country
      description: Valid mailing or billing address associated with the customer
      title: Address
    CustomerCustomData:
      type: object
      properties: {}
      description: Object for sending merchant-specific custom data.
      title: CustomerCustomData
    DriverLicense:
      type: object
      properties:
        number:
          type: string
          description: Driver License number.
        state:
          type: string
          description: 2 character ISO State code.
      required:
        - number
        - state
      title: DriverLicense
    Customer:
      type: object
      properties:
        name:
          type: string
          description: Full name of the Customer
        taxId:
          type: string
          description: >-
            Customer tax ID (e.g. SSN [US], SIN [CA]). *May be required
            depending on industry and location.*
        address:
          $ref: '#/components/schemas/Address'
        phone:
          type: string
          description: Customer phone number.
        email:
          type: string
          description: Customer email address.
        dateOfBirth:
          type: string
          description: Customer date of birth.
        createdAt:
          type: integer
          description: The record created date and time as a UNIX timestamp.
        updatedAt:
          type: integer
          description: The record created date and time as a UNIX timestamp.
        customerId:
          type: string
          description: A unique Trustly customer identifier.
        externalId:
          type: string
          description: A unique merchant customer identifier.
        merchantId:
          type: string
          description: A unique Trustly merchant identifier.
        enrollDate:
          type: integer
          description: >-
            Date of the user's first transaction in your system, regardless of
            payment method used as a UNIX timestamp.
        vip:
          type: string
          description: >-
            Range that determines how low-risk the customer represents to the
            merchant
        currency:
          type: string
          description: Customer currency.
        balance:
          type: string
          description: >-
            Customer account balance (not associated with a financial
            institution account).
        organizationNumber:
          type: string
          description: Organization number for business accounts
        externalTier:
          type: string
          description: >-
            It should describe the customer''s rank to the merchant (e.g. Gold,
            Diamond, 4 stars, etc.)
        personId:
          type: string
          description: Unique customer identity throughout different banks.
        customData:
          $ref: '#/components/schemas/CustomerCustomData'
          description: Object for sending merchant-specific custom data.
        driverLicense:
          $ref: '#/components/schemas/DriverLicense'
        nationalId:
          type: string
          description: Customer National ID
      required:
        - name
        - address
        - phone
        - email
      description: >-
        The Trustly customer object, containing identification details and
        contact information.
      title: Customer
    EstablishPostRequestBodyContentApplicationJsonSchemaAccount:
      type: object
      properties:
        routingNumber:
          type: string
          description: Bank Routing Number
        accountNumber:
          type: string
          description: Bank Account Number
        type:
          type: string
          description: Financial Institution Account Type
      description: >-
        Account information. Required if paymentType is Verification and a
        transactionId is not included.
      title: EstablishPostRequestBodyContentApplicationJsonSchemaAccount
    EstablishPostRequestBodyContentApplicationJsonSchemaBeneficiary:
      type: object
      properties:
        name:
          type: string
          description: Full name of the Customer
        taxId:
          type: string
          description: >-
            Customer tax ID (e.g. SSN [US], SIN [CA]). *May be required
            depending on industry and location.*
        address:
          $ref: '#/components/schemas/Address'
        phone:
          type: string
          description: Customer phone number.
        email:
          type: string
          description: Customer email address.
        dateOfBirth:
          type: string
          description: Customer date of birth.
        createdAt:
          type: integer
          description: The record created date and time as a UNIX timestamp.
        updatedAt:
          type: integer
          description: The record created date and time as a UNIX timestamp.
      description: >-
        The ultimate beneficiary of this payment. Required when using
        `paymentType: Instant` for [Money Transfer](/integrate/send-money)
      title: EstablishPostRequestBodyContentApplicationJsonSchemaBeneficiary
    PaymentProviderSubType:
      type: string
      enum:
        - '1000'
        - '2000'
        - '2001'
      description: |
        Financial Institution Account Type:
         * `1000`: Online Banking
         * `2000`: Manual Entry
         * `2001`: Manual Entry with Challenge Deposit
      title: PaymentProviderSubType
    PaymentProviderCountry:
      type: string
      enum:
        - US
        - CA
        - UK
        - DE
        - AU
      description: 2-letter ISO country code of the financial institution
      title: PaymentProviderCountry
    PaymentProvider:
      type: object
      properties:
        paymentProviderId:
          type: string
          description: A unique identifier for the Payment Provider.
        type:
          type: number
          format: double
        name:
          type: string
          description: Name of the payment provider
        instantPayoutAvailable:
          type: boolean
          description: Whether payment provider supports instant payout.
        subType:
          $ref: '#/components/schemas/PaymentProviderSubType'
          description: |
            Financial Institution Account Type:
             * `1000`: Online Banking
             * `2000`: Manual Entry
             * `2001`: Manual Entry with Challenge Deposit
        swift:
          type: string
        address:
          $ref: '#/components/schemas/Address'
        country:
          $ref: '#/components/schemas/PaymentProviderCountry'
          description: 2-letter ISO country code of the financial institution
        instantPayment:
          type: boolean
      required:
        - name
      description: Details of the Financial institution
      title: PaymentProvider
    EstablishPostRequestBodyContentApplicationJsonSchemaBeneficiaryAccount:
      type: object
      properties:
        accountNumber:
          type: number
          format: double
        iban:
          type: string
          description: International Bank Account Number (IBAN)
        paymentProvider:
          $ref: '#/components/schemas/PaymentProvider'
      description: >-
        Financial institution account associated with the ultimate beneficiary
        of a transaction. Required when using `paymentType: Instant` for [Money
        Transfer](/integrate/send-money)
      title: EstablishPostRequestBodyContentApplicationJsonSchemaBeneficiaryAccount
    EstablishPostRequestBodyContentApplicationJsonSchemaMetadataFinishButtonLabelType:
      type: string
      enum:
        - pay
        - deposit
        - withdraw
      description: >-
        Modify the final button label of the Trustly UI. The default label is
        "Continue", by passing a supported alternative in this property the
        button label can be changed to "Pay Now", "Deposit" or "Withdraw".
      title: >-
        EstablishPostRequestBodyContentApplicationJsonSchemaMetadataFinishButtonLabelType
    EstablishPostRequestBodyContentApplicationJsonSchemaMetadataIntegrationContext:
      type: string
      enum:
        - InAppBrowser
        - InAppBrowserNotify
        - ExternalBrowser
      description: >-
        Configuration required for mobile app compatibility with OAuth bank
        login flows. More details can be found in the [OAuth and Mobile apps
        guide](doc:oauth-guide).
      title: >-
        EstablishPostRequestBodyContentApplicationJsonSchemaMetadataIntegrationContext
    EstablishPostRequestBodyContentApplicationJsonSchemaMetadataClc:
      type: object
      properties:
        propertyId:
          type: number
          format: double
          description: ID number for property or location
        machineId:
          type: number
          format: double
          description: ID number specific to an associated Electronic Wagering System
        qrTimestamp:
          type: string
          format: date-time
          description: Timestamp of QR code generation
        playerNumber:
          type: number
          format: double
          description: Player tracking number
      description: >-
        Properties relating to Trustly In-Person configuration. Required for
        Trustly In-Person apps.
      title: EstablishPostRequestBodyContentApplicationJsonSchemaMetadataClc
    EstablishPostRequestBodyContentApplicationJsonSchemaMetadata:
      type: object
      properties:
        lang:
          type: string
          description: >-
            Display language for text in the Trustly UI using the [ISO 639
            Language
            Code](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes)
            format (e.g. `de_DE` or `fr_CA`). Defaults to `en_US` if not
            provided.
        finishButtonLabelType:
          $ref: >-
            #/components/schemas/EstablishPostRequestBodyContentApplicationJsonSchemaMetadataFinishButtonLabelType
          description: >-
            Modify the final button label of the Trustly UI. The default label
            is "Continue", by passing a supported alternative in this property
            the button label can be changed to "Pay Now", "Deposit" or
            "Withdraw".
        integrationContext:
          $ref: >-
            #/components/schemas/EstablishPostRequestBodyContentApplicationJsonSchemaMetadataIntegrationContext
          description: >-
            Configuration required for mobile app compatibility with OAuth bank
            login flows. More details can be found in the [OAuth and Mobile apps
            guide](doc:oauth-guide).
        urlScheme:
          type: string
          description: >-
            The deep link url associated with your mobile application. When
            users are directed to an external bank login or bank application on
            success or failure they will be redirected to this url. More details
            can be found in the [OAuth and Mobile apps guide](doc:oauth-guide).
        clc:
          $ref: >-
            #/components/schemas/EstablishPostRequestBodyContentApplicationJsonSchemaMetadataClc
          description: >-
            Properties relating to Trustly In-Person configuration. Required for
            Trustly In-Person apps.
      description: Provide additional use case-specific properties in this object.
      title: EstablishPostRequestBodyContentApplicationJsonSchemaMetadata
    EstablishDataCurrency:
      type: string
      enum:
        - USD
      description: 3-letter ISO Currency Code. Currently only USD is supported.
      title: EstablishDataCurrency
    EstablishDataKycType:
      type: string
      enum:
        - OnlineBanking
      description: >-
        Specifies the KYC (Know Your Customer) type as number. The possible
        value is 1 (OnlineBanking). This field is optional and can only be used
        by merchants configured for [Trustly
        ID](/integrate/retrieve-data/trustly-id).
      title: EstablishDataKycType
    VerificationStatus:
      type: string
      enum:
        - '1'
        - '2'
        - '3'
        - '4'
      description: "Verification Status:\n  * `1`: Automatic - Payment verification followed Trustly internal rules.\n  * `2`: ToVerify\t- Payment transaction is held (status = OnHold) for further investigation and approval by the merchant.\n  * `3`: Verified - Payment was verified and approved by the merchant or Trustly (see Verification Mode).\n  * `4`: Refused - Payment was denied by the merchant or Trustly after verification.\n"
      title: VerificationStatus
    VerificationMode:
      type: string
      enum:
        - '1'
        - '2'
        - '3'
        - '4'
      description: |
        Verification Mode:
          * `1`: VerifiedByMerchant
          * `2`: ApprovedByMerchant
          * `3`: VerifiedByTrustly
          * `4`: AmountAuthorizedByMerchant
      title: VerificationMode
    Verification:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/VerificationStatus'
          description: "Verification Status:\n  * `1`: Automatic - Payment verification followed Trustly internal rules.\n  * `2`: ToVerify\t- Payment transaction is held (status = OnHold) for further investigation and approval by the merchant.\n  * `3`: Verified - Payment was verified and approved by the merchant or Trustly (see Verification Mode).\n  * `4`: Refused - Payment was denied by the merchant or Trustly after verification.\n"
        mode:
          $ref: '#/components/schemas/VerificationMode'
          description: |
            Verification Mode:
              * `1`: VerifiedByMerchant
              * `2`: ApprovedByMerchant
              * `3`: VerifiedByTrustly
              * `4`: AmountAuthorizedByMerchant
        verifyCustomer:
          type: boolean
          description: >-
            If true, the Customer information (name and zip code) was verified
            against information provided by the User's bank.
      title: Verification
    AccountCountry:
      type: string
      enum:
        - US
        - CA
        - UK
        - DE
        - AU
      description: >-
        2-character ISO code of the country for the bank account that was
        selected. Currently only the US, CA, UK, DE, and AU are supported.
      title: AccountCountry
    FinancialInstitutionAccountVerificationType:
      type: string
      enum:
        - '1'
        - '2'
        - '3'
      description: "Verification Type:\n * `1`: Manual - The account was verified with manual account verification. For example, Manual Electronic Check and Micro Challenge Deposit.\n * `2`: Online Banking verification\t- The Account was verified using the Trustly Online Banking application.\n * `3`: Database verification\t- The Account was verified using the Trustly database or a Third-Party Service.  \n"
      title: FinancialInstitutionAccountVerificationType
    FinancialInstitutionAccountVerificationScore:
      type: string
      enum:
        - '0'
        - '1'
        - '2'
        - '3'
        - '4'
        - '5'
        - '6'
        - '7'
        - '8'
        - '9'
        - '10'
      description: |
        Verification Score:
         * `0`: Invalid input. The account or routing number are invalid. (Verified Mapping = false)
         * `1`: There is a strong indication that the account is invalid. (Verified Mapping = false)
         * `2`: There are active non-bankable returns on this account that are less than 3 years old. (Verified Mapping = false)
         * `3`: There are administrative returns on this account. (Verified Mapping = false)
         * `4`: The format appears to be suspicious. (Verified Mapping = false)
         * `5`: There is no data on this account or format. (Verified Mapping = false)
         * `6`: We have not seen this account, but the format appears to be valid. (Verified Mapping = true)
         * `7`: We have seen this account but have not received a final disposition on the transaction. (Verified Mapping = true)
         * `8`: We have seen this account, but not in the last 6 months, and have seen no returns associated with the account. (Verified Mapping = true)
         * `9`: We have seen this account in the last 6 months and have seen no returns associated with the account. (Verified Mapping = true)
         * `10`: This account has been directly validated with/by the financial institution or 3rd party. We have the highest confidence that this account is valid. (Verified Mapping = true)
      title: FinancialInstitutionAccountVerificationScore
    FinancialInstitutionAccountVerificationThirdPartyScore:
      type: string
      enum:
        - '0'
        - '100'
        - '200'
        - '300'
        - '400'
        - '500'
        - '600'
        - '700'
        - '800'
        - '900'
        - '999'
      description: |
        Verification Third-Party Score:
         * `0`: Failed RT validation. (Verified Mapping = 0)
         * `100`: The supplier has a strong indication that this account is invalid. (Verified Mapping = 1)
         * `200`: The supplier has active non-bankable debt(s) on this account that are less than 3 years old. (Verified Mapping = 2)
         * `300`: The supplier has administrative returns on this account. (Verified Mapping = 3)
         * `400`: The supplier does not have Neg data on this account, but the format appears to be suspicious. (Verified Mapping = 4)
         * `500`: The supplier does not have data on this account or format. (Verified Mapping = 5)
         * `600`: The supplier has not seen this account, but the format appears valid. (Verified Mapping = 6)
         * `700`: The supplier has seen this account, but did not receive a final disposition on the transaction. (Verified Mapping = 7)
         * `800`: The supplier has seen this account, but not in the last 6 months. (Verified Mapping = 8)
         * `900`: The supplier has seen this account in the last 6 months. (Verified Mapping = 9)
         * `999`: The supplier has the highest confidence that this account is valid. (Verified Mapping = 10)
      title: FinancialInstitutionAccountVerificationThirdPartyScore
    FinancialInstitutionAccountVerification:
      type: object
      properties:
        verified:
          type: boolean
          description: true if the account is verified; false otherwise.
        type:
          $ref: '#/components/schemas/FinancialInstitutionAccountVerificationType'
          description: "Verification Type:\n * `1`: Manual - The account was verified with manual account verification. For example, Manual Electronic Check and Micro Challenge Deposit.\n * `2`: Online Banking verification\t- The Account was verified using the Trustly Online Banking application.\n * `3`: Database verification\t- The Account was verified using the Trustly database or a Third-Party Service.  \n"
        hasEnoughFunds:
          type: boolean
          description: If true, there is enough balance in account.
        verificationDate:
          type: integer
          description: |-
            The date and time the verification was completed 
             as a UNIX timestamp.
        score:
          $ref: '#/components/schemas/FinancialInstitutionAccountVerificationScore'
          description: |
            Verification Score:
             * `0`: Invalid input. The account or routing number are invalid. (Verified Mapping = false)
             * `1`: There is a strong indication that the account is invalid. (Verified Mapping = false)
             * `2`: There are active non-bankable returns on this account that are less than 3 years old. (Verified Mapping = false)
             * `3`: There are administrative returns on this account. (Verified Mapping = false)
             * `4`: The format appears to be suspicious. (Verified Mapping = false)
             * `5`: There is no data on this account or format. (Verified Mapping = false)
             * `6`: We have not seen this account, but the format appears to be valid. (Verified Mapping = true)
             * `7`: We have seen this account but have not received a final disposition on the transaction. (Verified Mapping = true)
             * `8`: We have seen this account, but not in the last 6 months, and have seen no returns associated with the account. (Verified Mapping = true)
             * `9`: We have seen this account in the last 6 months and have seen no returns associated with the account. (Verified Mapping = true)
             * `10`: This account has been directly validated with/by the financial institution or 3rd party. We have the highest confidence that this account is valid. (Verified Mapping = true)
        thirdPartyScore:
          $ref: >-
            #/components/schemas/FinancialInstitutionAccountVerificationThirdPartyScore
          description: |
            Verification Third-Party Score:
             * `0`: Failed RT validation. (Verified Mapping = 0)
             * `100`: The supplier has a strong indication that this account is invalid. (Verified Mapping = 1)
             * `200`: The supplier has active non-bankable debt(s) on this account that are less than 3 years old. (Verified Mapping = 2)
             * `300`: The supplier has administrative returns on this account. (Verified Mapping = 3)
             * `400`: The supplier does not have Neg data on this account, but the format appears to be suspicious. (Verified Mapping = 4)
             * `500`: The supplier does not have data on this account or format. (Verified Mapping = 5)
             * `600`: The supplier has not seen this account, but the format appears valid. (Verified Mapping = 6)
             * `700`: The supplier has seen this account, but did not receive a final disposition on the transaction. (Verified Mapping = 7)
             * `800`: The supplier has seen this account, but not in the last 6 months. (Verified Mapping = 8)
             * `900`: The supplier has seen this account in the last 6 months. (Verified Mapping = 9)
             * `999`: The supplier has the highest confidence that this account is valid. (Verified Mapping = 10)
        numberOfTries:
          type: number
          format: double
          description: Number of tries allowed.
        numberOfAttemptsLeft:
          type: number
          format: double
          description: Number of remaining attempts.
      required:
        - verified
        - type
        - hasEnoughFunds
        - verificationDate
      title: FinancialInstitutionAccountVerification
    Account:
      type: object
      properties:
        providerId:
          type: string
          description: Payment provider ID.
        paymentProvider:
          $ref: '#/components/schemas/PaymentProvider'
        country:
          $ref: '#/components/schemas/AccountCountry'
          description: >-
            2-character ISO code of the country for the bank account that was
            selected. Currently only the US, CA, UK, DE, and AU are supported.
        name:
          type: string
          description: >-
            A description to identify a specific account (e.g. Test checking
            account)
        type:
          type: number
          format: double
          description: See Financial Institution Account Type Values.
        profile:
          type: number
          format: double
          description: See Financial Institution Account Profile Values
        accountNumber:
          type: string
          description: >-
            Bank Account Number or VAN if `virtualAccountRoutingPair` is equal
            to `true`.
        iban:
          type: string
          description: >-
            IBAN (International Bank Account Number) is an internationally
            agreed system of identifying bank accounts across national borders
        verified:
          type: boolean
          description: Indicates if the account is verified or not.
        verification:
          $ref: '#/components/schemas/FinancialInstitutionAccountVerification'
        source:
          type: number
          format: double
        routingNumber:
          type: string
          description: Bank Routing Number
        token:
          type: string
          description: The Account Token
        accountNumberLastFour:
          type: string
          description: The last 4 digits of the real account number.
        virtualAccountRoutingPair:
          type: boolean
          description: >-
            Indicates if account is using virtual/tokenized account and routing
            numbers (VANs/TANs) or not.
      title: Account
    Attribute:
      type: object
      properties:
        name:
          type: string
        value:
          type: string
      title: Attribute
    TrustlyABRequest:
      type: object
      properties:
        successURL:
          type: string
        failURL:
          type: string
        uRLTarget:
          type: string
        callbackURL:
          type: string
        notificationURL:
          type: string
      title: TrustlyABRequest
    EstablishData:
      type: object
      properties:
        merchantId:
          type: string
          description: Your Merchant ID.
        paymentType:
          type: number
          format: double
          description: >-
            The Payment Type of the transaction to create. Currently only
            Disbursement, Deferred, and Instant are supported.
        returnUrl:
          type: string
          description: Return URL to use when the transaction is completed.
        cancelUrl:
          type: string
          description: Cancel URL to use if the user cancels the transaction.
        notificationUrl:
          type: string
          description: >-
            Notification URL to use for notifications associated with this
            transaction. This overrides the notification URL configured at the
            merchant level.
        data:
          type: string
        accessId:
          type: string
          description: Your client application access id. It will be provided to you.
        requestSignature:
          type: string
          description: >-
            Request Signature that can be validated to verify the response
            authenticity.
        transactionId:
          type: string
          description: Transaction ID retrieved from Trustly.
        merchantReference:
          type: string
          description: >-
            An external reference from the merchant. Ex: Order identifier from
            merchant e-commerce application.
        description:
          type: string
          description: Merchant order description
        currency:
          $ref: '#/components/schemas/EstablishDataCurrency'
          description: 3-letter ISO Currency Code. Currently only USD is supported.
        kycType:
          $ref: '#/components/schemas/EstablishDataKycType'
          description: >-
            Specifies the KYC (Know Your Customer) type as number. The possible
            value is 1 (OnlineBanking). This field is optional and can only be
            used by merchants configured for [Trustly
            ID](/integrate/retrieve-data/trustly-id).
        amount:
          type: string
          description: >-
            The amount of the transaction. This represents the maximum amount of
            the transactions that can be processed with the Authorization. If
            the amount is 0.00, there will be no upper bound on the transaction.
            (10 characters with support for 2 decimal places)
        verification:
          $ref: '#/components/schemas/Verification'
        customer:
          $ref: '#/components/schemas/Customer'
        account:
          $ref: '#/components/schemas/Account'
        metadata:
          $ref: '#/components/schemas/Attribute'
        trustlyABRequest:
          $ref: '#/components/schemas/TrustlyABRequest'
        url:
          type: string
      required:
        - url
      description: >-
        Establish data is required to establish a new user authorization or to
        launch the Trustly UI for any other reason
      title: EstablishData
  securitySchemes:
    HTTPBasic:
      type: http
      scheme: basic
      description: ''

```

## Examples

### Example



**Request**

```json
undefined
```

**Response**

```json
{
  "url": "https://sandbox.trustly.one/start/establish?accessId=A48B73F694C4C8EE6306&token=1apuAbZyvZQRUM2ZB8UYMg7stPYC2v%2Fvu5UzY%2FScstZPbW6C264dkrywUI2ddPPqcjpwX1Ldaai8b%2FECcAi%2BR1StkxSRAmpE6Ct1fwfLxULVq6L%2BtbHlmK6r4%2BjHi11RbWF%2FtdC9TDy1fyS43nmH2VkAG3bmRNTl3rtIJilChcbakzdLuUDXi2yrv9vEimzkV882Wdzp5%2Bg63gBKFGcJQVq6KbyAL9HpfmJRKz2DBGWUXpZzgopB%2BiblkpY0gwy5FKBvEUyO7GU9jlVON8ynCl2QG6HqCAYFStqTqOj%2FFcqoOGqf5v5eN6SsB5%2BCJPmUYbeay7p%2BuEsMU9q4gG0AF%2FVDDxdHbQVxw60mYc0KTw2BfFg6lQFrihlyhy5N9rrvsWNmy7Ni995NyQ9ODHGkSFM1I%2FOKUG00GzRXzBJv6diQsITZkgf6acXdTLOeTcXglNwj23ouQRWckIK6Q8omYg%3D%3D",
  "establishData": {
    "merchantId": "110005514",
    "description": "Merchant order description",
    "currency": "USD",
    "amount": "0.00",
    "paymentType": 2,
    "returnUrl": "http://yourdomain.com/return?",
    "cancelUrl": "http://yourdomain.com/cancel?",
    "notificationUrl": "http://yourdomain.com/notification?",
    "data": "eNoT4jQ0NDAwMDU1NJFiD/APDvF19FOSSi0uSUzKySzOUEgqzcwpUcjMU4DKaTGHBrsYsRjoGRhYMDkJZJSUFFjp6+fkJyfmZOQXl3hhiGTnFCtxeeVn5CkE52aWZFgbMYUG2zjxahsqWFpaKliaWphbWHoJZwEV6BWDFDhkFScW6yXn52bs39o75a5eSbUBoxenoZGxiamZqblZEJBpYmBgbGhoVrOC6T8MMAIADTpBdA==",
    "accessId": "A48B73F694C4C8EE6306",
    "requestSignature": "S0lH/SLAhuKF+jspNLiMYK1IWAM="
  }
}
```

**SDK Code**

```python Example
import requests

url = "https://sandbox.trustly.one/api/v1/establish"

headers = {
    "Content-Type": "application/json"
}

response = requests.post(url, headers=headers, auth=("<username>", "<password>"))

print(response.json())
```

```javascript Example
const url = 'https://sandbox.trustly.one/api/v1/establish';
const credentials = btoa("<username>:<password>");

const options = {
  method: 'POST',
  headers: {
    Authorization: `Basic ${credentials}`,
    'Content-Type': 'application/json'
  },
  body: undefined
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://sandbox.trustly.one/api/v1/establish"

	req, _ := http.NewRequest("POST", url, nil)

	req.SetBasicAuth("<username>", "<password>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Example
require 'uri'
require 'net/http'

url = URI("https://sandbox.trustly.one/api/v1/establish")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request.basic_auth("<username>", "<password>")
request["Content-Type"] = 'application/json'

response = http.request(request)
puts response.read_body
```

```java Example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://sandbox.trustly.one/api/v1/establish")
  .basicAuth("<username>", "<password>")
  .header("Content-Type", "application/json")
  .asString();
```

```php Example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://sandbox.trustly.one/api/v1/establish', [
  'headers' => [
    'Content-Type' => 'application/json',
  ],
    'auth' => ['<username>', '<password>'],
]);

echo $response->getBody();
```

```csharp Example
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://sandbox.trustly.one/api/v1/establish");
client.Authenticator = new HttpBasicAuthenticator("<username>", "<password>");
var request = new RestRequest(Method.POST);

request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift Example
import Foundation

let credentials = Data("<username>:<password>".utf8).base64EncodedString()

let headers = [
  "Authorization": "Basic \(credentials)",
  "Content-Type": "application/json"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox.trustly.one/api/v1/establish")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Trustly ID Example



**Request**

```json
{
  "merchantId": "110005514",
  "accessId": "A48B73F694C4C8EE6306",
  "currency": "USD",
  "returnUrl": "http://yourdomain.com/return?",
  "cancelUrl": "http://yourdomain.com/cancel?",
  "requestSignature": "a/n62XqfgQA31xmFnCxNEOjd7g=",
  "merchantReference": "ABCDE12345",
  "amount": "1.00",
  "description": "Merchant KYC request",
  "notificationUrl": "http://yourdomain.com/notification?",
  "paymentType": "Instant",
  "kycType": "OnlineBanking"
}
```

**Response**

```json
{
  "url": "https://sandbox.trustly.one/start/establish?accessId=A48B73F694C4C8EE6306&token=1apuAbZyvZQRUM2ZB8UYMg7stPYC2v%2Fvu5UzY%2FScstZPbW6C264dkrywUI2ddPPqcjpwX1Ldaai8b%2FECcAi%2BR1StkxSRAmpE6Ct1fwfLxULVq6L%2BtbHlmK6r4%2BjHi11RbWF%2FtdC9TDy1fyS43nmH2VkAG3bmRNTl3rtIJilChcbakzdLuUDXi2yrv9vEimzkV882Wdzp5%2Bg63gBKFGcJQVq6KbyAL9HpfmJRKz2DBGWUXpZzgopB%2BiblkpY0gwy5FKBvEUyO7GU9jlVON8ynCl2QG6HqCAYFStqTqOj%2FFcqoOGqf5v5eN6SsB5%2BCJPmUYbeay7p%2BuEsMU9q4gG0AF%2FVDDxdHbQVxw60mYc0KTw2BfFg6lQFrihlyhy5N9rrvsWNmy7Ni995NyQ9ODHGkSFM1I%2FOKUG00GzRXzBJv6diQsITZkgf6acXdTLOeTcXglNwj23ouQRWckIK6Q8omYg%3D%3D",
  "establishData": {
    "merchantId": "110005514",
    "description": "Merchant KYC request",
    "currency": "USD",
    "amount": "1.00",
    "paymentType": 1,
    "returnUrl": "http://yourdomain.com/return?",
    "cancelUrl": "http://yourdomain.com/cancel?",
    "notificationUrl": "http://yourdomain.com/notification?",
    "data": "eNoT4jQ0NDAwMDU1NJFiD/APDvF19FOSSi0uSUzKySzOUEgqzcwpUcjMU4DKaTGHBrsYsRjoGRhYMDkJZJSUFFjp6+fkJyfmZOQXl3hhiGTnFCtxeeVn5CkE52aWZFgbMYUG2zjxahsqWFpaKliaWphbWHoJZwEV6BWDFDhkFScW6yXn52bs39o75a5eSbUBoxenoZGxiamZqblZEJBpYmBgbGhoVrOC6T8MMAIADTpBdA==",
    "accessId": "A48B73F694C4C8EE6306",
    "requestSignature": "S0lH/SLAhuKF+jspNLiMYK1IWAM=",
    "kycType": 1
  }
}
```

**SDK Code**

```python Trustly ID Example
import requests

url = "https://sandbox.trustly.one/api/v1/establish"

payload = {
    "merchantId": "110005514",
    "accessId": "A48B73F694C4C8EE6306",
    "currency": "USD",
    "returnUrl": "http://yourdomain.com/return?",
    "cancelUrl": "http://yourdomain.com/cancel?",
    "requestSignature": "a/n62XqfgQA31xmFnCxNEOjd7g=",
    "merchantReference": "ABCDE12345",
    "amount": "1.00",
    "description": "Merchant KYC request",
    "notificationUrl": "http://yourdomain.com/notification?",
    "paymentType": "Instant",
    "kycType": "OnlineBanking"
}
headers = {
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers, auth=("<username>", "<password>"))

print(response.json())
```

```javascript Trustly ID Example
const url = 'https://sandbox.trustly.one/api/v1/establish';
const credentials = btoa("<username>:<password>");

const options = {
  method: 'POST',
  headers: {
    Authorization: `Basic ${credentials}`,
    'Content-Type': 'application/json'
  },
  body: '{"merchantId":"110005514","accessId":"A48B73F694C4C8EE6306","currency":"USD","returnUrl":"http://yourdomain.com/return?","cancelUrl":"http://yourdomain.com/cancel?","requestSignature":"a/n62XqfgQA31xmFnCxNEOjd7g=","merchantReference":"ABCDE12345","amount":"1.00","description":"Merchant KYC request","notificationUrl":"http://yourdomain.com/notification?","paymentType":"Instant","kycType":"OnlineBanking"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Trustly ID Example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://sandbox.trustly.one/api/v1/establish"

	payload := strings.NewReader("{\n  \"merchantId\": \"110005514\",\n  \"accessId\": \"A48B73F694C4C8EE6306\",\n  \"currency\": \"USD\",\n  \"returnUrl\": \"http://yourdomain.com/return?\",\n  \"cancelUrl\": \"http://yourdomain.com/cancel?\",\n  \"requestSignature\": \"a/n62XqfgQA31xmFnCxNEOjd7g=\",\n  \"merchantReference\": \"ABCDE12345\",\n  \"amount\": \"1.00\",\n  \"description\": \"Merchant KYC request\",\n  \"notificationUrl\": \"http://yourdomain.com/notification?\",\n  \"paymentType\": \"Instant\",\n  \"kycType\": \"OnlineBanking\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.SetBasicAuth("<username>", "<password>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Trustly ID Example
require 'uri'
require 'net/http'

url = URI("https://sandbox.trustly.one/api/v1/establish")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request.basic_auth("<username>", "<password>")
request["Content-Type"] = 'application/json'
request.body = "{\n  \"merchantId\": \"110005514\",\n  \"accessId\": \"A48B73F694C4C8EE6306\",\n  \"currency\": \"USD\",\n  \"returnUrl\": \"http://yourdomain.com/return?\",\n  \"cancelUrl\": \"http://yourdomain.com/cancel?\",\n  \"requestSignature\": \"a/n62XqfgQA31xmFnCxNEOjd7g=\",\n  \"merchantReference\": \"ABCDE12345\",\n  \"amount\": \"1.00\",\n  \"description\": \"Merchant KYC request\",\n  \"notificationUrl\": \"http://yourdomain.com/notification?\",\n  \"paymentType\": \"Instant\",\n  \"kycType\": \"OnlineBanking\"\n}"

response = http.request(request)
puts response.read_body
```

```java Trustly ID Example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://sandbox.trustly.one/api/v1/establish")
  .basicAuth("<username>", "<password>")
  .header("Content-Type", "application/json")
  .body("{\n  \"merchantId\": \"110005514\",\n  \"accessId\": \"A48B73F694C4C8EE6306\",\n  \"currency\": \"USD\",\n  \"returnUrl\": \"http://yourdomain.com/return?\",\n  \"cancelUrl\": \"http://yourdomain.com/cancel?\",\n  \"requestSignature\": \"a/n62XqfgQA31xmFnCxNEOjd7g=\",\n  \"merchantReference\": \"ABCDE12345\",\n  \"amount\": \"1.00\",\n  \"description\": \"Merchant KYC request\",\n  \"notificationUrl\": \"http://yourdomain.com/notification?\",\n  \"paymentType\": \"Instant\",\n  \"kycType\": \"OnlineBanking\"\n}")
  .asString();
```

```php Trustly ID Example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://sandbox.trustly.one/api/v1/establish', [
  'body' => '{
  "merchantId": "110005514",
  "accessId": "A48B73F694C4C8EE6306",
  "currency": "USD",
  "returnUrl": "http://yourdomain.com/return?",
  "cancelUrl": "http://yourdomain.com/cancel?",
  "requestSignature": "a/n62XqfgQA31xmFnCxNEOjd7g=",
  "merchantReference": "ABCDE12345",
  "amount": "1.00",
  "description": "Merchant KYC request",
  "notificationUrl": "http://yourdomain.com/notification?",
  "paymentType": "Instant",
  "kycType": "OnlineBanking"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
    'auth' => ['<username>', '<password>'],
]);

echo $response->getBody();
```

```csharp Trustly ID Example
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://sandbox.trustly.one/api/v1/establish");
client.Authenticator = new HttpBasicAuthenticator("<username>", "<password>");
var request = new RestRequest(Method.POST);

request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"merchantId\": \"110005514\",\n  \"accessId\": \"A48B73F694C4C8EE6306\",\n  \"currency\": \"USD\",\n  \"returnUrl\": \"http://yourdomain.com/return?\",\n  \"cancelUrl\": \"http://yourdomain.com/cancel?\",\n  \"requestSignature\": \"a/n62XqfgQA31xmFnCxNEOjd7g=\",\n  \"merchantReference\": \"ABCDE12345\",\n  \"amount\": \"1.00\",\n  \"description\": \"Merchant KYC request\",\n  \"notificationUrl\": \"http://yourdomain.com/notification?\",\n  \"paymentType\": \"Instant\",\n  \"kycType\": \"OnlineBanking\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Trustly ID Example
import Foundation

let credentials = Data("<username>:<password>".utf8).base64EncodedString()

let headers = [
  "Authorization": "Basic \(credentials)",
  "Content-Type": "application/json"
]
let parameters = [
  "merchantId": "110005514",
  "accessId": "A48B73F694C4C8EE6306",
  "currency": "USD",
  "returnUrl": "http://yourdomain.com/return?",
  "cancelUrl": "http://yourdomain.com/cancel?",
  "requestSignature": "a/n62XqfgQA31xmFnCxNEOjd7g=",
  "merchantReference": "ABCDE12345",
  "amount": "1.00",
  "description": "Merchant KYC request",
  "notificationUrl": "http://yourdomain.com/notification?",
  "paymentType": "Instant",
  "kycType": "OnlineBanking"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox.trustly.one/api/v1/establish")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Basic Deferred Example



**Request**

```json
{
  "merchantId": "110005514",
  "accessId": "A48B73F694C4C8EE6306",
  "currency": "USD",
  "returnUrl": "http://yourdomain.com/return",
  "cancelUrl": "http://yourdomain.com/cancel",
  "requestSignature": "a/n62XqfgQA31xmFnCxNEOjd7g=",
  "merchantReference": "ABCDE12345",
  "amount": "0.00",
  "description": "Merchant order description",
  "notificationUrl": "http://yourdomain.com/notification?",
  "paymentType": "Deferred",
  "customer": {
    "name": "John Smith",
    "address": {
      "country": "US"
    },
    "phone": "+1 999 958789",
    "email": "john.smith@jsas.com",
    "enrollDate": 1605554625215
  }
}
```

**Response**

```json
{
  "url": "https://sandbox.trustly.one/start/establish?accessId=A48B73F694C4C8EE6306&token=1apuAbZyvZQRUM2ZB8UYMg7stPYC2v%2Fvu5UzY%2FScstZPbW6C264dkrywUI2ddPPqcjpwX1Ldaai8b%2FECcAi%2BR1StkxSRAmpE6Ct1fwfLxULVq6L%2BtbHlmK6r4%2BjHi11RbWF%2FtdC9TDy1fyS43nmH2VkAG3bmRNTl3rtIJilChcbakzdLuUDXi2yrv9vEimzkV882Wdzp5%2Bg63gBKFGcJQVq6KbyAL9HpfmJRKz2DBGWUXpZzgopB%2BiblkpY0gwy5FKBvEUyO7GU9jlVON8ynCl2QG6HqCAYFStqTqOj%2FFcqoOGqf5v5eN6SsB5%2BCJPmUYbeay7p%2BuEsMU9q4gG0AF%2FVDDxdHbQVxw60mYc0KTw2BfFg6lQFrihlyhy5N9rrvsWNmy7Ni995NyQ9ODHGkSFM1I%2FOKUG00GzRXzBJv6diQsITZkgf6acXdTLOeTcXglNwj23ouQRWckIK6Q8omYg%3D%3D",
  "establishData": {
    "merchantId": "110005514",
    "description": "Merchant order description",
    "currency": "USD",
    "amount": "0.00",
    "paymentType": 2,
    "returnUrl": "http://yourdomain.com/return?",
    "cancelUrl": "http://yourdomain.com/cancel?",
    "notificationUrl": "http://yourdomain.com/notification?",
    "data": "eNoT4jQ0NDAwMDU1NJFiD/APDvF19FOSSi0uSUzKySzOUEgqzcwpUcjMU4DKaTGHBrsYsRjoGRhYMDkJZJSUFFjp6+fkJyfmZOQXl3hhiGTnFCtxeeVn5CkE52aWZFgbMYUG2zjxahsqWFpaKliaWphbWHoJZwEV6BWDFDhkFScW6yXn52bs39o75a5eSbUBoxenoZGxiamZqblZEJBpYmBgbGhoVrOC6T8MMAIADTpBdA==",
    "accessId": "A48B73F694C4C8EE6306",
    "requestSignature": "S0lH/SLAhuKF+jspNLiMYK1IWAM="
  }
}
```

**SDK Code**

```python Basic Deferred Example
import requests

url = "https://sandbox.trustly.one/api/v1/establish"

payload = {
    "merchantId": "110005514",
    "accessId": "A48B73F694C4C8EE6306",
    "currency": "USD",
    "returnUrl": "http://yourdomain.com/return",
    "cancelUrl": "http://yourdomain.com/cancel",
    "requestSignature": "a/n62XqfgQA31xmFnCxNEOjd7g=",
    "merchantReference": "ABCDE12345",
    "amount": "0.00",
    "description": "Merchant order description",
    "notificationUrl": "http://yourdomain.com/notification?",
    "paymentType": "Deferred",
    "customer": {
        "name": "John Smith",
        "address": { "country": "US" },
        "phone": "+1 999 958789",
        "email": "john.smith@jsas.com",
        "enrollDate": 1605554625215
    }
}
headers = {
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers, auth=("<username>", "<password>"))

print(response.json())
```

```javascript Basic Deferred Example
const url = 'https://sandbox.trustly.one/api/v1/establish';
const credentials = btoa("<username>:<password>");

const options = {
  method: 'POST',
  headers: {
    Authorization: `Basic ${credentials}`,
    'Content-Type': 'application/json'
  },
  body: '{"merchantId":"110005514","accessId":"A48B73F694C4C8EE6306","currency":"USD","returnUrl":"http://yourdomain.com/return","cancelUrl":"http://yourdomain.com/cancel","requestSignature":"a/n62XqfgQA31xmFnCxNEOjd7g=","merchantReference":"ABCDE12345","amount":"0.00","description":"Merchant order description","notificationUrl":"http://yourdomain.com/notification?","paymentType":"Deferred","customer":{"name":"John Smith","address":{"country":"US"},"phone":"+1 999 958789","email":"john.smith@jsas.com","enrollDate":1605554625215}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Basic Deferred Example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://sandbox.trustly.one/api/v1/establish"

	payload := strings.NewReader("{\n  \"merchantId\": \"110005514\",\n  \"accessId\": \"A48B73F694C4C8EE6306\",\n  \"currency\": \"USD\",\n  \"returnUrl\": \"http://yourdomain.com/return\",\n  \"cancelUrl\": \"http://yourdomain.com/cancel\",\n  \"requestSignature\": \"a/n62XqfgQA31xmFnCxNEOjd7g=\",\n  \"merchantReference\": \"ABCDE12345\",\n  \"amount\": \"0.00\",\n  \"description\": \"Merchant order description\",\n  \"notificationUrl\": \"http://yourdomain.com/notification?\",\n  \"paymentType\": \"Deferred\",\n  \"customer\": {\n    \"name\": \"John Smith\",\n    \"address\": {\n      \"country\": \"US\"\n    },\n    \"phone\": \"+1 999 958789\",\n    \"email\": \"john.smith@jsas.com\",\n    \"enrollDate\": 1605554625215\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.SetBasicAuth("<username>", "<password>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Basic Deferred Example
require 'uri'
require 'net/http'

url = URI("https://sandbox.trustly.one/api/v1/establish")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request.basic_auth("<username>", "<password>")
request["Content-Type"] = 'application/json'
request.body = "{\n  \"merchantId\": \"110005514\",\n  \"accessId\": \"A48B73F694C4C8EE6306\",\n  \"currency\": \"USD\",\n  \"returnUrl\": \"http://yourdomain.com/return\",\n  \"cancelUrl\": \"http://yourdomain.com/cancel\",\n  \"requestSignature\": \"a/n62XqfgQA31xmFnCxNEOjd7g=\",\n  \"merchantReference\": \"ABCDE12345\",\n  \"amount\": \"0.00\",\n  \"description\": \"Merchant order description\",\n  \"notificationUrl\": \"http://yourdomain.com/notification?\",\n  \"paymentType\": \"Deferred\",\n  \"customer\": {\n    \"name\": \"John Smith\",\n    \"address\": {\n      \"country\": \"US\"\n    },\n    \"phone\": \"+1 999 958789\",\n    \"email\": \"john.smith@jsas.com\",\n    \"enrollDate\": 1605554625215\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Basic Deferred Example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://sandbox.trustly.one/api/v1/establish")
  .basicAuth("<username>", "<password>")
  .header("Content-Type", "application/json")
  .body("{\n  \"merchantId\": \"110005514\",\n  \"accessId\": \"A48B73F694C4C8EE6306\",\n  \"currency\": \"USD\",\n  \"returnUrl\": \"http://yourdomain.com/return\",\n  \"cancelUrl\": \"http://yourdomain.com/cancel\",\n  \"requestSignature\": \"a/n62XqfgQA31xmFnCxNEOjd7g=\",\n  \"merchantReference\": \"ABCDE12345\",\n  \"amount\": \"0.00\",\n  \"description\": \"Merchant order description\",\n  \"notificationUrl\": \"http://yourdomain.com/notification?\",\n  \"paymentType\": \"Deferred\",\n  \"customer\": {\n    \"name\": \"John Smith\",\n    \"address\": {\n      \"country\": \"US\"\n    },\n    \"phone\": \"+1 999 958789\",\n    \"email\": \"john.smith@jsas.com\",\n    \"enrollDate\": 1605554625215\n  }\n}")
  .asString();
```

```php Basic Deferred Example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://sandbox.trustly.one/api/v1/establish', [
  'body' => '{
  "merchantId": "110005514",
  "accessId": "A48B73F694C4C8EE6306",
  "currency": "USD",
  "returnUrl": "http://yourdomain.com/return",
  "cancelUrl": "http://yourdomain.com/cancel",
  "requestSignature": "a/n62XqfgQA31xmFnCxNEOjd7g=",
  "merchantReference": "ABCDE12345",
  "amount": "0.00",
  "description": "Merchant order description",
  "notificationUrl": "http://yourdomain.com/notification?",
  "paymentType": "Deferred",
  "customer": {
    "name": "John Smith",
    "address": {
      "country": "US"
    },
    "phone": "+1 999 958789",
    "email": "john.smith@jsas.com",
    "enrollDate": 1605554625215
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
    'auth' => ['<username>', '<password>'],
]);

echo $response->getBody();
```

```csharp Basic Deferred Example
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://sandbox.trustly.one/api/v1/establish");
client.Authenticator = new HttpBasicAuthenticator("<username>", "<password>");
var request = new RestRequest(Method.POST);

request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"merchantId\": \"110005514\",\n  \"accessId\": \"A48B73F694C4C8EE6306\",\n  \"currency\": \"USD\",\n  \"returnUrl\": \"http://yourdomain.com/return\",\n  \"cancelUrl\": \"http://yourdomain.com/cancel\",\n  \"requestSignature\": \"a/n62XqfgQA31xmFnCxNEOjd7g=\",\n  \"merchantReference\": \"ABCDE12345\",\n  \"amount\": \"0.00\",\n  \"description\": \"Merchant order description\",\n  \"notificationUrl\": \"http://yourdomain.com/notification?\",\n  \"paymentType\": \"Deferred\",\n  \"customer\": {\n    \"name\": \"John Smith\",\n    \"address\": {\n      \"country\": \"US\"\n    },\n    \"phone\": \"+1 999 958789\",\n    \"email\": \"john.smith@jsas.com\",\n    \"enrollDate\": 1605554625215\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Basic Deferred Example
import Foundation

let credentials = Data("<username>:<password>".utf8).base64EncodedString()

let headers = [
  "Authorization": "Basic \(credentials)",
  "Content-Type": "application/json"
]
let parameters = [
  "merchantId": "110005514",
  "accessId": "A48B73F694C4C8EE6306",
  "currency": "USD",
  "returnUrl": "http://yourdomain.com/return",
  "cancelUrl": "http://yourdomain.com/cancel",
  "requestSignature": "a/n62XqfgQA31xmFnCxNEOjd7g=",
  "merchantReference": "ABCDE12345",
  "amount": "0.00",
  "description": "Merchant order description",
  "notificationUrl": "http://yourdomain.com/notification?",
  "paymentType": "Deferred",
  "customer": [
    "name": "John Smith",
    "address": ["country": "US"],
    "phone": "+1 999 958789",
    "email": "john.smith@jsas.com",
    "enrollDate": 1605554625215
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox.trustly.one/api/v1/establish")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Instant Money Transfer



**Request**

```json
{
  "merchantId": "110005514",
  "accessId": "A48B73F694C4C8EE6306",
  "currency": "USD",
  "returnUrl": "http://yourdomain.com/return",
  "cancelUrl": "http://yourdomain.com/cancel",
  "requestSignature": "a/n62XqfgQA31xmFnCxNEOjd7g=",
  "merchantReference": "ABCDE12345",
  "amount": "0.00",
  "description": "Merchant order description",
  "notificationUrl": "http://yourdomain.com/notification?",
  "paymentType": "Instant",
  "customer": {
    "name": "John Smith",
    "address": {
      "country": "US",
      "address1": "2000 Broadway St",
      "city": "Redwood City",
      "state": "CA",
      "zip": "94063"
    },
    "phone": "+1 999 958789",
    "email": "john.smith@jsas.com",
    "dateOfBirth": "09/09/1990"
  },
  "beneficiary": {
    "name": "Johan Olen",
    "taxId": "756.9217.0769.85",
    "address": {
      "country": "CH",
      "address1": "Untere Bahnhofstrasse 90",
      "city": "Castiel",
      "state": "Graubünden",
      "zip": "7027"
    },
    "dateOfBirth": "08/08/1998"
  },
  "beneficiaryAccount": {
    "accountNumber": 762011623852957,
    "paymentProvider": {
      "name": "Swiss National Bank",
      "swift": "SNBZCHZZXXX",
      "country": "US"
    }
  }
}
```

**Response**

```json
{
  "url": "https://sandbox.trustly.one/start/establish?accessId=A48B73F694C4C8EE6306&token=1apuAbZyvZQRUM2ZB8UYMg7stPYC2v%2Fvu5UzY%2FScstZPbW6C264dkrywUI2ddPPqcjpwX1Ldaai8b%2FECcAi%2BR1StkxSRAmpE6Ct1fwfLxULVq6L%2BtbHlmK6r4%2BjHi11RbWF%2FtdC9TDy1fyS43nmH2VkAG3bmRNTl3rtIJilChcbakzdLuUDXi2yrv9vEimzkV882Wdzp5%2Bg63gBKFGcJQVq6KbyAL9HpfmJRKz2DBGWUXpZzgopB%2BiblkpY0gwy5FKBvEUyO7GU9jlVON8ynCl2QG6HqCAYFStqTqOj%2FFcqoOGqf5v5eN6SsB5%2BCJPmUYbeay7p%2BuEsMU9q4gG0AF%2FVDDxdHbQVxw60mYc0KTw2BfFg6lQFrihlyhy5N9rrvsWNmy7Ni995NyQ9ODHGkSFM1I%2FOKUG00GzRXzBJv6diQsITZkgf6acXdTLOeTcXglNwj23ouQRWckIK6Q8omYg%3D%3D",
  "establishData": {
    "merchantId": "110005514",
    "description": "Merchant order description",
    "currency": "USD",
    "amount": "0.00",
    "paymentType": 2,
    "returnUrl": "http://yourdomain.com/return?",
    "cancelUrl": "http://yourdomain.com/cancel?",
    "notificationUrl": "http://yourdomain.com/notification?",
    "data": "eNoT4jQ0NDAwMDU1NJFiD/APDvF19FOSSi0uSUzKySzOUEgqzcwpUcjMU4DKaTGHBrsYsRjoGRhYMDkJZJSUFFjp6+fkJyfmZOQXl3hhiGTnFCtxeeVn5CkE52aWZFgbMYUG2zjxahsqWFpaKliaWphbWHoJZwEV6BWDFDhkFScW6yXn52bs39o75a5eSbUBoxenoZGxiamZqblZEJBpYmBgbGhoVrOC6T8MMAIADTpBdA==",
    "accessId": "A48B73F694C4C8EE6306",
    "requestSignature": "S0lH/SLAhuKF+jspNLiMYK1IWAM="
  }
}
```

**SDK Code**

```python Instant Money Transfer
import requests

url = "https://sandbox.trustly.one/api/v1/establish"

payload = {
    "merchantId": "110005514",
    "accessId": "A48B73F694C4C8EE6306",
    "currency": "USD",
    "returnUrl": "http://yourdomain.com/return",
    "cancelUrl": "http://yourdomain.com/cancel",
    "requestSignature": "a/n62XqfgQA31xmFnCxNEOjd7g=",
    "merchantReference": "ABCDE12345",
    "amount": "0.00",
    "description": "Merchant order description",
    "notificationUrl": "http://yourdomain.com/notification?",
    "paymentType": "Instant",
    "customer": {
        "name": "John Smith",
        "address": {
            "country": "US",
            "address1": "2000 Broadway St",
            "city": "Redwood City",
            "state": "CA",
            "zip": "94063"
        },
        "phone": "+1 999 958789",
        "email": "john.smith@jsas.com",
        "dateOfBirth": "09/09/1990"
    },
    "beneficiary": {
        "name": "Johan Olen",
        "taxId": "756.9217.0769.85",
        "address": {
            "country": "CH",
            "address1": "Untere Bahnhofstrasse 90",
            "city": "Castiel",
            "state": "Graubünden",
            "zip": "7027"
        },
        "dateOfBirth": "08/08/1998"
    },
    "beneficiaryAccount": {
        "accountNumber": 762011623852957,
        "paymentProvider": {
            "name": "Swiss National Bank",
            "swift": "SNBZCHZZXXX",
            "country": "US"
        }
    }
}
headers = {
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers, auth=("<username>", "<password>"))

print(response.json())
```

```javascript Instant Money Transfer
const url = 'https://sandbox.trustly.one/api/v1/establish';
const credentials = btoa("<username>:<password>");

const options = {
  method: 'POST',
  headers: {
    Authorization: `Basic ${credentials}`,
    'Content-Type': 'application/json'
  },
  body: '{"merchantId":"110005514","accessId":"A48B73F694C4C8EE6306","currency":"USD","returnUrl":"http://yourdomain.com/return","cancelUrl":"http://yourdomain.com/cancel","requestSignature":"a/n62XqfgQA31xmFnCxNEOjd7g=","merchantReference":"ABCDE12345","amount":"0.00","description":"Merchant order description","notificationUrl":"http://yourdomain.com/notification?","paymentType":"Instant","customer":{"name":"John Smith","address":{"country":"US","address1":"2000 Broadway St","city":"Redwood City","state":"CA","zip":"94063"},"phone":"+1 999 958789","email":"john.smith@jsas.com","dateOfBirth":"09/09/1990"},"beneficiary":{"name":"Johan Olen","taxId":"756.9217.0769.85","address":{"country":"CH","address1":"Untere Bahnhofstrasse 90","city":"Castiel","state":"Graubünden","zip":"7027"},"dateOfBirth":"08/08/1998"},"beneficiaryAccount":{"accountNumber":762011623852957,"paymentProvider":{"name":"Swiss National Bank","swift":"SNBZCHZZXXX","country":"US"}}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Instant Money Transfer
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://sandbox.trustly.one/api/v1/establish"

	payload := strings.NewReader("{\n  \"merchantId\": \"110005514\",\n  \"accessId\": \"A48B73F694C4C8EE6306\",\n  \"currency\": \"USD\",\n  \"returnUrl\": \"http://yourdomain.com/return\",\n  \"cancelUrl\": \"http://yourdomain.com/cancel\",\n  \"requestSignature\": \"a/n62XqfgQA31xmFnCxNEOjd7g=\",\n  \"merchantReference\": \"ABCDE12345\",\n  \"amount\": \"0.00\",\n  \"description\": \"Merchant order description\",\n  \"notificationUrl\": \"http://yourdomain.com/notification?\",\n  \"paymentType\": \"Instant\",\n  \"customer\": {\n    \"name\": \"John Smith\",\n    \"address\": {\n      \"country\": \"US\",\n      \"address1\": \"2000 Broadway St\",\n      \"city\": \"Redwood City\",\n      \"state\": \"CA\",\n      \"zip\": \"94063\"\n    },\n    \"phone\": \"+1 999 958789\",\n    \"email\": \"john.smith@jsas.com\",\n    \"dateOfBirth\": \"09/09/1990\"\n  },\n  \"beneficiary\": {\n    \"name\": \"Johan Olen\",\n    \"taxId\": \"756.9217.0769.85\",\n    \"address\": {\n      \"country\": \"CH\",\n      \"address1\": \"Untere Bahnhofstrasse 90\",\n      \"city\": \"Castiel\",\n      \"state\": \"Graubünden\",\n      \"zip\": \"7027\"\n    },\n    \"dateOfBirth\": \"08/08/1998\"\n  },\n  \"beneficiaryAccount\": {\n    \"accountNumber\": 762011623852957,\n    \"paymentProvider\": {\n      \"name\": \"Swiss National Bank\",\n      \"swift\": \"SNBZCHZZXXX\",\n      \"country\": \"US\"\n    }\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.SetBasicAuth("<username>", "<password>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Instant Money Transfer
require 'uri'
require 'net/http'

url = URI("https://sandbox.trustly.one/api/v1/establish")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request.basic_auth("<username>", "<password>")
request["Content-Type"] = 'application/json'
request.body = "{\n  \"merchantId\": \"110005514\",\n  \"accessId\": \"A48B73F694C4C8EE6306\",\n  \"currency\": \"USD\",\n  \"returnUrl\": \"http://yourdomain.com/return\",\n  \"cancelUrl\": \"http://yourdomain.com/cancel\",\n  \"requestSignature\": \"a/n62XqfgQA31xmFnCxNEOjd7g=\",\n  \"merchantReference\": \"ABCDE12345\",\n  \"amount\": \"0.00\",\n  \"description\": \"Merchant order description\",\n  \"notificationUrl\": \"http://yourdomain.com/notification?\",\n  \"paymentType\": \"Instant\",\n  \"customer\": {\n    \"name\": \"John Smith\",\n    \"address\": {\n      \"country\": \"US\",\n      \"address1\": \"2000 Broadway St\",\n      \"city\": \"Redwood City\",\n      \"state\": \"CA\",\n      \"zip\": \"94063\"\n    },\n    \"phone\": \"+1 999 958789\",\n    \"email\": \"john.smith@jsas.com\",\n    \"dateOfBirth\": \"09/09/1990\"\n  },\n  \"beneficiary\": {\n    \"name\": \"Johan Olen\",\n    \"taxId\": \"756.9217.0769.85\",\n    \"address\": {\n      \"country\": \"CH\",\n      \"address1\": \"Untere Bahnhofstrasse 90\",\n      \"city\": \"Castiel\",\n      \"state\": \"Graubünden\",\n      \"zip\": \"7027\"\n    },\n    \"dateOfBirth\": \"08/08/1998\"\n  },\n  \"beneficiaryAccount\": {\n    \"accountNumber\": 762011623852957,\n    \"paymentProvider\": {\n      \"name\": \"Swiss National Bank\",\n      \"swift\": \"SNBZCHZZXXX\",\n      \"country\": \"US\"\n    }\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Instant Money Transfer
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://sandbox.trustly.one/api/v1/establish")
  .basicAuth("<username>", "<password>")
  .header("Content-Type", "application/json")
  .body("{\n  \"merchantId\": \"110005514\",\n  \"accessId\": \"A48B73F694C4C8EE6306\",\n  \"currency\": \"USD\",\n  \"returnUrl\": \"http://yourdomain.com/return\",\n  \"cancelUrl\": \"http://yourdomain.com/cancel\",\n  \"requestSignature\": \"a/n62XqfgQA31xmFnCxNEOjd7g=\",\n  \"merchantReference\": \"ABCDE12345\",\n  \"amount\": \"0.00\",\n  \"description\": \"Merchant order description\",\n  \"notificationUrl\": \"http://yourdomain.com/notification?\",\n  \"paymentType\": \"Instant\",\n  \"customer\": {\n    \"name\": \"John Smith\",\n    \"address\": {\n      \"country\": \"US\",\n      \"address1\": \"2000 Broadway St\",\n      \"city\": \"Redwood City\",\n      \"state\": \"CA\",\n      \"zip\": \"94063\"\n    },\n    \"phone\": \"+1 999 958789\",\n    \"email\": \"john.smith@jsas.com\",\n    \"dateOfBirth\": \"09/09/1990\"\n  },\n  \"beneficiary\": {\n    \"name\": \"Johan Olen\",\n    \"taxId\": \"756.9217.0769.85\",\n    \"address\": {\n      \"country\": \"CH\",\n      \"address1\": \"Untere Bahnhofstrasse 90\",\n      \"city\": \"Castiel\",\n      \"state\": \"Graubünden\",\n      \"zip\": \"7027\"\n    },\n    \"dateOfBirth\": \"08/08/1998\"\n  },\n  \"beneficiaryAccount\": {\n    \"accountNumber\": 762011623852957,\n    \"paymentProvider\": {\n      \"name\": \"Swiss National Bank\",\n      \"swift\": \"SNBZCHZZXXX\",\n      \"country\": \"US\"\n    }\n  }\n}")
  .asString();
```

```php Instant Money Transfer
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://sandbox.trustly.one/api/v1/establish', [
  'body' => '{
  "merchantId": "110005514",
  "accessId": "A48B73F694C4C8EE6306",
  "currency": "USD",
  "returnUrl": "http://yourdomain.com/return",
  "cancelUrl": "http://yourdomain.com/cancel",
  "requestSignature": "a/n62XqfgQA31xmFnCxNEOjd7g=",
  "merchantReference": "ABCDE12345",
  "amount": "0.00",
  "description": "Merchant order description",
  "notificationUrl": "http://yourdomain.com/notification?",
  "paymentType": "Instant",
  "customer": {
    "name": "John Smith",
    "address": {
      "country": "US",
      "address1": "2000 Broadway St",
      "city": "Redwood City",
      "state": "CA",
      "zip": "94063"
    },
    "phone": "+1 999 958789",
    "email": "john.smith@jsas.com",
    "dateOfBirth": "09/09/1990"
  },
  "beneficiary": {
    "name": "Johan Olen",
    "taxId": "756.9217.0769.85",
    "address": {
      "country": "CH",
      "address1": "Untere Bahnhofstrasse 90",
      "city": "Castiel",
      "state": "Graubünden",
      "zip": "7027"
    },
    "dateOfBirth": "08/08/1998"
  },
  "beneficiaryAccount": {
    "accountNumber": 762011623852957,
    "paymentProvider": {
      "name": "Swiss National Bank",
      "swift": "SNBZCHZZXXX",
      "country": "US"
    }
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
    'auth' => ['<username>', '<password>'],
]);

echo $response->getBody();
```

```csharp Instant Money Transfer
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://sandbox.trustly.one/api/v1/establish");
client.Authenticator = new HttpBasicAuthenticator("<username>", "<password>");
var request = new RestRequest(Method.POST);

request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"merchantId\": \"110005514\",\n  \"accessId\": \"A48B73F694C4C8EE6306\",\n  \"currency\": \"USD\",\n  \"returnUrl\": \"http://yourdomain.com/return\",\n  \"cancelUrl\": \"http://yourdomain.com/cancel\",\n  \"requestSignature\": \"a/n62XqfgQA31xmFnCxNEOjd7g=\",\n  \"merchantReference\": \"ABCDE12345\",\n  \"amount\": \"0.00\",\n  \"description\": \"Merchant order description\",\n  \"notificationUrl\": \"http://yourdomain.com/notification?\",\n  \"paymentType\": \"Instant\",\n  \"customer\": {\n    \"name\": \"John Smith\",\n    \"address\": {\n      \"country\": \"US\",\n      \"address1\": \"2000 Broadway St\",\n      \"city\": \"Redwood City\",\n      \"state\": \"CA\",\n      \"zip\": \"94063\"\n    },\n    \"phone\": \"+1 999 958789\",\n    \"email\": \"john.smith@jsas.com\",\n    \"dateOfBirth\": \"09/09/1990\"\n  },\n  \"beneficiary\": {\n    \"name\": \"Johan Olen\",\n    \"taxId\": \"756.9217.0769.85\",\n    \"address\": {\n      \"country\": \"CH\",\n      \"address1\": \"Untere Bahnhofstrasse 90\",\n      \"city\": \"Castiel\",\n      \"state\": \"Graubünden\",\n      \"zip\": \"7027\"\n    },\n    \"dateOfBirth\": \"08/08/1998\"\n  },\n  \"beneficiaryAccount\": {\n    \"accountNumber\": 762011623852957,\n    \"paymentProvider\": {\n      \"name\": \"Swiss National Bank\",\n      \"swift\": \"SNBZCHZZXXX\",\n      \"country\": \"US\"\n    }\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Instant Money Transfer
import Foundation

let credentials = Data("<username>:<password>".utf8).base64EncodedString()

let headers = [
  "Authorization": "Basic \(credentials)",
  "Content-Type": "application/json"
]
let parameters = [
  "merchantId": "110005514",
  "accessId": "A48B73F694C4C8EE6306",
  "currency": "USD",
  "returnUrl": "http://yourdomain.com/return",
  "cancelUrl": "http://yourdomain.com/cancel",
  "requestSignature": "a/n62XqfgQA31xmFnCxNEOjd7g=",
  "merchantReference": "ABCDE12345",
  "amount": "0.00",
  "description": "Merchant order description",
  "notificationUrl": "http://yourdomain.com/notification?",
  "paymentType": "Instant",
  "customer": [
    "name": "John Smith",
    "address": [
      "country": "US",
      "address1": "2000 Broadway St",
      "city": "Redwood City",
      "state": "CA",
      "zip": "94063"
    ],
    "phone": "+1 999 958789",
    "email": "john.smith@jsas.com",
    "dateOfBirth": "09/09/1990"
  ],
  "beneficiary": [
    "name": "Johan Olen",
    "taxId": "756.9217.0769.85",
    "address": [
      "country": "CH",
      "address1": "Untere Bahnhofstrasse 90",
      "city": "Castiel",
      "state": "Graubünden",
      "zip": "7027"
    ],
    "dateOfBirth": "08/08/1998"
  ],
  "beneficiaryAccount": [
    "accountNumber": 762011623852957,
    "paymentProvider": [
      "name": "Swiss National Bank",
      "swift": "SNBZCHZZXXX",
      "country": "US"
    ]
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox.trustly.one/api/v1/establish")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```