GET
/v1/payments/:idRequest Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | Bearer token with your API secret key |
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| id | string | The payment ID (e.g., pay_abc123xyz) |
Response Body
{
"id": "pay_abc123xyz",
"object": "payment",
"amount": 9999,
"currency": "USD",
"status": "succeeded",
"payment_method": "card",
"customer_email": "customer@example.com",
"customer_id": "cust_xyz789",
"description": "Order #1234",
"statement_descriptor": "HEDGE PAYMENTS",
"merchant_id": "merch_abc123",
"checkout_session_id": "cs_def456",
"refunded_amount": 0,
"fee": 320,
"net_amount": 9679,
"metadata": {
"orderId": "order_1234",
"sku": "PREMIUM_PLAN"
},
"failure_code": null,
"failure_message": null,
"settled": true,
"settled_at": "2024-06-15T10:35:00Z",
"created_at": "2024-06-15T10:30:00Z",
"updated_at": "2024-06-15T10:35:00Z"
}Response Fields
| Field | Type | Description |
|---|---|---|
| id | string | Unique payment identifier |
| object | string | Always "payment" |
| amount | integer | Payment amount in cents |
| currency | string | Three-letter ISO currency code (e.g., "USD") |
| status | string | Current payment status (see below) |
| payment_method | string | "card", "ach", or "crypto" |
| customer_email | string | Customer's email address |
| customer_id | string? | Associated customer ID, if any |
| description | string? | Description set at payment creation |
| refunded_amount | integer | Total amount refunded in cents |
| fee | integer | Processing fee charged in cents |
| net_amount | integer | Amount after fees in cents |
| metadata | object | Arbitrary key-value metadata |
| failure_code | string? | Error code if payment failed |
| failure_message | string? | Human-readable failure reason |
| settled | boolean | Whether funds have been settled to merchant |
| settled_at | string? | ISO 8601 timestamp of settlement |
| created_at | string | ISO 8601 creation timestamp |
| updated_at | string | ISO 8601 last update timestamp |
Payment Status Values
| Status | Description |
|---|---|
| pending | Payment created but not yet initiated |
| initiated | Payment has been submitted for processing |
| processing | Payment is being processed by the payment network |
| succeeded | Payment completed successfully |
| failed | Payment failed (see failure_code for details) |
| canceled | Payment was canceled before processing |
| refunded | Payment was fully refunded |
| partially_refunded | Payment was partially refunded |
Code Examples
Node.js
import { HedgePayments } from '@hedgepayments/node'
const hedge = new HedgePayments({
apiKey: process.env.HEDGE_API_KEY,
apiSecret: process.env.HEDGE_API_SECRET
})
const payment = await hedge.payments.retrieve('pay_abc123xyz')
console.log('Payment status:', payment.status)
console.log('Amount:', payment.amount / 100) // $99.99
console.log('Net amount:', payment.net_amount / 100) // after feescURL
curl https://api.hedgepayments.com/v1/payments/pay_abc123xyz \
-H "Authorization: Bearer sk_live_your_api_key"Error Responses
| Code | Description |
|---|---|
| 401 | Invalid or missing API key |
| 404 | Payment not found with the given ID |