Discounts

Retrieve and validate discounts. Discounts are applied coupon or promotion code reductions on a charge intent or invoice.

The Discount object

Attributes
idstring
objectstring
couponnullable string

ID of the coupon applied

promotion_codenullable string

ID of the promotion code applied

customernullable string

ID of the customer this discount is applied to

accountnullable string

ID of the account this discount is applied to

discountable_typestring

The type of object this discount is applied to (e.g. ChargeIntent, Invoice)

application_orderinteger

Order in which this discount was applied

discount_amount_centsinteger

Discount amount in cents

discount_amount_currencystring
livemodeboolean
createdinteger

Unix timestamp

updatedinteger

Unix timestamp

THE DISCOUNT OBJECT
{
  "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
amount_centsinteger

Transaction amount in cents

promotion_codesarray

Array of promotion code strings

customer_idstringoptional

Customer ID (mutually exclusive with account_id)

account_idstringoptional

Account ID (mutually exclusive with customer_id)

Returns

Validation successful - account owner

POST/v1/discounts/validate
curl --request POST \
  --url https://api.framepayments.com/v1/discounts/validate \
  --header 'Authorization: Bearer API_KEY'
RESPONSE
{
  "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
customer_idstringoptional

Filter by customer ID

account_idstringoptional

Filter by account ID

pageintegeroptional

Page number

per_pageintegeroptional

Results per page

Returns

Discounts retrieved

GET/v1/discounts
curl --request GET \
  --url https://api.framepayments.com/v1/discounts \
  --header 'Authorization: Bearer API_KEY'
RESPONSE
{
  "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
idstring

Discount ID

Returns

Discount retrieved

GET/v1/discounts/{id}
curl --request GET \
  --url https://api.framepayments.com/v1/discounts/a70cd72f-e74a-40f2-96a2-3f60714aac4a \
  --header 'Authorization: Bearer API_KEY'
RESPONSE
{
  "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
}