Takes in an optional JSON PromotionRequest body and performs a promotion operation defined by the specified Toast-Transaction-Type.
PROMOTION_VERIFY:
Verifies whether a given promotion code is applicable to a check. Confirms that the promotion code is available for use, the check meets the criteria of the promotion, and that no other, conflicting promotions or discounts are applied.
PROMOTION_VERIFY request has a unique GUID. Providers can cache a response based on a Toast-Transaction-GUID.
PromotionObject
that is applicable to the check provided in the PromotionRequest. This PromotionObject contains the proper state of the promotion,
including the amount to take off the check (as calculated by the provider), the name of the promotion, and the appliedDate. It is recommended
that the provider use the appliedDate provided by the VerifyPromotionRequest.
PROMOTION_VERIFY response, and may wish to use a composite key of (check.guid, restaurant-external-guid).
Providers should use the Toast-Transaction-GUID to prevent replayed requests from reserving the promotion more than once. Additionally, the Toast-Transaction-GUID acts
as an identifier for the promotion in future requests.
PROMOTION_REVALIDATE:
Revalidates all AppliedPromotions provided on an RevalidatePromotionsRequest (in the promotionsToActOn field). This should check that all promotions in that field
are still applicable to the provided check, and represent the correct amount. The promotions in promotionsToActOn are not APPLIED.
PROMOTION_REVALIDATE request is valid (it is properly formatted and the promotion code can be applied), then the API returns a 200 response with
a list of all AppliedPromotion objects from promotionsToActOn with up-to-date values. If the total discount of a promotion is different than what was provided, the corresponding
AppliedPromotion response should have this new value. PROMOTION_APPLY:
Redeems all AppliedPromotions provided on an ApplyPromotionsRequest (in the promotionsToActOn field). If the redemption is successful, the API commits the transaction and returns a 200 response.
PROMOTION_APPLY request will have a unique GUID, which will be referenced later to verify the state of a promotion code or to void a previously
applied promotion code. If the request contains a Toast-Transaction-GUID that has already been committed or voided for a different check GUID,
the API provider must return a 400 response with the appropriate ErrorResponse object. If there are any issues applying promotions, the API provider must return a 400
response, and we will revalidate our existing promotions.
AppliedPromotion objects
that are applicable to the check provided in the PromotionRequest. Each AppliedPromotion object contains the proper state of the promotion,
including the amount to be taken off the check (as calculated by the provider).
Toast-Transaction-GUID and the same check GUID, for a 24 hour period (that is, it should apply once and only once).
PROMOTION_STATUS:
Responds with the PromotionObject or ErrorResponse that is associated with the provided Toast-Transaction-GUID, as well as the status of the redemption
("VERIFIED", "VOIDED", or "APPLIED").
If the transaction GUID is not associated with a promotion that was VERIFIED, the response code is 400.
PROMOTION_VOID:
Voids supplied promotions from a VoidPromotionsRequest (in the appliedPromotions field).
This endpoint is called when the entire check is voided, or the promotion is removed from the check. This endpoint is called on
promotions that are verified as well as committed. If called on a non-committed promotion AND there is a lock placed on the
promotion, the lock should be lifted, allowing another user to potentially use the promotion code.
If the promotions have already been voided, then nothing should change for those.
Toast-Transaction-GUID. The Toast-Transaction-GUID may be used to cache
a response, and to prevent a replay attack.
| Authorization required | string <string> Contains configured authorization information.
This should be used by the client to verify the identity of the sender
|
| Toast-Restaurant-External-ID required | string <string> The ID that identifies the restaurant for this configuration. |
| Toast-Transaction-GUID required | string The identifier of the promotion request. Based on the requestType, it is used for different functions:
|
| Toast-Transaction-Type required | string <string> The type of operation. |
A JSON PromotionRequest or VerifyPromotionRequest object
containing information about an order and promotion code. Note:
VerifyPromotionRequest is a subtype of PromotionRequest. If
passed during a void, to void all promotions associated with it.
required | Array of objects (AppliedPromotion) A list of promotions applied on the check, linked to their AppliedDiscount. Includes metadata about promotions. |
required | object (Check) A wrapper object with fields that allow reference to a Toast entity by Toast GUID. |
| checkGuid | string The unique identifier of the check to which the promotions were applied. |
object (PromotionObject) An object to encapsulate information about a promotion. | |
| orderOpenedBusinessDate | integer The business date (yyyyMMdd) on which this order was opened. |
| orderOpenedDate | string <date-time> The date the corresponding Order was opened. |
Array of objects (AppliedPromotion) Specific promotions that a request should act on (such as void or apply all of the supplied promotions). | |
| requestBusinessDate | integer The business date (yyyyMMdd) on which this request was created. |
| requestDateTime required | string <date-time> The date and time when this check request was made. If not specified, set to the current system time. Use ISO 8601 date and time format for all Toast APIs. |
object (ExternalReference) A wrapper object with fields that allow reference to a Toast entity by Toast GUID. |
Returns a JSON PromotionObject
representing the response if this was a PROMOTION_VERIFY or PROMOTION_APPLY request.
Returns 200 for a successful PROMOTION_VOID request.
promotion codes should only be "used up" on a PROMOTION_APPLY request.
Invalid request. Returns a JSON ErrorResponse
to describe why the request was not valid.
Reasons for an ErrorResponse can include a bad request (such as invalid format or missing information),
or if the promotion code transaction being voided has never been seen.
Not properly authorized to make this request.
An unexpected internal error occurred.
{- "check": {
- "guid": "string",
- "entityType": "string",
- "externalId": "string",
- "openedDate": "2019-08-24T14:15:22Z",
- "closedDate": "2019-08-24T14:15:22Z",
- "modifiedDate": "2019-08-24T14:15:22Z",
- "deletedDate": "2019-08-24T14:15:22Z",
- "deleted": true,
- "createdDevice": {
- "id": "string"
}, - "selections": [
- {
- "guid": "string",
- "entityType": "string",
- "externalId": "string",
- "item": {
- "guid": "string",
- "entityType": "string",
- "externalId": "string"
}, - "itemGroup": {
- "guid": "string",
- "entityType": "string",
- "externalId": "string"
}, - "optionGroup": {
- "guid": "string",
- "entityType": "string",
- "externalId": "string"
}, - "preModifier": {
- "guid": "string",
- "entityType": "string",
- "externalId": "string"
}, - "quantity": 0,
- "selectionType": "NONE",
- "salesCategory": {
- "guid": "string",
- "entityType": "string",
- "externalId": "string"
}, - "appliedDiscounts": [
- {
- "guid": "string",
- "entityType": "string",
- "name": "string",
- "discountAmount": 0,
- "discount": {
- "guid": "string",
- "entityType": "string"
}, - "triggers": [
- {
- "selection": null,
- "quantity": null
}
], - "approver": {
- "guid": "string",
- "entityType": "string",
- "externalId": "string"
}, - "comboItems": [
- {
- "guid": null,
- "entityType": null,
- "externalId": null
}
], - "appliedPromoCode": "string",
- "provider": "string"
}
], - "deferred": true,
- "preDiscountPrice": 0,
- "price": 0,
- "tax": 0,
- "voided": true,
- "voidDate": "2019-08-24T14:15:22Z",
- "voidBusinessDate": 0,
- "voidReason": {
- "guid": "string",
- "entityType": "string",
- "externalId": "string"
}, - "displayName": "string",
- "createdDate": "2019-08-24T14:15:22Z",
- "modifiedDate": "2019-08-24T14:15:22Z",
- "modifiers": [
- { }
], - "fulfillmentStatus": "NEW",
- "appliedTaxes": [
- {
- "guid": "string",
- "entityType": "string",
- "taxRate": {
- "guid": "string",
- "entityType": "string"
}, - "name": "string",
- "rate": 0,
- "taxAmount": 0,
- "type": "PERCENT"
}
]
}
], - "customer": {
- "guid": "string",
- "entityType": "string",
- "firstName": "string",
- "lastName": "string",
- "phone": "string",
- "email": "string"
}, - "appliedLoyaltyInfo": {
- "guid": "string",
- "entityType": "string",
- "loyaltyIdentifier": "string",
- "vendor": "TOAST",
- "accrualFamilyGuid": "string",
- "accrualText": "string"
}, - "taxExempt": false,
- "displayNumber": "string",
- "appliedServiceCharges": [
- {
- "guid": "string",
- "entityType": "string",
- "externalId": "string",
- "chargeAmount": 0,
- "serviceCharge": {
- "guid": "string",
- "entityType": "string",
- "externalId": "string"
}, - "chargeType": "FIXED",
- "name": "string",
- "delivery": true,
- "gratuity": true,
- "taxable": true,
- "appliedTaxes": [
- {
- "guid": "string",
- "entityType": "string",
- "taxRate": {
- "guid": "string",
- "entityType": "string"
}, - "name": "string",
- "rate": 0,
- "taxAmount": 0,
- "type": "PERCENT"
}
]
}
], - "amount": 0,
- "taxAmount": 0,
- "totalAmount": 0,
- "payments": [
- {
- "guid": "string",
- "entityType": "string",
- "externalId": "string",
- "paidDate": "2019-08-24T14:15:22Z",
- "paidBusinessDate": 0,
- "type": "CASH",
- "cardEntryMode": "SWIPED",
- "amount": 0,
- "tipAmount": 0,
- "amountTendered": 0,
- "cardType": "VISA",
- "last4Digits": "string",
- "originalProcessingFee": 0,
- "cashDrawer": {
- "guid": "string",
- "entityType": "string",
- "externalId": "string"
}, - "refundStatus": "NONE",
- "refund": {
- "refundAmount": 0,
- "tipRefundAmount": 0,
- "refundDate": "2019-08-24T14:15:22Z",
- "refundBusinessDate": 0
}, - "paymentStatus": "OPEN",
- "voidInfo": {
- "voidUser": {
- "guid": "string",
- "entityType": "string",
- "externalId": "string"
}, - "voidApprover": {
- "guid": "string",
- "entityType": "string",
- "externalId": "string"
}, - "voidDate": "2019-08-24T14:15:22Z",
- "voidBusinessDate": 0,
- "voidReason": {
- "guid": "string",
- "entityType": "string",
- "externalId": "string"
}
}, - "houseAccount": {
- "guid": "string",
- "entityType": "string",
- "externalId": "string"
}, - "otherPayment": {
- "guid": "string",
- "entityType": "string",
- "externalId": "string"
}
}
], - "tabName": "string",
- "appliedDiscounts": [
- {
- "guid": "string",
- "entityType": "string",
- "name": "string",
- "discountAmount": 0,
- "discount": {
- "guid": "string",
- "entityType": "string"
}, - "triggers": [
- {
- "selection": {
- "guid": "string",
- "entityType": "string",
- "externalId": "string"
}, - "quantity": 0
}
], - "approver": {
- "guid": "string",
- "entityType": "string",
- "externalId": "string"
}, - "comboItems": [
- {
- "guid": "string",
- "entityType": "string",
- "externalId": "string"
}
], - "appliedPromoCode": "string",
- "provider": "string"
}
], - "voided": true,
- "voidDate": "2019-08-24T14:15:22Z",
- "voidBusinessDate": 0,
- "paidDate": "2019-08-24T14:15:22Z"
}, - "checkGuid": "string",
- "appliedPromotions": [
- {
- "appliedDate": "2019-08-24T14:15:22Z",
- "appliedBusinessDate": 0,
- "promoCode": "string",
- "name": "string",
- "discountAmount": 0,
- "referenceId": "string",
- "externalId": "string",
- "appliedDiscountGuid": "string"
}
], - "newPromotion": {
- "appliedDate": "2019-08-24T14:15:22Z",
- "appliedBusinessDate": 0,
- "promoCode": "string",
- "name": "string",
- "discountAmount": 0,
- "referenceId": "string"
}, - "promotionsToActOn": [
- {
- "appliedDate": "2019-08-24T14:15:22Z",
- "appliedBusinessDate": 0,
- "promoCode": "string",
- "name": "string",
- "discountAmount": 0,
- "referenceId": "string",
- "externalId": "string",
- "appliedDiscountGuid": "string"
}
], - "requestDateTime": "2019-08-24T14:15:22Z",
- "requestBusinessDate": 0,
- "requestUser": {
- "guid": "string",
- "entityType": "string",
- "externalId": "string"
}, - "orderOpenedDate": "2019-08-24T14:15:22Z",
- "orderOpenedBusinessDate": 0
}{- "appliedDate": "2019-08-24T14:15:22Z",
- "appliedBusinessDate": 0,
- "promoCode": "string",
- "name": "string",
- "discountAmount": 0,
- "referenceId": "string"
}