Skip to main content

Developer API (2.0.0)

Download OpenAPI specification:Download

Purchase

Operations about purchases.

Get a purchase

This endpoint requires the following permission(s): customer_information:purchases:read. This endpoint belongs to the Customer Information domain, which has a default rate limit of 480 requests per minute.

Authorizations:
BearerAuth
path Parameters
project_id
required
string <= 255 characters
Example: proj1ab2c3d4

ID of the project

purchase_id
required
string [ 1 .. 255 ] characters
Example: purc1a2b3c4d5e

ID of the purchase

query Parameters
expand
Array of strings[ items [ 1 .. 5000 ] characters ]
Items Value: "redemption"
Example: expand=redemption

Specifies which fields in the response should be expanded. Accepted values are: redemption (requires customer_information:purchases:read permission).

Responses

Response samples

Content type
application/json
{
  • "object": "purchase",
  • "id": "purch1a2b3c4d5e",
  • "customer_id": "19b8de26-77c1-49f1-aa18-019a391603e2",
  • "original_customer_id": "19b8de26-77c1-49f1-aa18-019a391603e2",
  • "product_id": "prod1a2b3c4d5e",
  • "purchased_at": 1658399423658,
  • "revenue_in_usd": {
    },
  • "quantity": 1,
  • "status": "owned",
  • "presented_offering_id": "ofrnge1a2b3c4d5",
  • "entitlements": {
    },
  • "environment": "production",
  • "store": "amazon",
  • "store_purchase_identifier": 12345678,
  • "ownership": "purchased",
  • "country": "US",
  • "redemption": {
    }
}

Get a list of entitlements associated with a purchase

Lists all Entitlements granted by a Purchase. This endpoint requires the following permission(s): customer_information:purchases:read. This endpoint belongs to the Customer Information domain, which has a default rate limit of 480 requests per minute.

Authorizations:
BearerAuth
path Parameters
project_id
required
string <= 255 characters
Example: proj1ab2c3d4

ID of the project

purchase_id
required
string [ 1 .. 255 ] characters
Example: purc1a2b3c4d5e

ID of the purchase

query Parameters
starting_after
string
Example: starting_after=ent12354

Pagination cursor. Pass the id of the last item from the previous page to fetch the next page; omit for the first page.

limit
integer
Default: 20
Example: limit=10

Maximum number of items to return per page. Values below 1 or above 100 are clamped to that range rather than rejected.

Responses

Response samples

Content type
application/json
{
  • "object": "list",
  • "items": [
    ],
  • "next_page": "/v2/projects/proj1ab2c3d4/entitlements?starting_after=entlab21dac",
  • "url": "/v2/projects/proj1ab2c3d4/entitlements"
}

Refund a Web Billing purchase

Refund a Web Billing purchase and revoke access to associated granted entitlements. This endpoint requires the following permission(s): customer_information:purchases:read_write. This endpoint belongs to the Customer Information domain, which has a default rate limit of 480 requests per minute.

Authorizations:
BearerAuth
path Parameters
project_id
required
string <= 255 characters
Example: proj1ab2c3d4

ID of the project

purchase_id
required
string [ 1 .. 255 ] characters
Example: purc1a2b3c4d5e

ID of the purchase

Responses

Response samples

Content type
application/json
{
  • "object": "purchase",
  • "id": "purch1a2b3c4d5e",
  • "customer_id": "19b8de26-77c1-49f1-aa18-019a391603e2",
  • "original_customer_id": "19b8de26-77c1-49f1-aa18-019a391603e2",
  • "product_id": "prod1a2b3c4d5e",
  • "purchased_at": 1658399423658,
  • "revenue_in_usd": {
    },
  • "quantity": 1,
  • "status": "owned",
  • "presented_offering_id": "ofrnge1a2b3c4d5",
  • "entitlements": {
    },
  • "environment": "production",
  • "store": "amazon",
  • "store_purchase_identifier": 12345678,
  • "ownership": "purchased",
  • "country": "US",
  • "redemption": {
    }
}

Search one-time purchases by store purchase identifier

Search for a one-time purchases by any of its associated store_purchase_identifier values.

For example, this may include the transactionId of any transaction in an Apple App Store purchase, or any order ID from a Google Play Store purchase. This endpoint requires the following permission(s): customer_information:purchases:read. This endpoint belongs to the Customer Information domain, which has a default rate limit of 480 requests per minute.

Authorizations:
BearerAuth
path Parameters
project_id
required
string <= 255 characters
Example: proj1ab2c3d4

ID of the project

query Parameters
store_purchase_identifier
required
string [ 1 .. 255 ] characters
Examples:
  • store_purchase_identifier=9aJscueFTxLPZXXo-AlBTkI0OnFXR2qiH14C1aqWnOT=:3:11 - Amazon Appstore
  • store_purchase_identifier=100001234567890 - Apple App Store
  • store_purchase_identifier=txn_01jss4bz50g1z5yw121npeb3ag - Paddle
  • store_purchase_identifier=GPA.1234-5678-9012-34567 - Google Play Store
  • store_purchase_identifier=txRcb553a54d4738816a63f1a05cfcb1723e3 - RevenueCat Web Billing
  • store_purchase_identifier=4ab8df12-3003-11f0-9646-8ac68bcdcaed - Roku
  • store_purchase_identifier=si_Rww1psqupbKxmt - Stripe

Store ID associated with the one-time purchase.

expand
Array of strings[ items [ 1 .. 5000 ] characters ]
Items Value: "items.redemption"
Example: expand=items.redemption

Specifies which fields in the response should be expanded. Accepted values are: items.redemption (requires customer_information:purchases:read permission).

Responses

Response samples

Content type
application/json
{
  • "object": "list",
  • "items": [
    ],
  • "next_page": "/v2/projects/proj1ab2c3d4/customers/19b8de26-77c1-49f1-aa18-019a391603e2/purchases?starting_after=purc1a2b3c4d5e",
  • "url": "/v2/projects/proj1ab2c3d4/customers/19b8de26-77c1-49f1-aa18-019a391603e2/purchases"
}