Switch API reference
Switch: invoicing
Invoices, credit notes, payables, netting, settlement and ageing.
26 operationsBase URL https://packetexchange.io/api/v1Postman collection
BrowseSwitch: invoicing
List customer invoices
GET/
- Access
- API key. Scoped keys need
switch:manage. - Rate limit
- 100 requests per second (the default)
Parameters
| Name | In | Type | Description |
|---|---|---|---|
customerId | query | string (uuid) | - |
status | query | string | -One of draft, open, partial, paid, overdue, void |
limit | query | integer | Page size (default 50, max 500) |
offset | query | integer | - |
Response 200
| Field | Type | Description |
|---|---|---|
datarequired | object | - |
rowsrequireddata.rows | object[] | - |
idrequireddata.rows[].id | string (uuid) | - |
customerIdrequireddata.rows[].customerId | string (uuid) | - |
invoiceNumberrequireddata.rows[].invoiceNumber | string | Sequential per operator, gap-free |
periodStartrequireddata.rows[].periodStart | string (date-time) | null | ISO-8601 timestamp (UTC) |
periodEndrequireddata.rows[].periodEnd | string (date-time) | null | ISO-8601 timestamp (UTC) |
issueDaterequireddata.rows[].issueDate | string (date-time) | ISO-8601 timestamp (UTC) |
dueDaterequireddata.rows[].dueDate | string (date-time) | null | ISO-8601 timestamp (UTC) |
currencyrequireddata.rows[].currency | string | -max 3 chars |
subtotalrequireddata.rows[].subtotal | money | USD as a decimal string with exactly 6 places, e.g. "0.012500". |
taxrequireddata.rows[].tax | money | USD as a decimal string with exactly 6 places, e.g. "0.012500". |
totalrequireddata.rows[].total | money | USD as a decimal string with exactly 6 places, e.g. "0.012500". |
amountPaidrequireddata.rows[].amountPaid | money | USD as a decimal string with exactly 6 places, e.g. "0.012500". |
statusrequireddata.rows[].status | string | -One of draft, open, partial, paid, overdue, void |
overduerequireddata.rows[].overdue | boolean | - |
notesrequireddata.rows[].notes | string | null | - |
replacesInvoiceIddata.rows[].replacesInvoiceId | string (uuid) | null | - |
sentAtdata.rows[].sentAt | string (date-time) | null | ISO-8601 timestamp (UTC) |
sendCountdata.rows[].sendCount | integer | - |
customerLabeldata.rows[].customerLabel | string | null | On list rows |
totalrequireddata.total | integer | - |
limitrequireddata.limit | integer | - |
offsetrequireddata.offset | integer | - |
Errors
- 400
VALIDATION_ERROR,INVALID_INPUTorBAD_REQUEST. ForVALIDATION_ERROR,error.detailsis an array of{ path, message }. - 401
UNAUTHORIZED: missing, invalid, expired or revoked credential. - 402
SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial. - 403
FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only. - 429
RATE_LIMITED: slow down and retry after theRetry-Afterseconds. - 500
INTERNAL_ERROR: unexpected failure. QuoteX-Request-Idto support.
Issue an invoice from a reviewed preview
POST/
- Access
- API key. Scoped keys need
switch:manage. - Rate limit
- 100 requests per second (the default)
- Moves money
- Issues, voids or settles a billing document.
Irreversible: allocates the next invoice number and claims the usage. Requires the reviewToken from a preview that still matches live data. Does not send the invoice; use POST /switch/invoices/{id}/send.
Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.
Request body (application/json)
| Field | Type | Description |
|---|---|---|
customerIdrequired | string (uuid) | - |
periodStartrequired | string | ISO-8601 date or timestamp; start of the billing period |
periodEndrequired | string | ISO-8601 date or timestamp; end of the billing period |
notes | string | null | -max 2000 chars |
includeBroughtForward | boolean | Also bill priced, still-unbilled usage from before the period |
applyCredits | boolean | Consume the customer's open credit notes on this invoice |
excludeUnrated | object | null | Issue despite unpriced usage, leaving it unbilled for the stated reason (needs the billing adjustment permission) |
reasonrequiredexcludeUnrated.reason | string | -max 2000 chars |
reviewTokenrequired | string | -max 120 chars |
Response 201
| Field | Type | Description |
|---|---|---|
datarequired | object | - |
idrequireddata.id | string (uuid) | - |
customerIdrequireddata.customerId | string (uuid) | - |
invoiceNumberrequireddata.invoiceNumber | string | Sequential per operator, gap-free |
periodStartrequireddata.periodStart | string (date-time) | null | ISO-8601 timestamp (UTC) |
periodEndrequireddata.periodEnd | string (date-time) | null | ISO-8601 timestamp (UTC) |
issueDaterequireddata.issueDate | string (date-time) | ISO-8601 timestamp (UTC) |
dueDaterequireddata.dueDate | string (date-time) | null | ISO-8601 timestamp (UTC) |
currencyrequireddata.currency | string | -max 3 chars |
subtotalrequireddata.subtotal | money | USD as a decimal string with exactly 6 places, e.g. "0.012500". |
taxrequireddata.tax | money | USD as a decimal string with exactly 6 places, e.g. "0.012500". |
totalrequireddata.total | money | USD as a decimal string with exactly 6 places, e.g. "0.012500". |
amountPaidrequireddata.amountPaid | money | USD as a decimal string with exactly 6 places, e.g. "0.012500". |
statusrequireddata.status | string | -One of draft, open, partial, paid, overdue, void |
overduerequireddata.overdue | boolean | - |
notesrequireddata.notes | string | null | - |
replacesInvoiceIddata.replacesInvoiceId | string (uuid) | null | - |
sentAtdata.sentAt | string (date-time) | null | ISO-8601 timestamp (UTC) |
sendCountdata.sendCount | integer | - |
customerLabeldata.customerLabel | string | null | On list rows |
reviewDigestrequireddata.reviewDigest | string | null | - |
previewdata.preview | object | - |
customerrequireddata.preview.customer | object | - |
idrequireddata.preview.customer.id | string (uuid) | - |
labelrequireddata.preview.customer.label | string | - |
legalNamerequireddata.preview.customer.legalName | string | - |
currencyrequireddata.preview.customer.currency | string | - |
periodrequireddata.preview.period | object | - |
startrequireddata.preview.period.start | string | - |
endrequireddata.preview.period.end | string | - |
timezonerequireddata.preview.period.timezone | string | - |
labelrequireddata.preview.period.label | string | - |
dueDaterequireddata.preview.dueDate | string | - |
paymentTermsDaysrequireddata.preview.paymentTermsDays | integer | - |
currencyrequireddata.preview.currency | string | - |
usagerequireddata.preview.usage | object | Billable, rated-at-zero, by-trunk and by-channel usage |
broughtForwardrequireddata.preview.broughtForward | object | - |
unratedrequireddata.preview.unrated | object | Usage that could not be priced. Blocks issue unless excluded with a reason. |
linesrequireddata.preview.lines | object[] | - |
chargesrequireddata.preview.charges | number | US dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string) |
creditsrequireddata.preview.credits | object | - |
taxrequireddata.preview.tax | object | - |
totalrequireddata.preview.total | number | US dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string) |
provenancerequireddata.preview.provenance | object | - |
reviewTokendata.preview.reviewToken | string | Pass to POST /switch/invoices to issue exactly what was reviewed |
Response 202
| Field | Type | Description |
|---|---|---|
datarequired | object | - |
approvalRequireddata.approvalRequired | boolean | -One of true |
approvalRequestIddata.approvalRequestId | string (uuid) | null | - |
permissiondata.permission | string | - |
expiresAtdata.expiresAt | string (date-time) | - |
messagedata.message | string | - |
Errors
- 400
VALIDATION_ERROR,INVALID_INPUTorBAD_REQUEST. ForVALIDATION_ERROR,error.detailsis an array of{ path, message }. - 401
UNAUTHORIZED: missing, invalid, expired or revoked credential. - 402
SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial. - 403
FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only. - 409
CONFLICT(or a code-specific 409): the change clashes with existing state. - 429
RATE_LIMITED: slow down and retry after theRetry-Afterseconds. - 500
INTERNAL_ERROR: unexpected failure. QuoteX-Request-Idto support. - Also
INVOICE_REVIEW_STALE,INVOICE_UNRATED_USAGE
Preview an invoice before issuing it
POST/
- Access
- API key. Scoped keys need
switch:manage. - Rate limit
- 100 requests per second (the default)
- Moves money
- Issues, voids or settles a billing document.
A read: allocates no number and claims no usage. Returns every figure the invoice would carry, the usage it could not price, and a review token. Issue with that token; if live data changes in between, issuing fails with INVOICE_REVIEW_STALE.
Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.
Request body (application/json)
| Field | Type | Description |
|---|---|---|
customerIdrequired | string (uuid) | - |
periodStartrequired | string | ISO-8601 date or timestamp; start of the billing period |
periodEndrequired | string | ISO-8601 date or timestamp; end of the billing period |
notes | string | null | -max 2000 chars |
includeBroughtForward | boolean | Also bill priced, still-unbilled usage from before the period |
applyCredits | boolean | Consume the customer's open credit notes on this invoice |
excludeUnrated | object | null | Issue despite unpriced usage, leaving it unbilled for the stated reason (needs the billing adjustment permission) |
reasonrequiredexcludeUnrated.reason | string | -max 2000 chars |
releaseInvoiceId | string (uuid) | null | Reissue only: review as if this invoice were already voided |
Response 200
| Field | Type | Description |
|---|---|---|
datarequired | object | Same fields as SwitchInvoicePreview, shown earlier on this page. |
Response 202
| Field | Type | Description |
|---|---|---|
datarequired | object | - |
approvalRequireddata.approvalRequired | boolean | -One of true |
approvalRequestIddata.approvalRequestId | string (uuid) | null | - |
permissiondata.permission | string | - |
expiresAtdata.expiresAt | string (date-time) | - |
messagedata.message | string | - |
Errors
- 400
VALIDATION_ERROR,INVALID_INPUTorBAD_REQUEST. ForVALIDATION_ERROR,error.detailsis an array of{ path, message }. - 401
UNAUTHORIZED: missing, invalid, expired or revoked credential. - 402
SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial. - 403
FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only. - 409
CONFLICT(or a code-specific 409): the change clashes with existing state. - 429
RATE_LIMITED: slow down and retry after theRetry-Afterseconds. - 500
INTERNAL_ERROR: unexpected failure. QuoteX-Request-Idto support.
Get an invoice with lines, payments and history
GET/
- Access
- API key. Scoped keys need
switch:manage. - Rate limit
- 100 requests per second (the default)
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | - |
Response 200
| Field | Type | Description |
|---|---|---|
datarequired | object | - |
idrequireddata.id | string (uuid) | - |
customerIdrequireddata.customerId | string (uuid) | - |
invoiceNumberrequireddata.invoiceNumber | string | Sequential per operator, gap-free |
periodStartrequireddata.periodStart | string (date-time) | null | ISO-8601 timestamp (UTC) |
periodEndrequireddata.periodEnd | string (date-time) | null | ISO-8601 timestamp (UTC) |
issueDaterequireddata.issueDate | string (date-time) | ISO-8601 timestamp (UTC) |
dueDaterequireddata.dueDate | string (date-time) | null | ISO-8601 timestamp (UTC) |
currencyrequireddata.currency | string | -max 3 chars |
subtotalrequireddata.subtotal | money | USD as a decimal string with exactly 6 places, e.g. "0.012500". |
taxrequireddata.tax | money | USD as a decimal string with exactly 6 places, e.g. "0.012500". |
totalrequireddata.total | money | USD as a decimal string with exactly 6 places, e.g. "0.012500". |
amountPaidrequireddata.amountPaid | money | USD as a decimal string with exactly 6 places, e.g. "0.012500". |
statusrequireddata.status | string | -One of draft, open, partial, paid, overdue, void |
overduerequireddata.overdue | boolean | - |
notesrequireddata.notes | string | null | - |
replacesInvoiceIddata.replacesInvoiceId | string (uuid) | null | - |
sentAtdata.sentAt | string (date-time) | null | ISO-8601 timestamp (UTC) |
sendCountdata.sendCount | integer | - |
customerLabeldata.customerLabel | string | null | On list rows |
linesrequireddata.lines | object[] | Invoice lines in print order |
paymentsrequireddata.payments | object[] | - |
idrequireddata.payments[].id | string (uuid) | - |
amountrequireddata.payments[].amount | money | USD as a decimal string with exactly 6 places, e.g. "0.012500". |
methodrequireddata.payments[].method | string | null | - |
referencerequireddata.payments[].reference | string | null | - |
paidAtrequireddata.payments[].paidAt | string (date-time) | ISO-8601 timestamp (UTC) |
createdAtrequireddata.payments[].createdAt | string (date-time) | ISO-8601 timestamp (UTC) |
customerrequireddata.customer | object | null | - |
idrequireddata.customer.id | string (uuid) | - |
labelrequireddata.customer.label | string | - |
sourcerequireddata.customer.source | string | null | - |
currencyrequireddata.customer.currency | string | - |
countryBreakdownrequireddata.countryBreakdown | object | Voice usage on this invoice by destination country (derived, read-only) |
billingProfilerequireddata.billingProfile | object | null | The billing identity frozen onto the document at issue |
identityFrozenrequireddata.identityFrozen | boolean | - |
exclusionsrequireddata.exclusions | object[] | Usage consciously left unbilled on this run, with the reason |
replacesrequireddata.replaces | object | null | - |
idrequireddata.replaces.id | string (uuid) | - |
invoiceNumberrequireddata.replaces.invoiceNumber | string | - |
statusrequireddata.replaces.status | string | -One of draft, open, partial, paid, overdue, void |
replacedByrequireddata.replacedBy | object | null | - |
idrequireddata.replacedBy.id | string (uuid) | - |
invoiceNumberrequireddata.replacedBy.invoiceNumber | string | - |
statusrequireddata.replacedBy.status | string | -One of draft, open, partial, paid, overdue, void |
Errors
- 400
VALIDATION_ERROR,INVALID_INPUTorBAD_REQUEST. ForVALIDATION_ERROR,error.detailsis an array of{ path, message }. - 401
UNAUTHORIZED: missing, invalid, expired or revoked credential. - 402
SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial. - 403
FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only. - 404
NOT_FOUND: no such resource on your account. - 429
RATE_LIMITED: slow down and retry after theRetry-Afterseconds. - 500
INTERNAL_ERROR: unexpected failure. QuoteX-Request-Idto support.
Record a payment received against an invoice
POST/
- Access
- API key. Scoped keys need
switch:manage. - Rate limit
- 100 requests per second (the default)
- Moves money
- Issues, voids or settles a billing document.
Updates amountPaid and the status (partial or paid). Overpayment is refused.
Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | - |
Request body (application/json)
| Field | Type | Description |
|---|---|---|
amountrequired | number | Amount received, in the document currencymin 0 |
method | string | null | -max 32 chars |
reference | string | null | -max 160 chars |
Response 201
| Field | Type | Description |
|---|---|---|
datarequired | object | Same fields as SwitchInvoice, shown earlier on this page. |
Response 202
| Field | Type | Description |
|---|---|---|
datarequired | object | - |
approvalRequireddata.approvalRequired | boolean | -One of true |
approvalRequestIddata.approvalRequestId | string (uuid) | null | - |
permissiondata.permission | string | - |
expiresAtdata.expiresAt | string (date-time) | - |
messagedata.message | string | - |
Errors
- 400
VALIDATION_ERROR,INVALID_INPUTorBAD_REQUEST. ForVALIDATION_ERROR,error.detailsis an array of{ path, message }. - 401
UNAUTHORIZED: missing, invalid, expired or revoked credential. - 402
SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial. - 403
FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only. - 404
NOT_FOUND: no such resource on your account. - 409
CONFLICT(or a code-specific 409): the change clashes with existing state. - 429
RATE_LIMITED: slow down and retry after theRetry-Afterseconds. - 500
INTERNAL_ERROR: unexpected failure. QuoteX-Request-Idto support.
Void an invoice
POST/
- Access
- API key. Scoped keys need
switch:manage. - Rate limit
- 100 requests per second (the default)
- Moves money
- Issues, voids or settles a billing document.
A correction, never an erasure: needs a reason, refuses an invoice that has payments against it (issue a credit note instead), and releases the usage it claimed so it can be billed again. Applied credit notes are returned to the customer.
Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | - |
Request body (application/json)
| Field | Type | Description |
|---|---|---|
reasonrequired | string | -max 2000 chars |
Response 200
| Field | Type | Description |
|---|---|---|
datarequired | object | - |
idrequireddata.id | string (uuid) | - |
customerIdrequireddata.customerId | string (uuid) | - |
invoiceNumberrequireddata.invoiceNumber | string | Sequential per operator, gap-free |
periodStartrequireddata.periodStart | string (date-time) | null | ISO-8601 timestamp (UTC) |
periodEndrequireddata.periodEnd | string (date-time) | null | ISO-8601 timestamp (UTC) |
issueDaterequireddata.issueDate | string (date-time) | ISO-8601 timestamp (UTC) |
dueDaterequireddata.dueDate | string (date-time) | null | ISO-8601 timestamp (UTC) |
currencyrequireddata.currency | string | -max 3 chars |
subtotalrequireddata.subtotal | money | USD as a decimal string with exactly 6 places, e.g. "0.012500". |
taxrequireddata.tax | money | USD as a decimal string with exactly 6 places, e.g. "0.012500". |
totalrequireddata.total | money | USD as a decimal string with exactly 6 places, e.g. "0.012500". |
amountPaidrequireddata.amountPaid | money | USD as a decimal string with exactly 6 places, e.g. "0.012500". |
statusrequireddata.status | string | -One of draft, open, partial, paid, overdue, void |
overduerequireddata.overdue | boolean | - |
notesrequireddata.notes | string | null | - |
replacesInvoiceIddata.replacesInvoiceId | string (uuid) | null | - |
sentAtdata.sentAt | string (date-time) | null | ISO-8601 timestamp (UTC) |
sendCountdata.sendCount | integer | - |
customerLabeldata.customerLabel | string | null | On list rows |
releasedCallsrequireddata.releasedCalls | integer | - |
returnedCreditNotesrequireddata.returnedCreditNotes | integer | - |
Response 202
| Field | Type | Description |
|---|---|---|
datarequired | object | - |
approvalRequireddata.approvalRequired | boolean | -One of true |
approvalRequestIddata.approvalRequestId | string (uuid) | null | - |
permissiondata.permission | string | - |
expiresAtdata.expiresAt | string (date-time) | - |
messagedata.message | string | - |
Errors
- 400
VALIDATION_ERROR,INVALID_INPUTorBAD_REQUEST. ForVALIDATION_ERROR,error.detailsis an array of{ path, message }. - 401
UNAUTHORIZED: missing, invalid, expired or revoked credential. - 402
SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial. - 403
FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only. - 404
NOT_FOUND: no such resource on your account. - 409
CONFLICT(or a code-specific 409): the change clashes with existing state. - 429
RATE_LIMITED: slow down and retry after theRetry-Afterseconds. - 500
INTERNAL_ERROR: unexpected failure. QuoteX-Request-Idto support.
Void an invoice and issue its replacement
POST/
- Access
- API key. Scoped keys need
switch:manage. - Rate limit
- 100 requests per second (the default)
- Moves money
- Issues, voids or settles a billing document.
Voids this invoice and issues a replacement over the same period in one step. Preview the replacement first (with releaseInvoiceId) and pass its review token. If the void succeeds but the issue fails, the original stays void and its usage is unbilled; the error says so.
Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | - |
Request body (application/json)
| Field | Type | Description |
|---|---|---|
reasonrequired | string | -max 2000 chars |
reviewTokenrequired | string | -max 120 chars |
notes | string | null | -max 2000 chars |
includeBroughtForward | boolean | - |
applyCredits | boolean | - |
excludeUnrated | object | null | - |
reasonrequiredexcludeUnrated.reason | string | -max 2000 chars |
Response 201
| Field | Type | Description |
|---|---|---|
datarequired | object | - |
idrequireddata.id | string (uuid) | - |
customerIdrequireddata.customerId | string (uuid) | - |
invoiceNumberrequireddata.invoiceNumber | string | Sequential per operator, gap-free |
periodStartrequireddata.periodStart | string (date-time) | null | ISO-8601 timestamp (UTC) |
periodEndrequireddata.periodEnd | string (date-time) | null | ISO-8601 timestamp (UTC) |
issueDaterequireddata.issueDate | string (date-time) | ISO-8601 timestamp (UTC) |
dueDaterequireddata.dueDate | string (date-time) | null | ISO-8601 timestamp (UTC) |
currencyrequireddata.currency | string | -max 3 chars |
subtotalrequireddata.subtotal | money | USD as a decimal string with exactly 6 places, e.g. "0.012500". |
taxrequireddata.tax | money | USD as a decimal string with exactly 6 places, e.g. "0.012500". |
totalrequireddata.total | money | USD as a decimal string with exactly 6 places, e.g. "0.012500". |
amountPaidrequireddata.amountPaid | money | USD as a decimal string with exactly 6 places, e.g. "0.012500". |
statusrequireddata.status | string | -One of draft, open, partial, paid, overdue, void |
overduerequireddata.overdue | boolean | - |
notesrequireddata.notes | string | null | - |
replacesInvoiceIddata.replacesInvoiceId | string (uuid) | null | - |
sentAtdata.sentAt | string (date-time) | null | ISO-8601 timestamp (UTC) |
sendCountdata.sendCount | integer | - |
customerLabeldata.customerLabel | string | null | On list rows |
replacesInvoiceNumberrequireddata.replacesInvoiceNumber | string | - |
Response 202
| Field | Type | Description |
|---|---|---|
datarequired | object | - |
approvalRequireddata.approvalRequired | boolean | -One of true |
approvalRequestIddata.approvalRequestId | string (uuid) | null | - |
permissiondata.permission | string | - |
expiresAtdata.expiresAt | string (date-time) | - |
messagedata.message | string | - |
Errors
- 400
VALIDATION_ERROR,INVALID_INPUTorBAD_REQUEST. ForVALIDATION_ERROR,error.detailsis an array of{ path, message }. - 401
UNAUTHORIZED: missing, invalid, expired or revoked credential. - 402
SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial. - 403
FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only. - 404
NOT_FOUND: no such resource on your account. - 409
CONFLICT(or a code-specific 409): the change clashes with existing state. - 429
RATE_LIMITED: slow down and retry after theRetry-Afterseconds. - 500
INTERNAL_ERROR: unexpected failure. QuoteX-Request-Idto support. - Also
INVOICE_REVIEW_STALE,INVOICE_UNRATED_USAGE
Email an invoice to its recipients
POST/
- Access
- API key. Scoped keys need
switch:manage. - Rate limit
- 60 requests per 10 minutes
- Sends email
- Emails the invoice to its recipients.
Safe to repeat. Sends to the billing contacts, or to up to 20 addresses in to. Only accepted sends count as delivered.
Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | - |
Request body (application/json)
| Field | Type | Description |
|---|---|---|
to | string (email)[] | - |
Response 200
| Field | Type | Description |
|---|---|---|
datarequired | object | - |
sentrequireddata.sent | boolean | - |
torequireddata.to | string[] | Addresses the mail transport accepted |
failedrequireddata.failed | any[] | Addresses that could not be sent to |
sendCountrequireddata.sendCount | integer | - |
sentAtrequireddata.sentAt | string (date-time) | null | ISO-8601 timestamp (UTC) |
Response 202
| Field | Type | Description |
|---|---|---|
datarequired | object | - |
approvalRequireddata.approvalRequired | boolean | -One of true |
approvalRequestIddata.approvalRequestId | string (uuid) | null | - |
permissiondata.permission | string | - |
expiresAtdata.expiresAt | string (date-time) | - |
messagedata.message | string | - |
Errors
- 400
VALIDATION_ERROR,INVALID_INPUTorBAD_REQUEST. ForVALIDATION_ERROR,error.detailsis an array of{ path, message }. - 401
UNAUTHORIZED: missing, invalid, expired or revoked credential. - 402
SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial. - 403
FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only. - 404
NOT_FOUND: no such resource on your account. - 409
CONFLICT(or a code-specific 409): the change clashes with existing state. - 429
RATE_LIMITED: slow down and retry after theRetry-Afterseconds. - 500
INTERNAL_ERROR: unexpected failure. QuoteX-Request-Idto support.
Render an invoice as printable HTML
GET/
- Access
- API key. Scoped keys need
switch:manage. - Rate limit
- 100 requests per second (the default)
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | - |
Response 200 (text/html)
The invoice as a standalone HTML document.
Errors
- 400
VALIDATION_ERROR,INVALID_INPUTorBAD_REQUEST. ForVALIDATION_ERROR,error.detailsis an array of{ path, message }. - 401
UNAUTHORIZED: missing, invalid, expired or revoked credential. - 402
SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial. - 403
FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only. - 404
NOT_FOUND: no such resource on your account. - 429
RATE_LIMITED: slow down and retry after theRetry-Afterseconds. - 500
INTERNAL_ERROR: unexpected failure. QuoteX-Request-Idto support.
Download an invoice as XML
GET/
- Access
- API key. Scoped keys need
switch:manage. - Rate limit
- 100 requests per second (the default)
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | - |
Response 200 (application/xml)
The invoice as a structured XML document.
Errors
- 400
VALIDATION_ERROR,INVALID_INPUTorBAD_REQUEST. ForVALIDATION_ERROR,error.detailsis an array of{ path, message }. - 401
UNAUTHORIZED: missing, invalid, expired or revoked credential. - 402
SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial. - 403
FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only. - 404
NOT_FOUND: no such resource on your account. - 429
RATE_LIMITED: slow down and retry after theRetry-Afterseconds. - 500
INTERNAL_ERROR: unexpected failure. QuoteX-Request-Idto support.
Download an invoice as PDF
GET/
- Access
- API key. Scoped keys need
switch:manage. - Rate limit
- 100 requests per second (the default)
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | - |
Response 200 (application/pdf)
The invoice PDF, as an attachment.
Errors
- 400
VALIDATION_ERROR,INVALID_INPUTorBAD_REQUEST. ForVALIDATION_ERROR,error.detailsis an array of{ path, message }. - 401
UNAUTHORIZED: missing, invalid, expired or revoked credential. - 402
SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial. - 403
FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only. - 404
NOT_FOUND: no such resource on your account. - 429
RATE_LIMITED: slow down and retry after theRetry-Afterseconds. - 500
INTERNAL_ERROR: unexpected failure. QuoteX-Request-Idto support.
List credit notes
GET/
- Access
- API key. Scoped keys need
switch:manage. - Rate limit
- 100 requests per second (the default)
Parameters
| Name | In | Type | Description |
|---|---|---|---|
customerId | query | string (uuid) | - |
limit | query | integer | Page size (default 50, max 500) |
offset | query | integer | - |
Response 200
| Field | Type | Description |
|---|---|---|
datarequired | object[] | - |
idrequireddata[].id | string (uuid) | - |
customerIdrequireddata[].customerId | string (uuid) | - |
creditNoteNumberrequireddata[].creditNoteNumber | string | - |
invoiceIdrequireddata[].invoiceId | string (uuid) | null | - |
amountrequireddata[].amount | money | USD as a decimal string with exactly 6 places, e.g. "0.012500". |
reasonrequireddata[].reason | string | null | - |
statusrequireddata[].status | string | issued (open credit) or applied |
createdAtrequireddata[].createdAt | string (date-time) | ISO-8601 timestamp (UTC) |
customerLabeldata[].customerLabel | string | null | - |
Errors
- 400
VALIDATION_ERROR,INVALID_INPUTorBAD_REQUEST. ForVALIDATION_ERROR,error.detailsis an array of{ path, message }. - 401
UNAUTHORIZED: missing, invalid, expired or revoked credential. - 402
SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial. - 403
FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only. - 429
RATE_LIMITED: slow down and retry after theRetry-Afterseconds. - 500
INTERNAL_ERROR: unexpected failure. QuoteX-Request-Idto support.
Issue a credit note to a customer
POST/
- Access
- API key. Scoped keys need
switch:manage. - Rate limit
- 100 requests per second (the default)
- Moves money
- Issues, voids or settles a billing document.
Open credit reduces net receivables and can be applied to a later invoice with applyCredits. invoiceId, when given, must belong to the same customer.
Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.
Request body (application/json)
| Field | Type | Description |
|---|---|---|
customerIdrequired | string (uuid) | - |
amountrequired | number | -min 0 |
reason | string | null | -max 2000 chars |
invoiceId | string (uuid) | null | - |
Response 201
| Field | Type | Description |
|---|---|---|
datarequired | object | Same fields as SwitchCreditNote, shown earlier on this page. |
Response 202
| Field | Type | Description |
|---|---|---|
datarequired | object | - |
approvalRequireddata.approvalRequired | boolean | -One of true |
approvalRequestIddata.approvalRequestId | string (uuid) | null | - |
permissiondata.permission | string | - |
expiresAtdata.expiresAt | string (date-time) | - |
messagedata.message | string | - |
Errors
- 400
VALIDATION_ERROR,INVALID_INPUTorBAD_REQUEST. ForVALIDATION_ERROR,error.detailsis an array of{ path, message }. - 401
UNAUTHORIZED: missing, invalid, expired or revoked credential. - 402
SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial. - 403
FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only. - 409
CONFLICT(or a code-specific 409): the change clashes with existing state. - 429
RATE_LIMITED: slow down and retry after theRetry-Afterseconds. - 500
INTERNAL_ERROR: unexpected failure. QuoteX-Request-Idto support.
Get accounts-receivable ageing
GET/
- Access
- API key. Scoped keys need
switch:manage. - Rate limit
- 100 requests per second (the default)
Outstanding customer invoice balances by days past due. totalOutstanding is net of open credit notes; the buckets are gross.
Response 200
| Field | Type | Description |
|---|---|---|
datarequired | object | - |
totalOutstandingrequireddata.totalOutstanding | number | US dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string) |
grossOutstandingrequireddata.grossOutstanding | number | US dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string) |
creditNotesOpenrequireddata.creditNotesOpen | number | US dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string) |
openCountrequireddata.openCount | integer | - |
bucketsrequireddata.buckets | object | - |
currentrequireddata.buckets.current | number | US dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string) |
d1_30requireddata.buckets.d1_30 | number | US dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string) |
d31_60requireddata.buckets.d31_60 | number | US dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string) |
d61_90requireddata.buckets.d61_90 | number | US dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string) |
d90plusrequireddata.buckets.d90plus | number | US dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string) |
Errors
- 400
VALIDATION_ERROR,INVALID_INPUTorBAD_REQUEST. ForVALIDATION_ERROR,error.detailsis an array of{ path, message }. - 401
UNAUTHORIZED: missing, invalid, expired or revoked credential. - 402
SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial. - 403
FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only. - 429
RATE_LIMITED: slow down and retry after theRetry-Afterseconds. - 500
INTERNAL_ERROR: unexpected failure. QuoteX-Request-Idto support.
List supplier payables
GET/
- Access
- API key. Scoped keys need
switch:manage. - Rate limit
- 100 requests per second (the default)
Parameters
| Name | In | Type | Description |
|---|---|---|---|
vendorTrunkId | query | string (uuid) | - |
status | query | string | -One of draft, open, partial, paid, overdue, void |
limit | query | integer | Page size (default 50, max 500) |
offset | query | integer | - |
Response 200
| Field | Type | Description |
|---|---|---|
datarequired | object | - |
rowsrequireddata.rows | object[] | - |
idrequireddata.rows[].id | string (uuid) | - |
vendorTrunkIdrequireddata.rows[].vendorTrunkId | string (uuid) | - |
payableNumberrequireddata.rows[].payableNumber | string | - |
periodStartrequireddata.rows[].periodStart | string (date-time) | null | ISO-8601 timestamp (UTC) |
periodEndrequireddata.rows[].periodEnd | string (date-time) | null | ISO-8601 timestamp (UTC) |
issueDaterequireddata.rows[].issueDate | string (date-time) | ISO-8601 timestamp (UTC) |
dueDaterequireddata.rows[].dueDate | string (date-time) | null | ISO-8601 timestamp (UTC) |
currencyrequireddata.rows[].currency | string | -max 3 chars |
subtotalrequireddata.rows[].subtotal | money | USD as a decimal string with exactly 6 places, e.g. "0.012500". |
totalrequireddata.rows[].total | money | USD as a decimal string with exactly 6 places, e.g. "0.012500". |
amountPaidrequireddata.rows[].amountPaid | money | USD as a decimal string with exactly 6 places, e.g. "0.012500". |
statusrequireddata.rows[].status | string | -One of draft, open, partial, paid, overdue, void |
notesrequireddata.rows[].notes | string | null | - |
overduedata.rows[].overdue | boolean | - |
trunkLabeldata.rows[].trunkLabel | string | null | On list rows |
createdAtrequireddata.rows[].createdAt | string (date-time) | ISO-8601 timestamp (UTC) |
updatedAtrequireddata.rows[].updatedAt | string (date-time) | ISO-8601 timestamp (UTC) |
totalrequireddata.total | integer | - |
limitrequireddata.limit | integer | - |
Errors
- 400
VALIDATION_ERROR,INVALID_INPUTorBAD_REQUEST. ForVALIDATION_ERROR,error.detailsis an array of{ path, message }. - 401
UNAUTHORIZED: missing, invalid, expired or revoked credential. - 402
SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial. - 403
FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only. - 429
RATE_LIMITED: slow down and retry after theRetry-Afterseconds. - 500
INTERNAL_ERROR: unexpected failure. QuoteX-Request-Idto support.
Raise a payable for a supplier trunk over a period
POST/
- Access
- API key. Scoped keys need
switch:manage. - Rate limit
- 100 requests per second (the default)
- Moves money
- Issues, voids or settles a billing document.
Totals the supplier cost of the usage on that trunk in the period and claims it, so it cannot be paid twice.
Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.
Request body (application/json)
| Field | Type | Description |
|---|---|---|
vendorTrunkIdrequired | string (uuid) | - |
periodStartrequired | string | ISO-8601 date or timestamp; start of the billing period |
periodEndrequired | string | ISO-8601 date or timestamp; end of the billing period |
notes | string | null | -max 2000 chars |
Response 201
| Field | Type | Description |
|---|---|---|
datarequired | object | Same fields as SwitchPayable, shown earlier on this page. |
Response 202
| Field | Type | Description |
|---|---|---|
datarequired | object | - |
approvalRequireddata.approvalRequired | boolean | -One of true |
approvalRequestIddata.approvalRequestId | string (uuid) | null | - |
permissiondata.permission | string | - |
expiresAtdata.expiresAt | string (date-time) | - |
messagedata.message | string | - |
Errors
- 400
VALIDATION_ERROR,INVALID_INPUTorBAD_REQUEST. ForVALIDATION_ERROR,error.detailsis an array of{ path, message }. - 401
UNAUTHORIZED: missing, invalid, expired or revoked credential. - 402
SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial. - 403
FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only. - 409
CONFLICT(or a code-specific 409): the change clashes with existing state. - 429
RATE_LIMITED: slow down and retry after theRetry-Afterseconds. - 500
INTERNAL_ERROR: unexpected failure. QuoteX-Request-Idto support.
Get a payable with lines and payments
GET/
- Access
- API key. Scoped keys need
switch:manage. - Rate limit
- 100 requests per second (the default)
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | - |
Response 200
| Field | Type | Description |
|---|---|---|
datarequired | object | - |
idrequireddata.id | string (uuid) | - |
vendorTrunkIdrequireddata.vendorTrunkId | string (uuid) | - |
payableNumberrequireddata.payableNumber | string | - |
periodStartrequireddata.periodStart | string (date-time) | null | ISO-8601 timestamp (UTC) |
periodEndrequireddata.periodEnd | string (date-time) | null | ISO-8601 timestamp (UTC) |
issueDaterequireddata.issueDate | string (date-time) | ISO-8601 timestamp (UTC) |
dueDaterequireddata.dueDate | string (date-time) | null | ISO-8601 timestamp (UTC) |
currencyrequireddata.currency | string | -max 3 chars |
subtotalrequireddata.subtotal | money | USD as a decimal string with exactly 6 places, e.g. "0.012500". |
totalrequireddata.total | money | USD as a decimal string with exactly 6 places, e.g. "0.012500". |
amountPaidrequireddata.amountPaid | money | USD as a decimal string with exactly 6 places, e.g. "0.012500". |
statusrequireddata.status | string | -One of draft, open, partial, paid, overdue, void |
notesrequireddata.notes | string | null | - |
overduedata.overdue | boolean | - |
trunkLabeldata.trunkLabel | string | null | On list rows |
createdAtrequireddata.createdAt | string (date-time) | ISO-8601 timestamp (UTC) |
updatedAtrequireddata.updatedAt | string (date-time) | ISO-8601 timestamp (UTC) |
linesrequireddata.lines | object[] | - |
paymentsrequireddata.payments | object[] | Same fields as SwitchPayment, shown earlier on this page. |
trunkrequireddata.trunk | object | null | - |
idrequireddata.trunk.id | string (uuid) | - |
labelrequireddata.trunk.label | string | - |
settlementModerequireddata.trunk.settlementMode | string | null | - |
Errors
- 400
VALIDATION_ERROR,INVALID_INPUTorBAD_REQUEST. ForVALIDATION_ERROR,error.detailsis an array of{ path, message }. - 401
UNAUTHORIZED: missing, invalid, expired or revoked credential. - 402
SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial. - 403
FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only. - 404
NOT_FOUND: no such resource on your account. - 429
RATE_LIMITED: slow down and retry after theRetry-Afterseconds. - 500
INTERNAL_ERROR: unexpected failure. QuoteX-Request-Idto support.
Record a payment made to a supplier
POST/
- Access
- API key. Scoped keys need
switch:manage. - Rate limit
- 100 requests per second (the default)
- Moves money
- Issues, voids or settles a billing document.
Payments larger than the outstanding balance, or against a void payable, are refused.
Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | - |
Request body (application/json)
| Field | Type | Description |
|---|---|---|
amountrequired | number | Amount received, in the document currencymin 0 |
method | string | null | -max 32 chars |
reference | string | null | -max 160 chars |
Response 201
| Field | Type | Description |
|---|---|---|
datarequired | object | Same fields as SwitchPayable, shown earlier on this page. |
Response 202
| Field | Type | Description |
|---|---|---|
datarequired | object | - |
approvalRequireddata.approvalRequired | boolean | -One of true |
approvalRequestIddata.approvalRequestId | string (uuid) | null | - |
permissiondata.permission | string | - |
expiresAtdata.expiresAt | string (date-time) | - |
messagedata.message | string | - |
Errors
- 400
VALIDATION_ERROR,INVALID_INPUTorBAD_REQUEST. ForVALIDATION_ERROR,error.detailsis an array of{ path, message }. - 401
UNAUTHORIZED: missing, invalid, expired or revoked credential. - 402
SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial. - 403
FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only. - 404
NOT_FOUND: no such resource on your account. - 409
CONFLICT(or a code-specific 409): the change clashes with existing state. - 429
RATE_LIMITED: slow down and retry after theRetry-Afterseconds. - 500
INTERNAL_ERROR: unexpected failure. QuoteX-Request-Idto support.
Void a payable
POST/
- Access
- API key. Scoped keys need
switch:manage. - Rate limit
- 100 requests per second (the default)
- Moves money
- Issues, voids or settles a billing document.
Releases the usage it claimed so a corrected payable can pick it up. Voiding an already void payable is a no-op.
Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | - |
Response 200
| Field | Type | Description |
|---|---|---|
datarequired | object | - |
idrequireddata.id | string (uuid) | - |
vendorTrunkIdrequireddata.vendorTrunkId | string (uuid) | - |
payableNumberrequireddata.payableNumber | string | - |
periodStartrequireddata.periodStart | string (date-time) | null | ISO-8601 timestamp (UTC) |
periodEndrequireddata.periodEnd | string (date-time) | null | ISO-8601 timestamp (UTC) |
issueDaterequireddata.issueDate | string (date-time) | ISO-8601 timestamp (UTC) |
dueDaterequireddata.dueDate | string (date-time) | null | ISO-8601 timestamp (UTC) |
currencyrequireddata.currency | string | -max 3 chars |
subtotalrequireddata.subtotal | money | USD as a decimal string with exactly 6 places, e.g. "0.012500". |
totalrequireddata.total | money | USD as a decimal string with exactly 6 places, e.g. "0.012500". |
amountPaidrequireddata.amountPaid | money | USD as a decimal string with exactly 6 places, e.g. "0.012500". |
statusrequireddata.status | string | -One of draft, open, partial, paid, overdue, void |
notesrequireddata.notes | string | null | - |
overduedata.overdue | boolean | - |
trunkLabeldata.trunkLabel | string | null | On list rows |
createdAtrequireddata.createdAt | string (date-time) | ISO-8601 timestamp (UTC) |
updatedAtrequireddata.updatedAt | string (date-time) | ISO-8601 timestamp (UTC) |
releasedCallsrequireddata.releasedCalls | integer | - |
Response 202
| Field | Type | Description |
|---|---|---|
datarequired | object | - |
approvalRequireddata.approvalRequired | boolean | -One of true |
approvalRequestIddata.approvalRequestId | string (uuid) | null | - |
permissiondata.permission | string | - |
expiresAtdata.expiresAt | string (date-time) | - |
messagedata.message | string | - |
Errors
- 400
VALIDATION_ERROR,INVALID_INPUTorBAD_REQUEST. ForVALIDATION_ERROR,error.detailsis an array of{ path, message }. - 401
UNAUTHORIZED: missing, invalid, expired or revoked credential. - 402
SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial. - 403
FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only. - 404
NOT_FOUND: no such resource on your account. - 409
CONFLICT(or a code-specific 409): the change clashes with existing state. - 429
RATE_LIMITED: slow down and retry after theRetry-Afterseconds. - 500
INTERNAL_ERROR: unexpected failure. QuoteX-Request-Idto support.
Get accounts-payable ageing
GET/
- Access
- API key. Scoped keys need
switch:manage. - Rate limit
- 100 requests per second (the default)
What you owe suppliers on open payables, by days past due.
Response 200
| Field | Type | Description |
|---|---|---|
datarequired | object | - |
totalOwedrequireddata.totalOwed | number | US dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string) |
openCountrequireddata.openCount | integer | - |
bucketsrequireddata.buckets | object | - |
currentrequireddata.buckets.current | number | US dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string) |
d1_30requireddata.buckets.d1_30 | number | US dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string) |
d31_60requireddata.buckets.d31_60 | number | US dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string) |
d61_90requireddata.buckets.d61_90 | number | US dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string) |
d90plusrequireddata.buckets.d90plus | number | US dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string) |
Errors
- 400
VALIDATION_ERROR,INVALID_INPUTorBAD_REQUEST. ForVALIDATION_ERROR,error.detailsis an array of{ path, message }. - 401
UNAUTHORIZED: missing, invalid, expired or revoked credential. - 402
SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial. - 403
FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only. - 429
RATE_LIMITED: slow down and retry after theRetry-Afterseconds. - 500
INTERNAL_ERROR: unexpected failure. QuoteX-Request-Idto support.
List bilateral counterparties
GET/
- Access
- API key. Scoped keys need
switch:manage. - Rate limit
- 100 requests per second (the default)
A counterparty pairs a customer you sell to with a supplier trunk you buy from, so the two balances can be netted.
Response 200
| Field | Type | Description |
|---|---|---|
datarequired | object[] | - |
idrequireddata[].id | string (uuid) | - |
namerequireddata[].name | string | - |
customerIdrequireddata[].customerId | string (uuid) | null | The customer side of this counterparty |
vendorTrunkIdrequireddata[].vendorTrunkId | string (uuid) | null | The supplier side of this counterparty |
currencyrequireddata[].currency | string | - |
nettingEnabledrequireddata[].nettingEnabled | boolean | - |
notesrequireddata[].notes | string | null | - |
customerLabeldata[].customerLabel | string | null | - |
trunkLabeldata[].trunkLabel | string | null | - |
createdAtrequireddata[].createdAt | string (date-time) | ISO-8601 timestamp (UTC) |
updatedAtrequireddata[].updatedAt | string (date-time) | ISO-8601 timestamp (UTC) |
Errors
- 400
VALIDATION_ERROR,INVALID_INPUTorBAD_REQUEST. ForVALIDATION_ERROR,error.detailsis an array of{ path, message }. - 401
UNAUTHORIZED: missing, invalid, expired or revoked credential. - 402
SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial. - 403
FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only. - 429
RATE_LIMITED: slow down and retry after theRetry-Afterseconds. - 500
INTERNAL_ERROR: unexpected failure. QuoteX-Request-Idto support.
Create a bilateral counterparty
POST/
- Access
- API key. Scoped keys need
switch:manage. - Rate limit
- 100 requests per second (the default)
Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.
Request body (application/json)
| Field | Type | Description |
|---|---|---|
namerequired | string | -max 160 chars |
customerId | string (uuid) | null | - |
vendorTrunkId | string (uuid) | null | - |
currency | string | null | -max 3 chars |
nettingEnabled | boolean | - |
notes | string | null | -max 2000 chars |
Response 201
| Field | Type | Description |
|---|---|---|
datarequired | object | Same fields as SwitchCounterparty, shown earlier on this page. |
Response 202
| Field | Type | Description |
|---|---|---|
datarequired | object | - |
approvalRequireddata.approvalRequired | boolean | -One of true |
approvalRequestIddata.approvalRequestId | string (uuid) | null | - |
permissiondata.permission | string | - |
expiresAtdata.expiresAt | string (date-time) | - |
messagedata.message | string | - |
Errors
- 400
VALIDATION_ERROR,INVALID_INPUTorBAD_REQUEST. ForVALIDATION_ERROR,error.detailsis an array of{ path, message }. - 401
UNAUTHORIZED: missing, invalid, expired or revoked credential. - 402
SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial. - 403
FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only. - 409
CONFLICT(or a code-specific 409): the change clashes with existing state. - 429
RATE_LIMITED: slow down and retry after theRetry-Afterseconds. - 500
INTERNAL_ERROR: unexpected failure. QuoteX-Request-Idto support.
Update a bilateral counterparty
PATCH/
- Access
- API key. Scoped keys need
switch:manage. - Rate limit
- 100 requests per second (the default)
Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | - |
Request body (application/json)
| Field | Type | Description |
|---|---|---|
name | string | -max 160 chars |
customerId | string (uuid) | null | - |
vendorTrunkId | string (uuid) | null | - |
currency | string | null | -max 3 chars |
nettingEnabled | boolean | - |
notes | string | null | -max 2000 chars |
Response 200
| Field | Type | Description |
|---|---|---|
datarequired | object | Same fields as SwitchCounterparty, shown earlier on this page. |
Response 202
| Field | Type | Description |
|---|---|---|
datarequired | object | - |
approvalRequireddata.approvalRequired | boolean | -One of true |
approvalRequestIddata.approvalRequestId | string (uuid) | null | - |
permissiondata.permission | string | - |
expiresAtdata.expiresAt | string (date-time) | - |
messagedata.message | string | - |
Errors
- 400
VALIDATION_ERROR,INVALID_INPUTorBAD_REQUEST. ForVALIDATION_ERROR,error.detailsis an array of{ path, message }. - 401
UNAUTHORIZED: missing, invalid, expired or revoked credential. - 402
SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial. - 403
FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only. - 404
NOT_FOUND: no such resource on your account. - 409
CONFLICT(or a code-specific 409): the change clashes with existing state. - 429
RATE_LIMITED: slow down and retry after theRetry-Afterseconds. - 500
INTERNAL_ERROR: unexpected failure. QuoteX-Request-Idto support.
Delete a bilateral counterparty
DELETE/
- Access
- API key. Scoped keys need
switch:manage. - Rate limit
- 100 requests per second (the default)
Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | - |
Response 200
| Field | Type | Description |
|---|---|---|
datarequired | object | - |
deletedrequireddata.deleted | boolean | -One of true |
Response 202
| Field | Type | Description |
|---|---|---|
datarequired | object | - |
approvalRequireddata.approvalRequired | boolean | -One of true |
approvalRequestIddata.approvalRequestId | string (uuid) | null | - |
permissiondata.permission | string | - |
expiresAtdata.expiresAt | string (date-time) | - |
messagedata.message | string | - |
Errors
- 400
VALIDATION_ERROR,INVALID_INPUTorBAD_REQUEST. ForVALIDATION_ERROR,error.detailsis an array of{ path, message }. - 401
UNAUTHORIZED: missing, invalid, expired or revoked credential. - 402
SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial. - 403
FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only. - 404
NOT_FOUND: no such resource on your account. - 409
CONFLICT(or a code-specific 409): the change clashes with existing state. - 429
RATE_LIMITED: slow down and retry after theRetry-Afterseconds. - 500
INTERNAL_ERROR: unexpected failure. QuoteX-Request-Idto support.
Run netting for a counterparty over a period
POST/
- Access
- API key. Scoped keys need
switch:manage. - Rate limit
- 100 requests per second (the default)
Open receivables (less issued credit notes) minus open payables in the period give one net figure and direction. The run is recorded as final and fires the netting.run webhook; the money itself moves off-platform.
Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | - |
Request body (application/json)
| Field | Type | Description |
|---|---|---|
periodStartrequired | string | ISO date or datetime |
periodEndrequired | string | ISO date or datetime (exclusive) |
notes | string | null | -max 2000 chars |
Response 201
| Field | Type | Description |
|---|---|---|
datarequired | object | - |
idrequireddata.id | string (uuid) | - |
counterpartyIdrequireddata.counterpartyId | string (uuid) | - |
counterpartyNamerequireddata.counterpartyName | string | - |
periodStartrequireddata.periodStart | string (date-time) | null | ISO-8601 timestamp (UTC) |
periodEndrequireddata.periodEnd | string (date-time) | null | ISO-8601 timestamp (UTC) |
arTotalrequireddata.arTotal | money | USD as a decimal string with exactly 6 places, e.g. "0.012500". |
apTotalrequireddata.apTotal | money | USD as a decimal string with exactly 6 places, e.g. "0.012500". |
netAmountrequireddata.netAmount | money | Absolute net amount; see direction USD as a decimal string with exactly 6 places, e.g. "0.012500". |
directionrequireddata.direction | string | -One of receivable, payable, settled |
statusrequireddata.status | string | - |
notesrequireddata.notes | string | null | - |
createdAtrequireddata.createdAt | string (date-time) | ISO-8601 timestamp (UTC) |
Response 202
| Field | Type | Description |
|---|---|---|
datarequired | object | - |
approvalRequireddata.approvalRequired | boolean | -One of true |
approvalRequestIddata.approvalRequestId | string (uuid) | null | - |
permissiondata.permission | string | - |
expiresAtdata.expiresAt | string (date-time) | - |
messagedata.message | string | - |
Errors
- 400
VALIDATION_ERROR,INVALID_INPUTorBAD_REQUEST. ForVALIDATION_ERROR,error.detailsis an array of{ path, message }. - 401
UNAUTHORIZED: missing, invalid, expired or revoked credential. - 402
SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial. - 403
FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only. - 404
NOT_FOUND: no such resource on your account. - 409
CONFLICT(or a code-specific 409): the change clashes with existing state. - 429
RATE_LIMITED: slow down and retry after theRetry-Afterseconds. - 500
INTERNAL_ERROR: unexpected failure. QuoteX-Request-Idto support.
List netting runs
GET/
- Access
- API key. Scoped keys need
switch:manage. - Rate limit
- 100 requests per second (the default)
Settlements that offset what a bilateral counterparty owes you against what you owe them (latest 200).
Parameters
| Name | In | Type | Description |
|---|---|---|---|
counterpartyId | query | string (uuid) | - |
Response 200
| Field | Type | Description |
|---|---|---|
datarequired | object[] | - |
idrequireddata[].id | string (uuid) | - |
counterpartyIdrequireddata[].counterpartyId | string (uuid) | - |
counterpartyNamerequireddata[].counterpartyName | string | null | - |
periodStartrequireddata[].periodStart | string (date-time) | null | ISO-8601 timestamp (UTC) |
periodEndrequireddata[].periodEnd | string (date-time) | null | ISO-8601 timestamp (UTC) |
arTotalrequireddata[].arTotal | money | USD as a decimal string with exactly 6 places, e.g. "0.012500". |
apTotalrequireddata[].apTotal | money | USD as a decimal string with exactly 6 places, e.g. "0.012500". |
netAmountrequireddata[].netAmount | money | USD as a decimal string with exactly 6 places, e.g. "0.012500". |
directionrequireddata[].direction | string | - |
statusrequireddata[].status | string | - |
notesrequireddata[].notes | string | null | - |
createdAtrequireddata[].createdAt | string (date-time) | ISO-8601 timestamp (UTC) |
Errors
- 400
VALIDATION_ERROR,INVALID_INPUTorBAD_REQUEST. ForVALIDATION_ERROR,error.detailsis an array of{ path, message }. - 401
UNAUTHORIZED: missing, invalid, expired or revoked credential. - 402
SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial. - 403
FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only. - 429
RATE_LIMITED: slow down and retry after theRetry-Afterseconds. - 500
INTERNAL_ERROR: unexpected failure. QuoteX-Request-Idto support.