Skip to content

Commerce API

The Commerce API sells tickets: you create an order for a ticket group, take payment through one of the payment methods that ticket group offers, and look the order up afterwards. Its main resources are orders, the order items inside them, and the payment step that sends the buyer's browser to the payment provider.

Resources

Resource What it is
Order One purchase of tickets from one ticket group for one admit date, with the buyer's details and the payment status.
Order item One ticket line in an order: the ticket variant, unit price, quantity and the issued ticket code.
Order log A dated entry in an order's history, such as "Order Created" or a payment result.
Payment method A way to pay that a ticket group offers, for example online banking (FPX) or a card checkout page.
Payment step Where the buyer's browser goes next to pay: a form to post, or a page to open.
Bank One bank the buyer can choose for a payment method that needs a bank (FPX).

Authentication and permissions

Most routes are storefront routes and are public: a buyer doesn't need an account to buy. See Authentication for the tokens used by the other routes.

Action Who can call it
List payment methods, list banks, create an order, create a free order, start a payment Public: no token needed
Get an order by ID, look up a guest order by order number and email Public: no token needed
Create an order as a signed-in customer Optional customer token: when sent, the buyer details come from the customer account
List your own orders Customer token from the customer sign-in in the Identity API
List orders of a workspace (order management) Access token with workspace:orders:view in that workspace
Payment return and webhook routes Called by the payment provider, not by you

Base path

Commerce routes are served by CoreAPI on two paths without /v1:

https://<API_HOST>/api/…        orders
https://<API_HOST>/payment/…    payment methods, payment start and provider callbacks

Only order management takes a scope: {workspaceId}, the workspace that sells the ticket groups.

Capabilities

  • Paid orders for guests and signed-in customers
  • Free orders (total amount zero), issued at once without payment
  • Several payment methods per ticket group, chosen by the buyer
  • Online banking (FPX) with a bank list, and hosted card checkout pages
  • Order lookup by ID, by order number and email, and for the signed-in customer
  • Order management list with search, date filter and pagination
  • Refunds (planned)
  • Ticket validation at the gate through this API (planned)

Object model

Order

The order object is returned in two parts: orderProfile (the order) and ticketProfile (the ticket group it was bought from, the same object as in the Catalogue API).

Field Type Required Description
orderTicketGroupId integer always Read-only. ID of the order.
ticketGroupId integer always ID of the ticket group the tickets come from.
paymentProfileId string (UUID) optional ID of the payment method chosen when the order was created. Absent when none was chosen.
custId string always ID of the customer who bought the order. A guest buyer gets a customer record from their email.
orderNo string always Read-only. Order number shown to the buyer, for example 20260715TB004821937. Use it to start payment and for guest lookup.
transactionId string always Read-only. The payment provider's transaction ID. Empty until a payment result arrives.
transactionStatus string always Read-only. Payment status: initiate, pending, success or failed. See States.
displayStatus string always Read-only. A finer status for display: initiated, pending, success, abandoned, expired, rejected or failed.
statusMessage string optional Read-only. The payment provider's message for the last result, for example why a payment was rejected.
transactionDate string always Read-only. When the payment result was recorded, YYYY-MM-DD HH:MM:SS in Malaysia time (UTC+8). Empty before a result.
bankCode, bankName string optional Read-only. The bank chosen for an FPX payment.
programCd string optional The program booked, for a ticket group sold per program (for example a boat tour).
totalAmount number always Read-only. Order total in Malaysian ringgit (MYR), computed from the ticket variants' prices.
buyerName, buyerEmail string always Buyer's full name and email.
productDesc string always Read-only. Name of the ticket group at the time of the order.
billId, productId, msgToken string always Read-only. References the payment provider uses for this order.
entryDate, entryTime string always Admit date (YYYY-MM-DD), and the program departure time (HH:MM:SS) or empty.
orderTicketInfo array always The order items (below). Empty until tickets are issued.
orderTicketLog array always The order's history: orderTicketLogId, performedBy, type, title, message, date. Newest first.
createdAt, updatedAt string always Read-only. When the order was created and last changed.

Each order item in orderTicketInfo:

