Promos
Promo/discount code management
List all active promo codes for the account. Returns all active promos (no pagination).
Account API key authentication. Pass an API key as a Bearer token in the Authorization header. An account may have multiple named keys; any of them grants full access to all endpoints — equivalent to all OAuth scopes.
Successful response
Unauthorized - Authentication is required or has failed
Forbidden - You do not have permission to access this resource
Internal Server Error - An unexpected error occurred
GET /v2/promos HTTP/1.1
Host: api.spiffy.co
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"data": [
{
"id": 1,
"code": "text",
"discount_type": "text",
"discount_amount": 1,
"duration": "text",
"duration_count": 1,
"order_limit": 1,
"expire_at": "text",
"ordered_count": 1,
"is_expired": true,
"created_at": "text",
"updated_at": "text"
}
]
}Create a new promo/discount code. Fields you omit take their default (no discount, no expiry, no limits).
Account API key authentication. Pass an API key as a Bearer token in the Authorization header. An account may have multiple named keys; any of them grants full access to all endpoints — equivalent to all OAuth scopes.
Promo code. Letters and numbers only — no spaces or punctuation. Trimmed and uppercased before saving.
Discount type for one-time items.
Discount value for one-time items. Cannot be negative. When type is "percent", a percent value from 0 to 100 (20 = 20%). When type is "amount", a monetary value in the smallest currency unit ($5.00 USD = 500; ¥500 JPY = 500).
Discount type for subscriptions.
Discount value for subscriptions. Cannot be negative. When type is "percent", a percent value from 0 to 100 (20 = 20%). When type is "amount", a monetary value in the smallest currency unit ($5.00 USD = 500; ¥500 JPY = 500).
Duration of subscription discount in months (0 = forever). null is treated as 0.
Expiration date
Maximum number of orders (0 = unlimited). null is treated as 0.
Maximum uses per customer (0 = unlimited). null is treated as 0.
Created successfully
Bad Request - The request was invalid or malformed
Unauthorized - Authentication is required or has failed
Forbidden - You do not have permission to access this resource
Conflict - The request conflicts with the current state of the resource
Internal Server Error - An unexpected error occurred
POST /v2/promos HTTP/1.1
Host: api.spiffy.co
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 241
{
"code": "text",
"onetime_discount_type": "amount",
"onetime_discount_offset": 1,
"subscription_discount_type": "amount",
"subscription_discount_offset": 1,
"subscription_duration_in_months": 1,
"expire_at": "text",
"order_limit": 1,
"per_customer_limit": 1
}No content
Retrieve a single promo code by ID.
Account API key authentication. Pass an API key as a Bearer token in the Authorization header. An account may have multiple named keys; any of them grants full access to all endpoints — equivalent to all OAuth scopes.
Promo ID
Successful response
Unauthorized - Authentication is required or has failed
Forbidden - You do not have permission to access this resource
Not Found - The requested resource does not exist
Internal Server Error - An unexpected error occurred
GET /v2/promos/{id} HTTP/1.1
Host: api.spiffy.co
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"id": 1,
"code": "text",
"discount_type": "text",
"discount_amount": 1,
"duration": "text",
"duration_count": 1,
"order_limit": 1,
"expire_at": "text",
"ordered_count": 1,
"is_expired": true,
"created_at": "text",
"updated_at": "text"
}Update an existing promo/discount code. This is a PARTIAL update: only the fields you send are changed, and anything you leave out keeps its current value. Send expire_at or either discount type as null to clear it; the numeric fields treat null as 0 (unlimited / forever). The code cannot be cleared.
Account API key authentication. Pass an API key as a Bearer token in the Authorization header. An account may have multiple named keys; any of them grants full access to all endpoints — equivalent to all OAuth scopes.
Promo ID
Promo code. Letters and numbers only — no spaces or punctuation. Trimmed and uppercased before saving.
Discount type for one-time items. Send null to remove the one-time discount.
Discount value for one-time items. Cannot be negative. When type is "percent", a percent value from 0 to 100 (20 = 20%). When type is "amount", a monetary value in the smallest currency unit ($5.00 USD = 500; ¥500 JPY = 500).
Discount type for subscriptions. Send null to remove the subscription discount.
Discount value for subscriptions. Cannot be negative. When type is "percent", a percent value from 0 to 100 (20 = 20%). When type is "amount", a monetary value in the smallest currency unit ($5.00 USD = 500; ¥500 JPY = 500).
Duration in months (0 = forever). null is treated as 0.
Expiration date. Send null to remove the expiry.
Maximum number of orders (0 = unlimited). null is treated as 0.
Maximum uses per customer (0 = unlimited). null is treated as 0.
Successful response
Bad Request - The request was invalid or malformed
Unauthorized - Authentication is required or has failed
Forbidden - You do not have permission to access this resource
Not Found - The requested resource does not exist
Conflict - The request conflicts with the current state of the resource
Internal Server Error - An unexpected error occurred
PUT /v2/promos/{id} HTTP/1.1
Host: api.spiffy.co
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 241
{
"code": "text",
"onetime_discount_type": "amount",
"onetime_discount_offset": 1,
"subscription_discount_type": "amount",
"subscription_discount_offset": 1,
"subscription_duration_in_months": 1,
"expire_at": "text",
"order_limit": 1,
"per_customer_limit": 1
}No content
Soft delete a promo code.
Account API key authentication. Pass an API key as a Bearer token in the Authorization header. An account may have multiple named keys; any of them grants full access to all endpoints — equivalent to all OAuth scopes.
Promo ID
Deleted successfully
No content
Unauthorized - Authentication is required or has failed
Forbidden - You do not have permission to access this resource
Not Found - The requested resource does not exist
Internal Server Error - An unexpected error occurred
DELETE /v2/promos/{id} HTTP/1.1
Host: api.spiffy.co
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
Get automation event actions for a promo code.
Account API key authentication. Pass an API key as a Bearer token in the Authorization header. An account may have multiple named keys; any of them grants full access to all endpoints — equivalent to all OAuth scopes.
Promo ID
Successful response
Unauthorized - Authentication is required or has failed
Forbidden - You do not have permission to access this resource
Not Found - The requested resource does not exist
Internal Server Error - An unexpected error occurred
GET /v2/promos/{id}/actions HTTP/1.1
Host: api.spiffy.co
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
Save automation event actions for a promo code.
Account API key authentication. Pass an API key as a Bearer token in the Authorization header. An account may have multiple named keys; any of them grants full access to all endpoints — equivalent to all OAuth scopes.
Promo ID
Map of event name to array of action configs
Successful response
Bad Request - The request was invalid or malformed
Unauthorized - Authentication is required or has failed
Forbidden - You do not have permission to access this resource
Not Found - The requested resource does not exist
Internal Server Error - An unexpected error occurred
PUT /v2/promos/{id}/actions HTTP/1.1
Host: api.spiffy.co
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 22
{
"event_actions": null
}No content
Last updated