List coupons
This endpoint returns a list of all coupons for an account in a list format.
The list of coupons is ordered starting from the most recently created coupon. The response also includes
pagination_metadata
, which lets the caller retrieve the next page of results if they exist. More information
about pagination can be found in the Pagination-metadata schema.
Query Parameters
Possible values: >= 1
and <= 1000
Default value: 20
- 200
- 400
- 401
- 404
- 409
- 413
- 429
- 500
OK
Response Headers
Schema
- Array [
- ]
data object[] required
Also referred to as coupon_id in this documentation.
This string can be used to redeem this coupon for a given subscription.
discount object required
object
object
The number of times this coupon has been redeemed.
This allows for a coupon's discount to apply for a limited time (determined in months); a null
value here means "unlimited time".
The maximum number of redemptions allowed for this coupon before it is exhausted; null
here means "unlimited".
An archived coupon can no longer be redeemed. Active coupons will have a value of null for archived_at
; this field will be non-null for archived coupons.
pagination_metadata object required
{
"data": [
{
"id": "7iz2yanVjQoBZhyH",
"redemption_code": "HALFOFF",
"discount": {
"discount_type": "percentage",
"applies_to_price_ids": [
"h74gfhdjvn7ujokd",
"7hfgtgjnbvc3ujkl"
],
"reason": "string",
"percentage_discount": 0.15
},
"times_redeemed": 0,
"duration_in_months": 12,
"max_redemptions": 0,
"archived_at": "2024-11-15T18:11:32.864Z"
}
],
"pagination_metadata": {
"has_more": true,
"next_cursor": "string"
}
}
Bad Request
Response Headers
Schema
Possible values: [https://docs.withorb.com/reference/error-responses#400-constraint-violation
]
Possible values: [400
]
Possible values: [https://docs.withorb.com/reference/error-responses#400-duplicate-resource-creation
]
Possible values: [400
]
Possible values: [https://docs.withorb.com/reference/error-responses#400-request-validation-errors
]
Possible values: [400
]
{}
Unauthorized
Response Headers
Schema
Possible values: [https://docs.withorb.com/reference/error-responses#401-authentication-error
]
Possible values: [401
]
{
"type": "https://docs.withorb.com/reference/error-responses#401-authentication-error",
"status": 401,
"detail": "string",
"title": "string"
}
Not Found
Response Headers
Schema
Possible values: [https://docs.withorb.com/reference/error-responses#404-feature-not-available
]
Possible values: [400
]
Possible values: [https://docs.withorb.com/reference/error-responses#404-resource-not-found
]
Possible values: [404
]
Possible values: [https://docs.withorb.com/reference/error-responses#404-url-not-found
]
Possible values: [404
]
{}
Conflict
Response Headers
Schema
Possible values: [https://docs.withorb.com/reference/error-responses#409-resource-conflict
]
Possible values: [409
]
{
"type": "https://docs.withorb.com/reference/error-responses#409-resource-conflict",
"status": 409,
"detail": "string",
"title": "string"
}
Request Entity Too Large
Response Headers
Schema
Possible values: [https://docs.withorb.com/reference/error-responses#413-request-too-large
]
Possible values: [413
]
Possible values: [https://docs.withorb.com/reference/error-responses#413-resource-too-large
]
Possible values: [413
]
Possible values: [https://docs.withorb.com/reference/error-responses#413-too-many-results
]
Possible values: [413
]
{}
Too Many Requests
Response Headers
Schema
Possible values: [https://docs.withorb.com/reference/error-responses#429-too-many-requests
]
Possible values: [429
]
{
"type": "https://docs.withorb.com/reference/error-responses#429-too-many-requests",
"status": 429,
"detail": "string",
"title": "string"
}
Internal Server Error
Response Headers
Schema
Possible values: [https://docs.withorb.com/reference/error-responses#500-internal-server-error
]
{
"type": "https://docs.withorb.com/reference/error-responses#500-internal-server-error",
"status": 0,
"detail": "string",
"title": "string"
}