# Payments

> A payment is one amount owed by one payer, with its outcome.

Source: https://docs.borga.is/api/payments

Payments are normally created by a [payment session](/api/payment-sessions). Use this resource to read status and card details, list payments, or create a payment ahead of a session.

**The payment object**

- `id` (string): Prefixed `pay_`.
- `amount` (integer): In the smallest currency unit.
- `currency` (string): <Param name="status" type="enum">`created`, `processing`, `succeeded`, `failed`, `canceled` or `refunded`.
- `customer` (string | null): Customer the payment belongs to.
- `description` (string | null): <Param name="external_reference" type="string | null">Your reference, from the session or payment create call.
- `metadata` (object): <Param name="collection_method" type="enum | null">`card`, `wallet` or `bank_invoice` once known.
- `refunded_amount` (integer): Total refunded so far.
- `failure_reason` (string | null): Processor's reason when `status` is `failed`.
- `card_brand` (string | null): For example `visa` or `mc`.
- `card_last4` (string | null): <Param name="wallet_type" type="string | null">`apple_pay` or `google_pay` when a wallet was used.
- `created_at` (timestamp): - `updated_at` (timestamp) ## Create a payment `POST /v1/payments` Creates a payment in status `created` without a checkout. Attach a session to it with the session's `payment` field. Most integrations skip this and let the session create the payment. **Body** <Param name="amount" type="integer" required>1 to 2,000,000,000 in the smallest currency unit.
- `currency` (string, default ISK): <Param name="customer" type="string">Must belong to your merchant in this mode.
- `description` (string): - `external_reference` (string) - `metadata` (object) ```bash curl https://api.borga.is/v1/payments \ -H "Authorization: Bearer sk_test_…" \ -H "Content-Type: application/json" \ -d '{ "amount": 12900, "currency": "ISK", "external_reference": "order_5678" }' ``` ## Retrieve a payment `GET /v1/payments/:id`  ```ts Node.js const payment = await borga.payments.retrieve("pay_7Hs2Kq9LmW4xZc1Vb8Ny3Rt6"); console.log(payment.status); // "succeeded" console.log(payment.card_brand, payment.card_last4); // "visa" "4242" ``` ```bash curl curl https://api.borga.is/v1/payments/pay_7Hs2Kq9LmW4xZc1Vb8Ny3Rt6 \ -H "Authorization: Bearer sk_test_…" ```  ```json title="Response" { "id": "pay_7Hs2Kq9LmW4xZc1Vb8Ny3Rt6", "amount": 12900, "currency": "ISK", "status": "succeeded", "customer": null, "description": null, "metadata": { "order_id": "5678" }, "collection_method": "card", "refunded_amount": 0, "external_reference": "order_5678", "failure_reason": null, "card_brand": "visa", "card_last4": "4242", "wallet_type": null, "created_at": "2026-09-07T12:03:58.201Z", "updated_at": "2026-09-07T12:04:31.498Z" } ``` ## List payments `GET /v1/payments` **Query parameters** <Param name="status" type="enum">Filter by payment status.
- `limit` (integer, default 25): Up to 100.
- `starting_after` (string): Cursor; see [Pagination](/api/pagination).

```bash
curl "https://api.borga.is/v1/payments?status=succeeded&limit=50" \
  -H "Authorization: Bearer sk_test_…"
```
