Payments

The All Aboard API supports three ways to pay for orders, each suited to different use cases.

Payment Methods Overview

  1. Wallet (Pre-paid Credits): Most API integrations use this. You maintain a balance of credits that are deducted when orders are finalized. Designed for automated systems and high-volume operations.

  2. Payment Gateway: For collecting payment directly from end customers. Redirects customers to All Aboard's hosted payment page, then automatically completes the order. Supports credit cards, Apple Pay, Google Pay, and more.

  3. Invoice: Monthly invoicing for vetted commercial clients. Orders are billed at month-end.

Most API users use the wallet system. It's the simplest for programmatic integrations and doesn't require handling customer payment flows.

Wallet (Pre-paid Credits)

The wallet system lets you pre-pay for credits that are used automatically when you finalize orders. This is the recommended approach for most API integrations.

How It Works

  1. Add credits to your wallet via the Dashboard or API
  2. Create orders using createOrder mutation
  3. Finalize orders using finalizeOrder mutation. Credits are deducted automatically.
  4. Monitor balance in the Dashboard

Credits are deducted only when you finalize an order. If you create an order but don't finalize it, no credits are used.

Creating Orders with Wallet

When using wallet credits, you create and finalize orders directly. No payment redirects needed:

graphql
# Step 1: Create the order (pre-books tickets)
mutation CreateOrder {
  createOrder(booking: "db071b1a-62f2-4961-84ab-f6ff1f6f47a8") {
    id
    status
  }
}

# Step 2: Finalize the order (deducts credits, triggers ticket issuance)
mutation FinalizeOrder {
  finalizeOrder(order: "order-id") {
    id
    status
  }
}
# Step 1: Create the order (pre-books tickets)
mutation CreateOrder {
  createOrder(booking: "76e36226-fce7-464f-bc33-fe84e9bacc2f") {
    id
    status
  }
}

# Step 2: Finalize the order (deducts credits, triggers ticket issuance)
mutation FinalizeOrder {
  finalizeOrder(order: "order-id") {
    id
    status
  }
}

Both operations happen immediately. The order is created, tickets are pre-booked, then finalized, all in your control.

See Orders for complete details on the order creation flow.

Managing Your Wallet

  • Add credits: Use the Dashboard to top up your wallet balance
  • Check balance: View your current balance and transaction history in the Dashboard
  • Automatic deduction: Credits are deducted when you finalize orders. No manual payment steps.

Payment Gateway

The payment gateway is for collecting payment directly from end customers. The payment flow is hosted on the All Aboard website, so you don't need to set up your own payment processing.

When to Use Payment Gateway

Use the payment gateway when:

  • You're building a customer-facing booking platform
  • You need to collect payment from end users
  • You want card payments, Apple Pay, Google Pay, and similar methods

Most API integrations don't need this; they use wallet credits instead.

How It Works

  1. Create a payment for a booking. This returns a payment URL.
  2. Redirect customer to the All Aboard payment page
  3. Customer pays on the hosted payment page
  4. Order is automatically created and finalized after successful payment
  5. Customer is redirected back to your success page

The payment gateway handles order creation and finalization automatically. You don't need to call createOrder or finalizeOrder.

Creating a Payment

graphql
mutation CreatePayment {
  createPayment(
    booking: "93718907-6858-42f9-8fa5-44a5c3b3bbd5"
    successUrl: "https://example.com/success/{order}"
    cancelUrl: "https://example.com/cancel"
  ) {
    url
  }
}
mutation CreatePayment {
  createPayment(
    booking: "3fe13ded-3ce9-4f9c-8dcd-c3529288e0b2"
    successUrl: "https://example.com/success/{order}"
    cancelUrl: "https://example.com/cancel"
  ) {
    url
  }
}

Redirect the customer to the returned url (All Aboard's payment page). After payment:

  • They're redirected to successUrl with the order ID
  • The order is automatically created and finalized
  • Tickets begin issuing automatically

URL Templates

The successUrl and cancelUrl support URI template substitution. Use {order} to include the order ID:

  • {order}: Order ID in path https://example.com/success/abc123
  • {?order}: Order ID as query param https://example.com/success?order=abc123
  • {&order}: Order ID as additional query param https://example.com/success?foo=bar&order=abc123

Important Notes

  • Use WebSocket: Creating a payment also creates an order (which pre-books tickets). This can take up to 30 seconds, so use WebSocket connections to avoid timeouts.

  • Single payment per booking: Due to technical limitations, with some operators it is only possible to create one payment attempt per booking. If a customer cancels and you need to retry but get an BOOKING_ALREADY_USED error, create a new booking first.

  • Browser back button: If customers use the browser back button (instead of canceling on the payment page), they return to your site but the payment may still be processing. Handle this gracefully in your UI.

Invoice Billing

Invoice billing is available for vetted commercial clients with established relationships. Orders are accumulated throughout the month and invoiced at month-end.

How It Works

  1. Create orders using createOrder mutation
  2. Finalize orders using finalizeOrder mutation
  3. Orders are tracked for monthly invoicing
  4. Receive invoice at month-end with all orders
  5. Pay invoice via bank transfer

The order creation flow is identical to wallet credits. You use createOrder and finalizeOrder. The difference is billing happens monthly via invoice instead of immediate credit deduction.

Getting Invoice Access

Invoice billing requires a commercial agreement. Contact team@allaboard.eu to discuss invoice billing for your account.

For how fees are charged, how service fees work, and monthly reconciliation, see Fees and Reconciliation.

Choosing a Payment Method

Use Wallet if:

  • You're building an API integration
  • You want simple, programmatic payment handling
  • You're comfortable pre-paying for credits
  • You handle high volumes

Use Payment Gateway if:

  • You're building a customer-facing booking site
  • You need to collect payment from end users
  • You want hosted card payments and security handled by All Aboard

Use Invoice if:

  • You have a commercial agreement with All Aboard
  • You prefer monthly billing over pre-paid credits
  • You're processing high volumes with established billing terms

Most API users start with wallet credits. It's the simplest path and doesn't require payment processing setup.

Next Steps

  • Using wallet? See Orders for details on creating and finalizing orders
  • Using payment gateway? See the examples above for the payment flow
  • Need help choosing? Contact team@allaboard.eu