Payment Context

Request a Payment Context #

Send a Payment Context request. Successful Payment Context requests will always return a 201 response.

Authorizations

bearer

#
HTTP: bearer #

HTTP Authorization Scheme: bearer

Bearer format: JWT

header Parameters #
AuthorizationrequiredstringBearer token (API Key or OAuth2 Access Token).
Cko-Idempotency-KeystringAn optional idempotency key for safely retrying payment requests.
Request Body schema: application/json #

Request body for creating a Payment Context.

source requiredobjectThe source of the payment.
currency requiredstring = 3 characters The three-letter ISO currency code.
amount requirednumber >= 0 The Payment Context Payment amount. The amount must be provided in the minor currency unit.
payment_typestring Default: “Regular” Enum:”Regular””Recurring”The payment type. “Recurring” must be specified if the payment is paid in multiple installments.
captureboolean Default: trueWhether to capture the later payment (if applicable).
customerobjectThe customer details.
shippingobjectThe shipping details.
processingobjectUse the processing object to influence or override the data sent during card processing.
processing_channel_idstring^(pc)_(\w{26})$The processing channel to be used for the payment.
referencestring <= 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.
descriptionstring <= 100 characters A description of the Payment Context.
success_urlstring <= 1024 characters Overrides the default success redirect URL configured on your account.
failure_urlstring <= 1024 characters Overrides the default failure redirect URL configured on your account.
itemsArray of objectsThe order line items. Required for Klarna payments.
metadataobjectA set of key-value pairs to store additional information about a transaction. Up to 20 fields, 255 chars each. Only string, number, boolean allowed.
Responses #
201 Payment Context Created.
Response Schema: application/json #
id requiredstringPayment Context’s unique identifier.
partner_metadata requiredobjectProcessing object
processed_on requiredstring <date-time> The date and time when the payment context was processed in UTC.
_linksrequiredobjectThe links related to the payment.
amount requirednumberThe payment amount.
status requiredstringThe status of the payment context.
response_code requiredstringThe gateway response code.
response_summary requiredstringThe gateway response summary.
available_payment_typesArray of objectsContains information about the available payment type returned by the partner for this purchase.
unavailable_payment_typesArray of objectsContains information about the unavailable payment type returned by the partner for this purchase.

401 Unauthorized

422 Invalid data was sent.
Response Schema: application/json #
request_id requiredstringThe unique request identifier.
error_type requiredstringThe error type.
error_codes requiredArray of stringsThe error codes.
429 Too many requests or duplicate request detected.
Response Schema: application/json #
request_id requiredstringThe unique request identifier.
error_type requiredstringThe error type.
error_codes requiredArray of stringsThe error codes.

502 Bad gateway

Get Payment Context details #

Returns all the Payment Context details.

Authorizations

bearer

#
HTTP: bearer #

HTTP Authorization Scheme: bearer

Bearer format: JWT

path Parameters #
id requiredstring = 30 characters ^(pct)_(\w{26})$Payment Context’s unique identifier.
header Parameters #
Authorization requiredstring
Responses #
200 Payment Context retrieved successfully.
Response Schema: application/json #
payment_request requiredobjectThe payment request details.
partner_metadata requiredobjectProcessing object
status requiredstring Default: “Created” Enum:”Created””Approved”The status of the payment context.

401 Unauthorized

404 Payment Context not found.
Response Schema: application/json #
request_id requiredstringThe unique request identifier.
error_type requiredstringThe error type.
error_codes requiredArray of stringsThe error codes.

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top