Skip to content
Markets open

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/api/v1/switch/invoices

Access
API key. Scoped keys need switch:manage.
Rate limit
100 requests per second (the default)

Parameters

NameInTypeDescription
customerIdquerystring (uuid)-
statusquerystring-One of draft, open, partial, paid, overdue, void
limitqueryintegerPage size (default 50, max 500)
offsetqueryinteger-

Response 200

FieldTypeDescription
datarequiredobject-
rowsrequireddata.rowsobject[]-
idrequireddata.rows[].idstring (uuid)-
customerIdrequireddata.rows[].customerIdstring (uuid)-
invoiceNumberrequireddata.rows[].invoiceNumberstringSequential per operator, gap-free
periodStartrequireddata.rows[].periodStartstring (date-time) | nullISO-8601 timestamp (UTC)
periodEndrequireddata.rows[].periodEndstring (date-time) | nullISO-8601 timestamp (UTC)
issueDaterequireddata.rows[].issueDatestring (date-time)ISO-8601 timestamp (UTC)
dueDaterequireddata.rows[].dueDatestring (date-time) | nullISO-8601 timestamp (UTC)
currencyrequireddata.rows[].currencystring-max 3 chars
subtotalrequireddata.rows[].subtotalmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
taxrequireddata.rows[].taxmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
totalrequireddata.rows[].totalmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
amountPaidrequireddata.rows[].amountPaidmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
statusrequireddata.rows[].statusstring-One of draft, open, partial, paid, overdue, void
overduerequireddata.rows[].overdueboolean-
notesrequireddata.rows[].notesstring | null-
replacesInvoiceIddata.rows[].replacesInvoiceIdstring (uuid) | null-
sentAtdata.rows[].sentAtstring (date-time) | nullISO-8601 timestamp (UTC)
sendCountdata.rows[].sendCountinteger-
customerLabeldata.rows[].customerLabelstring | nullOn list rows
totalrequireddata.totalinteger-
limitrequireddata.limitinteger-
offsetrequireddata.offsetinteger-

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Issue an invoice from a reviewed preview

POST/api/v1/switch/invoices

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)

FieldTypeDescription
customerIdrequiredstring (uuid)-
periodStartrequiredstringISO-8601 date or timestamp; start of the billing period
periodEndrequiredstringISO-8601 date or timestamp; end of the billing period
notesstring | null-max 2000 chars
includeBroughtForwardbooleanAlso bill priced, still-unbilled usage from before the period
applyCreditsbooleanConsume the customer's open credit notes on this invoice
excludeUnratedobject | nullIssue despite unpriced usage, leaving it unbilled for the stated reason (needs the billing adjustment permission)
reasonrequiredexcludeUnrated.reasonstring-max 2000 chars
reviewTokenrequiredstring-max 120 chars

Response 201

