v20

latestOpenAPI 3.0.0raw.githubusercontent.com2026-07-214885191.3 KB
Purchases

Get a purchase by reference

Retrieves a single purchase including plan snapshot, usage, and billing details.

get/v1/sdk/purchases/{purchaseRef}

Path parameters

purchaseRefstring required
Example:pur_1A2B3C4D

Purchase reference or ID

Response

Purchase retrieved successfully

amountnumber required

Amount in USD cents (normalised for aggregation)

autoRenewboolean

Auto-renew enabled

billingCycle'weekly' | 'monthly' | 'quarterly' | 'yearly'

Billing cycle

cancellationReasonstring

Cancellation reason

cancelledAtstring

Cancelled at

createdAtstring required

Created at

currencystring required

Original payment currency code

customerEmailstring required

Customer email

customerRefstring required

Customer reference

endDatestring

End date

exchangeRatenumber

Exchange rate from original currency to USD

isRecurringboolean required

Is recurring

metadataobject

Arbitrary metadata attached to the purchase

nextBillingDatestring

Next billing date

originalAmountnumber

Original amount in the payment currency (cents/pence)

paidAtstring

Paid at timestamp

productNamestring

Product name

productRefstring required

Product reference

referencestring required

Purchase reference

startDatestring required

Start date

statusstring required

Purchase status

Example response

{
  "amount": 9900,
  "currency": "GBP",
  "customerEmail": "customer@example.com",
  "customerRef": "cus_3C4D5E6F",
  "exchangeRate": 1.3082,
  "isRecurring": true,
  "originalAmount": 10000,
  "planSnapshot": {
    "billingCycle": "monthly",
    "creditsPerUnit": 1,
    "currency": "USD",
    "freeUnits": 100,
    "limit": 5000,
    "meterRef": "mtr_1A2B3C4D",
    "name": "Pro Monthly",
    "planType": "recurring",
    "price": 2999,
    "reference": "pln_1A2B3C4D"
  },
  "productName": "API Gateway Manager",
  "productRef": "prd_1A2B3C4D",
  "reference": "pur_1A2B3C4D",
  "status": "active",
  "usage": {
    "periodEnd": "2025-11-01T00:00:00Z",
    "periodStart": "2025-10-01T00:00:00Z",
    "used": 150
  }
}