Payment Context

Request a Payment Context

Send a Payment Context request.

Note: Successful Payment Context requests will always return a 201 response.

Effective August 2026, Payment Context is no longer supported for new integrations. New integration requests return a 405 Method Not Allowed response. For new integrations, call the Create a Payment Setup endpoint instead.

Headers
  • Cko-Idempotency-Key
    Type: string

    An optional idempotency key for safely retrying payment requests

Body·
application/json
  • source
    required

    The source of the payment.

    Klarna Source

    • type
      Discriminator
      Type: string
      required

      The source type of the payment context request.

    • account_holder
      Type: object
      required
  • amount
    Type: integer
    min:  
    0
    required

    The Payment Context Payment amount. The amount must be provided in the minor currency unit.

  • currency
    Type: string
    min length:  
    3
    max length:  
    3
    required

    The three-letter ISO currency code.

  • payment_type
    Type: string enum

    "Recurring" must be specified if the payment is paid in multiple installments.

    values
    • Regular
    • Recurring
  • capture
    Type: boolean

    Whether to capture the later payment (if applicable).

  • customer
    Type: object ·

    The customer details.
    Required if source.type is StcPay or Tabby.

  • shipping
    Type: object ·

    The shipping details.

  • processing
    Type: object ·

    Use the processing object to influence or override the data during the payment processing.

  • processing_channel_id
    Type: string Pattern: ^(pc)_(\w{26})$

    The processing channel to be used for the payment.

  • reference
    Type: string
    max length:  
    50

    A reference you can later use to identify this Payment Context, such as an order number.
    Can only be alphanumeric and must be unique for Benefit.
    For Amex, the string limit is 30 characters.

  • description
    Type: string
    max length:  
    100

    A description of the Payment Context.

  • success_url
    Type: string
    max length:  
    1024
    Format: uri

    For redirect payment methods, this overrides the default success redirect URL configured on your account.

Responses
  • application/json
  • 401

    Unauthorized

  • 405

    Method Not Allowed. Not supported for creating new integrations on this resource.

  • application/json
  • application/json
  • 502

    Bad gateway

