Create an order, take a PIN payment and invoice items#
This guide walks through creating an order, executing a PIN terminal payment, and generating an invoice for the order items.
Overview#
- Create an order with
createOrder - Add items to the order with
addItemsToOrder - Attach a PIN payment method with
addPaymentMethodToOrder - Execute the payment on the terminal with
executePayment - Fetch the order's inventory item IDs with the
itemsquery - Invoice the items with
invoiceItemsand retrieve the invoice
Step 1 — Create an order#
Input: CreateOrderInput!
| Name | Type | Required | Description |
|---|---|---|---|
channel_id | String | Optional | The channel (storefront) to create the order in. |
Returns: Order
| Name | Type | Required | Description |
|---|---|---|---|
id | ID! | Required | The ID |
number | String! | Required | Order number |
total | Money! | Required | Total value |
currency | Currency! | Required | Currency code |
Save the returned order.id — you'll use it in every subsequent step.
Step 2 — Add items#
Input: AddItemsToOrderInput!
| Name | Type | Required | Description |
|---|---|---|---|
order_id | String! | Required | The order to add items to. |
items | [OrderItemInput!]!▾ | Required | Items to add. |
Returns: Order
| Name | Type | Required | Description |
|---|---|---|---|
id | ID! | Required | The ID |
number | String! | Required | Order number |
total | Money! | Required | Total value |
currency | Currency! | Required | Currency code |
Step 3 — Add a PIN payment method#
Use addPaymentMethodToOrder to register a PIN payment. Pass the terminal_id of the physical payment terminal to route the transaction to the correct device.
Input: AddPaymentMethodToOrderInput!
| Name | Type | Required | Description |
|---|---|---|---|
order_id | String! | Required | The order ID. |
method_id | String! | Required | The payment method ID (use `paymentMethods` query to list available methods). |
issuer_id | String! | Required | The payment issuer ID. |
terminal_id | String | Optional | The PIN terminal ID. Required for in-person PIN payments. |
drawer_id | String | Optional | The cash drawer ID (for cash payments). |
Returns: Order
| Name | Type | Required | Description |
|---|---|---|---|
id | ID! | Required | The ID |
number | String! | Required | Order number |
total | Money! | Required | Total value |
currency | Currency! | Required | Currency code |
payments[0].details.id from the response — this is the payment_id needed in step 4.Step 4 — Execute the payment#
Send the payment to the terminal with executePayment. The terminal will prompt the customer to tap or insert their card.
Input: ExecutePaymentInput!
| Name | Type | Required | Description |
|---|---|---|---|
payment_id | String! | Required | The payment ID from `addPaymentMethodToOrder` (i.e. `order.payments[0].details.id`). |
Returns: ExecutePaymentPayload
| Name | Type | Required | Description |
|---|---|---|---|
payment | Payment▾ | Optional | The executed payment |
payment.status transitions to PAID once the terminal confirms the transaction. Poll the order query or listen for a webhook event to detect completion.Step 5 — Fetch inventory item IDs#
To invoice the items, you need the CollectionItem IDs for the order. Query the items endpoint filtered by order_id:
Step 6 — Invoice the items#
Use invoiceItems to generate an invoice for all or a subset of items. Pass the CollectionItem IDs from step 5.
Input: InvoiceItemsInput!
| Name | Type | Required | Description |
|---|---|---|---|
items | [String!]! | Required | CollectionItem IDs to include on the invoice. |
invoice_id | String | Optional | Existing invoice ID to add the items to. Omit to create a new invoice. |
Returns: InvoiceItemsPayload
| Name | Type | Required | Description |
|---|---|---|---|
invoice | Invoice▾ | Optional | The created invoice |
The response includes pdf_url — a direct link to download the invoice PDF.
Notes#
Moneyvalues (total,amount) are integers in cents — e.g.4998= € 49,98.- Use the
paymentMethodsquery to find validmethod_idandissuer_idvalues for your channel. - You can invoice a subset of items by passing only some IDs — useful for partial fulfilment.
- To retrieve the invoice later, use the
invoice(id: ...)query with the invoice ID from the response. - See Authentication for how to pass your API key.