CMS Tool API

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

NameTypeExampleNotes
idint123Filter results by id.
mbr_idint123Filter results by mbr id.
orderedAfterdate2026-09-24Filter results by order date on or after this value.
orderedBeforedate2026-09-24Filter results by order date on or before this value.
paidAfterdate2026-09-24Filter results by payment date on or after this value.
paidBeforedate2026-09-24Filter results by payment date on or before this value.
readyToShipbooleantrueFilter results to orders ready to ship. Accepts true or 1.
readyToPickbooleantrueFilter results to orders ready for picking, including orders shipped today for review. Accepts true or 1.
isPaidbooleantrueFilter results by whether payment has been completed. Accepts true or 1.
isShippedbooleantrueFilter results by whether shipping has been completed. Accepts true or 1.
isCancelledbooleantrueFilter results by whether the record has been cancelled. Accepts true or 1.
includeBasketItemsbooleantrueInclude basket items in the response. Accepts true or 1.
offsetint123Skip this many matching records before returning results.
pageSizeint123Limit the number of records returned.

POST

Create or update a basket and optionally run a basket action.

Query parameters

NameTypeExampleNotes
doActiontextSendMerchantInvoiceRun a basket action. Available actions: CalculateTotals, UpdateShippingStatus, FinaliseOrder, ReduceStock, Cancel, ProcessOnPaidActions, ProcessPoints, SendInvoice, SendOrder, SendMerchantOrder, SendMerchantInvoice.

Request content type: application/json

Request body fields

NameTypeExampleNotes
mbr_idint123Set the mbr id value.
b_cust_emailtextcustomer@example.comSet the b cust email value.
b_cust_nametextexampleSet the b cust name value.
basketItemstextexampleSet the basket items value.
paymentTransactionstextexampleSet the payment transactions value.
doActiontextSendMerchantInvoiceRun a basket action. Available actions: CalculateTotals, UpdateShippingStatus, FinaliseOrder, ReduceStock, Cancel, ProcessOnPaidActions, ProcessPoints, SendInvoice, SendOrder, SendMerchantOrder, SendMerchantInvoice.

Data definitions

