Create a card
Simple card creation
Configuration
Variable
Description
account_id
This represents the Toggle account that you are connecting to. You can get a list of accounts linked with your API user using an Accounts query.
sales_channel_id
Sales channels allow reporting by the source of an order. Commonly used are:
3 - In store
5 - B2B
7 - Guest Gratuity
product_id
All cards created need to be associated back to a product. Products can be created in the Toggle dashboard. You can retrieve a list of products for an account by using the Get Products query, or from within the Toggle interface
merchant_id
Orders can be linked back to specific merchants. You can use 26
as a catch-all "third party" merchant. But if you are an official Toggle partner, you'll have been issued your own merchant_id
.
order_items.fulfilment_method_id
The fulfilment method determines how the gift card will be delivered to the guest. Some of the methods have additional validation against them, i.e. if you want Toggle to send an email - we require the fulfilment_email
to be provided.
1 = Toggle sends an email
2 = Postal
3 = In venue (physical)
7 = Printed on Receipt 8 = Third party (i.e. you want to generate a gift card, but issue it yourself)
receipt_contact
The receipt contact details can be provided if you want to provide details against the order. If the account is configured to Send receipt email
- then this contact will receive a receipt (not the gift card, just confirmation of order) for any order put against them.
There are several variations of this request, based on what and how you want to issue the gift card. The below example shows;
A £50 gift card
With £25 Tender (cash payment)
With £25 Discount ('free' value added)
Purchased by
[email protected]
Gift card delivered by Email to
[email protected]
Sold
in-Store
mutation CreateOrder {
createOrder(
account_id: 1
currency: "GBP"
merchant_id: 24
group_fulfilment: false
auto_fulfil_group_fulfilment: true
merchant_transaction_reference: "912321-2139433213-12323421_26062021"
total: 2500
sales_channel_id: 3
order_items: [
{
product_id: 3532
custom_price_modifier_value: 5000
fulfilment_method_id: 1
generate_card_reference: true
fulfilment_email: "[email protected]"
discounts: [{
discount_type_id: 1
value: 2500
}]
}
]
receipt_contact: {
email: "[email protected]"
first_name: "Toggler"
last_name: "Smith"
}
) {
id,
LineItems{
id
Card{
id
card_reference
pin
balance
expiry_time
card_alias_card_reference
product_name
}
}
}
}
Last updated