## Get the payment status

### cURL

```bash
curl --request GET \
  --url https://api.pay.walletconnect.com/v1/gateway/payment/{id}/status \
  --header 'Api-Key: <api-key>'
```

### Python

```python
import requests

url = "https://api.pay.walletconnect.com/v1/gateway/payment/{id}/status"

headers = {"Api-Key": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
```

### JavaScript (Fetch)

```javascript
const options = {method: 'GET', headers: {'Api-Key': '<api-key>'}};

fetch('https://api.pay.walletconnect.com/v1/gateway/payment/{id}/status', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### PHP

```php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.pay.walletconnect.com/v1/gateway/payment/{id}/status",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "Api-Key: <api-key>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
```

### Go

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {
	url := "https://api.pay.walletconnect.com/v1/gateway/payment/{id}/status"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Api-Key", "<api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))
}
```

### Unirest (Java)

```java
HttpResponse<String> response = Unirest.get("https://api.pay.walletconnect.com/v1/gateway/payment/{id}/status")
  .header("Api-Key", "<api-key>")
  .asString();
```

### Ruby

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.pay.walletconnect.com/v1/gateway/payment/{id}/status")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Api-Key"] = '<api-key>'

response = http.request(request)
puts response.read_body
```

### Expected HTTP Response Status Codes

- **200**: Payment status retrieved successfully
- **400**: Bad request
- **401**: Unauthorized
- **404**: Not found
- **500**: Internal server error

### Response Structure

#### Successful Response Example:
```json
{
  "info": {
    "optionAmount": {
      "display": {
        "assetName": "USD Coin",
        "assetSymbol": "USDC",
        "decimals": 6,
        "iconUrl": "https://assets.walletconnect.com/usdc.png",
        "networkIconUrl": "https://assets.walletconnect.com/base.png",
        "networkName": "Base"
      },
      "unit": "caip19/eip155:8453/erc20:0x0000000000000000000000000000000000000000",
      "value": "1000000"
    },
    "txId": "0xabc123..."
  },
  "isFinal": true,
  "pollInMs": null,
  "status": "succeeded"
}
```

#### Error Response Example:
```json
{
  "message": "<string>"
}
```

### Authorization Details

| Header    | Type      | Required |
|-----------|-----------|----------|
| Api-Key   | string    | Yes      |
| App-Id    | string    | No       |
| Client-Id  | string   | No       |
| WCP-Version| string    | No       |
| Sdk-Name   | string   | No       |
| Sdk-Version| string   | No       |
| Sdk-Platform| string  | No       |

### Path Parameters

- **id**: (string) Payment ID (required)

### Query Parameters

- **maxPollMs**: (integer) Maximum time to long-poll for payment status, in milliseconds.
  - Required range: `x >= 0`

### Additional Resources
- [Get payment options](https://docs.walletconnect.com/api-reference/2026-02-19.preview/post-v1-gateway-payment-id-options)
- [Create a new payment](https://docs.walletconnect.com/api-reference/2026-02-19.preview/post-v1-payments)