Field Type Description
orderTicketInfoId integer Read-only. ID of the order item.
itemId string ID of the ticket variant.
variant string Name of the ticket variant, for example Adult.
unitPrice number Price of one ticket in MYR.
quantityBought integer Number of tickets on this line.
itemDesc1, itemDesc2, itemDesc3 string Descriptions printed on the ticket.
printType string Print type of the ticket variant, as set in the park's ticketing system.
encryptedId string Ticket code shown as the QR code on the ticket.
twbid string Optional. Ticket ID from the park's ticketing system, when it issues one.
admitDate string Admit date of the ticket, YYYY-MM-DD.
{
  "orderProfile": {
    "orderTicketGroupId": 18342,
    "ticketGroupId": 1,
    "paymentProfileId": "7c1f3b0e-2a44-4d3c-9a51-3f0b8f2d6e10",
    "custId": "CUST-20260601-0042",
    "transactionId": "JP2607150001234",
    "orderNo": "20260715TB004821937",
    "transactionStatus": "success",
    "displayStatus": "success",
    "transactionDate": "2026-07-15 10:42:08",
    "bankCode": "MBB0228",
    "bankName": "Maybank2U",
    "msgToken": "01",
    "billId": "B2607150042",
    "productId": "TG1",
    "totalAmount": 50.0,
    "buyerName": "Aisyah Rahman",
    "buyerEmail": "aisyah@example.com",
    "productDesc": "Zoo Day Pass",
    "orderTicketInfo": [
      {
        "orderTicketInfoId": 40211,
        "orderTicketGroupId": 18342,
        "itemId": "VAR-001",
        "unitPrice": 25.0,
        "itemDesc1": "Adult",
        "itemDesc2": "General admission",
        "itemDesc3": "",
        "printType": "ticket",
        "quantityBought": 2,
        "encryptedId": "ZJ2026071500001",
        "admitDate": "2026-07-20",
        "variant": "Adult",
        "createdAt": "2026-07-15T02:42:10Z",
        "updatedAt": "2026-07-15T02:42:10Z"
      }
    ],
    "orderTicketLog": [
      {
        "orderTicketLogId": 90012,
        "orderTicketGroupId": 18342,
        "performedBy": "System",
        "type": "order",
        "title": "Order Created",
        "message": "Order was created via Online channel",
        "date": "2026-07-15 10:40:51",
        "createdAt": "2026-07-15T02:40:51Z",
        "updatedAt": "2026-07-15T02:40:51Z"
      }
    ],
    "entryDate": "2026-07-20",
    "entryTime": "",
    "createdAt": "2026-07-15T02:40:51Z",
    "updatedAt": "2026-07-15T02:42:10Z"
  },
  "ticketProfile": {
    "ticketGroupId": 1,
    "groupNameEn": "Zoo Day Pass"
  }
}

ticketProfile is shortened here; see the Catalogue API for every field.

Lists

Both order lists answer in the ticketing format, with the orders in result.orderTicketGroups, newest order first (highest orderTicketGroupId first). Each item is an order object as above (orderProfile and ticketProfile).

  • List your own orders is not paginated: it returns every order of the signed-in customer.
  • List orders of a workspace is paginated with page (from 1, default 1) and limit (default 10; values below 10 become 10 and values above 100 become 100). totalCount is the number of orders that match the filters on all pages, and hasNext is true when another page follows.
curl "https://<API_HOST>/api/orderTicketGroups/<WORKSPACE_ID>/management?page=1&limit=10" \
  -H "Authorization: Bearer <ACCESS_TOKEN>"
{
  "respCode": 2000,
  "respDesc": "Success",
  "result": {
    "orderTicketGroups": [
      {
        "orderProfile": {
          "orderTicketGroupId": 18342,
          "ticketGroupId": 1,
          "orderNo": "20260715TB004821937",
          "transactionStatus": "success",
          "displayStatus": "success",
          "totalAmount": 50.0,
          "buyerName": "Aisyah Rahman",
          "buyerEmail": "aisyah@example.com",
          "productDesc": "Zoo Day Pass",
          "entryDate": "2026-07-20"
        },
        "ticketProfile": { "ticketGroupId": 1, "groupNameEn": "Zoo Day Pass" }
      }
    ],
    "totalCount": 1,
    "hasNext": false,
    "page": 1,
    "limit": 10
  }
}

The order objects are shortened here. The list for your own orders has the same shape without totalCount, hasNext, page and limit.

Create-order request