FieldTypeDescription
datarequiredobject-
idrequireddata.idstring (uuid)-
customerIdrequireddata.customerIdstring (uuid)-
invoiceNumberrequireddata.invoiceNumberstringSequential per operator, gap-free
periodStartrequireddata.periodStartstring (date-time) | nullISO-8601 timestamp (UTC)
periodEndrequireddata.periodEndstring (date-time) | nullISO-8601 timestamp (UTC)
issueDaterequireddata.issueDatestring (date-time)ISO-8601 timestamp (UTC)
dueDaterequireddata.dueDatestring (date-time) | nullISO-8601 timestamp (UTC)
currencyrequireddata.currencystring-max 3 chars
subtotalrequireddata.subtotalmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
taxrequireddata.taxmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
totalrequireddata.totalmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
amountPaidrequireddata.amountPaidmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
statusrequireddata.statusstring-One of draft, open, partial, paid, overdue, void
overduerequireddata.overdueboolean-
notesrequireddata.notesstring | null-
replacesInvoiceIddata.replacesInvoiceIdstring (uuid) | null-
sentAtdata.sentAtstring (date-time) | nullISO-8601 timestamp (UTC)
sendCountdata.sendCountinteger-
customerLabeldata.customerLabelstring | nullOn list rows
reviewDigestrequireddata.reviewDigeststring | null-
previewdata.previewobject-
customerrequireddata.preview.customerobject-
idrequireddata.preview.customer.idstring (uuid)-
labelrequireddata.preview.customer.labelstring-
legalNamerequireddata.preview.customer.legalNamestring-
currencyrequireddata.preview.customer.currencystring-
periodrequireddata.preview.periodobject-
startrequireddata.preview.period.startstring-
endrequireddata.preview.period.endstring-
timezonerequireddata.preview.period.timezonestring-
labelrequireddata.preview.period.labelstring-
dueDaterequireddata.preview.dueDatestring-
paymentTermsDaysrequireddata.preview.paymentTermsDaysinteger-
currencyrequireddata.preview.currencystring-
usagerequireddata.preview.usageobjectBillable, rated-at-zero, by-trunk and by-channel usage
broughtForwardrequireddata.preview.broughtForwardobject-
unratedrequireddata.preview.unratedobjectUsage that could not be priced. Blocks issue unless excluded with a reason.
linesrequireddata.preview.linesobject[]-
chargesrequireddata.preview.chargesnumberUS dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string)
creditsrequireddata.preview.creditsobject-
taxrequireddata.preview.taxobject-
totalrequireddata.preview.totalnumberUS dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string)
provenancerequireddata.preview.provenanceobject-
reviewTokendata.preview.reviewTokenstringPass to POST /switch/invoices to issue exactly what was reviewed

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.
  • AlsoINVOICE_REVIEW_STALE, INVOICE_UNRATED_USAGE

Preview an invoice before issuing it

POST/api/v1/switch/invoices/preview

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)

FieldTypeDescription
customerIdrequiredstring (uuid)-
periodStartrequiredstringISO-8601 date or timestamp; start of the billing period
periodEndrequiredstringISO-8601 date or timestamp; end of the billing period
notesstring | null-max 2000 chars
includeBroughtForwardbooleanAlso bill priced, still-unbilled usage from before the period
applyCreditsbooleanConsume the customer's open credit notes on this invoice
excludeUnratedobject | nullIssue despite unpriced usage, leaving it unbilled for the stated reason (needs the billing adjustment permission)
reasonrequiredexcludeUnrated.reasonstring-max 2000 chars
releaseInvoiceIdstring (uuid) | nullReissue only: review as if this invoice were already voided

Response 200

FieldTypeDescription
datarequiredobjectSame fields as SwitchInvoicePreview, shown earlier on this page.

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Get an invoice with lines, payments and history

GET/api/v1/switch/invoices/{id}

Access
API key. Scoped keys need switch:manage.
Rate limit
100 requests per second (the default)

Parameters

NameInTypeDescription
idrequiredpathstring-

Response 200

