curl -X GET "https://api.affonso.io/v1/coupons/cpn_abc123" \
-H "Authorization: Bearer sk_live_your_api_key"
curl -X GET "https://api.affonso.io/v1/coupons/cpn_abc123?expand=affiliate" \
-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
}
}
{
"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,
"affiliate": {
"id": "aff_123",
"name": "John Doe",
"email": "john@example.com",
"tracking_id": "PARTNER123",
"source": "api",
"onboarding_completed": true,
"program_id": "prg_789ghi",
"group_id": null,
"created_at": "2024-01-15T10:30:00Z"
}
}
}
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"
curl -X GET "https://api.affonso.io/v1/coupons/cpn_abc123?expand=affiliate" \
-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
}
}
{
"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,
"affiliate": {
"id": "aff_123",
"name": "John Doe",
"email": "john@example.com",
"tracking_id": "PARTNER123",
"source": "api",
"onboarding_completed": true,
"program_id": "prg_789ghi",
"group_id": null,
"created_at": "2024-01-15T10:30:00Z"
}
}
}
Retrieve a single coupon by ID with optional expanded fields.
Path Parameters
string
required
The unique identifier of the coupon to retrieve.
Query Parameters
string
Comma-separated list of related data to include in the response. Valid values:
affiliate.Response
boolean
Always
true for successful responsesobject
The coupon object.
Show Data Object Properties
Show Data Object Properties
string
Unique identifier for the coupon
string
The coupon code (always uppercase)
string
The ID of the affiliate who owns this coupon
string
The ID of the affiliate program this coupon belongs to
string
Type of discount:
percentage or fixednumber
The discount amount. For percentage: 0-100. For fixed: amount in the specified currency.
string
How long the discount applies:
forever, once, or repeatinginteger | null
Number of months the discount repeats (only applicable when duration is
repeating)string | null
Three-letter currency code (only applicable when discount_type is
fixed)array
Array of product IDs this coupon is restricted to. Empty array means all products.
string | null
The primary payment provider for this coupon (e.g.,
stripe, dodo, creem).string | null
The coupon ID at the primary payment provider.
string | null
The promo code ID at the primary payment provider.
array
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
string
ISO 8601 timestamp of when the coupon was created
string | null
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"
curl -X GET "https://api.affonso.io/v1/coupons/cpn_abc123?expand=affiliate" \
-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
}
}
{
"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,
"affiliate": {
"id": "aff_123",
"name": "John Doe",
"email": "john@example.com",
"tracking_id": "PARTNER123",
"source": "api",
"onboarding_completed": true,
"program_id": "prg_789ghi",
"group_id": null,
"created_at": "2024-01-15T10:30:00Z"
}
}
}
Was this page helpful?
⌘I
