API

Coupon

A store's coupons: list, create or update, get or delete one, or create and update in bulk.

Operations

Every route this entity exposes. Each route links to its own reference on this page.

Method Route SDK operation Returns
POST /v1/stores/{storeId}/coupons create OK
POST /v1/stores/{storeId}/coupons/bulk create OK
GET /v1/stores/{storeId}/coupons list OK
GET /v1/stores/{storeId}/coupons/{couponId} load OK
DELETE /v1/stores/{storeId}/coupons/{couponId} remove OK

Examples

One example per SDK, generated from the API model. The argument names are the parameters and fields of this entity, and the values are placeholders. The examples are not compiled or executed.

Golang

Construct client as shown in the Golang setup, then call the operations:

coupons, err := client.Coupon(nil).List(map[string]any{"store_id": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(coupons)
coupon, err := client.Coupon(nil).Load(map[string]any{"id": "example_id", "store_id": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(coupon)
created, err := client.Coupon(nil).Create(map[string]any{"store_id": "example", "code": "example", "min_order": 1, "start_date": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(created)
removed, err := client.Coupon(nil).Remove(map[string]any{"id": "example_id", "store_id": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(removed)

Lua

Construct client as shown in the Lua setup, then call the operations:

local coupons, err = client:Coupon():list({ store_id = "example" })
local coupon, err = client:Coupon():load({ id = "example_id", store_id = "example" })
local created, err = client:Coupon():create({ store_id = "example", code = "example", min_order = 1, start_date = "example" })
local removed, err = client:Coupon():remove({ id = "example_id", store_id = "example" })

PHP

Construct client as shown in the PHP setup, then call the operations:

$coupons = $client->Coupon()->list(["store_id" => "example"]);
$coupon = $client->Coupon()->load(["id" => "example_id", "store_id" => "example"]);
$created = $client->Coupon()->create(["store_id" => "example", "code" => "example", "min_order" => 1, "start_date" => "example"]);
$client->Coupon()->remove(["id" => "example_id", "store_id" => "example"]);

Python

Construct client as shown in the Python setup, then call the operations:

coupons = client.Coupon().list({"store_id": "example"})
coupon = client.Coupon().load({"id": "example_id", "store_id": "example"})
created = client.Coupon().create({ "store_id": "example", "code": "example", "min_order": 1, "start_date": "example" })
client.Coupon().remove({"id": "example_id", "store_id": "example"})

Ruby

Construct client as shown in the Ruby setup, then call the operations:

coupons = client.Coupon.list({ "store_id" => "example" })
coupon = client.Coupon.load({ "id" => "example_id", "store_id" => "example" })
created = client.Coupon.create({ "store_id" => "example", "code" => "example", "min_order" => 1, "start_date" => "example" })
client.Coupon.remove({ "id" => "example_id", "store_id" => "example" })

TypeScript

Construct client as shown in the TypeScript setup, then call the operations:

const coupons = await client.Coupon().list({ store_id: "example" })
const coupon = await client.Coupon().load({ id: "example_id", store_id: "example" })
const created = await client.Coupon().create({ store_id: "example", code: "example", min_order: 1, start_date: "example" })
await client.Coupon().remove({ id: "example_id", store_id: "example" })

Fields

Field Type Required Description
amount integer No Fixed discount taken off the order, in the lowest currency unit (pence, cents, paise, etc.).
availability array No Days of the week on which the coupon can be redeemed, given as two-letter codes.
body object Yes Body
code string Yes The customer-facing coupon code (for example
coupon_id integer No Coupon id.
coupon_items array No Optional list of item-level promotions tied to this coupon.
coupon_portal string No Defines where the coupon is applicable, Foodhub website only or both Foodhub and the store’s native website
coupon_type_id number No Coupon Type Id
created_at string No Created At
description string No Free-text, human-readable note describing the coupon or promotion.
end_date string No Last calendar day the coupon is valid, in YYYY-MM-DD format.
end_time string No Daily cut-off time the coupon stops being active.
host string No Host
id integer No Coupon id (same as coupon_id).
is_expired boolean No Must be explicitly true to mark as expired.
is_free_delivery boolean No When true, the coupon waives the delivery fee for qualifying orders.
is_public boolean No Must be explicitly true to make the coupon public.
is_tax_waiver boolean No Must be explicitly true to waive tax on the coupon amount.
maximum_discount_value integer No Maximum discount allowed on a single order, in cents.
min_order integer Yes Minimum order subtotal (in the lowest currency unit) a customer must reach before the coupon becomes redeemable.
number_of_uses number No Total number of times this coupon may be redeemed across all customers before it is exhausted.
one_per_customer boolean No Must be explicitly true to limit usage to one per customer.
outcome string Yes Outcome
percent number No Percentage discount applied to the order, expressed as 0–100.
service_type string No Restricts the coupon to a fulfilment channel, DELIVERY, COLLECTION, or BOTH.
start_date string Yes First calendar day the coupon is valid, in YYYY-MM-DD format.
start_time string No Daily start time the coupon becomes active.
updated_at string No Updated At

create

POST /v1/stores/{storeId}/coupons

Operation ID: POST/v1/stores/{storeId}/coupons.

Authentication: oauth2 (AccessToken).

Parameters

Parameter In Type Required Description
storeId path string Yes Store Identifier

Request body

application/json

Property Type Required Description
amount integer No Fixed discount taken off the order, in the lowest currency unit (pence, cents, paise, etc.). Provide either amount or percent , never both.
availability array of enum: MO, TU, WE, TH, FR, SA, ... No Days of the week on which the coupon can be redeemed, given as two-letter codes. Defaults to every day when omitted.
code string Yes The customer-facing coupon code (for example the text shoppers type at checkout). Must be unique within the store and at most 30 characters.
coupon_id integer No Coupon id. Preferred over id. Omit to create; include to full-replace an existing coupon.
coupon_items array of object No Optional list of item-level promotions tied to this coupon. On create and update, the provided list replaces any existing items; omit or send [] for none.
coupon_items[].addons array of string No Optional partner addon identifiers (same strings as menu addon partner_id). If any listed addon cannot be resolved for this store, that coupon line is skipped and the create response reports the unresolved IDs.
coupon_items[].include_addons boolean No When true, the listed addons are bundled into the item-level offer alongside the base item.
coupon_items[].is_free boolean No When true, the item is given away free as part of the coupon, overriding any price fields.
coupon_items[].item_id array of string Yes Partner-controlled item identifiers (same strings as menu item partner_id for this store). Each ID that matches a published item creates one coupon item line. IDs with no match are omitted and listed in the create response.
coupon_items[].menu_price integer No Original (pre-discount) menu price of the item, in the lowest currency unit (pence, paise, cents, yen, etc.). Useful for showing the saving against offer_price.
coupon_items[].offer_price integer No Discounted price the customer pays for the item under this coupon, in the lowest currency unit (pence, paise, cents, yen, etc.).
coupon_items[].quantity number No Number of units of the item the offer covers within the coupon.
coupon_portal enum: FOODHUB, ALL No Defines where the coupon is applicable, Foodhub website only or both Foodhub and the store’s native website
description string No Free-text, human-readable note describing the coupon or promotion. Shown internally and for record-keeping.
end_date string No Last calendar day the coupon is valid, in YYYY-MM-DD format. Pass an empty string for open-ended promotions that never expire by date.
end_time string No Daily cut-off time the coupon stops being active. Same format as start_time: empty for all-day, or 24-hour HH:MM / HH:MM:SS (for example 18:00:00).
id integer No Coupon id (same as coupon_id). Omit to create; include to full-replace an existing coupon.
is_expired boolean No Must be explicitly true to mark as expired.
is_free_delivery boolean No When true, the coupon waives the delivery fee for qualifying orders.
is_public boolean No Must be explicitly true to make the coupon public.
is_tax_waiver boolean No Must be explicitly true to waive tax on the coupon amount.
maximum_discount_value integer No Maximum discount allowed on a single order, in cents. Optional, if omitted, defaults to 500 ($5). Recommended for percentage coupons.
min_order integer Yes Minimum order subtotal (in the lowest currency unit) a customer must reach before the coupon becomes redeemable.
number_of_uses number No Total number of times this coupon may be redeemed across all customers before it is exhausted.
one_per_customer boolean No Must be explicitly true to limit usage to one per customer.
percent number No Percentage discount applied to the order, expressed as 0–100. Provide either percent or amount , never both. Defaults to no percentage discount when omitted.
service_type enum: DELIVERY, COLLECTION, BOTH No Restricts the coupon to a fulfilment channel, DELIVERY, COLLECTION, or BOTH. Defaults to BOTH so the coupon applies to every order type unless narrowed.
start_date string Yes First calendar day the coupon is valid, in YYYY-MM-DD format.
start_time string No Daily start time the coupon becomes active. Uses the same clock format as other Partner API fields: leave empty for all-day, or pass 24-hour HH:MM / HH:MM:SS (for example 09:00:00).

Responses

200: OK

application/json

Property Type Required Description
body object Yes
body.action enum: created, updated Yes
body.code string Yes
body.coupon_id number Yes
body.skipped_items array of object No
body.skipped_items[].item_id array of string Yes
body.skipped_items[].reason string Yes
body.skipped_items[].status enum: skipped Yes
body.skipped_items[].unresolved_addons array of string No
body.skipped_items[].unresolved_item_ids array of string No
outcome enum: success Yes
201: Created

application/json

Property Type Required Description
body object Yes
body.action enum: created, updated Yes
body.code string Yes
body.coupon_id number Yes
body.skipped_items array of object No
body.skipped_items[].item_id array of string Yes
body.skipped_items[].reason string Yes
body.skipped_items[].status enum: skipped Yes
body.skipped_items[].unresolved_addons array of string No
body.skipped_items[].unresolved_item_ids array of string No
outcome enum: success Yes
400: Bad Request

application/json

Property Type Required Description
error string Yes 400 Bad Request is the status code that indicates the server cannot or will not process the request due to something that is perceived to be a client error
401: Unauthorized

application/json

Property Type Required Description
error string Yes 401 Unauthorized is the status code to return when the client provides no credentials or invalid credentials.
403: Forbidden

application/json

Property Type Required Description
error string Yes 403 Forbidden is the status code to return when a client has valid credentials but not enough privileges to perform an action on a resource.
409: 409 response

application/json

Property Type Required Description
error string Yes 409 Conflict is the status code that indicates a request could not be completed due to a conflict with the current state of the resource
422: 422 response

application/json

Property Type Required Description
error string Yes 400 Bad Request is the status code that indicates the server cannot or will not process the request due to something that is perceived to be a client error
429: Too Many Requests

application/json

Property Type Required Description
error string Yes 429 Too Many Requests is the status code that indicates the client application has surpassed its rate limit, or number of requests they can send in a given period of time

POST /v1/stores/{storeId}/coupons/bulk

Operation ID: POST/v1/stores/{storeId}/coupons/bulk.

Authentication: oauth2 (AccessToken).

Parameters

Parameter In Type Required Description
storeId path string Yes Store Identifier

Request body

application/json

Property Type Required Description
coupons array of object Yes
coupons[].amount integer No Fixed discount taken off the order, in the lowest currency unit (pence, cents, paise, etc.). Provide either amount or percent , never both.
coupons[].availability array of enum: MO, TU, WE, TH, FR, SA, ... No Days of the week on which the coupon can be redeemed, given as two-letter codes. Defaults to every day when omitted.
coupons[].code string Yes The customer-facing coupon code (for example the text shoppers type at checkout). Must be unique within the store and at most 30 characters.
coupons[].coupon_id integer No Coupon id. Preferred over id. Omit to create; include to full-replace an existing coupon.
coupons[].coupon_items array of object No Optional list of item-level promotions tied to this coupon. On create and update, the provided list replaces any existing items; omit or send [] for none.
coupons[].coupon_items[].addons array of string No Optional partner addon identifiers (same strings as menu addon partner_id). If any listed addon cannot be resolved for this store, that coupon line is skipped and the create response reports the unresolved IDs.
coupons[].coupon_items[].include_addons boolean No When true, the listed addons are bundled into the item-level offer alongside the base item.
coupons[].coupon_items[].is_free boolean No When true, the item is given away free as part of the coupon, overriding any price fields.
coupons[].coupon_items[].item_id array of string Yes Partner-controlled item identifiers (same strings as menu item partner_id for this store). Each ID that matches a published item creates one coupon item line. IDs with no match are omitted and listed in the create response.
coupons[].coupon_items[].menu_price integer No Original (pre-discount) menu price of the item, in the lowest currency unit (pence, paise, cents, yen, etc.). Useful for showing the saving against offer_price.
coupons[].coupon_items[].offer_price integer No Discounted price the customer pays for the item under this coupon, in the lowest currency unit (pence, paise, cents, yen, etc.).
coupons[].coupon_items[].quantity number No Number of units of the item the offer covers within the coupon.
coupons[].coupon_portal enum: FOODHUB, ALL No Defines where the coupon is applicable, Foodhub website only or both Foodhub and the store’s native website
coupons[].description string No Free-text, human-readable note describing the coupon or promotion. Shown internally and for record-keeping.
coupons[].end_date string No Last calendar day the coupon is valid, in YYYY-MM-DD format. Pass an empty string for open-ended promotions that never expire by date.
coupons[].end_time string No Daily cut-off time the coupon stops being active. Same format as start_time: empty for all-day, or 24-hour HH:MM / HH:MM:SS (for example 18:00:00).
coupons[].id integer No Coupon id (same as coupon_id). Omit to create; include to full-replace an existing coupon.
coupons[].is_expired boolean No Must be explicitly true to mark as expired.
coupons[].is_free_delivery boolean No When true, the coupon waives the delivery fee for qualifying orders.
coupons[].is_public boolean No Must be explicitly true to make the coupon public.
coupons[].is_tax_waiver boolean No Must be explicitly true to waive tax on the coupon amount.
coupons[].maximum_discount_value integer No Maximum discount allowed on a single order, in cents. Optional, if omitted, defaults to 500 ($5). Recommended for percentage coupons.
coupons[].min_order integer Yes Minimum order subtotal (in the lowest currency unit) a customer must reach before the coupon becomes redeemable.
coupons[].number_of_uses number No Total number of times this coupon may be redeemed across all customers before it is exhausted.
coupons[].one_per_customer boolean No Must be explicitly true to limit usage to one per customer.
coupons[].percent number No Percentage discount applied to the order, expressed as 0–100. Provide either percent or amount , never both. Defaults to no percentage discount when omitted.
coupons[].service_type enum: DELIVERY, COLLECTION, BOTH No Restricts the coupon to a fulfilment channel, DELIVERY, COLLECTION, or BOTH. Defaults to BOTH so the coupon applies to every order type unless narrowed.
coupons[].start_date string Yes First calendar day the coupon is valid, in YYYY-MM-DD format.
coupons[].start_time string No Daily start time the coupon becomes active. Uses the same clock format as other Partner API fields: leave empty for all-day, or pass 24-hour HH:MM / HH:MM:SS (for example 09:00:00).

Responses

200: OK

application/json

Property Type Required Description
body array of object or object Yes
outcome enum: success Yes
400: Bad Request

application/json

Property Type Required Description
error string Yes 400 Bad Request is the status code that indicates the server cannot or will not process the request due to something that is perceived to be a client error
401: Unauthorized

application/json

Property Type Required Description
error string Yes 401 Unauthorized is the status code to return when the client provides no credentials or invalid credentials.
403: Forbidden

application/json

Property Type Required Description
error string Yes 403 Forbidden is the status code to return when a client has valid credentials but not enough privileges to perform an action on a resource.
422: 422 response

application/json

Property Type Required Description
error string Yes 400 Bad Request is the status code that indicates the server cannot or will not process the request due to something that is perceived to be a client error
429: Too Many Requests

application/json

Property Type Required Description
error string Yes 429 Too Many Requests is the status code that indicates the client application has surpassed its rate limit, or number of requests they can send in a given period of time

list

GET /v1/stores/{storeId}/coupons

Operation ID: GET/v1/stores/{storeId}/coupons.

Authentication: oauth2 (AccessToken).

Parameters

Parameter In Type Required Description
storeId path string Yes Store Identifier

Responses

200: OK

application/json

Property Type Required Description
data array of object No
data[].amount number No
data[].availability array of string No
data[].code string No
data[].coupon_id number No Coupon id. Same as id.
data[].coupon_portal enum: FOODHUB, ALL No
data[].coupon_type_id number No
data[].created_at string No
data[].description string No
data[].end_date string No
data[].end_time string No
data[].host string No
data[].id number No
data[].is_expired number No
data[].is_free_delivery number No
data[].is_public number No
data[].is_tax_waiver number No
data[].maximum_discount_value number No
data[].min_order number No
data[].number_of_uses number No
data[].one_per_customer number No
data[].percent number No
data[].service_type string No
data[].start_date string No
data[].start_time string No
data[].updated_at string No
400: Bad Request

application/json

Property Type Required Description
error string Yes 400 Bad Request is the status code that indicates the server cannot or will not process the request due to something that is perceived to be a client error
401: Unauthorized

application/json

Property Type Required Description
error string Yes 401 Unauthorized is the status code to return when the client provides no credentials or invalid credentials.
403: Forbidden

application/json

Property Type Required Description
error string Yes 403 Forbidden is the status code to return when a client has valid credentials but not enough privileges to perform an action on a resource.
404: Not Found

application/json

Property Type Required Description
error string Yes 404 Not Found is the status code that indicates a server could not find a client-requested webpage
429: Too Many Requests

application/json

Property Type Required Description
error string Yes 429 Too Many Requests is the status code that indicates the client application has surpassed its rate limit, or number of requests they can send in a given period of time

load

GET /v1/stores/{storeId}/coupons/{couponId}

Operation ID: GET/v1/stores/{storeId}/coupons/{couponId}.

Authentication: oauth2 (AccessToken).

Parameters

Parameter In Type Required Description
storeId path string Yes Store Identifier
couponId path string Yes

Responses

200: OK

application/json

Property Type Required Description
body object Yes Coupon Row
body.amount number No
body.availability array of string No
body.code string No
body.coupon_id number No Coupon id. Same as id.
body.coupon_portal enum: FOODHUB, ALL No
body.coupon_type_id number No
body.created_at string No
body.description string No
body.end_date string No
body.end_time string No
body.host string No
body.id number No
body.is_expired number No
body.is_free_delivery number No
body.is_public number No
body.is_tax_waiver number No
body.maximum_discount_value number No
body.min_order number No
body.number_of_uses number No
body.one_per_customer number No
body.percent number No
body.service_type string No
body.start_date string No
body.start_time string No
body.updated_at string No
outcome enum: success Yes
400: Bad Request

application/json

Property Type Required Description
error string Yes 400 Bad Request is the status code that indicates the server cannot or will not process the request due to something that is perceived to be a client error
401: Unauthorized

application/json

Property Type Required Description
error string Yes 401 Unauthorized is the status code to return when the client provides no credentials or invalid credentials.
403: Forbidden

application/json

Property Type Required Description
error string Yes 403 Forbidden is the status code to return when a client has valid credentials but not enough privileges to perform an action on a resource.
404: Not Found

application/json

Property Type Required Description
error string Yes 404 Not Found is the status code that indicates a server could not find a client-requested webpage
429: Too Many Requests

application/json

Property Type Required Description
error string Yes 429 Too Many Requests is the status code that indicates the client application has surpassed its rate limit, or number of requests they can send in a given period of time

remove

DELETE /v1/stores/{storeId}/coupons/{couponId}

Operation ID: DELETE/v1/stores/{storeId}/coupons/{couponId}.

Authentication: oauth2 (AccessToken).

Parameters

Parameter In Type Required Description
storeId path string Yes Store Identifier
couponId path string Yes

Responses

200: OK
400: Bad Request

application/json

Property Type Required Description
error string Yes 400 Bad Request is the status code that indicates the server cannot or will not process the request due to something that is perceived to be a client error
401: Unauthorized

application/json

Property Type Required Description
error string Yes 401 Unauthorized is the status code to return when the client provides no credentials or invalid credentials.
403: Forbidden

application/json

Property Type Required Description
error string Yes 403 Forbidden is the status code to return when a client has valid credentials but not enough privileges to perform an action on a resource.
404: Not Found

application/json

Property Type Required Description
error string Yes 404 Not Found is the status code that indicates a server could not find a client-requested webpage
429: Too Many Requests

application/json

Property Type Required Description
error string Yes 429 Too Many Requests is the status code that indicates the client application has surpassed its rate limit, or number of requests they can send in a given period of time