Integration recipes

Push and reconcile approved reimbursements

Import one approved claim, then track its review and payment separately.

Start in a test organization with synthetic workers and a Rippling connection enabled for expense import. Use an organization key with Expenses: Write to push claims; a separate reconciliation job needs only Expenses: Read. An approved claim can enter a payable workflow: do not use live claims to test.

Persist the provider's claim ID and a new UUID (REQUEST_ID) before sending. Keep that ID and payload together across network retries. Replace the sample dates and worker with values from your test claim.

curl -i https://api.toku.com/expense-imports/approved-reimbursements \
  -H "Authorization: Bearer $TOKU_API_KEY" -H "Idempotency-Key: $REQUEST_ID" \
  -H 'Content-Type: application/json' \
  -d '{"workerEmail":"worker@example.test","purchaseDate":"2026-11-26","approvedAt":"2026-11-27T09:00:00Z","vendor":"Example Rail","claimAmount":"12.50","claimCurrency":"USD","payoutAmount":"12.50","payoutCurrency":"USD","sourceReference":"test-rail-001"}'

On 201, store intakeId. HELD means Toku has the claim for review: do not resubmit it. IMPORTED means a record exists, not that the worker was paid. After a timeout, retry the same request with the same key. After a confirmed 5xx, retry with a new idempotency key and the same sourceReference: the old key replays the error. Fix invalid data, permissions or a disabled import connection before retrying. Never change the source reference to bypass a conflict.

Read one claim by GET /expense-imports/approved-reimbursements/{intakeId}. For a batch, call GET /expense-imports/approved-reimbursements?limit=100 and follow nextCursor as cursor until null. Upsert by intakeId, retaining the latest updatedAt, status, holdReason, reviewDecision, record and paid. Mark the claim paid only when paid is true; paidAt can be null.

On the next poll, set since a few minutes before your last completed watermark and deduplicate the overlap. Also re-read outstanding unpaid intakes by ID: a payment without a change timestamp can be missed by since alone.

Was this page helpful? Suggest edits