Skip to main content
POST
Node.js

Authorizations

Authorization
string
header
required

A secret API key, made under Developers in the dashboard: Authorization: Bearer shoply_sk_...

Headers

Idempotency-Key
string

A word of your own for this one change, up to 180 letters, digits, dots, dashes, underscores and colons. Sent again with the same key, the request is not carried out twice: the first answer comes back, with Idempotent-Replay: true.

Path Parameters

storeId
string
required

The store's ID. A key reaches the store it was made in: GET /key answers which.

Query Parameters

tz
string

The time zone startsAt and endsAt are read in when they name none, as an IANA name. Left out, UTC.

Example:

"Europe/Berlin"

Body

application/json
name
string
required

What the sale is called, up to 60 characters. Buyers see it on the storefront's countdown.

Example:

"Autumn sale"

value
number
required

How much comes off: above 0 and up to 100 for percent, an amount with at most 2 decimals for fixed.

Example:

20

startsAt
string
required

When it starts, as a date and time.

Example:

"2026-11-27T00:00:00Z"

endsAt
string
required

When it ends, as a date and time. After startsAt, and not already past.

Example:

"2026-11-30T23:59:00Z"

discountType
enum<string>
default:percent

A share of each price, or an amount in the store's currency.

Available options:
percent,
fixed
appliesTo
enum<string>
default:all

Every product, or only the ones in targets.

Available options:
all,
some
targets
object[]

The products on sale when appliesTo is some. Each names a product, and optionally one variant of it.

couponRule
enum<string>
default:rest

What coupons do while the sale runs. rest: a coupon counts only the items in the cart that are not on sale. all: coupons work on sale items too. none: no coupon works anywhere in the store.

Available options:
rest,
all,
none
exceptions
object[]

Up to 100 coupons or coupon categories that couponRule is turned around for.

enabled
boolean
default:true

Whether the sale runs when its time comes.

showBar
boolean
default:true

Whether the storefront shows the sale's countdown bar.

Response

It worked.

success
boolean
message
unknown
code
unknown
data
object