{"id":900,"date":"2025-06-08T16:43:15","date_gmt":"2025-06-08T16:43:15","guid":{"rendered":"https:\/\/lddpay.com\/?post_type=docs&#038;p=900"},"modified":"2025-06-08T16:45:31","modified_gmt":"2025-06-08T16:45:31","password":"","slug":"payment-context","status":"publish","type":"docs","link":"https:\/\/lddpay.com\/zh\/docs\/payment-context\/","title":{"rendered":"Payment Context"},"content":{"rendered":"<h2 class=\"wp-block-heading\"><a href=\"file:\/\/\/C:\/Users\/Administrator\/Downloads\/payfac-doc (1).htm#tag\/Payment-Context\/operation\/PaymentContextController_createPaymentContext\"><\/a>Request a Payment Context<\/h2>\n\n\n\n<p>Send a Payment Context request. Successful Payment Context requests will always return a 201 response.<\/p>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary>Authorizations<\/summary>\n<p><em>bearer<\/em><\/p>\n\n\n\n<h5 class=\"wp-block-heading\"><\/h5>\n\n\n\n<h5 class=\"wp-block-heading\">HTTP: bearer<\/h5>\n\n\n\n<p><strong>HTTP Authorization Scheme: <\/strong><code>bearer<\/code><\/p>\n\n\n\n<p><strong>Bearer format: <\/strong><code>JWT<\/code><\/p>\n<\/details>\n\n\n\n<h5 class=\"wp-block-heading\">header Parameters<\/h5>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>Authorizationrequired<\/td><td>stringBearer token (API Key or OAuth2 Access Token).<\/td><\/tr><tr><td>Cko-Idempotency-Key<\/td><td>stringAn optional idempotency key for safely retrying payment requests.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h5 class=\"wp-block-heading\">Request Body schema: application\/json<\/h5>\n\n\n\n<p>Request body for creating a Payment Context.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>source required<\/td><td>objectThe source of the payment.<\/td><\/tr><tr><td>currency required<\/td><td>string = 3 characters The three-letter ISO currency code.<\/td><\/tr><tr><td>amount required<\/td><td>number &gt;= 0 The Payment Context Payment amount. The amount must be provided in the minor currency unit.<\/td><\/tr><tr><td>payment_type<\/td><td>string Default: &#8220;Regular&#8221; Enum:&#8221;Regular&#8221;&#8221;Recurring&#8221;The payment type. &#8220;Recurring&#8221; must be specified if the payment is paid in multiple installments.<\/td><\/tr><tr><td>capture<\/td><td>boolean Default: trueWhether to capture the later payment (if applicable).<\/td><\/tr><tr><td>customer<\/td><td>objectThe customer details.<\/td><\/tr><tr><td>shipping<\/td><td>objectThe shipping details.<\/td><\/tr><tr><td>processing<\/td><td>objectUse the processing object to influence or override the data sent during card processing.<\/td><\/tr><tr><td>processing_channel_id<\/td><td>string^(pc)_(\\w{26})$The processing channel to be used for the payment.<\/td><\/tr><tr><td>reference<\/td><td>string &lt;= 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.<\/td><\/tr><tr><td>description<\/td><td>string &lt;= 100 characters A description of the Payment Context.<\/td><\/tr><tr><td>success_url<\/td><td>string &lt;= 1024 characters Overrides the default success redirect URL configured on your account.<\/td><\/tr><tr><td>failure_url<\/td><td>string &lt;= 1024 characters Overrides the default failure redirect URL configured on your account.<\/td><\/tr><tr><td>items<\/td><td>Array of objectsThe order line items. Required for Klarna payments.<\/td><\/tr><tr><td>metadata<\/td><td>objectA set of key-value pairs to store additional information about a transaction. Up to 20 fields, 255 chars each. Only string, number, boolean allowed.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h5 class=\"wp-block-heading\">Responses<\/h5>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary>201 Payment Context Created.<\/summary>\n<h5 class=\"wp-block-heading\">Response Schema: application\/json<\/h5>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>id required<\/td><td>stringPayment Context&#8217;s unique identifier.<\/td><\/tr><tr><td>partner_metadata required<\/td><td>objectProcessing object<\/td><\/tr><tr><td>processed_on required<\/td><td>string &lt;date-time&gt; The date and time when the payment context was processed in UTC.<\/td><\/tr><tr><td>_linksrequired<\/td><td>objectThe links related to the payment.<\/td><\/tr><tr><td>amount required<\/td><td>numberThe payment amount.<\/td><\/tr><tr><td>status required<\/td><td>stringThe status of the payment context.<\/td><\/tr><tr><td>response_code required<\/td><td>stringThe gateway response code.<\/td><\/tr><tr><td>response_summary required<\/td><td>stringThe gateway response summary.<\/td><\/tr><tr><td>available_payment_types<\/td><td>Array of objectsContains information about the available payment type returned by the partner for this purchase.<\/td><\/tr><tr><td>unavailable_payment_types<\/td><td>Array of objectsContains information about the unavailable payment type returned by the partner for this purchase.<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/details>\n\n\n\n<p>401 Unauthorized<\/p>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary>422 Invalid data was sent.<\/summary>\n<h5 class=\"wp-block-heading\">Response Schema: application\/json<\/h5>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>request_id required<\/td><td>stringThe unique request identifier.<\/td><\/tr><tr><td>error_type required<\/td><td>stringThe error type.<\/td><\/tr><tr><td>error_codes required<\/td><td>Array of stringsThe error codes.<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/details>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary>429 Too many requests or duplicate request detected.<\/summary>\n<h5 class=\"wp-block-heading\">Response Schema: application\/json<\/h5>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>request_id required<\/td><td>stringThe unique request identifier.<\/td><\/tr><tr><td>error_type required<\/td><td>stringThe error type.<\/td><\/tr><tr><td>error_codes required<\/td><td>Array of stringsThe error codes.<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/details>\n\n\n\n<p>502 Bad gateway<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"file:\/\/\/C:\/Users\/Administrator\/Downloads\/payfac-doc (1).htm#tag\/Payment-Context\/operation\/PaymentContextController_getPaymentContextDetails\"><\/a>Get Payment Context details<\/h2>\n\n\n\n<p>Returns all the Payment Context details.<\/p>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary>Authorizations<\/summary>\n<p><em>bearer<\/em><\/p>\n\n\n\n<h5 class=\"wp-block-heading\"><\/h5>\n\n\n\n<h5 class=\"wp-block-heading\">HTTP: bearer<\/h5>\n\n\n\n<p><strong>HTTP Authorization Scheme: <\/strong><code>bearer<\/code><\/p>\n\n\n\n<p><strong>Bearer format: <\/strong><code>JWT<\/code><\/p>\n<\/details>\n\n\n\n<h5 class=\"wp-block-heading\">path Parameters<\/h5>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>id required<\/td><td>string = 30 characters ^(pct)_(\\w{26})$Payment Context&#8217;s unique identifier.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h5 class=\"wp-block-heading\">header Parameters<\/h5>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>Authorization required<\/td><td>string<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h5 class=\"wp-block-heading\">Responses<\/h5>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary>200 Payment Context retrieved successfully.<\/summary>\n<h5 class=\"wp-block-heading\">Response Schema: application\/json<\/h5>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>payment_request required<\/td><td>objectThe payment request details.<\/td><\/tr><tr><td>partner_metadata required<\/td><td>objectProcessing object<\/td><\/tr><tr><td>status required<\/td><td>string Default: &#8220;Created&#8221; Enum:&#8221;Created&#8221;&#8221;Approved&#8221;The status of the payment context.<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/details>\n\n\n\n<p>401 Unauthorized<\/p>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary>404 Payment Context not found.<\/summary>\n<h5 class=\"wp-block-heading\">Response Schema: application\/json<\/h5>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>request_id required<\/td><td>stringThe unique request identifier.<\/td><\/tr><tr><td>error_type required<\/td><td>stringThe error type.<\/td><\/tr><tr><td>error_codes required<\/td><td>Array of stringsThe error codes.<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/details>","protected":false},"excerpt":{"rendered":"<p>Request a Payment Context Send a Payment Context request. Successful Payment Context requests will always return a 201 response. header [&hellip;]<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"doc_category":[122],"doc_tag":[],"year_month":"2026-04","word_count":514,"total_views":0,"reactions":{"happy":0,"normal":0,"sad":0},"author_info":{"author_nicename":"admin","author_url":"https:\/\/lddpay.com\/zh\/author\/admin\/"},"doc_category_info":[{"term_name":"Temp Solution","term_url":"https:\/\/lddpay.com\/zh\/docs-category\/temp-solution\/"}],"doc_tag_info":[],"author_list":[{"ID":"3","user_login":"jony","display_name":"jony","id":"3"},{"ID":"2","user_login":"Merchantlogin","display_name":"Merchantlogin","id":"2"},{"ID":"1","user_login":"w2863431","display_name":"admin","id":"1"}],"_links":{"self":[{"href":"https:\/\/lddpay.com\/zh\/wp-json\/wp\/v2\/docs\/900"}],"collection":[{"href":"https:\/\/lddpay.com\/zh\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/lddpay.com\/zh\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/lddpay.com\/zh\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lddpay.com\/zh\/wp-json\/wp\/v2\/comments?post=900"}],"version-history":[{"count":1,"href":"https:\/\/lddpay.com\/zh\/wp-json\/wp\/v2\/docs\/900\/revisions"}],"predecessor-version":[{"id":901,"href":"https:\/\/lddpay.com\/zh\/wp-json\/wp\/v2\/docs\/900\/revisions\/901"}],"wp:attachment":[{"href":"https:\/\/lddpay.com\/zh\/wp-json\/wp\/v2\/media?parent=900"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/lddpay.com\/zh\/wp-json\/wp\/v2\/doc_category?post=900"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/lddpay.com\/zh\/wp-json\/wp\/v2\/doc_tag?post=900"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}