Create a card
Simple card creation
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 using the Products query. |
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 . |
API call
Variables
mutation(
$account_id : Int!
$order_items : [OrderItemInput]!
$total : Int!
$currency : String!
$group_fulfilment : Boolean!
$sales_channel_id : Int!
$auto_fulfil_group_fulfilment : Boolean!
$merchant_id : Int!
) {
createOrder(
account_id : $account_id,
order_items : $order_items,
total : $total,
currency : $currency,
group_fulfilment : $group_fulfilment,
sales_channel_id : $sales_channel_id,
auto_fulfil_group_fulfilment : $auto_fulfil_group_fulfilment,
merchant_id : $merchant_id
) {
LineItems{
Card{
id,
card_reference,
pin,
balance
}
}
}
}
{
"account_id": 3,
"order_items": [
{
"product_id": 1591,
"custom_price_modifier_value": 1000, // £10 card
"fulfilment_method_id": 8, // "Third party"
"discounts": [
{
"discount_type_id": 1, // Discount type "FOC"
"value": 1000 // £10 discount
}
]
}
],
"currency": "GBP",
"total": 0, // No money taken for this card, so transaction total is "£0"
"group_fulfilment": true, // Mandatory
"sales_channel_id": 3, // 3 = "In store"
"auto_fulfil_group_fulfilment": true, // don't hold order open pending dispatch
"merchant_id" : 26 // 26 = "Third party" merchant
}
Last modified 2yr ago