unPLUGDevelopers

Management API · Offers

Preview an offer Coming soon

POST/v1/offers/{id}/preview

A dry run with no side effects. It checks the offer's rules against your members and their past orders and estimates what the offer will cost. Works on drafts and on published offers.

Permissions: Secret key with offers:write.

Request headers#

  • Idempotency-Keystring
    Any 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 with Idempotent-Replayed: true.
    Max Length 255

Path parameters#

  • idstring (uuid)Required

Request body#

FieldDescription
member_idsarrayUp to 500 members you plan to grant to. Leave it out to check all members.

Response fields#

Returns 200 with OfferPreview

  • eligible_membersinteger
  • expected_redemptionsinteger
  • expected_cost_centsinteger
  • warningsarray of string

Error descriptions#

400Bad request
invalid_param

More than 500 member_ids.

404Not found
not_found

No such offer.

Any endpoint can also return the common errors.