FieldTypeDescriptionFormatExample
b_cust_phonetextCustomer Phone (not validated format) (Validation: Text)
b_cust_countrytextCustomer primary address (aka billing address) (Validation: Text)
b_courier_reftextCourier tracking ticket number, for human viewing / readback, or for a human to copy and paste into a form (Validation: Text)
b_custom_fieldstextJSON data structure of any additional custom questions asked during checkout. (Validation: Text)
b_ship_citytextDelivery address (aka gift address), used for API shipping calc (Validation: Text)
b_cust_statetextCustomer primary address (aka billing address) (Validation: Text)
b_shippingcalcintShipping Method (Validation: Integer)
b_ship_nametextName of intended recipient (Validation: Text)
b_shopchanneltextIndicates Website or POS, or Market place where order originated (Validation: Text)
b_courier_notestextNotes given back to the customer about shipping status (Validation: Text)
b_surcharge_feedecimalA 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_intervalintervalFor repeating orders (aka subscriptions) this is the repeat interval (Validation: Interval)01:00:00
b_createdtimestampDraft order creation date (Validation: Timestamp)2025-12-31 23:59:59
b_cust_suburbtextCustomer primary address (aka billing address) (Validation: Text)
b_customer_savedontimestampWhen customer saved this order / wishlist. (Validation: Timestamp)2025-12-31 23:59:59
b_statustextThe status of an order, human readible.  (Validation: Text)
b_paypurchaseordertextCustomers 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_addresstextCustomer primary address (aka billing address) (Validation: Text)
b_repeated_from_bidintThe last basket ID in the repeating order chain. (Validation: Integer)
b_courier_urltextA 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_targettimestampThe 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_idserialUnique Invoice Serial Number, aka ID (Validation: Integer)123456
b_total_paiddecimalTotal amount of receipts received from the customer (Validation: Decimal)
b_gift_messagetextA message to be provided where applicable for gift stores. (Validation: Text)
b_preadj_taxdecimalThe value of b_total_tax, prior to post sale adjustments (Validation: Decimal)
b_json_datatextNested data in JSON format for other purposes
b_shippedontimestampTime 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_confirmtermsandconditionscharIf T&C confirmed, this will be: T otherwise null
b_total_discountdecimalThe total discount as calculated by promotions  (excl sales tax) (Validation: Decimal)
b_item_countintNumber of line items (Validation: Integer)
b_notes_confidentialtextNotes entered by merchant, that for for merchant / staff visibility only (Validation: Text)
b_booking_resourceidintThe staff member or room assigned to the booking (resource used by all products in the order) (Validation: Integer)
b_cust_emailtextCustomer Email (Validation: Text)
b_ship_emailtextEmail of intended recipient (Courier tracking sent here) (Validation: Text)
b_remindernotestextIf customer wishes to be reminded on an aniversary, then notes to themselves, perhaps persons name, or product serial number. (Validation: Text)
b_versionintIf an order is re opened after being closed, then the version number will increment and affect the invoice ID (Validation: Integer)
b_total_volumetextThe volume in cubed cm required to efficiently pack this whole order in one box.
b_payment_methodtextPayment method in human readable form, but is actually the payment type code. (Validation: Text)
b_closedtimestampThe order date, when the draft order was submitted to be come a proper order.  (Validation: Timestamp)2025-12-31 23:59:59
b_payopidintPayment method as ID reference, to the settings related to the payment method. (Validation: Integer)
b_staff_idintSales person ID for POS users (Validation: Integer)
b_address_qualitytextAPI results from address validation checker service, if enabled (Validation: Text)
b_typetextIdentifies the type of orders that were saved prior to submitting them, eg wishlists or saved orders.  (Validation: Text)
b_reminderduedateIf customer wishes to be reminded on an aniversary, then this is when they will be reminded next. (Validation: Timestamp)2025-12-31
b_paycustcodetextCustomers may provide their account number when checking out, rather than payment. (Not validated) (Validation: Text)
b_paidontimestampTime 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_emailjobidintIf this order originated from a bulk email, then this was the bulk email ID
b_points_earned_affiliatedecimalLoyalty points earned by an affiliate who referred the sale. (Validation: Decimal)
b_cust_postcodetextCustomer primary address (aka billing address) (Validation: Text)
b_bill_emailtextEmail address of accounts department (optional extra full address format) (Validation: Text)
b_currencytextCurrency of order (Validation: Text)
b_cancelledtimestampTime of cancellation if cancelled. Primary indicator of cancellation (Validation: Timestamp)2025-12-31 23:59:59
b_reminderperiodintervalIf 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_transfeedecimalOptional transaction fee that may be applied to final invoice, for use of certain payment methods. Transaction fees do not increase tax. (Validation: Decimal)
mbr_idintMember ID / Customer ID (Validation: Integer)
b_booking_finishtimestampThe 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_taxdecimalSales Tax (GST or VAT) related to adjustments if any (Validation: Decimal)
b_wishlistidintRelated wishlist ID if this order originated from a wedding list type picklist. (Validation: Integer)
b_total_shippingdecimalThe total shipping fee (excl sales tax) (Validation: Decimal)
b_quotedontimestampTimestamp when this order was quoted. If null, then there was never a quote.2025-12-31 23:59:59
b_total_savingsdecimalMarketing 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_totaldecimalThe final total after considering all charges, discounts, vouchers, taxes, transaction fees, and post sale adjustments (Validation: Decimal)
b_total_vouchersdecimalThe total of vouchers applied to this order. (Sales tax neutral) (Validation: Decimal)
b_ship_phonetextPhone of intended recipient (provided to courier) (Validation: Text)
b_cust_nametextCustomer Personal Name (Billing Name) (Validation: Text)
b_ship_suburbtextDelivery address (aka gift address) (Validation: Text)
b_ship_countrytextDelivery address (aka gift address) (Validation: Text)
basketItemsjsonNested array of basket items (order lines)
b_paymentsummarytextHuman readible payment summary (Validation: Text)
b_surcharge_reasontextSome text related to the surcharge, human readible, visible on invoice.  (Validation: Text)
b_total_refundsdecimalTotal amount of any refunds given to the customer, in monetary form. (do not put discounts here) (Validation: Decimal)
b_stock_allocatedboolTrue if stock counts have been allocated to this order, such that if cancelled stock allocation will be refreshed. (Validation: Boolean)
b_ipaddresstextIP Address of the user who placed the order
b_ship_statetextDelivery address (aka gift address) (Validation: Text)
b_booking_starttimestampThe booking time (Validation: Timestamp)2025-12-31 23:59:59
b_ship_companytextCompany Name of delivery address optional (Validation: Text)
b_payment_card_idintID of saved credit card that was or will be used to pay for this order
b_cust_notestextNotes given by customer as part of their order (Validation: Text)
b_points_earneddecimalLoyalty points earned from this order (if submitted) (Validation: Decimal)
b_cust_companytextCustomer Company name (Validation: Text)
b_pref_delivery_timetextCustomers preferred delivery time, that can be free text in some situations (Validation: Text)
b_total_depositdecimalIf 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)
pageintAll 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_redeemeddecimalThe monetary value of points redeemed on this order, that would have adjusted the total due of the order. (Validation: Decimal)
b_invoice_idtextInvoice Number (Validation: Text)
b_affiliateintAffiliate ID for affiliate style commissions (Validation: Integer)
b_cust_citytextCustomer primary address (aka billing address) (Validation: Text)
b_uuidtextGlobal Unique Identifier for the basket / order, soon to replace b_id
b_booking_durationintervalThe total duration of the order, from a pricing perspective. (Validation: Interval)01:00:00
b_points_redeemeddecimalLoyalty points redeemed for this order (if submitted) (Validation: Decimal)
b_wishlist_titletextOnly used if order is a wishlist (Validation: Text)
b_ship_addresstextDelivery address (aka gift address) (Validation: Text)
b_preadj_totaltextThe value of b_total_total, prior to post sale adjustments, and excluding any payment surcharges
b_ship_postcodetextDelivery address (aka gift address), used for API shipping calc (Validation: Text)
b_pref_delivery_timestamptimestampCustomers 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_apishippingdecimalLocation 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_readytoshiptimestampTimestamp 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_ratedecimalThe decimal multiplier from merchant base currency to currency selected. (Validation: Decimal)
b_total_gramsintTotal weight of all items in cart (Validation: Integer)
b_is_domesticintTax status, Domestic or International (Validation: Integer)
b_total_adjustmentsdecimalTotal of adjustments post sale, eg credits for returned items or fees for shipping overage fees.  (Validation: Decimal)
b_status_updatedtimestampThe timestamp when the order status was last updated (Validation: Timestamp)2025-12-31 23:59:59
b_total_qtydecimalTotal of all line item quantities (Validation: Decimal)
b_total_taxdecimalThe total sales tax on the order (eg GST or VAT) (Validation: Decimal)
b_promocodetextPromotional Code = Discount Code (Validation: Text)

