Skip to main content

Delivery Status

Billease Transaction API →

As an order progresses, tell us where it is so we can keep the customer updated in the app. This uses the standard transaction-update endpoint with one extra field, delivery_status.

POST https://trx.billease.ph/be-transactions-api/trx/{id}/update
Authorization: Bearer <your-token>
Content-Type: application/json
{
"order_id": "order-123",
"delivery_status": "DISPATCHED"
}

{id} is the Billease transaction UUID; order_id is the reference we sent you on POST /trx/transaction. Both must point at the same order, or the update is rejected.

Call it every time the status changes. Re-sending the status the order is already in is safe and returns 200.

Delivery status flow and status codes

The status codes

StatusRequired?Meaning
ORDER_RECEIVEDNoAlready implied by your successful POST /trx/transaction response; you do not need to send it.
IN_PROCESSOptionalBeing prepared / packed
DISPATCHEDRequiredHanded to the courier / out for delivery
DELIVERY_SUCCESSFULRequiredDelivered to the customer
DELIVERY_FAILEDRequiredDelivery attempt failed or could not be completed

At minimum, send DISPATCHED and then one of DELIVERY_SUCCESSFUL or DELIVERY_FAILED.

ORDER_RECEIVED ──▶ IN_PROCESS ──▶ DISPATCHED ──┬──▶ DELIVERY_SUCCESSFUL
│ (optional) │
└───────────────────────────────────────▶└──▶ DELIVERY_FAILED

status and delivery_status

They are two different things, and the endpoint accepts either or both.

FieldGovernsWho uses it
statusThe transaction: OK to confirm, CAN to cancelStandard checkout
delivery_statusThe physical goodsDeals partners

status and delivery_status are independent. For a Deals order the status field is inert: the transaction is already approved on our side, so any status value (including CAN) is rejected and cannot change or reverse it. Reverse it through the refund process instead; only delivery_status has any effect.

Refunds

There is deliberately no REFUNDED delivery status. Refunds are a first-class flow of their own:

POST /trx/{id}/refund

It settles the money, marks the individual items refunded, folds into your net-proceeds accounting and returns a refund_id you can poll with GET /trx/refund/{refund_id}. A delivery status could do none of that.

Checking our view of a transaction

To confirm what Billease believes about a transaction after a timeout, or when your record and ours disagree, read it back:

EndpointReturns
GET /trx/{id}/statusCurrent status, order_id, timestamps
GET /trx/{id}The full transaction
GET /trx/{id}/historyEvery status transition, timestamped

These are the same endpoints every Billease merchant has. GET /trx/{id}/history is the quickest way to see whether a transaction was cancelled and when.

Errors

StatusMeaning
400Malformed request, or an unrecognized delivery_status
401Missing or invalid JWT
500Error on our side. Safe to retry.