FieldTypeDescription
datarequiredobject-
idrequireddata.idstring (uuid)-
customerIdrequireddata.customerIdstring (uuid)-
invoiceNumberrequireddata.invoiceNumberstringSequential per operator, gap-free
periodStartrequireddata.periodStartstring (date-time) | nullISO-8601 timestamp (UTC)
periodEndrequireddata.periodEndstring (date-time) | nullISO-8601 timestamp (UTC)
issueDaterequireddata.issueDatestring (date-time)ISO-8601 timestamp (UTC)
dueDaterequireddata.dueDatestring (date-time) | nullISO-8601 timestamp (UTC)
currencyrequireddata.currencystring-max 3 chars
subtotalrequireddata.subtotalmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
taxrequireddata.taxmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
totalrequireddata.totalmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
amountPaidrequireddata.amountPaidmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
statusrequireddata.statusstring-One of draft, open, partial, paid, overdue, void
overduerequireddata.overdueboolean-
notesrequireddata.notesstring | null-
replacesInvoiceIddata.replacesInvoiceIdstring (uuid) | null-
sentAtdata.sentAtstring (date-time) | nullISO-8601 timestamp (UTC)
sendCountdata.sendCountinteger-
customerLabeldata.customerLabelstring | nullOn list rows
linesrequireddata.linesobject[]Invoice lines in print order
paymentsrequireddata.paymentsobject[]-
idrequireddata.payments[].idstring (uuid)-
amountrequireddata.payments[].amountmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
methodrequireddata.payments[].methodstring | null-
referencerequireddata.payments[].referencestring | null-
paidAtrequireddata.payments[].paidAtstring (date-time)ISO-8601 timestamp (UTC)
createdAtrequireddata.payments[].createdAtstring (date-time)ISO-8601 timestamp (UTC)
customerrequireddata.customerobject | null-
idrequireddata.customer.idstring (uuid)-
labelrequireddata.customer.labelstring-
sourcerequireddata.customer.sourcestring | null-
currencyrequireddata.customer.currencystring-
countryBreakdownrequireddata.countryBreakdownobjectVoice usage on this invoice by destination country (derived, read-only)
billingProfilerequireddata.billingProfileobject | nullThe billing identity frozen onto the document at issue
identityFrozenrequireddata.identityFrozenboolean-
exclusionsrequireddata.exclusionsobject[]Usage consciously left unbilled on this run, with the reason
replacesrequireddata.replacesobject | null-
idrequireddata.replaces.idstring (uuid)-
invoiceNumberrequireddata.replaces.invoiceNumberstring-
statusrequireddata.replaces.statusstring-One of draft, open, partial, paid, overdue, void
replacedByrequireddata.replacedByobject | null-
idrequireddata.replacedBy.idstring (uuid)-
invoiceNumberrequireddata.replacedBy.invoiceNumberstring-
statusrequireddata.replacedBy.statusstring-One of draft, open, partial, paid, overdue, void

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Record a payment received against an invoice

POST/api/v1/switch/invoices/{id}/payments

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

NameInTypeDescription
idrequiredpathstring-

Request body (application/json)

FieldTypeDescription
amountrequirednumberAmount received, in the document currencymin 0
methodstring | null-max 32 chars
referencestring | null-max 160 chars

Response 201

FieldTypeDescription
datarequiredobjectSame fields as SwitchInvoice, shown earlier on this page.

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Void an invoice

POST/api/v1/switch/invoices/{id}/void

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

NameInTypeDescription
idrequiredpathstring-

Request body (application/json)

FieldTypeDescription
reasonrequiredstring-max 2000 chars

Response 200

FieldTypeDescription
datarequiredobject-
idrequireddata.idstring (uuid)-
customerIdrequireddata.customerIdstring (uuid)-
invoiceNumberrequireddata.invoiceNumberstringSequential per operator, gap-free
periodStartrequireddata.periodStartstring (date-time) | nullISO-8601 timestamp (UTC)
periodEndrequireddata.periodEndstring (date-time) | nullISO-8601 timestamp (UTC)
issueDaterequireddata.issueDatestring (date-time)ISO-8601 timestamp (UTC)
dueDaterequireddata.dueDatestring (date-time) | nullISO-8601 timestamp (UTC)
currencyrequireddata.currencystring-max 3 chars
subtotalrequireddata.subtotalmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
taxrequireddata.taxmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
totalrequireddata.totalmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
amountPaidrequireddata.amountPaidmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
statusrequireddata.statusstring-One of draft, open, partial, paid, overdue, void
overduerequireddata.overdueboolean-
notesrequireddata.notesstring | null-
replacesInvoiceIddata.replacesInvoiceIdstring (uuid) | null-
sentAtdata.sentAtstring (date-time) | nullISO-8601 timestamp (UTC)
sendCountdata.sendCountinteger-
customerLabeldata.customerLabelstring | nullOn list rows
releasedCallsrequireddata.releasedCallsinteger-
returnedCreditNotesrequireddata.returnedCreditNotesinteger-

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Void an invoice and issue its replacement

POST/api/v1/switch/invoices/{id}/reissue

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

NameInTypeDescription
idrequiredpathstring-

Request body (application/json)

FieldTypeDescription
reasonrequiredstring-max 2000 chars
reviewTokenrequiredstring-max 120 chars
notesstring | null-max 2000 chars
includeBroughtForwardboolean-
applyCreditsboolean-
excludeUnratedobject | null-
reasonrequiredexcludeUnrated.reasonstring-max 2000 chars

