Chapter 3.1 - Commit Request
There are two ways to commit and uncommit DocumentCodes:
- Commit API
- Commit field (
cmmt) directly in the transaction
This page covers the Commit API. The transaction-level Commit can be found here.
Commit API Data FieldsThe following fields must be provided within a
CommitAPI call in order to support the Commit/Uncommit feature.
150-character max user-defined field that identifies a transaction, quote, or invoice in the calling system. The value is provided by the user when performing the tax calculation.
List of Key Value Pairs to provide additional information
The Commit RequestThe
Commitrequest is used to change the Commit flag for a given DocumentCode. Let's send a simple
Commitcall using Postman and inspect the results.
HeadersAdd the following mandatory headers to your request:
BodyFor the body of the
POSTrequest, copy and paste the following example:
What are we sending?The example above assumes you have submitted transactions for the current reporting cycle with a DocumentCode (
doc) of "123456789". The
dockey identifies the DocumentCode you want to update. The DocumentCode can be associated with a bill run, an invoice, a customer, or a transaction. Next comes the Commit flag (
cmmt). Set this flag to
trueto mark the DocumentCode (
doc) as committed or
falseto uncommit the DocumentCode. Reminder: this action commits or uncommits all transactions with this DocumentCode. Last is the optional Key Value Pair (
opt). This is where optional information about the commit batch, transactions, customer, etc. can be stored.
ResponseThe Commit response contains a confirmation of success or failure: An
truemeans that the DocumentCode (
doc) was committed or uncommitted successfully depending on the value of the Committed (
cmmt) flag. If
falseis returned in the
okkey, an error code (
code) and the error message (
msg) are returned.