API reference
discount
Throws an error if the discount doesn't exist, requires an authenticated user or is invalid (expired, consumed etc)
discount(
restaurantId: ID!
code: String!
): DiscountArguments
| Name | Type | Description |
|---|---|---|
restaurantId |
ID! |
|
code |
String! |
Returns
Example
query Discount($restaurantId: ID!, $code: String!) {
discount(restaurantId: $restaurantId, code: $code) {
id
isDisabled
code
title
description
validFrom
}
}curl https://api.thelocoapp.com/graphql \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $LOCO_API_KEY" \
-d '{"query": "query { discount(...) { __typename } }"}'