Payment Methods
An order can be paid in three ways: from your wallet, by your customer through the payment gateway, or by invoice.
Payment methods overview
-
Wallet (prepaid credits): You keep a balance of credits, and the order total is deducted when you finalize an order. Most API integrations use this. It is the simplest method, because there is no customer payment flow to handle.
-
Payment gateway: Your customer pays on All Aboard's hosted payment page, with a card, Apple Pay, Google Pay and more. The order is then finalized automatically. Use it for customer-facing booking sites.
-
Invoice: Orders are invoiced at the end of each month. Available to approved commercial clients.
Wallet (prepaid credits)
With the wallet you pay for credits in advance, and orders are paid from them when you finalize.
How it works
- Add credits to your wallet in the Dashboard.
- Create the order with
createOrder. - Finalize the order with
finalizeOrder. The order total is deducted from your credits.
Credits are only deducted when you finalize an order. An order that you create but don't finalize costs nothing.
Creating orders with wallet
You create and finalize the order yourself, without any payment redirect:
# Step 1: Create the order (pre-books tickets)
mutation CreateOrder {
createOrder(booking: "booking_m7318536n1f4t4m5c1r4c13685") {
id
status
}
}
# Step 2: Finalize the order (deducts credits, triggers ticket issuance)
mutation FinalizeOrder {
finalizeOrder(order: "order_93n495b3k721g1267292y1e7s3") {
id
status
}
}Creating the order can take up to 30 seconds, while the operators pre-book the tickets.
See Orders for more on creating and finalizing orders.
Currency
Every wallet holds euros, and top-ups are in EUR. A wallet still pays for orders in any currency. The order total is converted to EUR at the exchange rate fixed when the order was created and rounded to cents, and that EUR amount is deducted when you finalize the order.
A refund is credited to the wallet in EUR at the same rate as the deduction, not at the rate on the day of the refund. A full refund returns exactly what was deducted.
The transaction history in the Dashboard shows the amount in the order's currency next to each EUR entry, so you can reconcile an order priced in GBP or SEK against your wallet.
Managing your wallet
Top up the wallet, and see its balance and transaction history, in the Dashboard. None of this is available through the API. When the balance is too low, finalizeOrder fails with NOT_ENOUGH_FUNDS.
Payment gateway
Use the payment gateway when your customer pays for the order, for example on a booking site. The payment page is hosted by All Aboard, so you don't need payment processing of your own.
How it works
- Create an order with
createOrder. - Create a payment for the order with
createPayment. It returns a payment URL. - Redirect the customer to the payment URL, where they pay.
- The order is finalized automatically when the payment succeeds. You never call
finalizeOrderyourself. - The customer is redirected to your success page.
Creating a payment
Pass the order's id to createPayment as orderId:
# Step 1: Create the order (pre-books tickets)
mutation CreateOrder {
createOrder(booking: "booking_r0q5g1e09405k2g47056h7b0v1") {
id
}
}
# Step 2: Initialize payment for that order.
# Build successUrl from the id returned in step 1 (shown here as order_abc123).
mutation CreatePayment {
createPayment(
orderId: "order_abc123"
successUrl: "https://example.com/success/order_abc123"
cancelUrl: "https://example.com/cancel"
language: "sv"
) {
url
}
}language is an optional two-letter code, such as sv, that sets the language of the payment page. Without it, or with en, the page is in English.
Redirect the customer to the returned url. When they have paid:
- They are redirected to your
successUrl. - The order is finalized automatically.
- The tickets are issued.
Building the success URL
You create the order before the payment, so you already have its id. Put it in the successUrl, and in the cancelUrl if you need it there, so that the page the customer returns to can look up the order. The id can go in the path:
https://example.com/success/order_abc123or in a query parameter:
https://example.com/success?order=order_abc123You can also leave the filling in to us. Both URLs are URI templates: {order} is replaced with the order's id and {order_reference} with its reference, the short code a customer sees. https://example.com/success/{order} and https://example.com/success{?order_reference} both work.
Timeouts, retries and the back button
-
Timeouts: Creating the order pre-books tickets with the operators, which can take up to 30 seconds. Send
createOrderover a WebSocket to avoid timeouts. -
Retrying a payment: If the customer cancels or leaves the payment page, call
createPaymentagain with the sameorderId. Don't callcreateOrderagain for the same booking. With some operators that fails withBOOKING_ALREADY_USED. An order that is already paid or finalized can't be paid again, and fails withORDER_NOT_PAYABLE. -
The back button: A customer who uses the browser's back button, instead of canceling on the payment page, returns to your site while the payment may still be in progress. Make sure your page handles that.
Invoice billing
With invoice billing, your orders are collected during the month and invoiced at the end of it. You create and finalize orders in the same way as with the wallet, using createOrder and finalizeOrder. The invoice is paid by bank transfer.
Invoice billing requires a commercial agreement. Contact team@allaboard.eu to discuss it for your account.
For how fees are charged, how service fees work, and the monthly reconciliation, see Fees and Reconciliation.