Sales API

10 PracBill API endpoints for sales. Base URL https://billing.pracbill.com.au/api.

Process external sales from e-commerce platforms (creates customer, invoice, items, and payments). Per-sale failures are reported inside `results`. The request body is read as raw JSON (`explode('=')` + `urldecode` + `json_decode`); because of a `$data_pats` typo in the handler the `data=` form is NOT effectively supported - send the raw JSON document (a body containing a literal '=' is truncated at the first '=').

POST /{api_key}/externalsales/add

Request body

Responses

  • 200 — Sales processed. Failures (invalid key, validation, not found) are also returned with HTTP 200 and `success: false` + `description`.

Quote access stub. After API-key validation the handler does nothing and returns an empty body (HTTP 200); it is not implemented.

GET /{api_key}/quote/{quoteid}/{email}

Responses

  • 200 — Empty body on a valid key; JSON `ErrorResponse` ('invalid key') otherwise

Qualify an address (Vocus). Returns a QualificationItem object, or the literal `false` when the address does not qualify. `missing address` / `invalid key` give {success:false, description}. Parameters may be sent in the query string or as a form-encoded body.

POST /{api_key}/services/qualify

Responses

  • 200 — The qualification response

Check whether an address requires a New Development Fee. Returns {location, ndf}, or `false` when the address could not be found or does not PASS. Parameters may be sent in the query string or as a form-encoded body.

POST /{api_key}/services/qualify/ndf

Responses

  • 200 — The NDF response

Send an SMS (same behaviour as the GET form). Body is plain JSON (json_decode of the raw body). Missing `from`/`to`/`message` returns `{success:false, sent:0, description:'Invalid Data Passed in, not all fields completed: ...'}`.

POST /{api_key}/sms/send

Request body

FieldTypeDescription
from requiredstringSender id / number
to requiredstringDestination number
message requiredstring

Responses

  • 200 — Send result

Send an SMS. The API key's data must carry a customer (`cid`), otherwise `{success:false, sent:0, description:'No Valid Customer'}`. The key's optional `gateway` selects the SMS gateway; otherwise the customer's configured gateway is used.

GET /{api_key}/sms/send/{from}/{to}/{message}

Responses

  • 200 — Send result

Activate a voucher (marks it active). State-changing GET. `success` is true once the handler runs; the activation outcome is in `balance` (`balance.success`, `balance.message`).

GET /{api_key}/vouchers/activate/{vouchernumber}

Responses

  • 200 — Activation processed

Activate a voucher (marks it active). State-changing GET. `success` is true once the handler runs; the activation outcome is in `balance` (`balance.success`, `balance.message`).

GET /{api_key}/vouchers/activate/{vouchernumber}/{type}

Responses

  • 200 — Activation processed

Voucher balance. KNOWN DEFECT: the handler loads the payment gateway named 'vouchers', which does not exist; the loader falls back to direct_deposit, which has no getBalance() - the request currently fails with a PHP fatal error (HTTP 500). The 200 body is what the code intends to return.

GET /{api_key}/vouchers/balance/{vouchernumber}

Responses

  • 200 — Voucher balance (intended behaviour)
  • 500 — PHP fatal error: call to undefined method getBalance()

Voucher balance. KNOWN DEFECT: the handler loads the payment gateway named 'vouchers', which does not exist; the loader falls back to direct_deposit, which has no getBalance() - the request currently fails with a PHP fatal error (HTTP 500). The 200 body is what the code intends to return.

GET /{api_key}/vouchers/balance/{vouchernumber}/{type}

Responses

  • 200 — Voucher balance (intended behaviour)
  • 500 — PHP fatal error: call to undefined method getBalance()

← All API groups