For the complete documentation index, see llms.txt. This page is also available as Markdown.

Promos

Promo/discount code management

List promos

get

List all active promo codes for the account. Returns all active promos (no pagination).

Authorizations
AuthorizationstringRequired

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.

Responses
200

Successful response

application/json
get/v2/promos
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 promo

post

Create a new promo/discount code. Fields you omit take their default (no discount, no expiry, no limits).

Authorizations
AuthorizationstringRequired

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.

Body
codestringRequired

Promo code. Letters and numbers only — no spaces or punctuation. Trimmed and uppercased before saving.

onetime_discount_typestring · enum · nullableOptional

Discount type for one-time items.

Possible values:
onetime_discount_offsetnumber · nullableOptional

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).

subscription_discount_typestring · enum · nullableOptional

Discount type for subscriptions.

Possible values:
subscription_discount_offsetnumber · nullableOptional

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).

subscription_duration_in_monthsnumber · nullableOptional

Duration of subscription discount in months (0 = forever). null is treated as 0.

expire_atstring · nullableOptional

Expiration date

order_limitnumber · nullableOptional

Maximum number of orders (0 = unlimited). null is treated as 0.

per_customer_limitnumber · nullableOptional

Maximum uses per customer (0 = unlimited). null is treated as 0.

Responses
201

Created successfully

application/json
any · nullableOptional
post/v2/promos
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

Get a promo

get

Retrieve a single promo code by ID.

Authorizations
AuthorizationstringRequired

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.

Path parameters
idstringRequired

Promo ID

Responses
200

Successful response

application/json
idintegerRequired
codestringRequired
discount_typestringRequired
discount_amountnumberRequired
durationstring · nullableRequired
duration_countnumber · nullableRequired
order_limitnumber · nullableRequired
expire_atstring · nullableRequired
ordered_countintegerRequired
is_expiredbooleanRequired
created_atstringRequired
updated_atstringRequired
get/v2/promos/{id}
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 a promo

put

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.

Authorizations
AuthorizationstringRequired

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.

Path parameters
idstringRequired

Promo ID

Body
codestringOptional

Promo code. Letters and numbers only — no spaces or punctuation. Trimmed and uppercased before saving.

onetime_discount_typestring · enum · nullableOptional

Discount type for one-time items. Send null to remove the one-time discount.

Possible values:
onetime_discount_offsetnumber · nullableOptional

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).

subscription_discount_typestring · enum · nullableOptional

Discount type for subscriptions. Send null to remove the subscription discount.

Possible values:
subscription_discount_offsetnumber · nullableOptional

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).

subscription_duration_in_monthsnumber · nullableOptional

Duration in months (0 = forever). null is treated as 0.

expire_atstring · nullableOptional

Expiration date. Send null to remove the expiry.

order_limitnumber · nullableOptional

Maximum number of orders (0 = unlimited). null is treated as 0.

per_customer_limitnumber · nullableOptional

Maximum uses per customer (0 = unlimited). null is treated as 0.

Responses
200

Successful response

application/json
any · nullableOptional
put/v2/promos/{id}
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

Delete a promo

delete

Soft delete a promo code.

Authorizations
AuthorizationstringRequired

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.

Path parameters
idstringRequired

Promo ID

Responses
204

Deleted successfully

No content

delete/v2/promos/{id}
DELETE /v2/promos/{id} HTTP/1.1
Host: api.spiffy.co
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Get promo automation actions

get

Get automation event actions for a promo code.

Authorizations
AuthorizationstringRequired

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.

Path parameters
idstringRequired

Promo ID

Responses
200

Successful response

application/json
any · nullableOptional
get/v2/promos/{id}/actions
GET /v2/promos/{id}/actions HTTP/1.1
Host: api.spiffy.co
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Update promo automation actions

put

Save automation event actions for a promo code.

Authorizations
AuthorizationstringRequired

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.

Path parameters
idstringRequired

Promo ID

Body
event_actionsany · nullableOptional

Map of event name to array of action configs

Responses
200

Successful response

application/json
any · nullableOptional
put/v2/promos/{id}/actions
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