API

DiscountDeal

A discount deal.

Operations

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

Method Route SDK operation Returns
GET /v1/stores/{storeId}/deals/discount/{id} load OK
PUT /v1/stores/{storeId}/deals/discount/{id} update 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:

discount_deal, err := client.DiscountDeal(nil).Load(map[string]any{"id": "example_id", "store_id": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(discount_deal)
updated, err := client.DiscountDeal(nil).Update(map[string]any{"id": "example_id", "store_id": "example", "availability": []any{}}, nil)
if err != nil {
    panic(err)
}
fmt.Println(updated)

Lua

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

local discount_deal, err = client:DiscountDeal():load({ id = "example_id", store_id = "example" })
local updated, err = client:DiscountDeal():update({ id = "example_id", store_id = "example", availability = {} })

PHP

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

$discount_deal = $client->DiscountDeal()->load(["id" => "example_id", "store_id" => "example"]);
$updated = $client->DiscountDeal()->update(["id" => "example_id", "store_id" => "example", "availability" => []]);

Python

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

discount_deal = client.DiscountDeal().load({"id": "example_id", "store_id": "example"})
updated = client.DiscountDeal().update({"id": "example_id", "store_id": "example", "availability": []})

Ruby

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

discount_deal = client.DiscountDeal.load({ "id" => "example_id", "store_id" => "example" })
updated = client.DiscountDeal.update({ "id" => "example_id", "store_id" => "example", "availability" => [] })

TypeScript

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

const discount_deal = await client.DiscountDeal().load({ id: "example_id", store_id: "example" })
const updated = await client.DiscountDeal().update({ id: "example_id", store_id: "example", availability: [] })

Fields

Field Type Required Description
availability array No Availability
description string No Item Description
id string No Deal ID (controlled by partners)
items array No Array of item ids
name string No Item Name
schedule object Yes Schedule
subcategory_id string No Pass the ref id of subcategory it mapped with deals
type string No Deals Type
value number No Either Percent or Flat value

load

GET /v1/stores/{storeId}/deals/discount/{id}

Operation ID: GET/v1/stores/{storeId}/deals/discount/{id}.

Authentication: oauth2 (AccessToken).

Parameters

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

Responses

200: OK

application/json

Property Type Required Description
data object No
data.availability array of enum: MO, TU, WE, TH, FR, SA, ... No
data.id string No Deal ID (controlled by partners)
data.items array of string No Array of item ids
data.schedule object No
data.schedule.end_date string No The date at which the menu ceases to be available, in YYYY-MM-DD format eg 2024-12-01 leave empty always visible
data.schedule.end_time string Yes The time at which the menu ceases to be available, in 24-hour HH:MM format, for example “08:30”, “23:00”
data.schedule.start_date string No The date at which the menu becomes available, in YYYY-MM-DD format eg 2024-01-01 leave empty always visible
data.schedule.start_time string Yes The time at which the menu becomes available, in 24-hour HH:MM format, for example “08:30”, “23:00”
data.subcategory_id string No Pass the ref id of subcategory it mapped with deals
data.type enum: flat, percent No Deals Type
data.value number No Either Percent or Flat value
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

update

PUT /v1/stores/{storeId}/deals/discount/{id}

Operation ID: PUT/v1/stores/{storeId}/deals/discount/{id}.

Authentication: oauth2 (AccessToken).

Parameters

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

Request body

application/json

Property Type Required Description
availability array of enum: MO, TU, WE, TH, FR, SA, ... No
description string No Item Description
id string Yes Deal ID (controlled by partners)
items array of string No Array of item ids
name string No Item Name
schedule object No
schedule.end_date string No The date at which the menu ceases to be available, in YYYY-MM-DD format eg 2024-12-01 leave empty always visible
schedule.end_time string Yes The time at which the menu ceases to be available, in 24-hour HH:MM format, for example “08:30”, “23:00”
schedule.start_date string No The date at which the menu becomes available, in YYYY-MM-DD format eg 2024-01-01 leave empty always visible
schedule.start_time string Yes The time at which the menu becomes available, in 24-hour HH:MM format, for example “08:30”, “23:00”
subcategory_id string No Pass the ref id of subcategory it mapped with deals
type enum: flat, percent Yes Deals Type
value number No Either Percent or Flat value

Responses

200: OK
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