API reference · Testing

Sandbox

Simulate a customer paying, collecting and returning a car, with a test key.

post/sandbox/bookings/{reference}/{step}

Move a test booking forward

Test keys only

With a test key, simulate what happens in real life so you can watch your webhooks and your own code react: pay (the customer pays → confirmed), activate (the customer collects the car → active) and complete (the car is back → completed). Only test bookings made with test keys of your own business.

Path parameters

  • referencestringrequired

    The booking reference.

    Example: WC-7KQ2M9XA

  • stepstringrequired

    pay, activate or complete.

    payactivatecomplete

    Example: pay

Response 200

In data:

  • referencestringrequired

    e.g. WC-7KQ2M9XA. Show it to your customer.

  • statusenumrequired

    pending_paymentconfirmedactivecompletedcancelledexpired

  • testboolean

    True for a sandbox booking.

  • fromdate-timerequired

    ISO 8601 date-time.

  • todate-timerequired

    ISO 8601 date-time.

  • vehicleVehiclerequired
    Show 15 fields
    • idintegerrequired
    • titlestringrequired

      e.g. “2021 Toyota Camry”.

    • makestring
    • modelstring
    • yearinteger
    • classenumrequired

      economysedansuvvanluxury

    • transmissionenum

      automaticmanual

    • fuelenum

      petroldieselhybridelectric

    • seatsinteger
    • colourstring · nullable
    • photosarray of string
    • dailyRateintegerrequired

      Price per 24 hours.

    • depositinteger

      Refundable deposit.

    • locationobjectrequired
      Show 4 fields
      • idinteger
      • codestringrequired
      • namestring
      • citystring
    • ratingobject · nullable
      Show 2 fields
      • averagenumber

        Average of 1 to 5 stars, one decimal.

      • countinteger

        Published reviews of this car.

  • pickupobject
    Show 3 fields
    • codestring
    • namestring
    • instructionsstring · nullable
  • dropoffobject
    Show 2 fields
    • codestring
    • namestring
  • customerCustomer
    Show 3 fields
    • namestringrequired
    • emailstringrequired
    • phonestringrequired

      International format preferred, e.g. +2348031234567.

  • priceobjectrequired
    Show 9 fields
    • currencystring
    • daysinteger
    • linesarray of QuoteLine
      Show 6 fields
      • codestringrequired

        rental, an extra’s code, one_way or discount.

      • labelstringrequired
      • quantityinteger
      • unitAmountinteger

        Amount in kobo (₦1 = 100 kobo).

      • amountintegerrequired

        Negative for a discount.

      • pricingenum

        per_dayflatdiscount

    • listSubtotalinteger

      Amount in kobo (₦1 = 100 kobo).

    • discountobject · nullable
      Show 2 fields
      • codestring · nullable
      • amountinteger

        Amount in kobo (₦1 = 100 kobo).

    • subtotalinteger

      Amount in kobo (₦1 = 100 kobo).

    • depositinteger

      Amount in kobo (₦1 = 100 kobo).

    • totalinteger

      Amount in kobo (₦1 = 100 kobo).

    • refundedinteger

      Amount in kobo (₦1 = 100 kobo).

  • commissioninteger

    Your commission on this booking (businesses only).

  • flightNumberstring · nullable
  • checkedInAtdate-time · nullable

    ISO 8601 date-time.

  • arrivalNotestring · nullable
  • metadataobject

    Your own key/value pairs.

  • createdAtdate-time

    ISO 8601 date-time.

  • holdExpiresAtdate-time · nullable

    While unpaid: when the car is released.

  • checkoutUrlstring

    Send the customer here to pay (only while unpaid).

  • cancellationobject
    Show 8 fields
    • allowedboolean

      False once it is cancelled, collected or finished.

    • refundPercentinteger

      Share of the rental price refunded if cancelled right now: 100 (12 h or more before pick-up), 95 (6 to 12 h), 90 (under 6 h). The deposit always comes back in full.

    • rentalRefundinteger

      Amount in kobo (₦1 = 100 kobo).

    • feeinteger

      The cancellation fee that would be kept.

    • depositReturnedinteger

      Amount in kobo (₦1 = 100 kobo).

    • refundTotalinteger

      What goes back to the customer in all.

    • changesAtdate-time · nullable

      When the refund drops to the next level.

    • nextPercentinteger · nullable

      The refund percent from then on.

  • earlyReturnobject · nullable
    Show 7 fields
    • requestedAtdate-time · nullable

      When the customer asked to return early (the clock stops there if the car arrives within the grace period).

    • timeBasedPaidinteger

      The part of the rental price that is for time (spread evenly over the booked period).

    • bookedSecondsinteger
    • usedSecondsinteger
    • unusedSecondsinteger
    • rentalRefundinteger

      Refund for the unused time if the car is returned now.

    • depositReturnedinteger

      Amount in kobo (₦1 = 100 kobo).

  • overstayobject · nullable
    Show 5 fields
    • lateSecondsinteger

      Seconds past the return time.

    • graceSecondsinteger

      Free seconds after the return time.

    • billedSecondsinteger

      Late seconds that are charged (after the grace period).

    • ratePerHourinteger

      The late rate per hour, frozen when the booking was made.

    • chargeSoFarinteger

      The late charge if the car were handed back now (it runs to the second).

  • lateTermsobject
    Show 2 fields
    • ratePerHourinteger

      What a late return costs per hour (to the second) once the grace period has passed. Frozen when the booking was made.

    • graceMinutesinteger

      Free minutes after the return time.

  • tripUpdatesobject · nullable
    Show 2 fields
    • whatsappboolean

      True when the customer opted in to WhatsApp updates.

    • schedulearray of object
      Show 4 fields
      • stagestring
      • labelstring
      • atdate-time

        ISO 8601 date-time.

      • doneboolean
  • reviewobject
    Show 2 fields
    • allowedboolean

      True once the car is returned and no review has been left yet.

    • submittedAtdate-time · nullable

      ISO 8601 date-time.

  • returnedAtdate-time · nullable

    When the car was handed back.

  • balanceobject · nullable
    Show 2 fields
    • dueinteger

      What the customer still owes after the car came back (a late charge larger than the deposit).

    • paidAtdate-time · nullable

      ISO 8601 date-time.

  • settlementSettlement | null

    The closing statement, once the booking is cancelled or the car is back.

