Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.borga.is/llms.txt

Use this file to discover all available pages before exploring further.

A payment method represents a saved payment instrument attached to a customer. Payment methods are created when a customer completes checkout with save_payment_method: true. Use these endpoints to list, retrieve, detach, or set a default method on the customer. Supported types
TypeDescription
cardCredit or debit card.
apple_payApple Pay wallet.
google_payGoogle Pay wallet.
bank_invoiceBank invoice (gíróseðill).

List payment methods

GET /v1/payment_methods Returns a paginated list of payment methods for a customer.

Query parameters

customer
string
Filter by customer ID. Recommended — without this filter the endpoint returns methods across all customers on your merchant account.
starting_after
string
Cursor for pagination. Pass the id of the last payment method from the previous page to retrieve the next page.
limit
number
Maximum number of payment methods to return per page.
curl --request GET \
  --url "https://api.borga.is/v1/payment_methods?customer=cus_abc123&limit=20" \
  --header "Authorization: Bearer sk_live_..." \
  --header "X-Merchant-Id: mer_xxx"

Response fields

data
object[]
required
Array of payment method objects.
has_more
boolean
required
Whether more payment methods exist beyond this page.
{
  "data": [
    {
      "id": "pm_01hxa8w2qkfr5nt9vcj3dl7mbe",
      "customer": "cus_abc123",
      "type": "card",
      "card": {
        "brand": "visa",
        "last4": "4242",
        "exp_month": 12,
        "exp_year": 2028
      },
      "created_at": "2026-04-29T09:00:00Z"
    }
  ],
  "has_more": false
}

Retrieve a payment method

GET /v1/payment_methods/{id} Retrieves the details of a single payment method.

Path parameters

id
string
required
The ID of the payment method to retrieve.
curl --request GET \
  --url https://api.borga.is/v1/payment_methods/pm_01hxa8w2qkfr5nt9vcj3dl7mbe \
  --header "Authorization: Bearer sk_live_..." \
  --header "X-Merchant-Id: mer_xxx"

Response fields

id
string
required
Unique payment method identifier.
customer
string
required
ID of the customer this method belongs to.
type
string
required
Payment method type. One of card, apple_pay, google_pay, bank_invoice.
card
object
Card details. Present when type is card, apple_pay, or google_pay.
created_at
string
required
ISO 8601 timestamp of when the payment method was saved.
{
  "id": "pm_01hxa8w2qkfr5nt9vcj3dl7mbe",
  "customer": "cus_abc123",
  "type": "card",
  "card": {
    "brand": "visa",
    "last4": "4242",
    "exp_month": 12,
    "exp_year": 2028
  },
  "created_at": "2026-04-29T09:00:00Z"
}

Detach a payment method

DELETE /v1/payment_methods/{id} Detaches a payment method from its customer. Once detached, the method can no longer be used for future payments. This action is irreversible.

Path parameters

id
string
required
The ID of the payment method to detach.
curl --request DELETE \
  --url https://api.borga.is/v1/payment_methods/pm_01hxa8w2qkfr5nt9vcj3dl7mbe \
  --header "Authorization: Bearer sk_live_..." \
  --header "X-Merchant-Id: mer_xxx"

Response fields

id
string
required
ID of the detached payment method.
deleted
boolean
required
Always true on a successful detach response.
{
  "id": "pm_01hxa8w2qkfr5nt9vcj3dl7mbe",
  "deleted": true
}

Set default payment method

POST /v1/payment_methods/{id}/set_default Sets a payment method as the default for the associated customer. The default method is used automatically for recurring charges and subscription renewals.

Path parameters

id
string
required
The ID of the payment method to set as default.
curl --request POST \
  --url https://api.borga.is/v1/payment_methods/pm_01hxa8w2qkfr5nt9vcj3dl7mbe/set_default \
  --header "Authorization: Bearer sk_live_..." \
  --header "X-Merchant-Id: mer_xxx"

Response fields

id
string
required
Unique payment method identifier.
customer
string
required
ID of the customer this method belongs to.
type
string
required
Payment method type. One of card, apple_pay, google_pay, bank_invoice.
card
object
Card details. Present when type is card, apple_pay, or google_pay.
created_at
string
required
ISO 8601 timestamp of when the payment method was saved.
{
  "id": "pm_01hxa8w2qkfr5nt9vcj3dl7mbe",
  "customer": "cus_abc123",
  "type": "card",
  "card": {
    "brand": "visa",
    "last4": "4242",
    "exp_month": 12,
    "exp_year": 2028
  },
  "created_at": "2026-04-29T09:00:00Z"
}