Reason Codes {#ctp-appendix-reason-codes}
=========================================

A `Unified Checkout` request response returns one of the following reason codes:

| Reason Code                 | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           ||
|:----------------------------|:---------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `200`                       | Successful response.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  ||
| `201`                       | Capture context created.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ||
| `400` - Capture Context API | Bad request. Possible reason values:   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `400` - Capture Context API | `CAPTURE_CONTEXT_EXPIRED`              | This reason is returned when the capture context JWT has passed its expiration time of 900 seconds (15 minutes). Example decrypted JWT fields include `"exp": "1762894371"` and `"iat": "1762893471"`.                                                                                                                                                                                                                                                                        |
| `400` - Capture Context API | `CAPTURE_CONTEXT_INVALID`              | The `Unified Checkout` configuration rejected the request due to invalid values. This reason is returned when the minimum required fields are missing or invalid or the capture context contradicts which products are enabled.                                                                                                                                                                                                                                               |
| `400` - Capture Context API | `CHECKOUT_ERROR`                       | Checkout failed. This reason is returned when a general, non‑payment‑method‑specific error occurs during the UnifiedCheckout checkout flow. When the checkout failure is specifically related to tokenization, `Click to Pay` SDK, SRC launch, Google Pay, etc., the SDK returns a more specific error                                                                                                                                                                        |
| `400` - Capture Context API | `CLICK_TO_PAY_SDK_LOAD_ERROR`          | This reason is returned when the UI cannot be successfully rendered. For example: * Network failures (CDN unavailable, blocked, or timed out) * Browser or device restrictions are preventing the SDK from loading. * Incorrect or missing configuration causes `Unified Checkout` not to request the SDK asset. * The merchant site CSP is blocking the SDK. * Any runtime error that prevents `Click to Pay` JS initialization. {#ctp-appendix-reason-codes_ul_bl5_n5z_hjc} |
| `400` - Capture Context API | `CREATE_TOKEN_TIMEOUT`                 | The token creation timed out. This reason is returned when the `Unified Checkout` JavaScript SDK cannot generate the transient token within the expected time-frame.                                                                                                                                                                                                                                                                                                          |
| `400` - Capture Context API | `CREATE_TOKEN_XHR_ERROR`               | This reason is returned when the system attempts to create a token, but a network / XHR-level failure occurs before the token can be created. This is a client-side SDK network failure, not a timeout or back-end validation error.                                                                                                                                                                                                                                          |
| `400` - Capture Context API | `ENCRYPT_CARD_FOR_SRC_ENROLMENT_ERROR` | Encrypt card for SRC enrollment failed. This reason is returned when `Unified Checkout` attempts to encrypt a card to enroll it in the SRC / `Click to Pay` system and the encryption step fails. This causes the SRC enrolment to abort.                                                                                                                                                                                                                                     |
| `400` - Capture Context API | `INVALID_APIKEY`                       | Returned when the API key that is used in the server‑side capture context request is invalid.                                                                                                                                                                                                                                                                                                                                                                                 |
| `400` - Capture Context API | `LAUNCH_SRC_CHECKOUT_ERROR`            | The launch SRC checkout failed. This reason is returned by the `Unified Checkout` JavaScript SDK when it cannot initialize or open the SRC checkout flow.                                                                                                                                                                                                                                                                                                                     |
| `400` - Capture Context API | `SDK_XHR_ERROR`                        | SDK failed to load. This reason is returned when the JavaScript SDK fails to load due to an XHR/network error during `Unified Checkout` initialization.                                                                                                                                                                                                                                                                                                                       |
| `400` - Capture Context API | `SHOW_LOAD_CONTAINER_SELECTOR`         | The specified DOM element cannot be found. Returned when the DOM element specified in the `show()` configuration cannot be found. This is a client-side JavaScript SDK error thrown during rendering of the payment selection UI.                                                                                                                                                                                                                                             |
| `400` - Capture Context API | `SHOW_LOAD_ERROR`                      | There was a problem encountered when loading the payment screen. Returned when the Unified Payments UI fails to load the payment selection screen (iframe/UI) during the `.show()` step                                                                                                                                                                                                                                                                                       |
| `400` - Capture Context API | `SHOW_LOAD_INVALID_CONTAINER`          | The supplied container parameter is invalid. Returned when the container provided to `up.show()` exists but is invalid---wrong type, not suitable to host UC UI, unsupported context, or malformed in configuration                                                                                                                                                                                                                                                           |
| `400` - Capture Context API | `SHOW_LOAD_SIDEBAR_OPTIONS`            | The supplied container parameter is invalid when sidebar is selected. Returned when `sidebar = true` and the `containers` supplied to `up.show()` are not valid for the sidebar layout (wrong type, unsupported container, or structurally incompatible).                                                                                                                                                                                                                     |
| `400` - Capture Context API | `SHOW_PAYMENT_TIMEOUT`                 | Occurs when an error is encountered during the handling of a payment option. Returned when UC cannot progress the user's selected payment option in time:                                                                                                                                                                                                                                                                                                                     |
| `400` - Capture Context API | `SHOW_PAYMENT_UNAVAILABLE`             | No payment types could be presented to the customer. This could be due to browser/device support or errors encountered during the checkout. Returned when *zero* payment methods can be presented in the `.show()` phase --- typically due to browser/device incompatibility, disabled payment types, or internal errors while loading payment options.                                                                                                                       |
| `400` - Capture Context API | `SHOW_TOKEN_TIMEOUT`                   | Occurs when the createToken call was unable to proceed. Returned when the `createToken` call cannot proceed within the expected time while rendering the payment selection UI                                                                                                                                                                                                                                                                                                 |
| `400` - Capture Context API | `SHOW_TOKEN_XHR_ERROR`                 | Occurs when a network error is encountered while attempting to create a token. Returned when the `createToken` step within `.show()` fails due to an actual network/XHR error (blocked request, CORS/CSP violation, extension interference, unreachable endpoint).                                                                                                                                                                                                            |
| `400` - Capture Context API | `TOKENIZATION_ERROR`                   | Tokenization failed. Returned when tokenization of the selected payment method fails --- due to invalid payment data, a failed internal tokenization call, network issues, or an unsupported/blocked payment environment.                                                                                                                                                                                                                                                     |
| `400` - Capture Context API | `TRIGGER_PAYMENT_TYPE_NOT_SUPPORTED`   | Trigger is not supported for this payment type. Returned when `up.trigger(paymentType)` is called with a payment method that does not support trigger mode, is not enabled, not available on the device/browser, or not recognized by UC.                                                                                                                                                                                                                                     |
| `400` - Capture Context API | `UNIFIED_PAYMENTS_PAYMENT_PARAMETERS`  | Occurs when no valid payment parameters exist when initializing button. Returned when the merchant calls `VAS.UnifiedCheckout(sessionJWT)` without providing valid payment parameters --- meaning the SDK cannot initialize the payment buttons because the supplied configuration is missing, empty, or malformed.                                                                                                                                                           |
| `400` - Capture Context API | `UNIFIED_PAYMENTS_VALIDATION_FIELDS`   | A validation error occurred. Missing or invalid values in required fields                                                                                                                                                                                                                                                                                                                                                                                                     |
| `400` - Capture Context API | `UNIFIED_PAYMENTS_VALIDATION_PARAMS`   | Trigger is not supported for this payment type. Returned when `up.trigger(paymentType)` is called with a payment method that does not support trigger mode, is not enabled, not available on the device/browser, or not recognized by UC.                                                                                                                                                                                                                                     |
| `404`                       | The specified resource not found in the system.                                                                                                                                                                                                                                                                                                                                                                                                                                                                       ||
| `500`                       | Unexpected server error.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ||
[Reason Codes]

