BillKit/DocsConsole
Payments

Get payment

Retrieve one subscription payment, including how much has been refunded.

GET/v1/payments/{payment_id}
Operation get_payment·Scope payments:read·OpenAPI v1.1.0

Parameters

ParameterDescription
payment_idstring · pathrequiredId of the payment, which starts pay_.
expandstring | null · queryoptionalComma-separated related objects to include in the response. Expandable here: customer, refund_eligibility, subscription. An unknown name is a 400, and embedding another resource needs that resource's read scope. At most 256 characters.

Returns

Returns a PaymentResponse object.

Errors

StatusCause
400The request was refused (type: invalid_request_error): a required parameter is missing (parameter_missing), one failed validation (parameter_invalid) or is not one the operation takes (parameter_unknown), and param names it.
401No credential, or one that does not authenticate.
402The account is suspended (tenant_suspended), or the payment provider refused a charge or refund the call made (type: payment_error, code: payment_refused).
403Authenticated, but not allowed: missing scope (insufficient_scope), a key of the wrong mode (mode_mismatch), or a refused origin. Needs the payments:read scope.
404No such object in this account and mode.
429Rate limited. Retry-After says when to try again.
500Something failed on BillKit's side (type: api_error). Retry with the same Idempotency-Key.
503Temporarily unable to serve. reason says whether the request was attempted.
Request · curl
curl -X GET https://api.billkit.eu/v1/payments/pay_9XKp2vQ1 \
  -H "Authorization: Bearer $BILLKIT_API_KEY"
Response · 200 OK
{
  "amount_cents": 1900,
  "amount_disputed_cents": 1900,
  "amount_refundable_cents": 1900,
  "amount_refunded_cents": 1900,
  "checkout_session_id": "cs_9XKp2vQ1",
  "coupon_id": "coup_9XKp2vQ1",
  "created": 1789392000,
  "currency": "EUR",
  "customer": {
    "country_code": "NL",
    "email": "ada@example.com",
    "id": "obj_9XKp2vQ1",
    "name": "Ada Lovelace",
    "object": "customer.summary"
  },
  "customer_id": "cus_9XKp2vQ1",
  "discount_cents": 0,
  "failure_reason": "string",
  "id": "pay_9XKp2vQ1",
  "livemode": false,
  "object": "payment",
  "paid_at": 1789392000,
  "payment_method": "creditcard",
  "refund_eligibility": {
    "amount_cents": 1900,
    "currency": "EUR",
    "days_remaining": 0,
    "eligible": false,
    "object": "refund_eligibility",
    "reason": "no_charge",
    "window_ends_at": 1789392000
  },
  "status": "open",
  "subscription": {
    "id": "obj_9XKp2vQ1",
    "object": "subscription.summary",
    "price_id": "price_9XKp2vQ1",
    "status": "incomplete"
  },
  "subscription_id": "sub_9XKp2vQ1",
  "type": "initial"
}