Sell tickets online
Use this guide to sell tickets from your own storefront: the buyer picks tickets, pays with a payment method the ticket group offers, and gets the tickets by email. For every field and error, see the Commerce API.
Before you begin¶
- You know the ID of the ticket group to sell and the IDs of its ticket variants. Get them from the Catalogue API.
- Your storefront has a
/paymentRedirectpage, and its address is set for your deployment. The buyer comes back to this page after paying. - No token is needed for a guest buyer. For a signed-in customer, you have the customer token from the customer sign-in in the Identity API.
Steps¶
-
List the payment methods the ticket group offers.
Replace
<TICKET_GROUP_ID>with the ticket group ID. You get the methods to show the buyer: -
If the chosen method has
"bankSelection": true, list its banks and let the buyer pick one.curl -X POST "https://<API_HOST>/payment/bankList" \ -H "Content-Type: application/json" \ -d '{ "ticketGroupId": <TICKET_GROUP_ID>, "paymentProfileId": "<PAYMENT_METHOD_ID>", "mode": "individual" }'<PAYMENT_METHOD_ID>is theidfrom step 1. You get the banks; show those with"enabled": 1: -
Create the order.
curl -X POST "https://<API_HOST>/api/orderTicketGroup" \ -H "Content-Type: application/json" \ -d '{ "ticketGroupId": <TICKET_GROUP_ID>, "date": "2026-07-20", "langChosen": "en", "tickets": [ { "ticketId": "<TICKET_VARIANT_ID>", "qty": 2 } ], "paymentType": "fpx", "mode": "individual", "bankCode": "<BANK_CODE>", "paymentProfileId": "<PAYMENT_METHOD_ID>", "fullName": "Aisyah Rahman", "email": "aisyah@example.com", "contactNo": "+60123456789", "identificationNo": "900101-01-1234" }'<BANK_CODE>is thevaluefrom step 2. For a card method, send"paymentType": "credit/debit"and leave outmodeandbankCode. For a signed-in customer, add-H "Authorization: Bearer <CUSTOMER_TOKEN>"and leave out the four buyer fields. You get201 Createdwith the order ID: -
Read the order to get its order number.
The order is in
result.orderProfile, with"transactionStatus": "initiate"and itsorderNo, for example20260715TB004821937. -
Start the payment.
curl -X POST "https://<API_HOST>/payment/start" \ -H "Content-Type: application/json" \ -d '{ "orderNo": "20260715TB004821937" }'You get the payment step:
-
Send the buyer's browser on. For
"kind": "form_post", build an HTML form withmethod="post",actionset tourland one hidden input per entry infields, unchanged, and submit it. For"kind": "redirect", openurl.The buyer pays on the provider's page. Afterwards the browser lands on your
/paymentRedirectpage, for example/paymentRedirect?orderTicketGroupId=18342&transactionStatus=success&orderNo=20260715TB004821937.
Verify¶
On your /paymentRedirect page, read the order again (step 4) and check transactionStatus:
success: the tickets are issued and emailed to the buyer;orderTicketInfolists them.pending: the bank hasn't confirmed yet. Show "payment in progress" and read the order again later.failed: offer to pay again (step 5) or to start over.
A guest can find the order later with
GET https://<API_HOST>/api/orderNonMemberInquiry?orderNo=<ORDER_NO>&email=<EMAIL>.
Troubleshooting¶
| Symptom | Cause | Fix |
|---|---|---|
400 "paymentProfileId is required" |
The ticket group offers more than one payment method. | Send the id from step 1 as paymentProfileId. |
400 "All customer information … must be provided" |
A guest order without all four buyer fields. | Send fullName, email, contactNo and identificationNo, or a customer token. |
403 "Tickets quantity have exceeded the total limit" |
More tickets than the ticket group allows in one order. | Lower the quantities. |
409 "order has already been paid" |
The order is success. |
Don't pay again; show the order. |
409 "a payment for this order is still being processed" |
The order is pending. |
Wait for the final result. |
502 from Start a payment |
The payment provider couldn't be reached. | Retry step 5. |
Next steps¶
- Commerce API: every field, state and error
- Catalogue API: ticket groups and ticket variants