Discounts
Retrieve and validate discounts. Discounts are applied coupon or promotion code reductions on a charge intent or invoice.
The Discount object
Attributes
ID of the coupon applied
ID of the promotion code applied
ID of the customer this discount is applied to
ID of the account this discount is applied to
The type of object this discount is applied to (e.g. ChargeIntent, Invoice)
Order in which this discount was applied
Discount amount in cents
Unix timestamp
Unix timestamp
{
"id": null,
"object": "discount",
"coupon": null,
"promotion_code": null,
"customer": null,
"account": null,
"discountable_type": null,
"application_order": 0,
"discount_amount_cents": 0,
"discount_amount_currency": "usd",
"livemode": false,
"created": 0,
"updated": 0
}
Validate promotion codes
Validate promotion codes for a transaction. Provide either customer_id OR account_id (mutually exclusive).
Query parameters
Transaction amount in cents
Array of promotion code strings
Customer ID (mutually exclusive with account_id)
Account ID (mutually exclusive with customer_id)
Returns
Validation successful - account owner
curl --request POST \
--url https://api.framepayments.com/v1/discounts/validate \
--header 'Authorization: Bearer API_KEY'
{
"validation_result": [],
"total_discount_amount_cents": 0
}
List discounts
Returns a paginated list of discounts for the authenticated merchant. Filter by customer_id or account_id.
Query parameters
Filter by customer ID
Filter by account ID
Page number
Results per page
Returns
Discounts retrieved
curl --request GET \
--url https://api.framepayments.com/v1/discounts \
--header 'Authorization: Bearer API_KEY'
{
"meta": {
"page": 1,
"url": "/v1/discounts",
"has_more": false,
"prev": null,
"next": null
},
"data": [
{
"id": "b700348b-d1ba-4634-9ecc-c1b11d3fc8d0",
"application_order": 1,
"discount_amount_cents": 1000,
"discount_amount_currency": "usd",
"coupon": "68afeb58-1f0b-459e-9241-3aebd99dfa3c",
"promotion_code": null,
"customer": "d7410a08-15d5-4a36-a004-59a59f4ac675",
"account": null,
"account_id": null,
"discountable_type": "ChargeIntent",
"object": "discount",
"created": 1781115875,
"updated": 1781115875,
"livemode": false
}
]
}
Retrieve a discount
Retrieves a discount by ID.
Path parameters
Discount ID
Returns
Discount retrieved
curl --request GET \
--url https://api.framepayments.com/v1/discounts/a70cd72f-e74a-40f2-96a2-3f60714aac4a \
--header 'Authorization: Bearer API_KEY'
{
"id": "73eac00f-3325-45f4-8787-e826c01fa746",
"application_order": 1,
"discount_amount_cents": 1000,
"discount_amount_currency": "usd",
"coupon": "8757a06e-ba2c-4556-828a-2610ccfc16ac",
"promotion_code": null,
"customer": "717b2163-36af-4d2b-9d28-b78148103312",
"account": null,
"account_id": null,
"discountable_type": "ChargeIntent",
"object": "discount",
"created": 1781115875,
"updated": 1781115875,
"livemode": false
}