Payment Context

Request a Payment Context

Send a Payment Context request.

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

SecurityOAuth2: OAuth or API Key: ApiSecretKey
Request
header Parameters
Cko-Idempotency-Key
string

An optional idempotency key for safely retrying payment requests

Request Body schema: application/json
required
object (PaymentContextSource)

The source of the payment.

currency
required
string = 3 characters

The three-letter ISO currency code.

amount
required
integer >= 0

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

payment_type
string
Default: "Regular"

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

Enum: "Regular" "Recurring"
capture
boolean
Default: true

Whether to capture the later payment (if applicable).

object (PaymentContextDetailsCustomer)

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

object (Shipping)

The shipping details.

object

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

processing_channel_id
string^(pc)_(\w{26})$

The processing channel to be used for the payment.

reference
string <= 50 characters

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
string <= 100 characters

A description of the Payment Context.

success_url
string <uri> <= 1024 characters

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

failure_url
string <uri> <= 1024 characters

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

Array of objects (PaymentContextItems)

The order's line items.

Required for Klarna payments.

metadata
object

A set of key-value pairs store additional information about a transaction. You can send custom fields and up to five user-defined fields, which can be used for reporting purposes. You can supply fields of type

  • string
  • number
  • boolean

Arrays and objects are not supported.

You can provide up to 20 metadata fields per API call, but the value of each field must not exceed 255 characters in length.

You can also reference metadata properties in your custom rules for Fraud Detection.

Responses
201

Payment Context Created.

401

Unauthorized

422

Invalid data was sent.

429

Too many requests or duplicate request detected.

502

Bad gateway

post/payment-contexts
Request samples
application/json
{
  • "source": {
    },
  • "amount": 6540,
  • "currency": "USD",
  • "payment_type": "Recurring",
  • "capture": true,
  • "customer": {
    },
  • "shipping": {
    },
  • "processing": {
    },
  • "processing_channel_id": "pc_q4dbxom5jbgudnjzjpz7j2z6uq",
  • "reference": "ORD-5023-4E89",
  • "description": "Set of 3 masks",
  • "items": [
    ],
  • "metadata": {
    }
}
Response samples
application/json
{
  • "id": "pct_y3oqhf46pyzuxjbcn2giaqnb44",
  • "amount": 0,
  • "processed_on": "2019-08-24T14:15:22Z",
  • "status": "Pending",
  • "response_code": "2000",
  • "response_summary": "Rejected",
  • "available_payment_types": [
    ],
  • "unavailable_payment_types": [
    ],
  • "partner_metadata": {
    },
}

Get Payment Context details

Returns all the Payment Context details.

SecurityOAuth2: OAuth or API Key: ApiSecretKey
Request
path Parameters
id
required
string (PaymentContextId) = 30 characters ^(pct)_(\w{26})$

Payment Context's unique identifier.

Example: pct_y3oqhf46pyzuxjbcn2giaqnb44
Responses
200

Payment Context retrieved successfully.

401

Unauthorized

404

Payment Context not found.

get/payment-contexts/{id}
Request samples
Response samples
application/json
{
  • "status": "Approved",
  • "payment_request": {
    },
  • "partner_metadata": {
    }
}