Skip to content

PayPal

Last updated: 13th January 2022

Start accepting PayPal payments and open your business to thousands of online shoppers.

To start accepting PayPal payments, please contact your Customer Success Manager.

Model

GW only

Payment flow

Redirect

Payment method type

Wallet

One-step payment

Authorization

Capture

Refund

Partial refund

Chargeback

Recurring payment


Overview

PayPal payments follow a two-step process:


Request a payment

Endpoints

You can find the full list, as well as complete request and response examples, in our API reference.

    post

    https://api.checkout.com/payments

    Request example

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    {
    "amount": 100,
    "currency": "EUR",
    "source": {
    "type": "paypal",
    "invoice_number": "CKO00001",
    "logo_url": "https://www.example.com/logo.jpg",
    "stc": {
    "property_name1": "property 1",
    "property_name2": "property 2",
    "property_name3": "property 3"
    }
    }
    }

    Response example

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

    Response example

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    {
    "id": "pay_ks2zlgzmff7ejnbvkpdw5n4liq",
    "status": "Pending",
    "customer": {
    "id": "cus_ho2i3q5rgl4e7ed3uox4ez4a5m"
    },
    "_links": {
    "self": {
    "href": "https://api.sandbox.checkout.com/payments/pay_ks2zlgzmff7ejnbvkpdw5n4liq"
    },
    "redirect": {
    "href": "https://www.sandbox.paypal.com/checkoutnow?token=EC-45B75666L8055651R&useraction=commit"
    }
    }
    }

    Redirect the customer

    Redirect your customer to the redirect link’s href in the response. The customer will be redirected to a PayPal page where they can authorize the payment, before being transferred to your predefined success or failure URL.


    Get details about a payment

    You can use the payment_id found in the payment response, or the cko-session-id from the success/failure URL (e.g., https://www/checkout.com/order/succeeded?cko-session-id=sid_vii64oquze5u3h2x6hh4rurc4y) to retrieve details about the payment.

    The cko-session-id expires 15 minutes after being created.

    Use the details below to set up your request.

    Endpoints

    You can find the full list, as well as complete request and response examples, in our API reference.

      get

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

      Response example

      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      22
      23
      24
      25
      26
      27
      28
      29
      {
      "id": "pay_ks2zlgzmff7ejnbvkpdw5n4liq",
      "requested_on": "2019-07-17T07:24:12Z",
      "source": {
      "type": "paypal"
      },
      "amount": 100,
      "currency": "EUR",
      "payment_type": "Regular",
      "status": "Captured",
      "approved": true,
      "risk": {
      "flagged": false
      },
      "customer": {
      "id": "cus_ho2i3q5rgl4e7ed3uox4ez4a5m"
      },
      "_links": {
      "self": {
      "href": "https://api.sandbox.checkout.com/payments/pay_ks2zlgzmff7ejnbvkpdw5n4liq"
      },
      "actions": {
      "href": "https://api.sandbox.checkout.com/payments/pay_ks2zlgzmff7ejnbvkpdw5n4liq/actions"
      },
      "refund": {
      "href": "https://api.sandbox.checkout.com/payments/pay_ks2zlgzmff7ejnbvkpdw5n4liq/refunds"
      }
      }
      }

      Testing PayPal

      To start testing, you'll need to:

      • create a test account, and
      • contact your Customer Success Manager or Integrations engineer to activate PayPal payments in the sandbox environment.
      1. Create a PayPal transaction as above, following the redirect link in the response to PayPal's website.
      2. Log in with your PayPal username and password.
      3. Set the payment status – pending, paid, or refused – and then select Confirm. You should then be redirected to your predefined success URL.