Create test workspace

Idempotency

Accounting writes must happen exactly once. Give every create, update, delete, and void a stable Idempotency-Key, and reconcile when the outcome is unknown.

When a key is required

Live-project writes without an Idempotency-Key header fail with 409 IDEMPOTENCY_KEY_REQUIRED. Test projects accept writes without one, but use keys there too so your code is ready for production. Keys are ignored on reads.

cURL
curl -X POST "https://crossblade.dev/v1/quickbooks-desktop/invoices" \
  -H "Authorization: Bearer $CROSSBLADE_SECRET_KEY" \
  -H "Conductor-End-User-Id: $CROSSBLADE_END_USER_ID" \
  -H "Idempotency-Key: invoice:ord_1042:v1" \
  -H "Content-Type: application/json" \
  -d '{"customerId":"80000001-1234567890","transactionDate":"2026-09-23","lines":[{"itemId":"80000002-1234567890","quantity":2,"rate":"125.00"}]}'

Designing keys

  • Use <operation>:<your record id>:v<n>, for example invoice:ord_1042:v1 or void:invoice:ord_1042:v1. Keys are 1–255 characters.
  • Derive the key from your own data, and save it before sending. A key generated in memory is lost if your process crashes mid-request.
  • Keys are scoped to one company file (end-user). The same key on two end-users refers to two separate operations.
  • Put your record ID somewhere visible in QuickBooks too, such as the memo or reference number, so a person can find the record while reconciling.

Replay semantics

You sendPrevious state of that keyResult
Same key, same payloadSucceeded; response retainedThe original result. Nothing is written again.
Same key, same payloadSucceeded; response unavailable409 QBD_RESULT_UNAVAILABLE. The original outcome stays succeeded; nothing is written again. Read the original request status using Location or error.requestId.
Same key, same payloadQueued, processing, or unknownAttaches to the original durable request (same Conductor-Request-Id).
Same key, same payloadQBD_REQUEST_EXPIRED (never dispatched)The original request is queued again with its original ID.
Same key, same payloadFailed in QuickBooks (502 with integrationCode)The same failure. Fix the cause, then send the corrected write with the next version, such as :v2.
Same key, different payloadAny409 IDEMPOTENCY_KEY_CONFLICT. Nothing is queued.
New key—A new, independent write. Only do this when you know the previous attempt did not happen.

Validation errors (422) happen before anything is recorded, so you can fix the request and reuse the same key.

Request status separates the recorded outcome from response availability. A successful request can return status: "succeeded", hasResult: false and result: null after its payload is removed; payloadPurgedAt records that removal. Keep the successful outcome. Do not repeat the write with a new key to recover expired response data.

Unknown outcomes and reconciliation

If a write reached QuickBooks but no verifiable response came back, Crossblade returns HTTP 202 with status: "unknown_outcome" and code QBD_WRITE_OUTCOME_UNKNOWN. The write may or may not exist in QuickBooks. Until it is resolved, later requests for that company file wait behind it.

  1. Poll GET /v1/requests/{id} (the statusUrl). A late QuickBooks response resolves it automatically; result is available only after verified success and while the response bytes are retained.
  2. If it stays unknown, check QuickBooks for the record, for example by reference number or memo.
  3. Record what you found, in the dashboard request log or with requests.resolve. Evidence must be at least 12 characters and should say what you checked.
  4. If QuickBooks later reports a different outcome, the request moves to resolution_conflict (409 QBD_RESOLUTION_CONFLICT). Review it before writing again.
TypeScript
const state = await client.requests.retrieve(requestId);
if (state.status === "unknown_outcome") {
  // Only after checking QuickBooks:
  await client.requests.resolve(requestId, {
    outcome: "succeeded",
    evidence: "Invoice 1042 found in QuickBooks, entered 2026-09-23 10:14 by the connection user",
  });
}

A manual resolution records your decision; it does not create a QuickBooks object or invent an ID. Keep your integration on hold for that record until you have its real QuickBooks ID.