curl -X GET "https://api.affonso.io/v1/coupons?limit=10" \
-H "Authorization: Bearer sk_live_your_api_key"
curl -X GET "https://api.affonso.io/v1/coupons?affiliate_id=aff_123&expand=affiliate" \
-H "Authorization: Bearer sk_live_your_api_key"
{
"success": true,
"data": [
{
"id": "cpn_abc123",
"code": "SAVE25",
"affiliate_id": "aff_123",
"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
}
],
"pagination": {
"page": 1,
"limit": 10,
"total": 1,
"totalPages": 1,
"hasNextPage": false,
"hasPrevPage": false
}
}
Coupons
List Coupons
Get a paginated list of affiliate promotional coupons
GET
/
v1
/
coupons
curl -X GET "https://api.affonso.io/v1/coupons?limit=10" \
-H "Authorization: Bearer sk_live_your_api_key"
curl -X GET "https://api.affonso.io/v1/coupons?affiliate_id=aff_123&expand=affiliate" \
-H "Authorization: Bearer sk_live_your_api_key"
{
"success": true,
"data": [
{
"id": "cpn_abc123",
"code": "SAVE25",
"affiliate_id": "aff_123",
"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
}
],
"pagination": {
"page": 1,
"limit": 10,
"total": 1,
"totalPages": 1,
"hasNextPage": false,
"hasPrevPage": false
}
}
Query Parameters
integer
default:"1"
Page number for pagination. Must be a positive integer.
integer
default:"50"
Number of results per page. Maximum value is 200. Default is 50.
string
Filter coupons by affiliate ID.
string
Search by coupon code. Case-insensitive partial matching. Maximum 100 characters.
string
Sort field and direction in the format
field:direction. Valid fields: created_at, code. Valid directions: asc, desc. Example: created_at:desc.string
Comma-separated list of related data to include in the response. Valid values:
affiliate.Response
The response includes a paginated list of coupons and pagination metadata.boolean
Always
true for successful responsesarray
Array of coupon objects. Each coupon object has the same structure as the single coupon response (see Get Coupon endpoint).
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
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
object
Pagination metadata object containing:
page(integer): Current page numberlimit(integer): Number of results per pagetotal(integer): Total number of coupons matching the filterstotalPages(integer): Total number of pageshasNextPage(boolean): Whether there is a next pagehasPrevPage(boolean): Whether there is a previous page
curl -X GET "https://api.affonso.io/v1/coupons?limit=10" \
-H "Authorization: Bearer sk_live_your_api_key"
curl -X GET "https://api.affonso.io/v1/coupons?affiliate_id=aff_123&expand=affiliate" \
-H "Authorization: Bearer sk_live_your_api_key"
{
"success": true,
"data": [
{
"id": "cpn_abc123",
"code": "SAVE25",
"affiliate_id": "aff_123",
"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
}
],
"pagination": {
"page": 1,
"limit": 10,
"total": 1,
"totalPages": 1,
"hasNextPage": false,
"hasPrevPage": false
}
}
Was this page helpful?
