# Retrieve Payment Details by ID

**GET** `/v2/mia/payments/{payID}`

This endpoint returns the details of a specific payment, identified by the `payId`.

***

#### URL Parameters (path)

| Parameter | Type         | Required | Description                       |
| --------- | ------------ | -------- | --------------------------------- |
| `payId`   | string(guid) | Yes      | Unique identifier of the payment. |

***

#### Request example

```bash
curl -G "https://api.example.com/v2/mia/payments/123e4567-e89b-12d3-a456-426614174000" \
  -H "Authorization: Bearer {{access_token}}"
```

***

#### Response structure

**Object `result`**

| Field         | Type             | Description                                                          |
| ------------- | ---------------- | -------------------------------------------------------------------- |
| `payId`       | string(guid)     | Unique ID of the payment.                                            |
| `referenceId` | string(15)       | RRN code from the instant payments service.                          |
| `qrId`        | string(guid)     | ID of the QR code associated with the payment.                       |
| `extensionId` | string(guid)     | ID of the QR code extension associated with the payment.             |
| `orderId`     | string(100)      | ID of the merchant-side order.                                       |
| `amount`      | number(decimal)  | Payment amount.                                                      |
| `commission`  | number(decimal)  | Fee applied to the payment.                                          |
| `currency`    | string(enum)     | Currency in which the payment was made. Possible value: `MDL`.       |
| `description` | string(500)      | Description of the order.                                            |
| `payerName`   | string(200)      | Abbreviated name of the payer.                                       |
| `payerIban`   | string(100)      | Payer’s IBAN.                                                        |
| `status`      | string(enum)     | Payment status. Possible values: `Executed`, `Refunded`.             |
| `executedAt`  | string(datetime) | Timestamp of payment execution. Format: ISO 8601-1:2019.             |
| `refundedAt`  | string(datetime) | Timestamp of payment refund, if applicable. Format: ISO 8601-1:2019. |
| `terminalId`  | string(100)      | Terminal ID provided by the bank.                                    |

***

**Other response fields**

| Field    | Type    | Description                                                          |
| -------- | ------- | -------------------------------------------------------------------- |
| `ok`     | boolean | Processing status. `true` means success, `false` indicates an error. |
| `errors` | array   | List of errors, if any.                                              |

**Object `errors`**

| Field          | Type   | Description               |
| -------------- | ------ | ------------------------- |
| `errorCode`    | string | Error code.               |
| `errorMessage` | string | Description of the error. |

***

#### Exemplu răspuns

```json
{
    "result": {
        "payId": "123e4567-e89b-12d3-a456-426614174000",
        "referenceId": "QR000123456789",
        "qrId": "789e0123-f456-7890-a123-456789012345",
        "extensionId": "40e6ba44-7dff-48cc-91ec-386a38318c68",
        "amount": 50.00,
        "commission": 0.50,
        "currency": "MDL",
        "description": "Plată pentru comanda #123",
        "payerName": "John D.",
        "payerIban": "MD24AG00225100013104168",
        "status": "Executed",
        "executedAt": "2024-08-05T10:32:28+03:00",
        "terminalId": "P011111"
    },
    "ok": true
}
```


---

# 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/mia-qr-api/en/endpoints/information-retrieval-get/retrieve-payment-details-by-id.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.
