# Simulate rejection of a payment request

Simulates the customer rejecting an RTP in the **sandbox** environment. Use it to test decline flows and error handling on the merchant side, without real payments.

***

### Request

**HTTP Method**: `POST`\
**Endpoint**:

```
/v2/rtp/{id}/test-reject
```

**Headers**

```http
Authorization: Bearer {access_token}
Content-Type: application/json
```

> Test RTP simulation is allowed **only in sandbox**.

#### Path Parameters

| Parameter | Type          | Required | Description                      |
| --------- | ------------- | -------- | -------------------------------- |
| `rtpId`   | string (GUID) | Yes      | RTP unique identifier (`rtpId`). |

***

### Response

#### Response Parameters

| Field                 | Type                               | Description                                                                         |
| --------------------- | ---------------------------------- | ----------------------------------------------------------------------------------- |
| `result`              | object                             | Response result object.                                                             |
| `result.rtpId`        | string (GUID)                      | RTP unique identifier.                                                              |
| `result.status`       | string (enum)                      | RTP status (`Pending`, `Accepted`, `Rejected`, `Expired`, `Cancelled`, `Refunded`). |
| `result.orderId`      | string (100)                       | Merchant-side order identifier.                                                     |
| `result.payId`        | string (GUID)                      | Payment unique identifier.                                                          |
| `result.amount`       | number (decimal)                   | Payment amount.                                                                     |
| `result.commission`   | number (decimal)                   | Payment commission.                                                                 |
| `result.currency`     | string (enum)                      | Payment currency (`MDL`).                                                           |
| `result.payerName`    | string (200)                       | Payer abbreviated name.                                                             |
| `result.payerIban`    | string (100)                       | Payer IBAN.                                                                         |
| `result.executedAt`   | string (datetime, ISO 8601-1:2019) | Timestamp when the payment was executed.                                            |
| `result.signature`    | string                             | Notification validation signature.                                                  |
| `ok`                  | boolean                            | Request processing status (`true` on success).                                      |
| `errors`              | array                              | Present only if `ok = false`.                                                       |
| `errors.errorCode`    | string                             | Error code.                                                                         |
| `errors.errorMessage` | string                             | Error description.                                                                  |

#### Example Successful Response

```json
{
  "result": {
    "rtpId": "123e4567-e89b-12d3-a456-426614174000",
    "rtpStatus": "Active",
    "orderId": "123",
    "payId": "6d24e4a5-c6bf-4d3e-bf7a-8d2123faf4e9",
    "amount": 10,
    "commission": 2.50,
    "currency": "MDL",
    "payerName": "John D.",
    "payerIban": "MD88AG000000011621810140",
    "executedAt": "2024-11-29T10:56:52.1380956+00:00",
    "signature": "592b6999-fdd0-4fd3-9708-5cb9df590dee"
  },
  "ok": true
}
```

***

> ### Notes
>
> * Use this endpoint to simulate **declines** and verify your application reacts appropriately (e.g., show failure states, do not fulfill the order).


---

# 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://docs.maibmerchants.md/request-to-pay/api-reference/sandbox-simulation-environment/simulate-rejection-of-a-payment-request.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.
