> 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/pending-transactions.md).

# Pending Transactions

The `pendingTransactions` API allows merchants to retrieve a list of pending transactions associated with their websites. These transactions are token-based and must be linked to a successful payment to be considered pending.

### Endpoint Details

* **URL:** `/api/transactions/pending`
* **Method:** `POST`
* **Content-Type:** `application/json`

### Request Parameters

When making a request to this API, include the following parameter in the request body:

| Parameter    | Type   | Required | Description                                             |
| ------------ | ------ | -------- | ------------------------------------------------------- |
| merchant\_id | string | Yes      | The unique identifier assigned to a merchant’s website. |

#### Example Request

```
{
    "merchant_id": "your_merchant_id"
}
```

### Response Structure

The API responds with a JSON object containing the status, a message, and the list of pending transactions.

#### Success Response

**Status Code:** `200`

```
{
    "status": "success",
    "message": "Pending transactions retrieved successfully.",
    "data": [
        {
            "token": "abc123",
            "payment_id": "pay_456",
            "amount": 100.50,
            "currency": "USD",
            "hash": "txn_hash_here",
            "status": "success",
            "date": "2024-03-10T12:34:56Z"
        }
    ]
}
```

#### Error Responses

**Invalid Merchant ID**

**Status Code:** `422`

```
{
    "status": "error",
    "message": "The given data was invalid.",
    "errors": {
        "merchant_id": ["The selected merchant_id is invalid."]
    }
}
```

**Inactive Website**

**Status Code:** `403`

```
{
    "status": "error",
    "message": "The website is not active.",
    "data": []
}
```

### Usage Guidelines

* Ensure the `merchant_id` provided exists and is linked to an active website.
* Transactions will only be returned if they are unused and associated with a successful payment.
* If a website is inactive, no transactions will be retrieved.
* The API should be accessed using a secure and authenticated request mechanism.

### Notes

* This API is designed for merchants to track pending transactions awaiting further processing.
* Ensure the API is integrated into a secure system to protect sensitive transaction data.

For further assistance, contact the API support team.


---

# 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, and the optional `goal` query parameter:

```
GET https://dcgate.gitbook.io/oxipay/api-endpoints/pending-transactions.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