Errors

  • 401unauthorized: the API key is missing, wrong or revoked.
  • 403forbidden: this key may not do that (wrong plan, not a business, or the account is not approved).
  • 404not_found: no such thing, or it is not yours.
  • 409conflict or unavailable: not possible in the current state, or the car was just taken.
curl -X POST "https://engine-production-0004.up.railway.app/api/v1/sandbox/bookings/WC-7KQ2M9XA/pay" \
  -H "Authorization: Bearer wc_test_YOUR_KEY"
post/sandbox/orders/{reference}/{step}

Move a test purchase forward

Test keys only

With a test key: pay-deposit (→ reserved), pay-balance (the transfer reaches escrow → paid) and complete (car and papers handed over → completed).

Path parameters

  • referencestringrequired

    The order reference.

    Example: WS-4HZ8P2LD

  • stepstringrequired

    pay-deposit, pay-balance or complete.

    pay-depositpay-balancecomplete

    Example: pay-deposit

Response 200

In data:

  • referencestringrequired

    e.g. WS-7KQ2M9XA.

  • statusenumrequired

    pending_paymentreservedpaidcompletedcancelledexpired

  • testboolean
  • vehicleVehiclerequired
    Show 15 fields
    • idintegerrequired
    • titlestringrequired

      e.g. “2021 Toyota Camry”.

    • makestring
    • modelstring
    • yearinteger
    • classenumrequired

      economysedansuvvanluxury

    • transmissionenum

      automaticmanual

    • fuelenum

      petroldieselhybridelectric

    • seatsinteger
    • colourstring · nullable
    • photosarray of string
    • dailyRateintegerrequired

      Price per 24 hours.

    • depositinteger

      Refundable deposit.

    • locationobjectrequired
      Show 4 fields
      • idinteger
      • codestringrequired
      • namestring
      • citystring
    • ratingobject · nullable
      Show 2 fields
      • averagenumber

        Average of 1 to 5 stars, one decimal.

      • countinteger

        Published reviews of this car.

  • buyerCustomer
    Show 3 fields
    • namestringrequired
    • emailstringrequired
    • phonestringrequired

      International format preferred, e.g. +2348031234567.

  • priceobjectrequired
    Show 5 fields
    • currencystring
    • totalinteger

      Amount in kobo (₦1 = 100 kobo).

    • depositinteger

      Amount in kobo (₦1 = 100 kobo).

    • balanceDueinteger

      Amount in kobo (₦1 = 100 kobo).

    • refundedinteger

      Amount in kobo (₦1 = 100 kobo).

  • commissioninteger

    Your referral commission (businesses only).

  • holdExpiresAtdate-time · nullable

    ISO 8601 date-time.

  • reservedUntildate-time · nullable

    While reserved: when the hold ends.

  • metadataobject
  • createdAtdate-time

    ISO 8601 date-time.

  • checkoutUrlstring

    The deposit payment link (while unpaid).

Errors

  • 401unauthorized: the API key is missing, wrong or revoked.
  • 403forbidden: this key may not do that (wrong plan, not a business, or the account is not approved).
  • 404not_found: no such thing, or it is not yours.
  • 409conflict or unavailable: not possible in the current state, or the car was just taken.
curl -X POST "https://engine-production-0004.up.railway.app/api/v1/sandbox/orders/WS-4HZ8P2LD/pay-deposit" \
  -H "Authorization: Bearer wc_test_YOUR_KEY"