Response 201

FieldTypeDescription
datarequiredobject-
idrequireddata.idstring (uuid)-
customerIdrequireddata.customerIdstring (uuid)-
invoiceNumberrequireddata.invoiceNumberstringSequential per operator, gap-free
periodStartrequireddata.periodStartstring (date-time) | nullISO-8601 timestamp (UTC)
periodEndrequireddata.periodEndstring (date-time) | nullISO-8601 timestamp (UTC)
issueDaterequireddata.issueDatestring (date-time)ISO-8601 timestamp (UTC)
dueDaterequireddata.dueDatestring (date-time) | nullISO-8601 timestamp (UTC)
currencyrequireddata.currencystring-max 3 chars
subtotalrequireddata.subtotalmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
taxrequireddata.taxmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
totalrequireddata.totalmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
amountPaidrequireddata.amountPaidmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
statusrequireddata.statusstring-One of draft, open, partial, paid, overdue, void
overduerequireddata.overdueboolean-
notesrequireddata.notesstring | null-
replacesInvoiceIddata.replacesInvoiceIdstring (uuid) | null-
sentAtdata.sentAtstring (date-time) | nullISO-8601 timestamp (UTC)
sendCountdata.sendCountinteger-
customerLabeldata.customerLabelstring | nullOn list rows
replacesInvoiceNumberrequireddata.replacesInvoiceNumberstring-

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.
  • AlsoINVOICE_REVIEW_STALE, INVOICE_UNRATED_USAGE

Email an invoice to its recipients

POST/api/v1/switch/invoices/{id}/send

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

NameInTypeDescription
idrequiredpathstring-

Request body (application/json)

FieldTypeDescription
tostring (email)[]-

Response 200

FieldTypeDescription
datarequiredobject-
sentrequireddata.sentboolean-
torequireddata.tostring[]Addresses the mail transport accepted
failedrequireddata.failedany[]Addresses that could not be sent to
sendCountrequireddata.sendCountinteger-
sentAtrequireddata.sentAtstring (date-time) | nullISO-8601 timestamp (UTC)

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Render an invoice as printable HTML

GET/api/v1/switch/invoices/{id}/print

Access
API key. Scoped keys need switch:manage.
Rate limit
100 requests per second (the default)

Parameters

NameInTypeDescription
idrequiredpathstring-

Response 200 (text/html)

The invoice as a standalone HTML document.

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Download an invoice as XML

GET/api/v1/switch/invoices/{id}/xml

Access
API key. Scoped keys need switch:manage.
Rate limit
100 requests per second (the default)

Parameters

NameInTypeDescription
idrequiredpathstring-

Response 200 (application/xml)

The invoice as a structured XML document.

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Download an invoice as PDF

GET/api/v1/switch/invoices/{id}/pdf

Access
API key. Scoped keys need switch:manage.
Rate limit
100 requests per second (the default)

Parameters

NameInTypeDescription
idrequiredpathstring-

Response 200 (application/pdf)

The invoice PDF, as an attachment.

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

List credit notes

GET/api/v1/switch/credit-notes

Access
API key. Scoped keys need switch:manage.
Rate limit
100 requests per second (the default)

Parameters

NameInTypeDescription
customerIdquerystring (uuid)-
limitqueryintegerPage size (default 50, max 500)
offsetqueryinteger-

Response 200

FieldTypeDescription
datarequiredobject[]-
idrequireddata[].idstring (uuid)-
customerIdrequireddata[].customerIdstring (uuid)-
creditNoteNumberrequireddata[].creditNoteNumberstring-
invoiceIdrequireddata[].invoiceIdstring (uuid) | null-
amountrequireddata[].amountmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
reasonrequireddata[].reasonstring | null-
statusrequireddata[].statusstringissued (open credit) or applied
createdAtrequireddata[].createdAtstring (date-time)ISO-8601 timestamp (UTC)
customerLabeldata[].customerLabelstring | null-

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Issue a credit note to a customer