Field Type Required Description
ticketGroupId integer yes ID of the ticket group to buy from.
date string yes Admit date, YYYY-MM-DD. Must be a date the ticket group sells.
langChosen string yes Language of the tickets and email: en, bm (Malay) or cn (Chinese).
tickets array yes Ticket lines: ticketId (ticket variant ID, string) and qty (integer, at least 1). The total quantity can't exceed the ticket group's order limit.
paymentType string yes (paid orders) fpx (online banking) or credit/debit.
mode string for fpx FPX account type: individual or corporate.
bankCode string for fpx Bank code from List banks.
paymentProfileId string (UUID) when the ticket group offers more than one payment method The payment method ID from List payment methods.
fullName, email, contactNo, identificationNo string for guests Buyer details. Send all four or none. A guest must send all four; a signed-in customer's details come from the account.
programCd string for ticket groups sold per program Program code, for example boattour. Ignored otherwise.
scheduleTime string optional Departure time for a program, HH:MM:SS. Ignored otherwise.

The free-order request has the same fields without paymentType, mode, bankCode and paymentProfileId.

Payment method

Field Type Description
id string (UUID) Payment method ID. Send it as paymentProfileId.
name string Name to show the buyer, for example Online banking.
provider string Payment provider: johorpay or stripe.
bankSelection boolean true when the buyer picks a bank first (FPX): call List banks.

Payment step

Field Type Description
kind string form_post: submit fields as an HTML form to url. redirect: open url.
url string Where the browser goes next.
fields object Form fields to post, for form_post only. Post them unchanged: they are signed.

States

An order's transactionStatus moves through these values:

transactionStatus Meaning What happens next
initiate Order created, no payment result yet. Start a payment. Still initiate 60 minutes after creation: moved to failed by a periodic check.
pending The payment provider reported the payment as still in progress. Wait for the final result. Still pending 120 minutes after the transaction date: moved to failed. You can't start another payment while pending.
success Paid, or a free order. Tickets are issued and emailed to the buyer. Final.
failed Payment rejected, cancelled, expired or never completed. Start a payment again, or create a new order.

displayStatus refines failed into rejected (declined by the bank), abandoned (cancelled, or never reached the provider) and expired (timed out). Use it for display only; branch on transactionStatus.

After the buyer pays, the payment provider sends the browser back to CoreAPI, which records the result once and redirects the browser to your storefront's /paymentRedirect page with orderTicketGroupId, transactionStatus and orderNo in the query string. On success, CoreAPI issues the tickets and emails them to the buyer. For the whole purchase, step by step, see Sell tickets online.

Errors

Order routes answer in the ticketing response format. A success has respCode 2000; an error has respCode 4000 and the reason in respDesc. Use the HTTP status to decide what to do:

{ "respCode": 4000, "respDesc": "Missing order number", "result": null }

Payment routes (/payment/…) answer { "success": false, "message": "…" } instead. A missing or invalid token answers 401 with { "message": "Unauthorized - …" }, and a missing permission on order management answers 403 with { "message": "Forbidden - Insufficient permissions" }.

Status When it happens What to do
400 A required field is missing or invalid, guest details are incomplete, the date or ticket variant isn't sold, or the ticket group can't be bought at the moment. Fix the request using respDesc or message.
400 paymentProfileId is required: this ticket group offers more than one payment method, or the method isn't offered. Send a paymentProfileId from List payment methods.
401 No valid token on a route that needs one. Sign in again.
403 The ticket quantity exceeds the ticket group's order limit, the customer token doesn't match a customer, or your role lacks workspace:orders:view. Lower the quantity, sign in again, or ask an admin for the permission.
404 The order or ticket group doesn't exist, or a guest lookup doesn't match. Check the ID, order number and email.
409 Start a payment on an order that is already paid, or whose payment is still pending. Read the order; don't pay twice.
500 The order could not be created or read. Retry later; if it persists, contact support with the orderNo.
502 Start a payment couldn't reach the payment provider. Retry the same call.

Example bodies:

400, order routes
{ "respCode": 4000, "respDesc": "Missing order number", "result": null }
400, payment routes
{ "success": false, "message": "orderNo is required" }
401, routes that need a token
{ "message": "Unauthorized - No token provided" }
403, missing permission
{ "message": "Forbidden - Insufficient permissions" }
403, order routes (quantity over the limit)
{
  "respCode": 4000,
  "respDesc": "Tickets quantity have exceeded the total limit allowed of 10",
  "result": null
}
404, order routes
{ "respCode": 4000, "respDesc": "Order ticket group not found", "result": null }

Starting a payment for an order number that doesn't exist answers 400 with "message": "Order not found", not 404. A 409 and a 502 come from the payment routes and use their format: { "success": false, "message": "…" }. A 500 on order routes is { "respCode": 4000, "respDesc": "Failed to create order: …", "result": null }.

Endpoints