Request Example for post/payment-contexts
curl 'https://{prefix}.api.sandbox.checkout.com/payment-contexts' \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "source": {
    "type": "klarna",
    "account_holder": {
      "billing_address": {
        "country": ""
      }
    }
  },
  "amount": 6540,
  "currency": "USD",
  "payment_type": "Recurring",
  "capture": true,
  "customer": {
    "phone": {
      "country_code": "+1",
      "number": "415 555 2671",
      "phone_verified": true
    },
    "email": "card.success@tabby.ai",
    "name": "string",
    "email_verified": true,
    "summary": {
      "registration_date": "2023-05-01",
      "first_transaction_date": "2023-07-01",
      "last_payment_date": "2023-08-01",
      "total_order_count": 15,
      "last_payment_amount": 500
    }
  },
  "shipping": {
    "first_name": "John",
    "last_name": "Smith",
    "email": "john.smith@example.com",
    "address": {
      "address_line1": "123 High St.",
      "address_line2": "Flat 456",
      "city": "London",
      "state": "",
      "zip": "SW1A 1AA",
      "country": "GB"
    },
    "phone": {
      "country_code": "+1",
      "number": "415 555 2671"
    },
    "from_address_zip": "123456",
    "timeframe": "SameDay",
    "method": "BillingAddress",
    "delay": 5
  },
  "processing": {
    "plan": {
      "type": "MERCHANT_INITIATED_BILLING",
      "skip_shipping_address": true,
      "immutable_shipping_address": true
    },
    "discount_amount": 5,
    "shipping_amount": 300,
    "tax_amount": 3000,
    "invoice_id": "",
    "brand_name": "Acme Corporation",
    "locale": "en-US",
    "shipping_preference": "set_provided_address",
    "user_action": "pay_now",
    "partner_customer_risk_data": {
      "key": "",
      "value": ""
    },
    "custom_payment_method_ids": [
      ""
    ],
    "airline_data": [
      {
        "ticket": {
          "number": "045-21351455613",
          "issue_date": "2023-05-20",
          "issuing_carrier_code": "AI",
          "travel_package_indicator": "B",
          "travel_agency_name": "World Tours",
          "travel_agency_code": "01"
        },
        "passenger": [
          {
            "first_name": "John",
            "last_name": "White",
            "date_of_birth": "1990-05-26",
            "address": {
              "country": "US"
            }
          }
        ],
        "flight_leg_details": [
          {
            "flight_number": "101",
            "carrier_code": "BA",
            "class_of_travelling": "J",
            "departure_airport": "LHR",
            "departure_date": "2023-06-19",
            "departure_time": "15:30",
            "arrival_airport": "LAX",
            "stop_over_code": "x",
            "fare_basis_code": "SPRSVR"
          }
        ]
      }
    ],
    "accommodation_data": [
      {
        "name": "The Sea View Hotel",
        "booking_reference": "HOTEL123",
        "check_in_date": "2023-06-20",
        "check_out_date": "2023-06-23",
        "address": {
          "address_line1": "123 Beach Road",
          "zip": "10001"
        },
        "state": "FL",
        "country": "USA",
        "city": "Los Angeles",
        "number_of_rooms": 2,
        "guests": [
          {
            "first_name": "Jane",
            "last_name": "Doe",
            "date_of_birth": "1985-07-14"
          }
        ],
        "room": [
          {
            "rate": "70",
            "number_of_nights_at_room_rate": "3"
          }
        ],
        "property_phone": [
          {
            "country_code": "44",
            "number": "7123456789"
          }
        ],
        "customer_service_phone": [
          {
            "country_code": "44",
            "number": "7123456789"
          }
        ]
      }
    ]
  },
  "processing_channel_id": "pc_q4dbxom5jbgudnjzjpz7j2z6uq",
  "reference": "ORD-5023-4E89",
  "description": "Set of 3 masks",
  "success_url": "https://example.com/payments/success",
  "failure_url": "https://example.com/payments/fail",
  "items": [
    {
      "type": "",
      "name": "Test item",
      "quantity": 2,
      "unit_price": 50,
      "reference": "858818ac",
      "total_amount": 29000,
      "tax_rate": 2000,
      "tax_amount": 1000,
      "discount_amount": 1000,
      "url": "",
      "image_url": ""
    }
  ],
  "metadata": {
    "coupon_code": "NY2018"
  }
}'
{
  "id": "pct_y3oqhf46pyzuxjbcn2giaqnb44",
  "amount": 1,
  "processed_on": "2026-09-23T13:52:07.856Z",
  "status": "Pending",
  "response_code": "2000",
  "response_summary": "Rejected",
  "available_payment_types": [
    {
      "payment_type": "Regular",
      "payment_plan": {
        "days_between_payments": 28,
        "total_number_of_payments": 5,
        "current_payment_number": 3,
        "expiry": "20251031",
        "name": "Subscription 1234",
        "start_date": "20260507",
        "amount": 1234
      }
    }
  ],
  "unavailable_payment_types": [
    {
      "payment_type": "Regular",
      "rejection_reason": "string",
      "payment_plan": {
        "days_between_payments": 28,
        "total_number_of_payments": 5,
        "current_payment_number": 3,
        "expiry": "20251031",
        "name": "Subscription 1234",
        "start_date": "20260507",
        "amount": 1234
      },
      "description": "string"
    }
  ],
  "partner_metadata": {
    "order_id": "test_order_123",
    "customer_id": "cus_123",
    "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vcGlhLXNkay1mbG93IiwidmFyaWF0ZSI6InZhcmlhdGUtMSJ9LHsibmFtZSI6ImtwLWNsaWVudC11dG9waWEtd2Vidmlldy1mbG93IiwidmFyaWF0ZSI6InZhcmlhdGUtMSJ9LHsibmFtZSI6ImluLWFwcC1zZGstY2FyZC1zY2FubmluZyIsInBhcmFtZXRlcnMiOnsidmFyaWF0ZV9pZCI6ImNhcmQtc2Nhbm5pbmctZW5hYmxlIn19XSwicmVnaW9uIjoiZXUiLCJvcmRlcl9hbW91bnQiOjIwMDAsIm9mZmVyaW5nX29wdHMiOjAsIm9vIjoiY3ciLCJ2ZXJzaW9uIjoidjEuMTAuMC0xNTkwLWczZWJjMzkwNyJ9.ZxThQVo5e0Fck1vwOQ-WWAr7Zw-dsiEhjd3CW-E5p8atUhnBhrzIs6WCBeOOv3ci2VvpykVnDw2qycCTA-7TpTq1wn_kPxxixDQnYJYJzrZMoUhPLZo5pfy2a1S_t2owEQks0THRzu2wRlZwCN4ewDnVqsut60X4r3B92cJENIDtEC4Fs55CjFEmYUtsLXSspNLKvpZe2zg4O_M5yjH7XsBs5YJalZLexf4545G5vJrmVHgiA322mbgWC7BH0IU1A-ql5sFvs190_cjGaLsAvrkh9CVczUPy3X-jr3A5z1YRVfywPpvwKFWL8GZtgrdUZmgiU5_8ZZLkEPzrSucHrQ"
  },
  "_links": {
    "self": {
      "href": "https://{prefix}.api.checkout.com/payment-contexts/pct_y3oqhf46pyzuxjbcn2giaqnb44"
    }
  }
}

Get Payment Context details

Returns all the Payment Context details.

Path Parameters
  • id
    Type: string ·
    min length:  
    30
    max length:  
    30
    Pattern: ^(pct)_(\w{26})$
    required

    Payment Context's unique identifier.

Responses
  • application/json
  • 401

    Unauthorized

  • 404

    Payment Context not found.

