v20

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

Get purchases for a product

Retrieves all purchases for a specific product. Each billing period creates a new purchase document.

get/v1/sdk/purchases/product/{productRef}

Path parameters

productRefstring required
Example:prd_1A2B3C4D

Product reference or ID

Response

Product purchases retrieved successfully

Example response

{
  "purchases": [
    {
      "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
      }
    }
  ]
}