Skip to content

Orders

Cancel an order or request the cancellation of its services

Section titled “Cancel an order or request the cancellation of its services”

POST /v1/orders/{id}/cancel · scope orders:write · destructive — cannot be undone · idempotent

A pending order (unpaid) is voided at once. An active order gets a cancellation request per service, which WHMCS executes immediately or at the end_of_cycle. This call destroys nothing by itself; backups are kept according to the product policy.

Terminal window
curl https://api.truo.cloud/v1/orders/ord_245/cancel \
-X POST \
-H "Authorization: Bearer $TRUO_TOKEN"

operationId: orders.cancel

POST /v1/orders · scope orders:write · reversible · asynchronous · idempotent

Creates the order in WHMCS and returns an operation to follow (202 + Location). If the invoice is settled at once (free, 100 % promo code, or account credit), the order is accepted and provisioning starts: the operation goes runningsucceeded with result.service when the service is active (for WordPress, when the site is up). If the invoice needs a payment, the operation stays pending with result.invoice.payment_url until it is paid; there is no timeout on that. An accepted order that is not active after 30 minutes fails with provisioning_timeout.

Everything that can be rejected without touching WHMCS is rejected first: unknown product or cycle, invalid promo code (invalid_promocode), taken WordPress site name (hostname_taken), bad options.

Idempotency-Key is required: a retry without it would be a second purchase.

Terminal window
curl https://api.truo.cloud/v1/orders \
-X POST \
-H "Authorization: Bearer $TRUO_TOKEN"

operationId: orders.create

GET /v1/orders/{id} · scope orders:read

The order, its invoice (if any) and the services it created. An order of another account is a 404.

Terminal window
curl https://api.truo.cloud/v1/orders/ord_245 \
-H "Authorization: Bearer $TRUO_TOKEN"

operationId: orders.get

GET /v1/orders · scope orders:read

Terminal window
curl https://api.truo.cloud/v1/orders \
-H "Authorization: Bearer $TRUO_TOKEN"

operationId: orders.list

List the payment methods available to this account

Section titled “List the payment methods available to this account”

GET /v1/orders/payment-methods · scope orders:read

What payment_method accepts when ordering. The one flagged default is used when omitted. An order whose invoice cannot be settled with account credit stays pending until it is paid through the panel with one of these.

Terminal window
curl https://api.truo.cloud/v1/orders/payment-methods \
-H "Authorization: Bearer $TRUO_TOKEN"

operationId: orders.payment_methods.list

GET /v1/orders/products · scope orders:read

The orderable catalog, priced in the account currency. product is the stable slug to pass to POST /v1/orders; prices lists the cycles actually sold; options the configurable choices. Hidden and retired products are not listed and cannot be ordered. The whole catalog fits in one page by default (limit defaults to 100 here); filter with family (e.g. wordpress, vps).

Terminal window
curl https://api.truo.cloud/v1/orders/products \
-H "Authorization: Bearer $TRUO_TOKEN"

operationId: orders.products.list