> For the complete documentation index, see [llms.txt](https://dcgate.gitbook.io/oxipay/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dcgate.gitbook.io/oxipay/api-endpoints/sandbox-mode.md).

# Sandbox Mode

**Overview** OXI Pay provides a sandbox environment to facilitate testing of payment transactions without processing real payments. This document outlines how to use the sandbox mode when requesting a payment link.

***

**Endpoint:** `POST https://pay.oxichange.com/payment`

**Headers:**

* `X-SANDBOX: true` (Required to enable sandbox mode)

**Sandbox Mode Behavior:** When `X-SANDBOX` is set to `true`, the system generates a prefixed token (`SANDBOX-<token>`) and returns a sandbox-specific payment link:

* **Base URL:** `https://pay.oxichange.com/sandbox/invoice`
* **Payment Link:** `https://pay.oxichange.com/sandbox/invoice?token=SANDBOX-<token>`

Example Response in Sandbox Mode:

```
{
    "transaction_id": "PYD1713456789",
    "token": "SANDBOX-abcdef123456",
    "base_url": "https://pay.oxichange.com/sandbox/invoice",
    "payment_link": "https://pay.oxichange.com/sandbox/invoice?token=SANDBOX-abcdef123456"
}
```

***

**Error Codes in Sandbox Mode:**

| Status Code | Message                           | Description                                         |
| ----------- | --------------------------------- | --------------------------------------------------- |
| -1          | "Invalid Merchant ID."            | The provided Merchant ID is incorrect.              |
| -2          | "Website status is not approved." | The merchant's website is not in an approved state. |
| -3          | "Invalid currency type."          | The specified currency is not supported.            |

***

**Conclusion:** By utilizing the `X-SANDBOX` header, developers can safely test transactions in the sandbox mode before moving to production. Ensure that real transactions omit the sandbox flag for proper processing.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dcgate.gitbook.io/oxipay/api-endpoints/sandbox-mode.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