POST/api/v1/switch/credit-notes

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)

FieldTypeDescription
customerIdrequiredstring (uuid)-
amountrequirednumber-min 0
reasonstring | null-max 2000 chars
invoiceIdstring (uuid) | null-

Response 201

FieldTypeDescription
datarequiredobjectSame fields as SwitchCreditNote, shown earlier on this page.

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Get accounts-receivable ageing

GET/api/v1/switch/ar-aging

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

FieldTypeDescription
datarequiredobject-
totalOutstandingrequireddata.totalOutstandingnumberUS dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string)
grossOutstandingrequireddata.grossOutstandingnumberUS dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string)
creditNotesOpenrequireddata.creditNotesOpennumberUS dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string)
openCountrequireddata.openCountinteger-
bucketsrequireddata.bucketsobject-
currentrequireddata.buckets.currentnumberUS dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string)
d1_30requireddata.buckets.d1_30numberUS dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string)
d31_60requireddata.buckets.d31_60numberUS dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string)
d61_90requireddata.buckets.d61_90numberUS dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string)
d90plusrequireddata.buckets.d90plusnumberUS dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string)

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

List supplier payables

GET/api/v1/switch/payables

Access
API key. Scoped keys need switch:manage.
Rate limit
100 requests per second (the default)

Parameters

NameInTypeDescription
vendorTrunkIdquerystring (uuid)-
statusquerystring-One of draft, open, partial, paid, overdue, void
limitqueryintegerPage size (default 50, max 500)
offsetqueryinteger-

Response 200

FieldTypeDescription
datarequiredobject-
rowsrequireddata.rowsobject[]-
idrequireddata.rows[].idstring (uuid)-
vendorTrunkIdrequireddata.rows[].vendorTrunkIdstring (uuid)-
payableNumberrequireddata.rows[].payableNumberstring-
periodStartrequireddata.rows[].periodStartstring (date-time) | nullISO-8601 timestamp (UTC)
periodEndrequireddata.rows[].periodEndstring (date-time) | nullISO-8601 timestamp (UTC)
issueDaterequireddata.rows[].issueDatestring (date-time)ISO-8601 timestamp (UTC)
dueDaterequireddata.rows[].dueDatestring (date-time) | nullISO-8601 timestamp (UTC)
currencyrequireddata.rows[].currencystring-max 3 chars
subtotalrequireddata.rows[].subtotalmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
totalrequireddata.rows[].totalmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
amountPaidrequireddata.rows[].amountPaidmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
statusrequireddata.rows[].statusstring-One of draft, open, partial, paid, overdue, void
notesrequireddata.rows[].notesstring | null-
overduedata.rows[].overdueboolean-
trunkLabeldata.rows[].trunkLabelstring | nullOn list rows
createdAtrequireddata.rows[].createdAtstring (date-time)ISO-8601 timestamp (UTC)
updatedAtrequireddata.rows[].updatedAtstring (date-time)ISO-8601 timestamp (UTC)
totalrequireddata.totalinteger-
limitrequireddata.limitinteger-

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Raise a payable for a supplier trunk over a period

POST/api/v1/switch/payables

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)

FieldTypeDescription
vendorTrunkIdrequiredstring (uuid)-
periodStartrequiredstringISO-8601 date or timestamp; start of the billing period
periodEndrequiredstringISO-8601 date or timestamp; end of the billing period
notesstring | null-max 2000 chars

Response 201

FieldTypeDescription
datarequiredobjectSame fields as SwitchPayable, shown earlier on this page.

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Get a payable with lines and payments

GET/api/v1/switch/payables/{id}

Access
API key. Scoped keys need switch:manage.
Rate limit
100 requests per second (the default)

Parameters

NameInTypeDescription
idrequiredpathstring-

Response 200