Request Example for get/payment-contexts/{id}
Shell Curl
curl 'https://{prefix}.api.sandbox.checkout.com/payment-contexts/pct_y3oqhf46pyzuxjbcn2giaqnb44' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "id": "pct_y3oqhf46pyzuxjbcn2giaqnb44",
  "status": "Approved",
  "payment_request": {
    "source": {
      "type": "klarna",
      "account_holder": {
        "billing_address": {
          "country": "string"
        }
      }
    },
    "amount": 6540,
    "currency": "USD",
    "payment_type": "Recurring",
    "capture": true,
    "customer": {
      "email": "johnsmith@example.com",
      "name": "John Smith"
    },
    "shipping": {
      "first_name": "John",
      "last_name": "Smith",
      "email": "john.smith@example.com",
      "address": {
        "address_line1": "123 High St.",
        "address_line2": "Flat 456",
        "city": "London",
        "state": "string",
        "zip": "SW1A 1AA",
        "country": "GB"
      },
      "phone": {
        "country_code": "+1",
        "number": "415 555 2671"
      },
      "from_address_zip": "123456",
      "timeframe": "SameDay",
      "method": "BillingAddress",
      "delay": 5
    },
    "processing": {
      "plan": {
        "type": "MERCHANT_INITIATED_BILLING",
        "skip_shipping_address": true,
        "immutable_shipping_address": true
      },
      "discount_amount": 5,
      "shipping_amount": 300,
      "tax_amount": 3000,
      "invoice_id": "string",
      "brand_name": "Acme Corporation",
      "locale": "en-US",
      "shipping_preference": "set_provided_address",
      "user_action": "pay_now",
      "partner_customer_risk_data": {
        "key": "string",
        "value": "string"
      },
      "custom_payment_method_ids": [
        "string"
      ],
      "airline_data": [
        {
          "ticket": {
            "number": "045-21351455613",
            "issue_date": "2023-05-20",
            "issuing_carrier_code": "AI",
            "travel_package_indicator": "B",
            "travel_agency_name": "World Tours",
            "travel_agency_code": "01"
          },
          "passenger": [
            {
              "first_name": "John",
              "last_name": "White",
              "date_of_birth": "1990-05-26",
              "address": {
                "country": "US"
              }
            }
          ],
          "flight_leg_details": [
            {
              "flight_number": "101",
              "carrier_code": "BA",
              "class_of_travelling": "J",
              "departure_airport": "LHR",
              "departure_date": "2023-06-19",
              "departure_time": "15:30",
              "arrival_airport": "LAX",
              "stop_over_code": "x",
              "fare_basis_code": "SPRSVR"
            }
          ]
        }
      ],
      "accommodation_data": [
        {
          "name": "The Sea View Hotel",
          "booking_reference": "HOTEL123",
          "check_in_date": "2023-06-20",
          "check_out_date": "2023-06-23",
          "address": {
            "address_line1": "123 Beach Road",
            "zip": "10001"
          },
          "state": "FL",
          "country": "USA",
          "city": "Los Angeles",
          "number_of_rooms": 2,
          "guests": [
            {
              "first_name": "Jane",
              "last_name": "Doe",
              "date_of_birth": "1985-07-14"
            }
          ],
          "room": [
            {
              "rate": "70",
              "number_of_nights_at_room_rate": "3"
            }
          ],
          "property_phone": [
            {
              "country_code": "44",
              "number": "7123456789"
            }
          ],
          "customer_service_phone": [
            {
              "country_code": "44",
              "number": "7123456789"
            }
          ]
        }
      ]
    },
    "processing_channel_id": "pc_q4dbxom5jbgudnjzjpz7j2z6uq",
    "reference": "ORD-5023-4E89",
    "description": "Set of 3 masks",
    "success_url": "https://example.com/payments/success",
    "failure_url": "https://example.com/payments/fail",
    "items": [
      {
        "type": "string",
        "name": "Test item",
        "quantity": 2,
        "unit_price": 50,
        "reference": "858818ac",
        "total_amount": 29000,
        "tax_rate": 2000,
        "tax_amount": 1000,
        "discount_amount": 1000,
        "url": "string",
        "image_url": "string"
      }
    ],
    "metadata": {
      "coupon_code": "NY2018"
    }
  },
  "partner_metadata": {
    "order_id": "test_order_123",
    "customer_id": "cus_123",
    "session_id": "feb0096d-8486-400d-89fa-2fa716b4521f",
    "client_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjgyMzA1ZWJjLWI4MTEtMzYzNy1hYTRjLTY2ZWNhMTg3NGYzZCJ9.eyJzZXNzaW9uX2lkIjoiY2RiNDI0MGQtMTdkYy01MjJkLWJlYjEtYjAyYjRlMzllYTdhIiwiYmFzZV91cmwiOiJodHRwczovL2pzLnBsYXlncm91bmQua2xhcm5hLmNvbS9ldS9rcCIsImRlc2lnbiI6ImtsYXJuYSIsImxhbmd1YWdlIjoiZW4iLCJwdXJjaGFzZV9jb3VudHJ5IjoiREUiLCJlbnZpcm9ubWVudCI6InBsYXlncm91bmQiLCJtZXJjaGFudF9uYW1lIjoiQ2hlY2tvdXQuY29tI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