Publish an offer Coming soon
POST/v1/offers/{id}/publish
Moves a draft to scheduled if starts_at is in the future, or to live now. Run a preview first.
Permissions: Secret key with offers:write.
Request headers#
Idempotency-KeystringAny string up to 255 characters; use a UUID v4. Kept 24 hours per key (or member) and endpoint. Same key and body replays the first response withIdempotent-Replayed: true.Max Length 255
Path parameters#
idstring (uuid)Required
Response fields#
Returns 200 with Offer
idstring (uuid)The offer.namestringShown to guests on wallet items and in checkout.descriptionstringOne or two lines for guests.statusstringdraft,scheduled,live,pausedorended.One ofdraft,scheduled,live,paused,endedversionintegerStarts at 1. Goes up each time a scheduled or live offer is edited. Members keep the version they got.discountDiscountSame shape as a reward's discount:typeisamount(amount_cents),percent(percent),free_item(itemsorcategories,max_items) orbogo.Show attributesDiscount
typestringOne ofamount,percent,free_item,bogoamount_centsintegerForamount.percentnumberForpercent.itemsarray of objectItem scope, by Square variation id.Show attributesHide attributes
pos_item_idstringnamestring
categoriesarray of objectCategory scope.Show attributesHide attributes
pos_category_idstringnamestring
max_itemsinteger
rulesRulesSame shape as a reward's rules:min_subtotal_cents,channels,location_ids,fulfillment,available_times,tier_ids. Empty lists mean no limit.Show attributesRules
min_subtotal_centsintegerInteger cents.Min 0channelsarray of stringOne ofapp,weblocation_idsarray of string (uuid)fulfillmentarray of stringOne ofpickup,delivery,curbside,dine_inavailable_timesarray of AvailableTimeShow attributesAvailableTime
daysarray of stringShow valuesHide values
montuewedthufrisatsun
startstringLocal time, HH:MM.endstringLocal time, HH:MM.
tier_idsarray of string (uuid)
distributionstringgranted(lands in the wallet),shared_code(one code for everyone) orunique_codes(single-use codes from batches).One ofgranted,shared_code,unique_codesshared_codestringNullableThe code, forshared_codeoffers. Otherwisenull.per_member_limitintegerNullableHow many times one member can use the offer.nullfor no limit.budgetBudgetmax_redemptionsandmax_discount_cents(either can benull), and the running totalsused_redemptionsandused_discount_cents. Enforced at checkout.Show attributesBudget
max_redemptionsintegerNullablemax_discount_centsintegerNullableused_redemptionsintegerused_discount_centsinteger
starts_atstring (date-time)NullableWhen it goes live.nullto go live on publish.ends_atstring (date-time)NullableWhen it ends.nullfor no end date.wallet_expiry_daysintegerNullableForgrantedoffers: days a wallet item lasts after it's granted.created_bystringapi,dashboardorcampaign.One ofapi,dashboard,campaign
Error descriptions#
409Conflict
invalid_state
The offer isn't a draft, or its ends_at has already passed. detail says which.
Any endpoint can also return the common errors.