FieldTypeDescription
datarequiredobject-
idrequireddata.idstring (uuid)-
vendorTrunkIdrequireddata.vendorTrunkIdstring (uuid)-
payableNumberrequireddata.payableNumberstring-
periodStartrequireddata.periodStartstring (date-time) | nullISO-8601 timestamp (UTC)
periodEndrequireddata.periodEndstring (date-time) | nullISO-8601 timestamp (UTC)
issueDaterequireddata.issueDatestring (date-time)ISO-8601 timestamp (UTC)
dueDaterequireddata.dueDatestring (date-time) | nullISO-8601 timestamp (UTC)
currencyrequireddata.currencystring-max 3 chars
subtotalrequireddata.subtotalmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
totalrequireddata.totalmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
amountPaidrequireddata.amountPaidmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
statusrequireddata.statusstring-One of draft, open, partial, paid, overdue, void
notesrequireddata.notesstring | null-
overduedata.overdueboolean-
trunkLabeldata.trunkLabelstring | nullOn list rows
createdAtrequireddata.createdAtstring (date-time)ISO-8601 timestamp (UTC)
updatedAtrequireddata.updatedAtstring (date-time)ISO-8601 timestamp (UTC)
linesrequireddata.linesobject[]-
paymentsrequireddata.paymentsobject[]Same fields as SwitchPayment, shown earlier on this page.
trunkrequireddata.trunkobject | null-
idrequireddata.trunk.idstring (uuid)-
labelrequireddata.trunk.labelstring-
settlementModerequireddata.trunk.settlementModestring | null-

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Record a payment made to a supplier

POST/api/v1/switch/payables/{id}/payments

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

NameInTypeDescription
idrequiredpathstring-

Request body (application/json)

FieldTypeDescription
amountrequirednumberAmount received, in the document currencymin 0
methodstring | null-max 32 chars
referencestring | null-max 160 chars

Response 201

FieldTypeDescription
datarequiredobjectSame fields as SwitchPayable, shown earlier on this page.

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Void a payable

POST/api/v1/switch/payables/{id}/void

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

NameInTypeDescription
idrequiredpathstring-

Response 200

FieldTypeDescription
datarequiredobject-
idrequireddata.idstring (uuid)-
vendorTrunkIdrequireddata.vendorTrunkIdstring (uuid)-
payableNumberrequireddata.payableNumberstring-
periodStartrequireddata.periodStartstring (date-time) | nullISO-8601 timestamp (UTC)
periodEndrequireddata.periodEndstring (date-time) | nullISO-8601 timestamp (UTC)
issueDaterequireddata.issueDatestring (date-time)ISO-8601 timestamp (UTC)
dueDaterequireddata.dueDatestring (date-time) | nullISO-8601 timestamp (UTC)
currencyrequireddata.currencystring-max 3 chars
subtotalrequireddata.subtotalmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
totalrequireddata.totalmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
amountPaidrequireddata.amountPaidmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
statusrequireddata.statusstring-One of draft, open, partial, paid, overdue, void
notesrequireddata.notesstring | null-
overduedata.overdueboolean-
trunkLabeldata.trunkLabelstring | nullOn list rows
createdAtrequireddata.createdAtstring (date-time)ISO-8601 timestamp (UTC)
updatedAtrequireddata.updatedAtstring (date-time)ISO-8601 timestamp (UTC)
releasedCallsrequireddata.releasedCallsinteger-

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Get accounts-payable ageing

GET/api/v1/switch/ap-aging

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

FieldTypeDescription
datarequiredobject-
totalOwedrequireddata.totalOwednumberUS dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string)
openCountrequireddata.openCountinteger-
bucketsrequireddata.bucketsobject-
currentrequireddata.buckets.currentnumberUS dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string)
d1_30requireddata.buckets.d1_30numberUS dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string)
d31_60requireddata.buckets.d31_60numberUS dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string)
d61_90requireddata.buckets.d61_90numberUS dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string)
d90plusrequireddata.buckets.d90plusnumberUS dollars as a JSON number rounded to 6 decimals (a computed figure, not a ledger string)

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

List bilateral counterparties

GET/api/v1/switch/counterparties

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