basketItems — Sales Order Item Line data dictionary

FieldTypeDescriptionFormatExample
bi_idserialUnique ID of this basket item
bi_custom_totaldecimalTotal cost derived from product customisations used towards calculating the unit price
bi_disc_amtdecimalThe discount value for the total line
b_qtydecimalQuantity of items purchased in this order line
b_unit_pricedecimalUnit price of the product excluding tax, after any discounts were deducted, and this value includes any option pricing or customisation pricing.
pidintID of the product variant. Links to product.id. If the product has no variants, then pid = b_parentpid
bi_line_totaldecimalLine total equals unit price multiplied by quantity, and does not include any sales tax. After discounts applied
bi_custom_fieldstextAdditional product customisations in a JSON array format. Contains all the other design/manufacture customer selections
bi_staff_idintID of the user who made an adjustment to this order, only used with adjustments
bi_holdboolIf this product line is on hold and not to be shipped with the current batch
b_bookingidintID of a booking if any
bi_priceprediscountdecimalThe RRP unit price of the product prior to discounting excluding sales tax
bi_adjusted_from_bi_idintID 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_bookingsummarytextA summary of any booking details if any. This could be an appointment booking or an event.
bi_shippedontimestampTimestamp of when this line item was shipped, that may not be shipped as a whole order together2025-12-31 23:59:59
b_sizetextProduct option size
bi_discountmessagetextA message displayed to customer as to which promotion was used to discount their item line
bi_jsonjsonNested JSON structure for additional information for this item line, including stock picking status, loyalty points redemption
b_optiontextProduct option style or generic option
bi_promoidintID of the discount rule applied to this line item, if any
bi_tax_amtdecimalSales tax total for the whole line
bi_messagetextWarning message about stock availability, back order or any errors during processing of this order line
b_eventattendeeidintID of a member or customer who will attend an event that is being purchased by this line item
b_colourtextProduct option colour
bi_detailtextA human friendly description of the product being purchased
b_parentpidintID of the main product purchased (not variant). Links to product.id
bi_partof_biintThe 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_posdecimalOveride discount amount for the entire item line. Only staff can set this discount. When this approach used, no other discount rule applied
b_idintBasket 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

Any new transactions will be inserted, but only if they do not have a system generated ID and the "gwtransid" is unique /missing. No updates will occur, only inserts. After inserts of successful payment records, the b_total_paid balance will update. wgtpayopid should match a valid payment option on your payments list. AuthMsg can contain anything. callbacktime is the date/time of the payment is deemed successful. Leave it out and we will set it to NOW() "Amtrec" is the value of the receipt. "authtxnref" can be used for saving misc success identifier. To record a transaction against an existing order, you can use the following example, with minimal data provided. The API result will include the full order JSON status and all payment transactions, new and old, will be listed.
{
    "id": 35463057,
    "paymentTransactions": [
        {
            "gwtransid": "32433",
            "authmsg": "Approved blah blah",
            "wgtpayopid": 11487,
            "wgt_paymethod": "Bank",
            "amtrec": 100.00,
            "authtxnref": "anything you want",
            "successfulpayment": true,
            "callbacktime": "2026-05-05 13:15:38"
        }
    ]
}


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

{
  "b_id": 123456,
  "b_preadj_total": 100,
  "b_total_adjustments": -10,
  "b_total_total": 90,
  "basketItems": [
    {
      "allowInvalidProduct": true,
      "b_qty": 1,
      "b_unit_price": -10,
      "bi_line_total": -10,
      "bi_message": "Discount applied",
      "bi_json":{"bi_adjust_type": "Credit"}
    }
  ]
}

Sample POA Shipping Fee $15

{
  "b_id": 123456,
  "b_preadj_total": 100,
  "b_total_adjustments": 15,
  "b_total_total": 115,
  "basketItems": [
    {
      "allowInvalidProduct": true,
      "b_qty": 1,
      "b_unit_price": 15,
      "bi_line_total": 15,
      "bi_message": "Shipping fee",
      "bi_json":{"bi_adjust_type": "Fee"}
    }
  ]
}

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.