Invoices

Submit Bulk Invoice Payments

Creates pending invoice records for existing contractors in the authenticated organization, with per-invoice amounts, currencies and line items. Does not approve, fund, release or verify a bank transfer. Does not implement Idempotency-Key or deduplicate by invoiceID; confirm the result before retrying an uncertain submission. Also attempts monthly draft invoice-payroll summarization after the invoice transaction; summarization failure does not roll back invoices. invoiceNumber must be unique per contractor. Validation, missing-contractor and duplicate-number errors may return HTTP 500.

POSThttps://app.toku.com/api/tokuApi/v1/submitBulkInvoicePayments

This is the v1 (legacy) API. The current API is in the API reference.

For creating, editing, submitting, approving, rejecting and tracking contractor invoices, see the invoice calls of the Toku API, listed under Contractor › API.

What submission does#

Creates invoice records for existing contractors in the authenticated organization. Each invoice can have its own amount, currency and task-level line items. orgID is required in the request body for validation, but the authenticated token determines the organization used to create the invoices.

A successful response means the invoices were created with a pending status. It does not approve a payment, fund an account, release a bank transfer or confirm that a contractor has been paid. Follow the organization’s invoice approval and payment process separately.

After creating the invoices, Toku attempts to add them to the monthly draft invoice payroll. A failure in that step does not undo invoice creation. The draft payroll still needs approval and funding.

The response uses the v1 envelope: {"data":{"success":true},"error":null}.

This operation does not implement an Idempotency-Key header or make invoiceID a unique deduplication key. Do not automatically repeat a submission after an uncertain response. Confirm whether the invoices were created before submitting them again. invoiceNumber must be unique for each contractor, so resubmitting the same contractor and invoice number fails rather than creating a second invoice.

All invoice records in the submission are created in one transaction. An invalid item prevents that batch of records from being created. Use the contractor’s exact login email, including its letter case. Validation errors, unknown contractor emails and duplicate invoice numbers can return HTTP 500 with an error.message object. A retry after a timeout can therefore fail because the first submission already succeeded.

curl --request POST \
  --url 'https://app.toku.com/api/tokuApi/v1/submitBulkInvoicePayments' \
  --header 'Authorization: Bearer <token>' \
  --header 'x-role-type: CLIENT_ORG_ADMIN' \
  --header 'Content-Type: application/json' \
  --data '{
  "invoices": [
    {
      "invoiceID": "string",
      "contractorEmail": "string",
      "contractorName": "string",
      "invoiceNumber": "string",
      "invoiceDate": "2026-01-01",
      "dueDate": "2026-01-01",
      "totalAmount": 0,
      "currencyCode": "string",
      "lineItems": [
        {
          "description": "string",
          "quantity": 0,
          "rate": 0,
          "amount": 0,
          "type": "EARNING"
        }
      ]
    }
  ],
  "submissionTimestamp": "2026-01-01T00:00:00Z",
  "orgID": "string"
}'
200 response
{
  "data": {
    "success": true
  },
  "error": null
}

Authorizations

Authorizationstringheaderrequired

Bearer authentication header of the form Bearer <token>, where <token> is your API token.

Headers

x-role-typestringrequired

Role context for the request. Use CLIENT_ORG_ADMIN for most integrations.

Available options: CLIENT_ORG_ADMIN

Body

application/json

invoicesobject[]required
Show child attributes
invoiceIDstringrequired

Stored as externalInvoiceID; use this value when marking this invoice settled.

contractorEmailstringrequired

Exact existing contractor login email, including letter case.

contractorNamestringrequired
invoiceNumberstringrequired

Unique per contractor. Reusing this number for the same contractor is refused.

invoiceDatestring<date>required
dueDatestring<date>required
totalAmountnumberrequired
currencyCodestringrequired
lineItemsobject[]required
Show child attributes
descriptionstring
quantitynumber
ratenumber
amountnumber
typestring

Available options: EARNING, TAX

submissionTimestampstring<date-time>required
orgIDstringrequired

Required for request validation. Invoice creation uses the organization from the authenticated token.

Response

200Invoices submitted
dataobjectrequired
Show child attributes
successboolean
errorobject | nullrequired

Always null on success

401The token is missing, invalid or expired
errorstringrequired

What went wrong

403The token's seat doesn't have the permission this operation needs
errorobjectrequired
Show child attributes
messagestringrequired
429Too many requests from this address or token. Wait for the number of seconds in the Retry-After header, then retry.
errorstringrequired

What went wrong

500The operation failed. This includes input that doesn't match what the operation accepts; error.message says what was wrong.
errorobjectrequired
Show child attributes
messagestringrequired
Was this page helpful? Suggest edits