# Get Payment Status (server-to-server)

An essential aspect of managing your payments is having the ability to retrieve and analyze their statuses.&#x20;

{% hint style="warning" %}

#### <mark style="color:orange;">Warning</mark>

CoinbarPay payment gateway automatically send a callback response to configured webhook callback url previously configured.

For more informations please refer to [Post payments actions](https://docs.coinbar.io/api-web-integration/payment-gateway#id-1-backend-callback)
{% endhint %}

Otherwise you can just call the following API to retrieve a payment status by client request payment id.

## Get Payment Status

The API will return a JSON object containing the status details of the requested payment.

## Get payment details

<mark style="color:blue;">`GET`</mark> `https://sandbox.coinbar.io/coinbar/api/v2/pay/gateway/payment/{{payment_request_id}}/status`

#### Path Parameters

| Name                 | Type   | Description                                    |
| -------------------- | ------ | ---------------------------------------------- |
| payment\_request\_id | String | Payment Request Id used to request the payment |

#### Headers

| Name                                            | Type   | Description                                                              |
| ----------------------------------------------- | ------ | ------------------------------------------------------------------------ |
| CBPAY-API-KEY<mark style="color:red;">\*</mark> | String | {{<mark style="color:purple;">`SERVICE_CLIENT_ID`</mark>}}               |
| Content-Type                                    | String | application/json                                                         |
| SIGNATURE                                       | String | <p>{{<code>SIGNATURE\_TOKEN</code>}}<br>HMAC SHA-256 body validation</p> |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "payment_id_coinbar": "XxYyWwZz-XxYy-XxYy-XxYy-XxYyWwZz",
    "payment_request_id_client": "XxYyWwZz-XxYy-XxYy-XxYy-XxYyWwZz",
    "service_client_id": "XxYyWwZz-XxYy-XxYy-XxYy-XxYyWwZz",
    "status": "FAILED",
    "payment_detail": {
        "destination_coin": "BTC",
        "trade_pair": "BTC/EUR",
        "destination_amount": 0.00045145423250897323,
        "coin_change": 19913.425,
        "total_price": 8.99
    },
    "input_coin": "EUR",
    "creation_time": "2022-05-11T12:16:01.064Z",
    "update_time": "2022-05-11T12:30:35.059Z",
    "status_descr": "Timeout"
}
```

{% endtab %}
{% endtabs %}
