Skip to content

Trustly Beta

Last updated: December 16, 2022

Start accepting payments using Trustly, a popular payment method in Europe.

Information

To learn more, reach out to your Customer Success Manager or support@checkout.com.

Model

Gateway

Payment flow

Redirect

Payment method type

Bank transfer

One-step payment

Authorization

Capture

Refund

Partial refund

Chargeback

Recurring payment

Trustly payments follow a 2-step process:

  1. Request a payment
  2. Redirect the customer

Request a payment

For the full API specification, see the API reference.

    post

    https://api.checkout.com/payments

    Request example

    1
    {
    2
    "amount": 2000,
    3
    "currency": "EUR",
    4
    "source": {
    5
    "type": "trustly"
    6
    },
    7
    "failure_url": "https://example.com/payments/failure",
    8
    "success_url": "https://example.com/payments/success",
    9
    "reference": "ORD-5023-4E89",
    10
    "customer": {
    11
    "name": "John Smith",
    12
    "email": "john.smith@example.com",
    13
    "phone": {
    14
    "country_code": "+33",
    15
    "number": "1234567890"
    16
    }
    17
    }
    18
    }

    Response example

    If you receive a 202 Accepted response with a status field set to Pending, your request was successful.

    1
    {
    2
    "id": "pay_e4xq6um55ezuplruf7dfyq2ggu",
    3
    "status": "Pending",
    4
    "reference": "ORD-5023-4E89",
    5
    "customer": {
    6
    "id": "cus_frc2mddwzxvuhliq4ejh2q4xh4",
    7
    "email": "john.smith@example.com",
    8
    "name": "John Smith",
    9
    "phone": {
    10
    "number": "1234567890",
    11
    "country_code": "+33"
    12
    }
    13
    },
    14
    "processing": {
    15
    "partner_payment_id": "588631298089"
    16
    },
    17
    "_links": {
    18
    "self": {
    19
    "href": "https://api.sandbox.checkout.com/payments/pay_e4xq6um55ezuplruf7dfyq2ggu"
    20
    },
    21
    "redirect": {
    22
    "href": "https://payment.limonetikqualif.com/ComputopTrustly/Order/PayPage/588631298089"
    23
    }
    24
    }
    25
    }

    Redirect the customer

    Redirect your customer to the redirect link’s href in the response. This will allow the customer to authorize the payment, before they are transferred to your predefined success or failure URL.


    Get details about a payment

    You can retrieve details about an existing Trustly payment with the following endpoint.

    For the full API specification, see the API reference.

      post

      https://api.checkout.com/payments/{id}

      Response example

        1
        {
        2
        "id": "pay_e4xq6um55ezuplruf7dfyq2ggu",
        3
        "requested_on": "2022-07-26T10:13:07.1485537Z",
        4
        "source": {
        5
        "type": "trustly"
        6
        },
        7
        "amount": 2000,
        8
        "currency": "EUR",
        9
        "payment_type": "Regular",
        10
        "reference": "ORD-5023-4E89",
        11
        "status": "Pending",
        12
        "customer": {
        13
        "id": "cus_frc2mddwzxvuhliq4ejh2q4xh4",
        14
        "email": "john.smith@example.com",
        15
        "name": "John Smith",
        16
        "phone": {
        17
        "country_code": "+33",
        18
        "number": "1234567890"
        19
        }
        20
        },
        21
        "processing": {
        22
        "partner_payment_id": "588631298089"
        23
        },
        24
        "_links": {
        25
        "redirect": {
        26
        "href": "https://payment.limonetikqualif.com/ComputopTrustly/Order/PayPage/588631298089"
        27
        },
        28
        "self": {
        29
        "href": "https://api.sandbox.checkout.com/payments/pay_e4xq6um55ezuplruf7dfyq2ggu"
        30
        },
        31
        "actions": {
        32
        "href": "https://api.sandbox.checkout.com/payments/pay_e4xq6um55ezuplruf7dfyq2ggu/actions"
        33
        }
        34
        }
        35
        }

        Refund a payment

        Trustly supports both partial and full refunds. You can refund a payment through the Dashboard or using the refund API.

          post

          https://api.checkout.com/payments/{id}/refunds

          Request example

          1
          {
          2
          "amount": 10
          3
          }

          Response example

          1
          {
          2
          "action_id": "act_jpme4ffzbw7e3fmmlelj5r2qwi",
          3
          "_links": {
          4
          "payment": {
          5
          "href": "https://api.sandbox.checkout.com/payments/pay_fbp44nuw7knehes5ffrlbj7qty"
          6
          }
          7
          }
          8
          }

          Cancel a payment

          Once a payment is created, you cannot void it. If you wish to void a payment in progress, please wait for the payment_captured webhook, and then process a refund. Communicating this in advance to your end customer can help you avoid chargebacks.

          If the customer cancels or fails to complete their payment, we will send a payment_canceled webhook.


          Webhooks

          You may receive the following webhooks when using Trustly.

          WebhookDescription

          payment_pending

          Sent when a payment request has been successfully initiated.

          payment_declined

          Sent when a payment request has been rejected.

          payment_capture_pending

          Sent when a customer has successfully completed the redirect checkout flow.

          payment_captured

          Sent when the payment has been successfully captured.

          payment_canceled

          Sent when the customer cancels their payment or the payment expires automatically.

          payment_refund_accepted

          Sent when the refund of the payment has been (fully or partially) accepted.

          payment_refunded

          Sent when the payment has been (fully or partially) refunded.

          payment_refund_declined

          Sent when a refund has been declined.

          View all of our webhook notifications.


          Testing Trustly

          To start testing, you'll need to contact your Customer Success Manager or Implementation Engineer to activate Trustly payments in the sandbox environment.

          1. Create a Trustly transaction by following the Request a payment instructions.
          2. Follow the redirect link in the response to Trustly’s website.
          3. Select the country where your bank is located, then select your bank. Trustly will provide a secure connection to your bank.
          4. Enter the login credentials for your bank.
          5. Enter your one-time code and select Continue.
          6. Select your account (checking, savings or other) and select Continue.
          7. Enter your one-time code again and select Confirm payment. You should be redirected to your provided success URL.