Comment on page
Creating a card
To create an order in Toggle, make a mutation request to
receipt_contactdetails are the "purchaser" of the card. So for automated guest gratuity cards, you could either hard-code these to a system level address or you could use the currently logged in user to your own platform, if you have such a thing or... you can leave the
receipt_contactdetails out of your mutation..
Merchant IDs are issued to approved partner integrations for auditing and reporting purposes. If you have not been issued with a
merchant_id, you may remove this field from your query.
All orders in Toggle are linked to a product. This would enable you to create a menu of product options to choose from when selling a gift card or experience.
To retrieve a list of products for an account:
"name": "In-Store Gift"
"name": "Summer Promotion"
Alternatively, we do have a default product on every account which you can use if you wish to simply sell a single gift card product type and avoid the extra overhead of creating a menu of product options to choose from.
To retrieve the default product ID, use the same query as above and find a product called "In-store Gift". This Product ID will be unique per customer/client account, but you only need to retrieve and configure this id a single time as it will not change for an account once that account exists.
price_modifier_idrelates to the particular price option for this card. e.g. a pre-defined list of denominations.
Products can also be set to allow a "custom price modifier" on a product-by-product basis. In such cases, you can pass in the value of the card using:
instead of using a
For Guest Gratuity cards, the
totalwould always typically be
0as there is nothing to pay.
For the discount, this is passed in with a
discount_type_idand value. A discount type of
1is a general-use FOC type, though we also have other types available. For example
3is for discounts for promotions.
These different configuration variables are all to designed to aid book-keepers with reporting on card sales and discounts.
This variable automatically marks your order as 'fulfilled' in Toggle (e.g. sent and dispatched). If, for some reason, you wanted to leave an order as open, and mark as fulfilled later, you could do this with some subsequent API calls. However, for your use-case, we recommend using this to automatically close off all orders you create as fulfilled.