Orders

An order represents a comittment to book and holds all the ticket and passes of a booking. Only once an order has been finalized will the booking be confirmed and tickets issued.

There are two ways of creating an order; either by creating a payment or by manually creating an order. The latter is a privileged operation and requires a special commercial configuration.

Create Order

When creating an order, the selected fares are pre-booked. Depending on the underlying carreir systems, this process can be slow and is recommended to be performed over WebSocket. Typically, you want to collect the payment from the end customer after this step.

Privileged access

Manually creating an order is a privileged operation and requires a special commercial configuration. The easiest way to complete orders is to use Payments via the All Aboard API. If you want to process payments yourself, please contact us at team@allaboard.eu.

Example: Create an order
graphql
mutation CreateOrder {
  createOrder(booking: "ef4a677c-6f73-43bc-a6d0-8542d3747d06") {
    id
    status
    reference
  }
}
mutation CreateOrder {
  createOrder(booking: "c116929b-17b3-4312-a382-f848e0c780cf") {
    id
    status
    reference
  }
}

Finalize Order

If you process payments yourself, you need to finalize the order after the payment has been completed. This will finalize the booking and issue tickets.

Example: Finalize order
graphql
mutation FinalizeOrder {
  finalizeOrder(id: "58420c7b-7753-45d0-96e8-a4ef3be66bc2") {
    id
    status
    reference
  }
}
mutation FinalizeOrder {
  finalizeOrder(id: "169d1ab2-8f6b-4755-a0d9-95828feb3af7") {
    id
    status
    reference
  }
}