# Run a Test Payment in the API Reference

Use the sandbox API Reference to create a test payment directly from your browser.

This is useful when you want to confirm that your Payments API key, merchant ID, terminal ID, and request body are working before building the request in your own application.

#### Before you start

You need:

* A sandbox Payments API key
* A sandbox merchant ID
* A sandbox terminal ID for that merchant

The Payments API key is sent as a request header. Do not add the API key to the request body or URL.

#### What you will do

In this guide, you will:

* Open the `POST /Payments/crypto` endpoint in the sandbox API Reference
* Open the test request panel
* Add your `X-Api-Key` header
* Paste a sample JSON request body
* Update the merchant ID and terminal ID
* Send the request
* Copy the hosted payment URL from the response

#### Step 1: Open the payment endpoint

Go directly to the sandbox API Reference page for creating a payment:

```
https://api.test.devs.beadpay.io/apidocs/index.html#tag/payments/POST/Payments/crypto
```

Find the `POST /Payments/crypto` endpoint.

#### Step 2: Open the test request panel

![](/files/ppOkTSCREYYqsgDuYbiB)

Select `Test Request`.

This opens the interactive API Client, where you can add headers, paste a JSON request body, and send the request.

#### Step 3: Add your API key header

<figure><img src="/files/BFnn4u7Zi1W9Ga7UX6GV" alt=""><figcaption></figcaption></figure>

In the API Client, expand `Headers`.

Add a new header:

| Key         | Value                         |
| ----------- | ----------------------------- |
| `X-Api-Key` | Your sandbox Payments API key |

The API Client may display the header as `x-api-key` after it is added. That is okay. In your own code, use the canonical header name `X-Api-Key`.

Keep the existing JSON headers:

| Key            | Value              |
| -------------- | ------------------ |
| `Content-Type` | `application/json` |
| `Accept`       | `application/json` |

If the Authentication section says no authentication is selected, that is okay for this test. The API key is being added directly as a request header.

#### Step 4: Paste the request body

<figure><img src="/files/NSGTaSZdVXnLkFgfh0Ax" alt=""><figcaption></figcaption></figure>

In `Request Body`, choose `JSON`.

Paste the sample request body below.

Replace:

* `TERMINAL_ID_HERE` with your sandbox terminal ID
* `MERCHANT_ID_HERE` with your sandbox merchant ID

```json
{
  "terminalId": "TERMINAL_ID_HERE",
  "merchantId": "MERCHANT_ID_HERE",
  "requestedAmount": 1.00,
  "refundEmail": "customer@example.com",
  "customer": {
    "firstName": "Jordan",
    "lastName": "Reed",
    "email": "customer@example.com",
    "address": "456 Market St",
    "address2": "Suite 210",
    "city": "Chicago",
    "state": "IL",
    "postalCode": "60601",
    "countryCode": "US"
  }
}
```

Before sending, confirm:

* The terminal ID has been replaced
* The merchant ID has been replaced
* The JSON does not include a trailing comma
* The API key header has been added

\[Screenshot placeholder: Show the API Client with the `X-Api-Key` header, request body, and Send button]

#### Step 5: Send the request

<figure><img src="/files/t9ayKk3zzNN442lpdje2" alt=""><figcaption></figcaption></figure>

Select `Send`.

A successful request returns a `200 OK` response with payment details.

The response includes:

* `trackingId`
* `paymentPageId`
* `paymentUrls`

Example response:

```json
{
  "trackingId": "b7940046b87a496d9096728cd0cf2dd7",
  "paymentPageId": "69f1fc75404d0e85721b94ff",
  "paymentUrls": [
    "https://pay-test.bead.xyz/69f1fc75404d0e85721b94ff"
  ]
}
```

Copy the first value in `paymentUrls` and open it in a browser to view the hosted payment page.

\[Screenshot placeholder: Show the response pane with `200 OK`, `trackingId`, and `paymentUrls`]

#### Troubleshooting

**401 Unauthorized**

Confirm that:

* The `X-Api-Key` header was added
* The full sandbox Payments API key value was used
* The API key matches the sandbox environment
* The API key was not added to the request body or URL

**Validation error**

Confirm that:

* The merchant ID and terminal ID are valid sandbox values
* The request body is valid JSON
* The request does not include a trailing comma
* The customer fields are complete for the payment flow you are testing

**Hosted payment URL does not load**

Confirm that:

* You copied a URL from the `paymentUrls` array
* The response was successful
* The terminal is configured for the tender types you are testing

#### Related pages

* [Create Payment](/payments/create-payment.md)
* [Authentication](/authentication.md)
* [Payment Statuses](/payments/payment-statuses.md)
* [Test Crypto Transactions](/payments/test-crypto-transactions.md)


---

# Agent Instructions: 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://developers.bead.xyz/payments/run-a-test-payment-in-the-api-reference.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.
