Skip to content

Latest commit

 

History

History

Batch API Best Practices – Ordered Scenarios

How to use

  • Open Step 2 (Accounting Batch API) in the app.
  • Pick an example below, open the corresponding JSON, copy/paste into the textarea, run.
  • Replace any placeholders like REPLACE_ID, REPLACE_TOKEN, REPLACE_INCOME_ACCOUNT_ID.
  • Add requestid={uuid} to the batch URL (idempotency) when you retry a request.

Order and purpose

  1. 01-smoke-query.json — minimal read-only to verify setup
  2. 02-queries-common.json — fast, side‑effect free data preview
  3. 03-30-queries.json — demonstrate max 30 items per batch
  4. 04-independent-mixed.json — mixed ops with no intra-batch dependencies
  5. 05-sparse-invoice-update.json — show sparse update with Id + SyncToken
  6. 06-void-salesreceipt.json — example of void via optionsData
  7. 07-delete-invoice.json — safe delete template (replace Id/SyncToken)
  8. 08-errors-duplicate-bid.json — show client-side preflight catching dup bId
  9. 09-errors-query-plus-op.json — show invalid shape (Query + operation)
  10. 10-idempotent-retry-note.txt — how to call with requestid for safe retries

Tips

  • Keep batches independent; do not rely on earlier items in the same batch.
  • Prefer read-only queries to validate IDs before mutating.
  • Cap batches to 30 items for your realm.
  • Use idempotency (requestid) and exponential backoff for retries.