Toggle Developers
HomeAcademy
  • Welcome
  • GraphQL
    • Getting started
    • Exploring our API
    • Authentication
    • API playground
    • Error handling
  • Key concepts
    • Overview
      • Orders, Transactions & Line Items
      • Card number formats
  • Basics
    • Create a card
    • Check a card balance
    • Redeem a card
  • Webhooks
    • Overview
      • Getting started
      • Authentication & responses
    • Events
      • Card.balance_adjusted
      • Card.card_reference_updated
      • Card.expiry_reminder
      • Card.registered
      • Card.send_recipient_email
      • Card.resend_recipient_email
      • Order.created
      • Order.cancelled
      • Order.send_receipt_email
      • Order.send_cancellation_email
      • Payment.failed
      • Payment.review_opened
      • Fulfilment.dispatched
  • Partner Guides
    • EPOS & Ordering
      • Overview
      • Accreditation
      • Configuration variables
      • Playground examples
      • Physical card orders
      • Custom validity rules
      • Balance check
      • Redemptions & top-ups
      • Reversals
    • Guest gratuity
      • Overview
      • Accreditation
      • Configuration variables
      • Playground examples
      • Creating a card
      • Cancelling a card
      • Register a card
    • CRM
      • Overview
      • Historic data via GraphQL
      • Real time data via webhooks
Powered by GitBook
On this page
  • Where should I get the card reference when creating an order?
  • What product ID should you use?
  • What value should I use for "total"?
  • Common troubleshooting tips
  1. Partner Guides
  2. EPOS & Ordering

Physical card orders

PreviousPlayground examplesNextCustom validity rules

Last updated 3 years ago

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

Where should I get the card reference when creating an order?

The use-case here is that a POS operative would have a stack of unused cards (not associated with an order yet) on-site which would be keyed or swiped/scanned in as the card order is created on EPOS.

So to simulate this scenario while developing, you need some 'blank' cards to create orders with. If you haven't yet been provided any, ask our support team to create some card numbers, which we will provide to you as a CSV.

You can then use card numbers from the CSV during development, as if they were unsold stock on site.

You will also need to switch your account to use Magnetic Stripe cards under .

What product ID should you 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.

There is an example query of how to retrieve a list of products on the .

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.

What value should I use for "total"?

This should equal the total of the cards being created. e.g. if a customer is buying 1x card for £20, the total would be 2000. If they are buying 2x £20 cards, and it’s being done as a single order, the total would be passed as 4000.

Common troubleshooting tips

Unit EPOS Reference errors

If you receive this validation response:

"unit_epos_reference" : [
 "This field is not of an expected value"
]

This is because the unit_epos_reference you are passing in to the createOrder mutation is not set up in Toggle yet, or is incorrectly typed in.

These references are site specific IDs that allow you to programmatically indicate back to Toggle which physical location this transaction is taking place in. We have an interface in Toggle where a user adds their sites/locations and specifies what the EPOS reference is for each one as they do so.

For example:

The card number generated isn't the one provided

Toggle sites

If you create an order for a card and provide a card number, but the generated card number returned isn't the one you provided, check to make sure your Toggle account is set to use Magnetic Stripe cards under .

Take a look at the playground example >
General Settings
API playground
Settings > General