FieldTypeDescription
datarequiredobject[]-
idrequireddata[].idstring (uuid)-
namerequireddata[].namestring-
customerIdrequireddata[].customerIdstring (uuid) | nullThe customer side of this counterparty
vendorTrunkIdrequireddata[].vendorTrunkIdstring (uuid) | nullThe supplier side of this counterparty
currencyrequireddata[].currencystring-
nettingEnabledrequireddata[].nettingEnabledboolean-
notesrequireddata[].notesstring | null-
customerLabeldata[].customerLabelstring | null-
trunkLabeldata[].trunkLabelstring | null-
createdAtrequireddata[].createdAtstring (date-time)ISO-8601 timestamp (UTC)
updatedAtrequireddata[].updatedAtstring (date-time)ISO-8601 timestamp (UTC)

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Create a bilateral counterparty

POST/api/v1/switch/counterparties

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)

FieldTypeDescription
namerequiredstring-max 160 chars
customerIdstring (uuid) | null-
vendorTrunkIdstring (uuid) | null-
currencystring | null-max 3 chars
nettingEnabledboolean-
notesstring | null-max 2000 chars

Response 201

FieldTypeDescription
datarequiredobjectSame fields as SwitchCounterparty, shown earlier on this page.

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Update a bilateral counterparty

PATCH/api/v1/switch/counterparties/{id}

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

NameInTypeDescription
idrequiredpathstring-

Request body (application/json)

FieldTypeDescription
namestring-max 160 chars
customerIdstring (uuid) | null-
vendorTrunkIdstring (uuid) | null-
currencystring | null-max 3 chars
nettingEnabledboolean-
notesstring | null-max 2000 chars

Response 200

FieldTypeDescription
datarequiredobjectSame fields as SwitchCounterparty, shown earlier on this page.

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Delete a bilateral counterparty

DELETE/api/v1/switch/counterparties/{id}

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

NameInTypeDescription
idrequiredpathstring-

Response 200

FieldTypeDescription
datarequiredobject-
deletedrequireddata.deletedboolean-One of true

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Run netting for a counterparty over a period

POST/api/v1/switch/counterparties/{id}/netting

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

NameInTypeDescription
idrequiredpathstring-

Request body (application/json)

FieldTypeDescription
periodStartrequiredstringISO date or datetime
periodEndrequiredstringISO date or datetime (exclusive)
notesstring | null-max 2000 chars

Response 201

FieldTypeDescription
datarequiredobject-
idrequireddata.idstring (uuid)-
counterpartyIdrequireddata.counterpartyIdstring (uuid)-
counterpartyNamerequireddata.counterpartyNamestring-
periodStartrequireddata.periodStartstring (date-time) | nullISO-8601 timestamp (UTC)
periodEndrequireddata.periodEndstring (date-time) | nullISO-8601 timestamp (UTC)
arTotalrequireddata.arTotalmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
apTotalrequireddata.apTotalmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
netAmountrequireddata.netAmountmoneyAbsolute net amount; see direction USD as a decimal string with exactly 6 places, e.g. "0.012500".
directionrequireddata.directionstring-One of receivable, payable, settled
statusrequireddata.statusstring-
notesrequireddata.notesstring | null-
createdAtrequireddata.createdAtstring (date-time)ISO-8601 timestamp (UTC)

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

List netting runs

GET/api/v1/switch/netting-runs

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

NameInTypeDescription
counterpartyIdquerystring (uuid)-

Response 200

FieldTypeDescription
datarequiredobject[]-
idrequireddata[].idstring (uuid)-
counterpartyIdrequireddata[].counterpartyIdstring (uuid)-
counterpartyNamerequireddata[].counterpartyNamestring | null-
periodStartrequireddata[].periodStartstring (date-time) | nullISO-8601 timestamp (UTC)
periodEndrequireddata[].periodEndstring (date-time) | nullISO-8601 timestamp (UTC)
arTotalrequireddata[].arTotalmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
apTotalrequireddata[].apTotalmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
netAmountrequireddata[].netAmountmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
directionrequireddata[].directionstring-
statusrequireddata[].statusstring-
notesrequireddata[].notesstring | null-
createdAtrequireddata[].createdAtstring (date-time)ISO-8601 timestamp (UTC)

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.