> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stellartools.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Payments

> Retrieve payment records

A payment is created automatically when a customer completes a checkout. Payments are confirmed on the Stellar ledger and carry a transaction hash.

## The payment object

**id** `string`

Unique identifier. Prefixed with `pay_`.

**object** `string`

Always `"payment"`.

**checkout\_id** `string`

The checkout this payment originated from.

**customer\_id** `string`

The customer who made the payment.

**subscription\_id** `string`

If this payment is a subscription renewal, the subscription ID.

**amount** `string`

Amount and asset code, e.g. `"50 XLM"`.

**status** `string`

`pending`, `confirmed`, or `failed`.

**transaction\_hash** `string`

The Stellar transaction hash.

**billing\_details** `object | null`

Snapshot of the customer's billing info at the time of payment. `null` if no customer was attached.

**billing\_details fields**

**email** `string`

Customer's email address.

**name** `string`

Customer's full name.

**payment\_method\_details** `object | null`

The Stellar wallet used to make the payment. `null` if unavailable.

**payment\_method\_details fields**

**id** `string`

Wallet identifier. Prefixed with `cwl_`.

**address** `string`

The Stellar public key (G-address).

**line\_items** `array`

Refunds issued against this payment. Empty array if no refunds exist.

**line item fields**

**id** `string`

Unique identifier for the refund. Prefixed with `ref_`.

**amount** `string`

Refunded amount and asset code, e.g. `"10 XLM"`.

**reason** `string`

The reason provided when the refund was issued.

**status** `string`

`pending`, `confirmed`, or `failed`.

**metadata** `object`

Arbitrary key-value data.

**created\_at** `string`

ISO 8601 timestamp.

***

## Retrieve a payment

`GET /payment/{id}`

Fetches a single payment by ID. Before returning, the Stellar network is queried for any `pending` payments and their status is updated accordingly.

```bash theme={null}
curl https://api.stellartools.dev/payment/pay_01jx... \
  -H "x-api-key: YOUR_API_KEY"
```

Returns a payment object.

***

## List payments

`GET /payment`

Returns a paginated list of payments for your account, ordered by creation date descending.

```bash theme={null}
curl https://api.stellartools.dev/payment \
  -H "x-api-key: YOUR_API_KEY"
```

### Query parameters

**customer** `string`

Filter payments by customer ID. Returns only payments made by this customer.

**limit** `number`

Maximum number of payments to return. Defaults to `10`.

**starting\_after** `string`

Return payments after this payment ID (exclusive). Use the last `id` in the previous page to paginate forward.

Returns a [list object](https://docs.stellartools.dev/api-reference/introduction.md#pagination) containing payment objects.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.