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.
curl https://api.truo.cloud/v1/orders/ord_245/cancel \ -X POST \ -H "Authorization: Bearer $TRUO_TOKEN"truo orders cancel ord_245await truo.orders.cancel("ord_245");truo_orders({ "action": "cancel", "id": "ord_245"})operationId: orders.cancel
Order a product
Section titled “Order a product”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 running → succeeded 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.
curl https://api.truo.cloud/v1/orders \ -X POST \ -H "Authorization: Bearer $TRUO_TOKEN"truo orders createawait truo.orders.create();truo_orders({ "action": "create"})operationId: orders.create
Get an order
Section titled “Get an order”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.
curl https://api.truo.cloud/v1/orders/ord_245 \ -H "Authorization: Bearer $TRUO_TOKEN"truo orders get ord_245await truo.orders.get("ord_245");truo_orders({ "action": "get", "id": "ord_245"})operationId: orders.get
List the account’s orders
Section titled “List the account’s orders”GET /v1/orders · scope orders:read
curl https://api.truo.cloud/v1/orders \ -H "Authorization: Bearer $TRUO_TOKEN"truo orders listawait truo.orders.list();truo_orders({ "action": "list"})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.
curl https://api.truo.cloud/v1/orders/payment-methods \ -H "Authorization: Bearer $TRUO_TOKEN"truo orders payment-methodsawait truo.orders.payment_methods.list();truo_orders({ "action": "payment_methods_list"})operationId: orders.payment_methods.list
List the products this account can order
Section titled “List the products this account can order”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).
curl https://api.truo.cloud/v1/orders/products \ -H "Authorization: Bearer $TRUO_TOKEN"truo orders productsawait truo.orders.products.list();truo_orders({ "action": "products_list"})operationId: orders.products.list