Coupons
All Coupons
GET
https://yoursite.mavenseed.com/api/v1/coupons
Retrieve all coupons.
Path Parameters
page
integer
Results are paginated.
Headers
Authorization
string
Auth token
[
{
"id": 33,
"internal_coupon_id": "englishtea",
"coupon_type": "coupon",
"currency": "USD",
"duration": "once",
"duration_in_months": null,
"max_redemptions": null,
"amount_off": 6000,
"percent_off": null,
"redeem_by": null,
"eligible_types": [
"orders"
],
"created_at": "2020-05-14T13:47:54.567-04:00",
"updated_at": "2020-09-08T12:28:49.246-04:00",
"supported_countries": [],
"metadata": "{}",
"coupons_orders_count": 0
},
{
"id": 14,
"internal_coupon_id": "blueberrymuffin",
"coupon_type": "coupon",
"currency": "USD",
"duration": "once",
"duration_in_months": null,
"max_redemptions": null,
"amount_off": 6000,
"percent_off": null,
"redeem_by": null,
"eligible_types": [
"orders"
],
"created_at": "2020-04-09T11:54:36.083-04:00",
"updated_at": "2020-08-03T13:03:11.995-04:00",
"supported_countries": [
"IN"
],
"metadata": "{}",
"coupons_orders_count": 4
}
]
Show Coupon
GET
https://yoursite.mavenseed.com/api/v1/coupons/:id
Retrieve a single coupon.
Headers
Authorization
string
Auth token
{
"id": 33,
"internal_coupon_id": "englishtea",
"coupon_type": "coupon",
"currency": "USD",
"duration": "once",
"duration_in_months": null,
"max_redemptions": null,
"amount_off": 6000,
"percent_off": null,
"redeem_by": null,
"eligible_types": [
"orders"
],
"created_at": "2020-05-14T13:47:54.567-04:00",
"updated_at": "2020-09-08T12:28:49.246-04:00",
"supported_countries": [],
"metadata": "{}",
"coupons_orders_count": 0
}
Create Coupon
POST
https://yoursite.mavenseed.com/api/v1/coupons
Create a coupon.
Headers
Authorization
string
Auth Token
Request Body
internal_coupon_id
string
The actual coupon code itself.
coupon_type
string
coupon
or gift_card
currency
string
Currently only supporting USD
duration
string
once
, repeating
, or forever
duration_in_moths
integer
Required only if duration is repeating
max_redemptions
integer
Max times coupon can be claimed
amount_off
integer
Amount in cents , required if percent off is blank.
percent_off
integer
Percent off as an integer, required only if amount off is blank.
redeem_by
object
When the coupon should expire in datetime format.
eligible_types
array
Can include orders
and/or subscriptions
supported_countries
array
Array of 2 letter iso codes that the coupon can only be claimed from.
{
"id": 33,
"internal_coupon_id": "englishtea",
"coupon_type": "coupon",
"currency": "USD",
"duration": "once",
"duration_in_months": null,
"max_redemptions": null,
"amount_off": 6000,
"percent_off": null,
"redeem_by": null,
"eligible_types": [
"orders"
],
"created_at": "2020-05-14T13:47:54.567-04:00",
"updated_at": "2020-09-08T12:28:49.246-04:00",
"supported_countries": [],
"metadata": "{}",
"coupons_orders_count": 0
}
Update Coupon
PATCH
https://yoursite.mavenseed.com/api/v1/coupons/:id
Update a single coupon. All of the above properties in create coupon are valid.
Headers
Authorization
string
Auth token
{
"id": 33,
"internal_coupon_id": "englishtea",
"coupon_type": "coupon",
"currency": "USD",
"duration": "once",
"duration_in_months": null,
"max_redemptions": null,
"amount_off": 6000,
"percent_off": null,
"redeem_by": null,
"eligible_types": [
"orders"
],
"created_at": "2020-05-14T13:47:54.567-04:00",
"updated_at": "2020-09-08T12:28:49.246-04:00",
"supported_countries": [],
"metadata": "{}",
"coupons_orders_count": 0
}
Delete Coupon
DELETE
https://yoursite.mavenseed.com/api/v1/coupons/:id
Path Parameters
string
Last updated
Was this helpful?