Creating a card

To create an order in Toggle, make a mutation request to createOrder.

Take a look at the example in our API playground >

What contact details should I use?

The receipt_contact details 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_contact details out of your mutation..

What merchant ID to I use?

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.

What product ID should I use?

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:

query($account_id:Int!) {
  Products(account_id:$account_id) {
    id
    name
  }
}

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 vs custom price modifiers

The price_modifier_id relates 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:

"custom_price_modifier_value": 2500

instead of using a price_modifier_id.

Total vs discounts

For Guest Gratuity cards, the total would always typically be 0 as there is nothing to pay.

For the discount, this is passed in with a discount_type_id and value. A discount type of 1 is a general-use FOC type, though we also have other types available. For example 3 is for discounts for promotions.

These different configuration variables are all to designed to aid book-keepers with reporting on card sales and discounts.

What does auto_fulfil_group_fulfilment do?

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.

Last updated