import { Autumn } from 'autumn-js'
const autumn = new Autumn()
const result = await autumn.customers.listPurchases({
customerId: "cus_123",
statuses: [
"active",
"expired",
],
});from autumn_sdk import Autumn
autumn = Autumn(secret_key="am_sk_test...")
res = autumn.customers.list_purchases(
customer_id="cus_123",
limit=50,
start_cursor="",
statuses=[
"active",
"expired",
],
)curl --request POST \
--url https://api.useautumn.com/v1/purchases.list \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-api-version: <x-api-version>' \
--data '
{
"customer_id": "cus_123",
"statuses": [
"active",
"expired"
]
}
'{
"list": [
{
"id": "cus_prod_123",
"plan_id": "credit_pack",
"status": "expired",
"expires_at": null,
"started_at": 1768817161016,
"quantity": 1,
"scope": "customer",
"customer_id": "cus_123",
"entity_id": null,
"created_at": 1768817161016
}
],
"has_more": false,
"next_cursor": null
}
List Purchases
Lists one-off plan purchases across customers, live or expired. Filter by customer, entity, plan, or status. Pages may hold fewer than limit rows while has_more is true.
import { Autumn } from 'autumn-js'
const autumn = new Autumn()
const result = await autumn.customers.listPurchases({
customerId: "cus_123",
statuses: [
"active",
"expired",
],
});from autumn_sdk import Autumn
autumn = Autumn(secret_key="am_sk_test...")
res = autumn.customers.list_purchases(
customer_id="cus_123",
limit=50,
start_cursor="",
statuses=[
"active",
"expired",
],
)curl --request POST \
--url https://api.useautumn.com/v1/purchases.list \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-api-version: <x-api-version>' \
--data '
{
"customer_id": "cus_123",
"statuses": [
"active",
"expired"
]
}
'{
"list": [
{
"id": "cus_prod_123",
"plan_id": "credit_pack",
"status": "expired",
"expires_at": null,
"started_at": 1768817161016,
"quantity": 1,
"scope": "customer",
"customer_id": "cus_123",
"entity_id": null,
"created_at": 1768817161016
}
],
"has_more": false,
"next_cursor": null
}
statuses: ["expired"] to see purchases that have ended.
limit rows (even zero) while has_more is true. Keep paginating until has_more is false.Body Parameters
Response
{
"list": [
{
"id": "cus_prod_123",
"plan_id": "credit_pack",
"status": "expired",
"expires_at": null,
"started_at": 1768817161016,
"quantity": 1,
"scope": "customer",
"customer_id": "cus_123",
"entity_id": null,
"created_at": 1768817161016
}
],
"has_more": false,
"next_cursor": null
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Body
Only return rows for this customer. Omit to list across every customer.
Only return rows for this entity. Requires customer_id.
Number of items to return. Default 50, hard ceiling 200.
1 <= x <= 200Opaque pagination cursor. Empty string (default) requests the first page; use next_cursor from a prior response for subsequent pages.
Statuses to include. Defaults to active and scheduled. past_due matches plans with overdue payments, which read as status active with past_due true.
1active, scheduled, past_due, expired Only return rows for this plan.
Response
OK
Rows on this page.
Show child attributes
Show child attributes
Whether more results exist. A page may hold fewer than limit items (even zero) while has_more is true, so paginate until has_more is false.
Pass as start_cursor to fetch the next page. Null when has_more is false.