CMS Tool API schema
Public API version 1.4.10.
Sales Order
Invoices, orders, baskets and quotes are all represented by this object, and differentiated by status.
Endpoint URL
https://api.cms-tool.net/api/order
/api/basket
Read and update shopping baskets and orders.
GET
List baskets, or retrieve one by appending its ID to the path.
Query parameters
| Name | Type | Example | Notes |
|---|---|---|---|
id | int | 123 | Filter results by id. |
mbr_id | int | 123 | Filter results by mbr id. |
orderedAfter | date | 2026-09-24 | Filter results by order date on or after this value. |
orderedBefore | date | 2026-09-24 | Filter results by order date on or before this value. |
paidAfter | date | 2026-09-24 | Filter results by payment date on or after this value. |
paidBefore | date | 2026-09-24 | Filter results by payment date on or before this value. |
readyToShip | boolean | true | Filter results to orders ready to ship. Accepts true or 1. |
readyToPick | boolean | true | Filter results to orders ready for picking, including orders shipped today for review. Accepts true or 1. |
isPaid | boolean | true | Filter results by whether payment has been completed. Accepts true or 1. |
isShipped | boolean | true | Filter results by whether shipping has been completed. Accepts true or 1. |
isCancelled | boolean | true | Filter results by whether the record has been cancelled. Accepts true or 1. |
includeBasketItems | boolean | true | Include basket items in the response. Accepts true or 1. |
offset | int | 123 | Skip this many matching records before returning results. |
pageSize | int | 123 | Limit the number of records returned. |
POST
Create or update a basket and optionally run a basket action.
Query parameters
| Name | Type | Example | Notes |
|---|---|---|---|
doAction | text | SendMerchantInvoice | Run a basket action. Available actions: CalculateTotals, UpdateShippingStatus, FinaliseOrder, ReduceStock, Cancel, ProcessOnPaidActions, ProcessPoints, SendInvoice, SendOrder, SendMerchantOrder, SendMerchantInvoice. |
Request content type: application/json
Request body fields
| Name | Type | Example | Notes |
|---|---|---|---|
mbr_id | int | 123 | Set the mbr id value. |
b_cust_email | text | customer@example.com | Set the b cust email value. |
b_cust_name | text | example | Set the b cust name value. |
basketItems | text | example | Set the basket items value. |
paymentTransactions | text | example | Set the payment transactions value. |
doAction | text | SendMerchantInvoice | Run a basket action. Available actions: CalculateTotals, UpdateShippingStatus, FinaliseOrder, ReduceStock, Cancel, ProcessOnPaidActions, ProcessPoints, SendInvoice, SendOrder, SendMerchantOrder, SendMerchantInvoice. |
Data definitions
| Field | Type | Description | Format | Example |
|---|---|---|---|---|
b_cust_phone | text | Customer Phone (not validated format) (Validation: Text) | ||
b_cust_country | text | Customer primary address (aka billing address) (Validation: Text) | ||
b_courier_ref | text | Courier tracking ticket number, for human viewing / readback, or for a human to copy and paste into a form (Validation: Text) | ||
b_custom_fields | text | JSON data structure of any additional custom questions asked during checkout. (Validation: Text) | ||
b_ship_city | text | Delivery address (aka gift address), used for API shipping calc (Validation: Text) | ||
b_cust_state | text | Customer primary address (aka billing address) (Validation: Text) | ||
b_shippingcalc | int | Shipping Method (Validation: Integer) | ||
b_ship_name | text | Name of intended recipient (Validation: Text) | ||
b_shopchannel | text | Indicates Website or POS, or Market place where order originated (Validation: Text) | ||
b_courier_notes | text | Notes given back to the customer about shipping status (Validation: Text) | ||
b_surcharge_fee | decimal | A fee added to an order, usually via some sort of customisation script that calculates a fee using javascript or similar, or simply a POS surcharge on an order. (Validation: Decimal) | ||
b_repeat_interval | interval | For repeating orders (aka subscriptions) this is the repeat interval (Validation: Interval) | 01:00:00 | |
b_created | timestamp | Draft order creation date (Validation: Timestamp) | 2025-12-31 23:59:59 | |
b_cust_suburb | text | Customer primary address (aka billing address) (Validation: Text) | ||
b_customer_savedon | timestamp | When customer saved this order / wishlist. (Validation: Timestamp) | 2025-12-31 23:59:59 | |
b_status | text | The status of an order, human readible. (Validation: Text) | ||
b_paypurchaseorder | text | Customers may provide their own purchase order number when checking out, for future reconcilation when the goods are received and documentation accounted for. (Validation: Text) | ||
b_cust_address | text | Customer primary address (aka billing address) (Validation: Text) | ||
b_repeated_from_bid | int | The last basket ID in the repeating order chain. (Validation: Integer) | ||
b_courier_url | text | A URL to a courier tracking site, that may or may not include a courier reference.. Presented to user as a clickable link (Validation: Text) | ||
b_repeat_target | timestamp | The target date for the draft order to be closed, and start the next draft order. Allows users to skip a repeatition. (Validation: Timestamp) | 2025-12-31 23:59:59 | |
b_id | serial | Unique Invoice Serial Number, aka ID (Validation: Integer) | 123456 | |
b_total_paid | decimal | Total amount of receipts received from the customer (Validation: Decimal) | ||
b_gift_message | text | A message to be provided where applicable for gift stores. (Validation: Text) | ||
b_preadj_tax | decimal | The value of b_total_tax, prior to post sale adjustments (Validation: Decimal) | ||
b_json_data | text | Nested data in JSON format for other purposes | ||
b_shippedon | timestamp | Time when order was marked as shipped. Primary indicator that an order has been collected or shipped or taken, essentially completing the order status. (Validation: Timestamp) | 2025-12-31 23:59:59 | |
b_confirmtermsandconditions | char | If T&C confirmed, this will be: T otherwise null | ||
b_total_discount | decimal | The total discount as calculated by promotions (excl sales tax) (Validation: Decimal) | ||
b_item_count | int | Number of line items (Validation: Integer) | ||
b_notes_confidential | text | Notes entered by merchant, that for for merchant / staff visibility only (Validation: Text) | ||
b_booking_resourceid | int | The staff member or room assigned to the booking (resource used by all products in the order) (Validation: Integer) | ||
b_cust_email | text | Customer Email (Validation: Text) | ||
b_ship_email | text | Email of intended recipient (Courier tracking sent here) (Validation: Text) | ||
b_remindernotes | text | If customer wishes to be reminded on an aniversary, then notes to themselves, perhaps persons name, or product serial number. (Validation: Text) | ||
b_version | int | If an order is re opened after being closed, then the version number will increment and affect the invoice ID (Validation: Integer) | ||
b_total_volume | text | The volume in cubed cm required to efficiently pack this whole order in one box. | ||
b_payment_method | text | Payment method in human readable form, but is actually the payment type code. (Validation: Text) | ||
b_closed | timestamp | The order date, when the draft order was submitted to be come a proper order. (Validation: Timestamp) | 2025-12-31 23:59:59 | |
b_payopid | int | Payment method as ID reference, to the settings related to the payment method. (Validation: Integer) | ||
b_staff_id | int | Sales person ID for POS users (Validation: Integer) | ||
b_address_quality | text | API results from address validation checker service, if enabled (Validation: Text) | ||
b_type | text | Identifies the type of orders that were saved prior to submitting them, eg wishlists or saved orders. (Validation: Text) | ||
b_reminderdue | date | If customer wishes to be reminded on an aniversary, then this is when they will be reminded next. (Validation: Timestamp) | 2025-12-31 | |
b_paycustcode | text | Customers may provide their account number when checking out, rather than payment. (Not validated) (Validation: Text) | ||
b_paidon | timestamp | Time once order payment was completed in full. Null if partially paid. Primary indicator of fully paid orders (Validation: Timestamp) | 2025-12-31 23:59:59 | |
b_emailjobid | int | If this order originated from a bulk email, then this was the bulk email ID | ||
b_points_earned_affiliate | decimal | Loyalty points earned by an affiliate who referred the sale. (Validation: Decimal) | ||
b_cust_postcode | text | Customer primary address (aka billing address) (Validation: Text) | ||
b_bill_email | text | Email address of accounts department (optional extra full address format) (Validation: Text) | ||
b_currency | text | Currency of order (Validation: Text) | ||
b_cancelled | timestamp | Time of cancellation if cancelled. Primary indicator of cancellation (Validation: Timestamp) | 2025-12-31 23:59:59 | |
b_reminderperiod | interval | If customer wishes to be reminded on an aniversary, then this is when they will be reminded (interval from the last order) (Validation: Interval) | 01:00:00 | |
b_total_transfee | decimal | Optional transaction fee that may be applied to final invoice, for use of certain payment methods. Transaction fees do not increase tax. (Validation: Decimal) | ||
mbr_id | int | Member ID / Customer ID (Validation: Integer) | ||
b_booking_finish | timestamp | The end booking time, may be selectable for rental items, but otherwise is the booking start plus the duration (Validation: Timestamp) | 2025-12-31 23:59:59 | |
b_total_adjustments_tax | decimal | Sales Tax (GST or VAT) related to adjustments if any (Validation: Decimal) | ||
b_wishlistid | int | Related wishlist ID if this order originated from a wedding list type picklist. (Validation: Integer) | ||
b_total_shipping | decimal | The total shipping fee (excl sales tax) (Validation: Decimal) | ||
b_quotedon | timestamp | Timestamp when this order was quoted. If null, then there was never a quote. | 2025-12-31 23:59:59 | |
b_total_savings | decimal | Marketing savings, based on discounts or promotions on offer, but does not affect the total column, except where identified in b_total_discounts. (Validation: Decimal) | ||
b_total_total | decimal | The final total after considering all charges, discounts, vouchers, taxes, transaction fees, and post sale adjustments (Validation: Decimal) | ||
b_total_vouchers | decimal | The total of vouchers applied to this order. (Sales tax neutral) (Validation: Decimal) | ||
b_ship_phone | text | Phone of intended recipient (provided to courier) (Validation: Text) | ||
b_cust_name | text | Customer Personal Name (Billing Name) (Validation: Text) | ||
b_ship_suburb | text | Delivery address (aka gift address) (Validation: Text) | ||
b_ship_country | text | Delivery address (aka gift address) (Validation: Text) | ||
basketItems | json | Nested array of basket items (order lines) | ||
b_paymentsummary | text | Human readible payment summary (Validation: Text) | ||
b_surcharge_reason | text | Some text related to the surcharge, human readible, visible on invoice. (Validation: Text) | ||
b_total_refunds | decimal | Total amount of any refunds given to the customer, in monetary form. (do not put discounts here) (Validation: Decimal) | ||
b_stock_allocated | bool | True if stock counts have been allocated to this order, such that if cancelled stock allocation will be refreshed. (Validation: Boolean) | ||
b_ipaddress | text | IP Address of the user who placed the order | ||
b_ship_state | text | Delivery address (aka gift address) (Validation: Text) | ||
b_booking_start | timestamp | The booking time (Validation: Timestamp) | 2025-12-31 23:59:59 | |
b_ship_company | text | Company Name of delivery address optional (Validation: Text) | ||
b_payment_card_id | int | ID of saved credit card that was or will be used to pay for this order | ||
b_cust_notes | text | Notes given by customer as part of their order (Validation: Text) | ||
b_points_earned | decimal | Loyalty points earned from this order (if submitted) (Validation: Decimal) | ||
b_cust_company | text | Customer Company name (Validation: Text) | ||
b_pref_delivery_time | text | Customers preferred delivery time, that can be free text in some situations (Validation: Text) | ||
b_total_deposit | decimal | If customer is prepaying a deposit only, then this is the amount of deposit required, and customer will be expected to pay the remaining value of b_total_total - b_total_paid (Validation: Decimal) | ||
page | int | All baskets are associated with the website page ID for the first product ordered. Some config settings exist to prevent split page orders. The Page ID is automatically assigned by CSV uploads and API connections. (Validation: Integer) | 123456 | |
b_value_redeemed | decimal | The monetary value of points redeemed on this order, that would have adjusted the total due of the order. (Validation: Decimal) | ||
b_invoice_id | text | Invoice Number (Validation: Text) | ||
b_affiliate | int | Affiliate ID for affiliate style commissions (Validation: Integer) | ||
b_cust_city | text | Customer primary address (aka billing address) (Validation: Text) | ||
b_uuid | text | Global Unique Identifier for the basket / order, soon to replace b_id | ||
b_booking_duration | interval | The total duration of the order, from a pricing perspective. (Validation: Interval) | 01:00:00 | |
b_points_redeemed | decimal | Loyalty points redeemed for this order (if submitted) (Validation: Decimal) | ||
b_wishlist_title | text | Only used if order is a wishlist (Validation: Text) | ||
b_ship_address | text | Delivery address (aka gift address) (Validation: Text) | ||
b_preadj_total | text | The value of b_total_total, prior to post sale adjustments, and excluding any payment surcharges | ||
b_ship_postcode | text | Delivery address (aka gift address), used for API shipping calc (Validation: Text) | ||
b_pref_delivery_timestamp | timestamp | Customers target delivery time in a timestamp format, that is better suited to sorting and filtering. (Validation: Timestamp) | 2025-12-31 23:59:59 | |
b_total_apishipping | decimal | Location for storing any shipping fee calculated from a live pricing API. This value may differ from b_total_shipping if surcharges applied. Assumption is a GST exclusive fee. (Validation: Decimal) | ||
b_readytoship | timestamp | Timestamp indicating an order has been picked/packed, and is ready to ship or collect by customer. (Validation: Timestamp) | 2025-12-31 23:59:59 | |
b_fx_rate | decimal | The decimal multiplier from merchant base currency to currency selected. (Validation: Decimal) | ||
b_total_grams | int | Total weight of all items in cart (Validation: Integer) | ||
b_is_domestic | int | Tax status, Domestic or International (Validation: Integer) | ||
b_total_adjustments | decimal | Total of adjustments post sale, eg credits for returned items or fees for shipping overage fees. (Validation: Decimal) | ||
b_status_updated | timestamp | The timestamp when the order status was last updated (Validation: Timestamp) | 2025-12-31 23:59:59 | |
b_total_qty | decimal | Total of all line item quantities (Validation: Decimal) | ||
b_total_tax | decimal | The total sales tax on the order (eg GST or VAT) (Validation: Decimal) | ||
b_promocode | text | Promotional Code = Discount Code (Validation: Text) |
basketItems — Sales Order Item Line data dictionary
| Field | Type | Description | Format | Example |
|---|---|---|---|---|
bi_id | serial | Unique ID of this basket item | ||
bi_custom_total | decimal | Total cost derived from product customisations used towards calculating the unit price | ||
bi_disc_amt | decimal | The discount value for the total line | ||
b_qty | decimal | Quantity of items purchased in this order line | ||
b_unit_price | decimal | Unit price of the product excluding tax, after any discounts were deducted, and this value includes any option pricing or customisation pricing. | ||
pid | int | ID of the product variant. Links to product.id. If the product has no variants, then pid = b_parentpid | ||
bi_line_total | decimal | Line total equals unit price multiplied by quantity, and does not include any sales tax. After discounts applied | ||
bi_custom_fields | text | Additional product customisations in a JSON array format. Contains all the other design/manufacture customer selections | ||
bi_staff_id | int | ID of the user who made an adjustment to this order, only used with adjustments | ||
bi_hold | bool | If this product line is on hold and not to be shipped with the current batch | ||
b_bookingid | int | ID of a booking if any | ||
bi_priceprediscount | decimal | The RRP unit price of the product prior to discounting excluding sales tax | ||
bi_adjusted_from_bi_id | int | ID of a reference item, eg if a credit is given for a returned item, then this will identify which line item was originally issued. | ||
b_bookingsummary | text | A summary of any booking details if any. This could be an appointment booking or an event. | ||
bi_shippedon | timestamp | Timestamp of when this line item was shipped, that may not be shipped as a whole order together | 2025-12-31 23:59:59 | |
b_size | text | Product option size | ||
bi_discountmessage | text | A message displayed to customer as to which promotion was used to discount their item line | ||
bi_json | json | Nested JSON structure for additional information for this item line, including stock picking status, loyalty points redemption | ||
b_option | text | Product option style or generic option | ||
bi_promoid | int | ID of the discount rule applied to this line item, if any | ||
bi_tax_amt | decimal | Sales tax total for the whole line | ||
bi_message | text | Warning message about stock availability, back order or any errors during processing of this order line | ||
b_eventattendeeid | int | ID of a member or customer who will attend an event that is being purchased by this line item | ||
b_colour | text | Product option colour | ||
bi_detail | text | A human friendly description of the product being purchased | ||
b_parentpid | int | ID of the main product purchased (not variant). Links to product.id | ||
bi_partof_bi | int | The ID of another basket item where this product is a part of another recipe combindation product. eg part of a gift basket or assembled item. | ||
bi_disc_amt_pos | decimal | Overide discount amount for the entire item line. Only staff can set this discount. When this approach used, no other discount rule applied | ||
b_id | int | Basket ID, foriegn key to basket.b_id |
Usage instructions and examples
Useful use cases for a courier company
1. Get all orders that are ready to ship (paid status)
Return all orders that are ready to ship. Use GET to retrieve the data.
EndPoint: https://api.cms-tool.net/webapps/api/basket?readyToShip=1
2. Update an existing order status as shipped (Courier approach)
Assuming you are a courier company, just provide only the minimal data to update your order. The data is provided as a "data" field, or as POST content in JSON format.
The UpdateShippingStatus action will update shipping dates and shipping status, and send a notification to the customer with the courier details, unless you also provide the parameter ?doNotSendNotification=1
EndPoint: https://api.cms-tool.net/webapps/api/order?doAction=UpdateShippingStatus
{
"id": 26845824,
"b_courier_ref": "999yourtrackcode999",
"b_courier_url": "https://mycourier.com/mytrackingsystem?trackcode=999yourtrackcode999"
}
3. Update an existing order to shipped status
Even though you will see attributes where you can set the shipping date and status, we request you do not use those, because you need a fuller understanding for partial fulfilment.
Use the UpdateShippingStatus action to ensure our logic will focus on items that were ready to ship, and not those that are held back.
Payment Transaction Recording
"authtxnref": "anything you want",
Credits and Adjustments
Credits and adjustments can be appended to the basket after it is closed. The user of the API is required to ensure they provide quality data and update the required order totals. For a proper audit trail, the original invoice total is b_preadj_total, and adjustments totaled into b_total_adjustments, and then b_total_total need to be manually updated to account for a final total. Additionally there are tax fields of a similar name. The additional attribute "allowInvalidProduct" is required if you are not going to provide a valid product ID. The b_preadj_total should not change per update. It is the original order total when the user first submitted/closed their order.
Sample Discount / Credit $10
Sample POA Shipping Fee $15
Sample
Based on our endpoints, we can expect to receive a sample output data as below. A full same output is provided at the bottom of this page.
endpoint: The end point that is being used
resultCount: The total number of results returned
data: The actual data desried
success: true or false depicting the success of the query
{
"b_cust_name": "my name",
"b_ship_address": "123 Street",
"b_ship_email": "name@myname.nz",
"basketItems": [
{
"b_qty": 1.000,
"pid": 2332685
...
}
],
}
Sample object
{
"id": 35462412,
"b_id": 35463057,
"mbr_id": 123456,
"b_status": "Paid",
"b_created": "2026-08-11 10:07:35.0",
"b_closed": "2026-08-11 10:22:52.0",
"b_paidon": "2026-08-11 10:22:52.0",
"b_status_updated": "2026-08-11 10:57:59.0",
"b_uuid": "f7134deb-9cb7-406a-914a-68780641a31c",
"b_booking_resourceid": 0,
"b_booking_duration": "00:00:00",
"b_custom_fields": {},
"b_shippingcalc": 0,
"b_wishlistid": 0,
"b_total_adjustments_tax": 0,
"b_total_transfee": 0,
"b_total_shipping": 0,
"b_surcharge_fee": 0,
"b_total_savings": 0,
"b_total_vouchers": 0,
"b_total_refunds": 0,
"b_total_total": 1021.2,
"b_total_paid": 110.10,
"b_total_qty": 2,
"b_total_tax": 133.2,
"b_payment_card_id": 0,
"b_points_earned": 0,
"b_total_deposit": 0,
"b_total_discount": 0,
"b_value_redeemed": 0,
"b_preadj_total": 1021.2,
"b_total_apishipping": 0,
"b_total_grams": 0,
"b_points_earned_affiliate": 0,
"b_total_adjustments": 0,
"b_cust_name": "my name",
"b_ship_email": "name@myname.nz",
"b_ship_address": "123 Street",
"b_paymentsummary": "Bank",
"b_repeated_from_bid": 0,
"b_stock_allocated": "t",
"b_json_data": {},
"page": 905,
"b_item_count": 2,
"b_notes_confidential": "",
"b_version": 0,
"b_total_volume": 0,
"refundTransactions": [],
"b_affiliate": 0,
"b_payopid": 0,
"b_staff_id": 0,
"b_points_redeemed": 0,
"b_fx_rate": 1,
"b_is_domestic": 1,
"b_emailjobid": 0,
"basketItems": [
{
"bi_promoid": 0,
"product": {},
"bi_tax_amt": 15,
"bi_id": 52577096,
"bi_message": "",
"b_eventattendeeid": 0,
"bi_disc_amt": 0,
"b_qty": 1,
"b_unit_price": 100,
"pid": 731833,
"bi_line_total": 100,
"bi_custom_fields": {},
"bi_detail": "Sample Product A",
"b_parentpid": 731833,
"bi_priceprediscount": 100,
"b_bookingid": 0,
"bi_partof_bi": 0,
"bi_disc_amt_pos": 0,
"bi_discountmessage": "",
"bi_json": {}
},
{
"bi_promoid": 0,
"product": {},
"bi_tax_amt": 15,
"bi_id": 52577097,
"bi_message": "",
"b_eventattendeeid": 0,
"bi_disc_amt": 0,
"b_qty": 2,
"b_unit_price": 100,
"pid": 731839,
"bi_line_total": 200,
"bi_custom_fields": {},
"bi_detail": "Sample Product B",
"b_parentpid": 731839,
"bi_priceprediscount": 120,
"b_bookingid": 0,
"bi_partof_bi": 0,
"bi_disc_amt_pos": 0,
"bi_discountmessage": "",
"bi_json": {}
}
],
"paymentTransactions": [
{
"gwtransid": "32423",
"transbystaffid": 0,
"authmsg": "Sample transaction",
"wgtpayopid": 11487,
"wgt_paymethod": "CashPOS",
"amtrec": 10,
"successfulpayment": "t",
"wgttimestamp": "2026-05-05 13:15:38.0",
"id": 9258050,
"callbacktime": "2026-05-05 13:15:38.0"
},
{
"gwtransid": "32424",
"transbystaffid": 0,
"authmsg": "Sample transaction",
"wgtpayopid": 11487,
"wgt_paymethod": "Bank",
"amtrec": 100.1,
"successfulpayment": "t",
"wgttimestamp": "2026-05-05 13:15:38.0",
"id": 9258051,
"callbacktime": "2026-05-05 13:15:38.0"
}
]
}
Machine-readable documentation
This documentation is also available as JSON or Markdown at the same URL. Request JSON with Accept: application/json or Markdown with Accept: text/markdown.