curl -X GET "https://api.affonso.io/v1/coupons/cpn_abc123" \
-H "Authorization: Bearer sk_live_your_api_key"
{
"success": true,
"data": {
"id": "cpn_abc123",
"code": "SAVE25",
"affiliate_id": "aff_123",
"program_id": "prg_789ghi",
"discount_type": "percentage",
"discount_value": 25,
"duration": "forever",
"duration_in_months": null,
"currency": null,
"product_ids": [],
"provider": "stripe",
"provider_coupon_id": "promo_abc123",
"provider_promo_code_id": "pc_abc123",
"provider_records": [
{
"provider": "stripe",
"provider_coupon_id": "promo_abc123",
"provider_promo_code_id": "pc_abc123",
"created_at": "2024-01-15T10:30:00Z"
}
],
"created_at": "2024-01-15T10:30:00Z",
"updated_at": null
}
}
Coupons
Get Coupon
Retrieve details for a specific coupon
GET
/
v1
/
coupons
/
{id}
curl -X GET "https://api.affonso.io/v1/coupons/cpn_abc123" \
-H "Authorization: Bearer sk_live_your_api_key"
{
"success": true,
"data": {
"id": "cpn_abc123",
"code": "SAVE25",
"affiliate_id": "aff_123",
"program_id": "prg_789ghi",
"discount_type": "percentage",
"discount_value": 25,
"duration": "forever",
"duration_in_months": null,
"currency": null,
"product_ids": [],
"provider": "stripe",
"provider_coupon_id": "promo_abc123",
"provider_promo_code_id": "pc_abc123",
"provider_records": [
{
"provider": "stripe",
"provider_coupon_id": "promo_abc123",
"provider_promo_code_id": "pc_abc123",
"created_at": "2024-01-15T10:30:00Z"
}
],
"created_at": "2024-01-15T10:30:00Z",
"updated_at": null
}
}
Retrieve a single coupon by ID with optional expanded fields.
Path Parameters
The unique identifier of the coupon to retrieve.
Query Parameters
Comma-separated list of related data to include in the response. Valid values:
affiliate.Response
Always
true for successful responsesThe coupon object.
Show Data Object Properties
Show Data Object Properties
Unique identifier for the coupon
The coupon code (always uppercase)
The ID of the affiliate who owns this coupon
The ID of the affiliate program this coupon belongs to
Type of discount:
percentage or fixedThe discount amount. For percentage: 0-100. For fixed: amount in the specified currency.
How long the discount applies:
forever, once, or repeatingNumber of months the discount repeats (only applicable when duration is
repeating)Three-letter currency code (only applicable when discount_type is
fixed)Array of product IDs this coupon is restricted to. Empty array means all products.
The primary payment provider for this coupon (e.g.,
stripe, dodo, creem).The coupon ID at the primary payment provider.
The promo code ID at the primary payment provider.
Array of provider-specific coupon records. Each record contains:
provider(string): The payment provider nameprovider_coupon_id(string): The coupon ID at this providerprovider_promo_code_id(string): The promo code ID at this providercreated_at(string): ISO 8601 timestamp of when the provider record was created
ISO 8601 timestamp of when the coupon was created
ISO 8601 timestamp of when the coupon was last updated
curl -X GET "https://api.affonso.io/v1/coupons/cpn_abc123" \
-H "Authorization: Bearer sk_live_your_api_key"
{
"success": true,
"data": {
"id": "cpn_abc123",
"code": "SAVE25",
"affiliate_id": "aff_123",
"program_id": "prg_789ghi",
"discount_type": "percentage",
"discount_value": 25,
"duration": "forever",
"duration_in_months": null,
"currency": null,
"product_ids": [],
"provider": "stripe",
"provider_coupon_id": "promo_abc123",
"provider_promo_code_id": "pc_abc123",
"provider_records": [
{
"provider": "stripe",
"provider_coupon_id": "promo_abc123",
"provider_promo_code_id": "pc_abc123",
"created_at": "2024-01-15T10:30:00Z"
}
],
"created_at": "2024-01-15T10:30:00Z",
"updated_at": null
}
}
Was this page helpful?
⌘I
