Aller au contenu
Ressource · Billing

Invoices

An invoice is a sales invoice or a supplier bill of the workspace.

invoices:readinvoices:write
MéthodeCheminRésumé
GET…/invoicesList invoices in the workspace
GET…/invoices/searchSearch invoices by attributes
POST…/invoices/uploadGet an upload URL for a sales invoice or a bill document
POST…/invoices/upload-splitGet an upload URL for a document holding several sales invoices or bills
PATCH…/invoices/{invoiceId}Update an invoice
POST…/invoices/{invoiceId}/update-statusUpdate the status of an invoice
POST…/invoices/{invoiceId}/update-counterpartyUpdate the counterparty associated with an invoice
POST…/invoices/{invoiceId}/matches/addAdd a confirmed match between an invoice and a bank transaction
POST…/invoices/{invoiceId}/matches/confirmConfirm a candidate match between an invoice and a bank transaction
POST…/invoices/{invoiceId}/matches/removeRemove a confirmed match between an invoice and a bank transaction
POST…/invoices/{invoiceId}/matches/remove-candidateRemove a candidate match suggestion for an invoice
POST…/invoices/exportExport an invoice to a downloadable file

Les chemins commencent par /workspaces/{workspaceId}. Les endpoints GET demandent invoices:read, les autres invoices:write.

L’objet Invoice

firestoreIdstringobligatoire

ID of the invoice.

workspaceIdstringobligatoire

ID of the workspace.

creationobjectobligatoire

When and by whom the resource was created.

Afficher les 2 champs enfants
creationDateTimestringdate-timeobligatoire

Date and time when the resource was created.

createdBystring

ID of the user who created the resource, when recorded.

invoiceStatusstringobligatoire

Status of the invoice in its lifecycle.

  • drafted

    Draft that may lack mandatory fields; an uploaded invoice starts here and moves to created once its data passes validation.

  • created

    Validated invoice, whose mandatory fields are all present and valid.

  • deleted

    Deleted invoice, which can no longer change status and is left out of transaction matching.

  • authorised

    Validated invoice that a user approved.

  • paid

    Validated invoice settled in full by matched bank transactions or marked as paid by a user; its mandatory fields can no longer change.

  • voided

    Cancelled invoice, left out of transaction matching.

processingStatusstringobligatoire

Progress of the data extraction from the invoice file.

  • uploaded

    The file is uploaded and its data is not extracted yet.

  • parsed

    The data is extracted from the file, or the invoice was imported without a file.

  • failed

    The data could not be extracted from the file, for example because the file is too large.

accountingTypestring

Direction of the invoice: a supplier bill to pay or a sales invoice to collect.

  • payable

    A bill received from a supplier, which the workspace pays.

  • receivable

    An invoice issued to a customer, which the workspace collects.

reconciledbooleanobligatoire
Afficher les 57 champs
processedbooleanobligatoire
paymentSubmittedbooleanobligatoire
sentDateTimestringdate-time
paymentMethodstring

Payment method of the invoice.

Afficher les 13 valeurs
  • creditCard

    Credit card.

  • debitCard

    Debit card.

  • directDebit

    Direct debit.

  • bankTransfer

    Bank transfer.

  • cash

    Cash.

  • voucher

    Voucher.

  • check

    Check.

  • paypal

    PayPal.

  • stripe

    Stripe.

  • applePay

    Apple Pay.

  • googlePay

    Google Pay.

  • samsungPay

    Samsung Pay.

  • unknown

    The payment method is not known.

supplierCounterpartyIdstring | null

ID of the counterparty.

receiverCounterpartyIdstring | null

ID of the counterparty.

storagePathstring
fileChecksumMd5string
fileChecksumCrc32cstring
amountDueMonetaryAmount | null
Afficher les 2 champs enfants
amountnumberobligatoire

Amount in the main unit of the currency, such as francs.

currencystring | null

Currency of the amount, when known.

amountPaidSinceLastInvoiceMonetaryAmount | null
Afficher les 2 champs enfants
amountnumberobligatoire

Amount in the main unit of the currency, such as francs.

currencystring | null

Currency of the amount, when known.

clientIdstring | null
currencystring | null

ISO 4217 currency code

dueDatestring | null
invoiceDatestring | null
invoiceIdstring | null
isUnpaidRemindernumber | null
netAmountMonetaryAmount | null
Afficher les 2 champs enfants
amountnumberobligatoire

Amount in the main unit of the currency, such as francs.

currencystring | null

Currency of the amount, when known.

paymentTermsstring | null
purchaseOrderstring | null
receiverAddressAddressField | null

Postal address on a document, in which any part can be missing.

Afficher les 12 champs enfants
countrystring | null

ISO 3166-1 alpha-2 country code

postCodestring | null

Post code of the address.

townNamestring | null

Name of the town or city.

streetNamestring | null

Name of the street.

buildingNumberstring | null

Number of the building in the street.

namestring | null

Name of the building or place.

sortingCodestring | null

Additional sorting code of the postal service, used in a few countries such as France.

postBoxstring | null

Post office box.

administrativeAreastring | null

Region of the country, such as a canton or a state.

recipientsstring[] | null

Names of the people the address is for.

organizationstring | null

Name of the organization at the address.

sourcestring[] | null

Text the address was read from, one item per line.

receiverBankAccountBankAccountField | null
Afficher les 6 champs enfants
bankNamestring | null
bankAddressAddressField | null

Postal address on a document, in which any part can be missing.

Afficher les 12 champs enfants
countrystring | null

ISO 3166-1 alpha-2 country code

postCodestring | null

Post code of the address.

townNamestring | null

Name of the town or city.

streetNamestring | null

Name of the street.

buildingNumberstring | null

Number of the building in the street.

namestring | null

Name of the building or place.

sortingCodestring | null

Additional sorting code of the postal service, used in a few countries such as France.

postBoxstring | null

Post office box.

administrativeAreastring | null

Region of the country, such as a canton or a state.

recipientsstring[] | null

Names of the people the address is for.

organizationstring | null

Name of the organization at the address.

sourcestring[] | null

Text the address was read from, one item per line.

bicstring | null
currencystring | null

ISO 4217 currency code

accountIdentificationstring | null
accountSecondaryIdentificationstring | null
receiverContactNamestring | null
receiverEmailstring | null
receiverNamestring | null
receiverPhonestring | null
receiverTaxIdstring | null
remitToAddressAddressField | null

Postal address on a document, in which any part can be missing.

Afficher les 12 champs enfants
countrystring | null

ISO 3166-1 alpha-2 country code

postCodestring | null

Post code of the address.

townNamestring | null

Name of the town or city.

streetNamestring | null

Name of the street.

buildingNumberstring | null

Number of the building in the street.

namestring | null

Name of the building or place.

sortingCodestring | null

Additional sorting code of the postal service, used in a few countries such as France.

postBoxstring | null

Post office box.

administrativeAreastring | null

Region of the country, such as a canton or a state.

recipientsstring[] | null

Names of the people the address is for.

organizationstring | null

Name of the organization at the address.

sourcestring[] | null

Text the address was read from, one item per line.

remitToNamestring | null
shipToAddressAddressField | null

Postal address on a document, in which any part can be missing.

Afficher les 12 champs enfants
countrystring | null

ISO 3166-1 alpha-2 country code

postCodestring | null

Post code of the address.

townNamestring | null

Name of the town or city.

streetNamestring | null

Name of the street.

buildingNumberstring | null

Number of the building in the street.

namestring | null

Name of the building or place.

sortingCodestring | null

Additional sorting code of the postal service, used in a few countries such as France.

postBoxstring | null

Post office box.

administrativeAreastring | null

Region of the country, such as a canton or a state.

recipientsstring[] | null

Names of the people the address is for.

organizationstring | null

Name of the organization at the address.

sourcestring[] | null

Text the address was read from, one item per line.

shipToNamestring | null
supplierAddressAddressField | null

Postal address on a document, in which any part can be missing.

Afficher les 12 champs enfants
countrystring | null

ISO 3166-1 alpha-2 country code

postCodestring | null

Post code of the address.

townNamestring | null

Name of the town or city.

streetNamestring | null

Name of the street.

buildingNumberstring | null

Number of the building in the street.

namestring | null

Name of the building or place.

sortingCodestring | null

Additional sorting code of the postal service, used in a few countries such as France.

postBoxstring | null

Post office box.

administrativeAreastring | null

Region of the country, such as a canton or a state.

recipientsstring[] | null

Names of the people the address is for.

organizationstring | null

Name of the organization at the address.

sourcestring[] | null

Text the address was read from, one item per line.

supplierBankAccountsBankAccountField[] | null
Afficher les 6 champs enfants
bankNamestring | null
bankAddressAddressField | null

Postal address on a document, in which any part can be missing.

Afficher les 12 champs enfants
countrystring | null

ISO 3166-1 alpha-2 country code

postCodestring | null

Post code of the address.

townNamestring | null

Name of the town or city.

streetNamestring | null

Name of the street.

buildingNumberstring | null

Number of the building in the street.

namestring | null

Name of the building or place.

sortingCodestring | null

Additional sorting code of the postal service, used in a few countries such as France.

postBoxstring | null

Post office box.

administrativeAreastring | null

Region of the country, such as a canton or a state.

recipientsstring[] | null

Names of the people the address is for.

organizationstring | null

Name of the organization at the address.

sourcestring[] | null

Text the address was read from, one item per line.

bicstring | null
currencystring | null

ISO 4217 currency code

accountIdentificationstring | null
accountSecondaryIdentificationstring | null
supplierContactNamestring | null
supplierEmailstring | null
supplierNamestring | null
supplierPaymentRefstring | null
supplierPhonestring | null
supplierTaxIdstring | null
supplierWebsitestring | null
totalAmountMonetaryAmount | null
Afficher les 2 champs enfants
amountnumberobligatoire

Amount in the main unit of the currency, such as francs.

currencystring | null

Currency of the amount, when known.

totalTaxAmountMonetaryAmount | null
Afficher les 2 champs enfants
amountnumberobligatoire

Amount in the main unit of the currency, such as francs.

currencystring | null

Currency of the amount, when known.

itemsobject[] | null
Afficher les 12 champs enfants
amountMonetaryAmount | null
Afficher les 2 champs enfants
amountnumberobligatoire

Amount in the main unit of the currency, such as francs.

currencystring | null

Currency of the amount, when known.

descriptionstring | null
discountAmountMonetaryAmount | null
Afficher les 2 champs enfants
amountnumberobligatoire

Amount in the main unit of the currency, such as francs.

currencystring | null

Currency of the amount, when known.

discountRatenumber | null
productCodestring | null
productIdstring | null

ID of the product.

quantitynumber | null
taxAmountMonetaryAmount | null
Afficher les 2 champs enfants
amountnumberobligatoire

Amount in the main unit of the currency, such as francs.

currencystring | null

Currency of the amount, when known.

taxRatenumber | null
taxTypeIdstring | null

ID of the tax type.

unitstring | null
unitPriceMonetaryAmount | null
Afficher les 2 champs enfants
amountnumberobligatoire

Amount in the main unit of the currency, such as francs.

currencystring | null

Currency of the amount, when known.

taxesobject[] | null
Afficher les 4 champs enfants
netAmountBeforeTaxMonetaryAmount | null
Afficher les 2 champs enfants
amountnumberobligatoire

Amount in the main unit of the currency, such as francs.

currencystring | null

Currency of the amount, when known.

taxAmountMonetaryAmount | null
Afficher les 2 champs enfants
amountnumberobligatoire

Amount in the main unit of the currency, such as francs.

currencystring | null

Currency of the amount, when known.

taxCodestring | null
taxRatenumber | null
draftPaymentIdsstring[]
initiatedPaymentIdsstring[]
transactionCandidateMatchIdsstring[]
transactionConfirmedMatchIdsstring[]
transactionCandidateMatchesInvoiceMatch[]
Afficher les 2 champs enfants
targetstringobligatoire
dataobjectobligatoire
Afficher 1 champ enfant
confidencenumberobligatoire
transactionConfirmedMatchesInvoiceMatch[]
Afficher les 2 champs enfants
targetstringobligatoire
dataobjectobligatoire
Afficher 1 champ enfant
confidencenumberobligatoire
L’objet Invoice
{
  "firestoreId": "Iv5zP2nK7wRt3xMq9bLd",
  "workspaceId": "Wk7fQ2xR9bLm4tZp8sNv",
  "creation": {
    "creationDateTime": "2026-03-02T09:15:00.000Z",
    "createdBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
  },
  "invoiceStatus": "drafted",
  "processingStatus": "uploaded",
  "accountingType": "payable",
  "reconciled": true,
  "processed": true,
  "paymentSubmitted": true,
  "sentDateTime": "2026-03-02T09:30:00.000Z",
  "paymentMethod": "creditCard",
  "supplierCounterpartyId": "Cp2nG7vB4xLq9wRt5hMz",
  "receiverCounterpartyId": "Cp2nG7vB4xLq9wRt5hMz",
  "storagePath": "string",
  "fileChecksumMd5": "string",
  "fileChecksumCrc32c": "string",
  "amountDue": {
    "amount": 1250.5,
    "currency": "CHF"
  },
  "amountPaidSinceLastInvoice": {
    "amount": 1250.5,
    "currency": "CHF"
  },
  "clientId": "string",
  "currency": "CHF",
  "dueDate": "2026-03-02",
  "invoiceDate": "2026-03-02",
  "invoiceId": "string",
  "isUnpaidReminder": 0,
  "netAmount": {
    "amount": 1250.5,
    "currency": "CHF"
  },
  "paymentTerms": "string",
  "purchaseOrder": "string",
  "receiverAddress": {
    "country": "CH",
    "postCode": "8001",
    "townName": "Zürich",
    "streetName": "Bahnhofstrasse",
    "buildingNumber": "10",
    "name": "Haus zur Linde",
    "sortingCode": "string",
    "postBox": "Postfach 1234",
    "administrativeArea": "Zürich",
    "recipients": [
      "Anna Meier"
    ],
    "organization": "Muster AG",
    "source": [
      "Muster AG",
      "Bahnhofstrasse 10",
      "8001 Zürich"
    ]
  },
  "receiverBankAccount": {
    "bankName": "string",
    "bankAddress": {
      "country": "CH",
      "postCode": "8001",
      "townName": "Zürich",
      "streetName": "Bahnhofstrasse",
      "buildingNumber": "10",
      "name": "Haus zur Linde",
      "sortingCode": "string",
      "postBox": "Postfach 1234",
      "administrativeArea": "Zürich",
      "recipients": [
        "Anna Meier"
      ],
      "organization": "Muster AG",
      "source": [
        "Muster AG",
        "Bahnhofstrasse 10",
        "8001 Zürich"
      ]
    },
    "bic": "string",
    "currency": "CHF",
    "accountIdentification": "string",
    "accountSecondaryIdentification": "string"
  },
  "receiverContactName": "string",
  "receiverEmail": "string",
  "receiverName": "string",
  "receiverPhone": "string",
  "receiverTaxId": "string",
  "remitToAddress": {
    "country": "CH",
    "postCode": "8001",
    "townName": "Zürich",
    "streetName": "Bahnhofstrasse",
    "buildingNumber": "10",
    "name": "Haus zur Linde",
    "sortingCode": "string",
    "postBox": "Postfach 1234",
    "administrativeArea": "Zürich",
    "recipients": [
      "Anna Meier"
    ],
    "organization": "Muster AG",
    "source": [
      "Muster AG",
      "Bahnhofstrasse 10",
      "8001 Zürich"
    ]
  },
  "remitToName": "string",
  "shipToAddress": {
    "country": "CH",
    "postCode": "8001",
    "townName": "Zürich",
    "streetName": "Bahnhofstrasse",
    "buildingNumber": "10",
    "name": "Haus zur Linde",
    "sortingCode": "string",
    "postBox": "Postfach 1234",
    "administrativeArea": "Zürich",
    "recipients": [
      "Anna Meier"
    ],
    "organization": "Muster AG",
    "source": [
      "Muster AG",
      "Bahnhofstrasse 10",
      "8001 Zürich"
    ]
  },
  "shipToName": "string",
  "supplierAddress": {
    "country": "CH",
    "postCode": "8001",
    "townName": "Zürich",
    "streetName": "Bahnhofstrasse",
    "buildingNumber": "10",
    "name": "Haus zur Linde",
    "sortingCode": "string",
    "postBox": "Postfach 1234",
    "administrativeArea": "Zürich",
    "recipients": [
      "Anna Meier"
    ],
    "organization": "Muster AG",
    "source": [
      "Muster AG",
      "Bahnhofstrasse 10",
      "8001 Zürich"
    ]
  },
  "supplierBankAccounts": [
    {
      "bankName": "string",
      "bankAddress": {
        "country": "CH",
        "postCode": "8001",
        "townName": "Zürich",
        "streetName": "Bahnhofstrasse",
        "buildingNumber": "10",
        "name": "Haus zur Linde",
        "sortingCode": "string",
        "postBox": "Postfach 1234",
        "administrativeArea": "Zürich",
        "recipients": [
          "Anna Meier"
        ],
        "organization": "Muster AG",
        "source": [
          "Muster AG",
          "Bahnhofstrasse 10",
          "8001 Zürich"
        ]
      },
      "bic": "string",
      "currency": "CHF",
      "accountIdentification": "string",
      "accountSecondaryIdentification": "string"
    }
  ],
  "supplierContactName": "string",
  "supplierEmail": "string",
  "supplierName": "string",
  "supplierPaymentRef": "string",
  "supplierPhone": "string",
  "supplierTaxId": "string",
  "supplierWebsite": "string",
  "totalAmount": {
    "amount": 1250.5,
    "currency": "CHF"
  },
  "totalTaxAmount": {
    "amount": 1250.5,
    "currency": "CHF"
  },
  "items": [
    {
      "amount": {
        "amount": 1250.5,
        "currency": "CHF"
      },
      "description": "string",
      "discountAmount": {
        "amount": 1250.5,
        "currency": "CHF"
      },
      "discountRate": 0,
      "productCode": "string",
      "productId": "Pr4wJ8tM1xNq6zRb3vKf",
      "quantity": 0,
      "taxAmount": {
        "amount": 1250.5,
        "currency": "CHF"
      },
      "taxRate": 0,
      "taxTypeId": "Tt9mC5rL2wQz7nVb4kHp",
      "unit": "string",
      "unitPrice": {
        "amount": 1250.5,
        "currency": "CHF"
      }
    }
  ],
  "taxes": [
    {
      "netAmountBeforeTax": {
        "amount": 1250.5,
        "currency": "CHF"
      },
      "taxAmount": {
        "amount": 1250.5,
        "currency": "CHF"
      },
      "taxCode": "string",
      "taxRate": 0
    }
  ],
  "draftPaymentIds": [
    "string"
  ],
  "initiatedPaymentIds": [
    "string"
  ],
  "transactionCandidateMatchIds": [
    "string"
  ],
  "transactionConfirmedMatchIds": [
    "string"
  ],
  "transactionCandidateMatches": [
    {
      "target": "string",
      "data": {
        "confidence": 0
      }
    }
  ],
  "transactionConfirmedMatches": [
    {
      "target": "string",
      "data": {
        "confidence": 0
      }
    }
  ]
}
GET/workspaces/{workspaceId}/invoices

List invoices in the workspace

Portéeinvoices:read

Paramètres de chemin

workspaceIdstringobligatoire

ID of the workspace.

Paramètres de requête

limitinteger

Maximum number of items to return, from 1 to 100. A missing, invalid or non-positive value falls back to 20, and a larger value to 100.

Par défaut20

startAfterstring

Cursor of the page to return: the nextCursor of the previous page.

fieldsstring

Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.

idsstring[]

Comma-separated IDs of the items to return, up to 30. When set, limit, startAfter and the filters are ignored.

Renvoie

200

List of items

dataInvoice[]obligatoire

Items of the page, in list order.

limitintegerobligatoire

Page size of the request, or the number of requested ids.

nextCursorstring

Cursor of the next page, to pass as startAfter. Absent when the page holds fewer items than limit; a full last page still has one, and the page it points to is empty.

curl 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/invoices' \
  -H "Authorization: Bearer $SWAY_API_KEY"
{
  "data": [
    {
      "firestoreId": "Iv5zP2nK7wRt3xMq9bLd",
      "workspaceId": "Wk7fQ2xR9bLm4tZp8sNv",
      "creation": {
        "creationDateTime": "2026-03-02T09:15:00.000Z",
        "createdBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
      },
      "invoiceStatus": "drafted",
      "processingStatus": "uploaded",
      "accountingType": "payable",
      "reconciled": true,
      "processed": true,
      "paymentSubmitted": true,
      "sentDateTime": "2026-03-02T09:30:00.000Z",
      "paymentMethod": "creditCard",
      "supplierCounterpartyId": "Cp2nG7vB4xLq9wRt5hMz",
      "receiverCounterpartyId": "Cp2nG7vB4xLq9wRt5hMz",
      "storagePath": "string",
      "fileChecksumMd5": "string",
      "fileChecksumCrc32c": "string",
      "amountDue": {
        "amount": 1250.5,
        "currency": "CHF"
      },
      "amountPaidSinceLastInvoice": {
        "amount": 1250.5,
        "currency": "CHF"
      },
      "clientId": "string",
      "currency": "CHF",
      "dueDate": "2026-03-02",
      "invoiceDate": "2026-03-02",
      "invoiceId": "string",
      "isUnpaidReminder": 0,
      "netAmount": {
        "amount": 1250.5,
        "currency": "CHF"
      },
      "paymentTerms": "string",
      "purchaseOrder": "string",
      "receiverAddress": {…},
      "receiverBankAccount": {…},
      "receiverContactName": "string",
      "receiverEmail": "string",
      "receiverName": "string",
      "receiverPhone": "string",
      "receiverTaxId": "string",
      "remitToAddress": {…},
      "remitToName": "string",
      "shipToAddress": {…},
      "shipToName": "string",
      "supplierAddress": {…},
      "supplierBankAccounts": […],
      "supplierContactName": "string",
      "supplierEmail": "string",
      "supplierName": "string",
      "supplierPaymentRef": "string",
      "supplierPhone": "string",
      "supplierTaxId": "string",
      "supplierWebsite": "string",
      "totalAmount": {
        "amount": 1250.5,
        "currency": "CHF"
      },
      "totalTaxAmount": {
        "amount": 1250.5,
        "currency": "CHF"
      },
      "items": […],
      "taxes": […],
      "draftPaymentIds": [
        "string"
      ],
      "initiatedPaymentIds": [
        "string"
      ],
      "transactionCandidateMatchIds": [
        "string"
      ],
      "transactionConfirmedMatchIds": [
        "string"
      ],
      "transactionCandidateMatches": […],
      "transactionConfirmedMatches": […]
    }
  ],
  "limit": 0,
  "nextCursor": "string"
}
POST/workspaces/{workspaceId}/invoices/upload

Get an upload URL for a sales invoice or a bill document

The document is a PDF or an image. The characters <>:"/\|?*#^ are removed from fileName, and a name left empty is rejected. PUT the file bytes to uploadUrl with the returned contentType. Once uploaded, the document is parsed in the background into a new invoice (receivable) or bill (payable). With bankAccountId and bankTransactionId, the new invoice is matched with that bank transaction.

Portéeinvoices:write

Paramètres de chemin

workspaceIdstringobligatoire

ID of the workspace.

Paramètres de requête

fieldsstring

Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.

Corps de la requête

accountingTypestringobligatoire

Direction of the invoice: a supplier bill to pay or a sales invoice to collect.

  • payable

    A bill received from a supplier, which the workspace pays.

  • receivable

    An invoice issued to a customer, which the workspace collects.

fileNamestringobligatoire
contentTypestringobligatoire
sizeintegerobligatoire
bankAccountIdstring

ID of the bank account.

bankTransactionIdstring

ID of the bank transaction.

Renvoie

200

Successful response

dataFileUploadUrlobligatoire
Afficher les 3 champs enfants
uploadUrlstringuriobligatoire
contentTypestringobligatoire
sizeintegerobligatoire
curl -X POST 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/invoices/upload' \
  -H "Authorization: Bearer $SWAY_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "accountingType": "payable",
  "fileName": "string",
  "contentType": "string",
  "size": 0,
  "bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
  "bankTransactionId": "trx_MjAyNjAzMDJUMDk"
}'
{
  "data": {
    "uploadUrl": "https://example.com",
    "contentType": "string",
    "size": 0
  }
}
POST/workspaces/{workspaceId}/invoices/upload-split

Get an upload URL for a document holding several sales invoices or bills

The document is a PDF or an image. The characters <>:"/\|?*#^ are removed from fileName, and a name left empty is rejected. PUT the file bytes to uploadUrl with the returned contentType. Once uploaded, the document is split in the background into one document per invoice or receipt. Each invoice is parsed into a new invoice (receivable) or bill (payable), and each receipt into a new bill.

Portéeinvoices:write

Paramètres de chemin

workspaceIdstringobligatoire

ID of the workspace.

Paramètres de requête

fieldsstring

Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.

Corps de la requête

accountingTypestringobligatoire

Direction of the invoice: a supplier bill to pay or a sales invoice to collect.

  • payable

    A bill received from a supplier, which the workspace pays.

  • receivable

    An invoice issued to a customer, which the workspace collects.

fileNamestringobligatoire
contentTypestringobligatoire
sizeintegerobligatoire

Renvoie

200

Successful response

dataFileUploadUrlobligatoire
Afficher les 3 champs enfants
uploadUrlstringuriobligatoire
contentTypestringobligatoire
sizeintegerobligatoire
curl -X POST 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/invoices/upload-split' \
  -H "Authorization: Bearer $SWAY_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "accountingType": "payable",
  "fileName": "string",
  "contentType": "string",
  "size": 0
}'
{
  "data": {
    "uploadUrl": "https://example.com",
    "contentType": "string",
    "size": 0
  }
}
PATCH/workspaces/{workspaceId}/invoices/{invoiceId}

Update an invoice

Portéeinvoices:write

Paramètres de chemin

workspaceIdstringobligatoire

ID of the workspace.

invoiceIdstringobligatoire

ID of the invoice.

Paramètres de requête

fieldsstring

Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.

Corps de la requête

fieldsobjectobligatoire
Afficher les 38 champs enfants
amountDueMonetaryAmount | null
Afficher les 2 champs enfants
amountnumberobligatoire

Amount in the main unit of the currency, such as francs.

currencystring | null

Currency of the amount, when known.

amountPaidSinceLastInvoiceMonetaryAmount | null
Afficher les 2 champs enfants
amountnumberobligatoire

Amount in the main unit of the currency, such as francs.

currencystring | null

Currency of the amount, when known.

clientIdstring | null
currencystring | null

ISO 4217 currency code

dueDatestring | null
footerstring | null

Text printed at the bottom of the invoice.

headerstring | null

Text printed at the top of the invoice.

invoiceDatestring | null
invoiceIdstring | null
isUnpaidRemindernumber | null
netAmountMonetaryAmount | null
Afficher les 2 champs enfants
amountnumberobligatoire

Amount in the main unit of the currency, such as francs.

currencystring | null

Currency of the amount, when known.

paymentTermsstring | null
purchaseOrderstring | null
receiverAddressAddressField | null

Postal address on a document, in which any part can be missing.

Afficher les 12 champs enfants
countrystring | null

ISO 3166-1 alpha-2 country code

postCodestring | null

Post code of the address.

townNamestring | null

Name of the town or city.

streetNamestring | null

Name of the street.

buildingNumberstring | null

Number of the building in the street.

namestring | null

Name of the building or place.

sortingCodestring | null

Additional sorting code of the postal service, used in a few countries such as France.

postBoxstring | null

Post office box.

administrativeAreastring | null

Region of the country, such as a canton or a state.

recipientsstring[] | null

Names of the people the address is for.

organizationstring | null

Name of the organization at the address.

sourcestring[] | null

Text the address was read from, one item per line.

receiverBankAccountBankAccountField | null
Afficher les 6 champs enfants
bankNamestring | null
bankAddressAddressField | null

Postal address on a document, in which any part can be missing.

Afficher les 12 champs enfants
countrystring | null

ISO 3166-1 alpha-2 country code

postCodestring | null

Post code of the address.

townNamestring | null

Name of the town or city.

streetNamestring | null

Name of the street.

buildingNumberstring | null

Number of the building in the street.

namestring | null

Name of the building or place.

sortingCodestring | null

Additional sorting code of the postal service, used in a few countries such as France.

postBoxstring | null

Post office box.

administrativeAreastring | null

Region of the country, such as a canton or a state.

recipientsstring[] | null

Names of the people the address is for.

organizationstring | null

Name of the organization at the address.

sourcestring[] | null

Text the address was read from, one item per line.

bicstring | null
currencystring | null

ISO 4217 currency code

accountIdentificationstring | null
accountSecondaryIdentificationstring | null
receiverContactNamestring | null
receiverEmailstring | null
receiverNamestring | null
receiverPhonestring | null
receiverTaxIdstring | null
remitToAddressAddressField | null

Postal address on a document, in which any part can be missing.

Afficher les 12 champs enfants
countrystring | null

ISO 3166-1 alpha-2 country code

postCodestring | null

Post code of the address.

townNamestring | null

Name of the town or city.

streetNamestring | null

Name of the street.

buildingNumberstring | null

Number of the building in the street.

namestring | null

Name of the building or place.

sortingCodestring | null

Additional sorting code of the postal service, used in a few countries such as France.

postBoxstring | null

Post office box.

administrativeAreastring | null

Region of the country, such as a canton or a state.

recipientsstring[] | null

Names of the people the address is for.

organizationstring | null

Name of the organization at the address.

sourcestring[] | null

Text the address was read from, one item per line.

remitToNamestring | null
shipToAddressAddressField | null

Postal address on a document, in which any part can be missing.

Afficher les 12 champs enfants
countrystring | null

ISO 3166-1 alpha-2 country code

postCodestring | null

Post code of the address.

townNamestring | null

Name of the town or city.

streetNamestring | null

Name of the street.

buildingNumberstring | null

Number of the building in the street.

namestring | null

Name of the building or place.

sortingCodestring | null

Additional sorting code of the postal service, used in a few countries such as France.

postBoxstring | null

Post office box.

administrativeAreastring | null

Region of the country, such as a canton or a state.

recipientsstring[] | null

Names of the people the address is for.

organizationstring | null

Name of the organization at the address.

sourcestring[] | null

Text the address was read from, one item per line.

shipToNamestring | null
supplierAddressAddressField | null

Postal address on a document, in which any part can be missing.

Afficher les 12 champs enfants
countrystring | null

ISO 3166-1 alpha-2 country code

postCodestring | null

Post code of the address.

townNamestring | null

Name of the town or city.

streetNamestring | null

Name of the street.

buildingNumberstring | null

Number of the building in the street.

namestring | null

Name of the building or place.

sortingCodestring | null

Additional sorting code of the postal service, used in a few countries such as France.

postBoxstring | null

Post office box.

administrativeAreastring | null

Region of the country, such as a canton or a state.

recipientsstring[] | null

Names of the people the address is for.

organizationstring | null

Name of the organization at the address.

sourcestring[] | null

Text the address was read from, one item per line.

supplierBankAccountsBankAccountField[] | null
Afficher les 6 champs enfants
bankNamestring | null
bankAddressAddressField | null

Postal address on a document, in which any part can be missing.

Afficher les 12 champs enfants
countrystring | null

ISO 3166-1 alpha-2 country code

postCodestring | null

Post code of the address.

townNamestring | null

Name of the town or city.

streetNamestring | null

Name of the street.

buildingNumberstring | null

Number of the building in the street.

namestring | null

Name of the building or place.

sortingCodestring | null

Additional sorting code of the postal service, used in a few countries such as France.

postBoxstring | null

Post office box.

administrativeAreastring | null

Region of the country, such as a canton or a state.

recipientsstring[] | null

Names of the people the address is for.

organizationstring | null

Name of the organization at the address.

sourcestring[] | null

Text the address was read from, one item per line.

bicstring | null
currencystring | null

ISO 4217 currency code

accountIdentificationstring | null
accountSecondaryIdentificationstring | null
supplierContactNamestring | null
supplierEmailstring | null
supplierNamestring | null
supplierPaymentRefstring | null
supplierPhonestring | null
supplierTaxIdstring | null
supplierWebsitestring | null
totalAmountMonetaryAmount | null
Afficher les 2 champs enfants
amountnumberobligatoire

Amount in the main unit of the currency, such as francs.

currencystring | null

Currency of the amount, when known.

totalTaxAmountMonetaryAmount | null
Afficher les 2 champs enfants
amountnumberobligatoire

Amount in the main unit of the currency, such as francs.

currencystring | null

Currency of the amount, when known.

itemsobject[] | null
Afficher les 12 champs enfants
amountMonetaryAmount | null
Afficher les 2 champs enfants
amountnumberobligatoire

Amount in the main unit of the currency, such as francs.

currencystring | null

Currency of the amount, when known.

descriptionstring | null
discountAmountMonetaryAmount | null
Afficher les 2 champs enfants
amountnumberobligatoire

Amount in the main unit of the currency, such as francs.

currencystring | null

Currency of the amount, when known.

discountRatenumber | null
productCodestring | null
productIdstring | null

ID of the product.

quantitynumber | null
taxAmountMonetaryAmount | null
Afficher les 2 champs enfants
amountnumberobligatoire

Amount in the main unit of the currency, such as francs.

currencystring | null

Currency of the amount, when known.

taxRatenumber | null
taxTypeIdstring | null

ID of the tax type.

unitstring | null
unitPriceMonetaryAmount | null
Afficher les 2 champs enfants
amountnumberobligatoire

Amount in the main unit of the currency, such as francs.

currencystring | null

Currency of the amount, when known.

taxesobject[] | null
Afficher les 4 champs enfants
netAmountBeforeTaxMonetaryAmount | null
Afficher les 2 champs enfants
amountnumberobligatoire

Amount in the main unit of the currency, such as francs.

currencystring | null

Currency of the amount, when known.

taxAmountMonetaryAmount | null
Afficher les 2 champs enfants
amountnumberobligatoire

Amount in the main unit of the currency, such as francs.

currencystring | null

Currency of the amount, when known.

taxCodestring | null
taxRatenumber | null
qrCodeDatastring[] | null

Renvoie

200

Successful response

dataInvoiceobligatoire
curl -X PATCH 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/invoices/Iv5zP2nK7wRt3xMq9bLd' \
  -H "Authorization: Bearer $SWAY_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "fields": {
    "amountDue": {
      "amount": 1250.5,
      "currency": "CHF"
    },
    "amountPaidSinceLastInvoice": {
      "amount": 1250.5,
      "currency": "CHF"
    },
    "currency": "CHF",
    "dueDate": "2026-03-02",
    "invoiceDate": "2026-03-02",
    "netAmount": {
      "amount": 1250.5,
      "currency": "CHF"
    },
    "receiverAddress": {
      "country": "CH",
      "postCode": "8001",
      "townName": "Zürich",
      "streetName": "Bahnhofstrasse",
      "buildingNumber": "10",
      "name": "Haus zur Linde",
      "postBox": "Postfach 1234",
      "administrativeArea": "Zürich",
      "recipients": [
        "Anna Meier"
      ],
      "organization": "Muster AG",
      "source": [
        "Muster AG",
        "Bahnhofstrasse 10",
        "8001 Zürich"
      ]
    },
    "receiverBankAccount": {
      "bankAddress": {
        "country": "CH",
        "postCode": "8001",
        "townName": "Zürich",
        "streetName": "Bahnhofstrasse",
        "buildingNumber": "10",
        "name": "Haus zur Linde",
        "postBox": "Postfach 1234",
        "administrativeArea": "Zürich",
        "recipients": [
          "Anna Meier"
        ],
        "organization": "Muster AG",
        "source": [
          "Muster AG",
          "Bahnhofstrasse 10",
          "8001 Zürich"
        ]
      },
      "currency": "CHF"
    },
    "remitToAddress": {
      "country": "CH",
      "postCode": "8001",
      "townName": "Zürich",
      "streetName": "Bahnhofstrasse",
      "buildingNumber": "10",
      "name": "Haus zur Linde",
      "postBox": "Postfach 1234",
      "administrativeArea": "Zürich",
      "recipients": [
        "Anna Meier"
      ],
      "organization": "Muster AG",
      "source": [
        "Muster AG",
        "Bahnhofstrasse 10",
        "8001 Zürich"
      ]
    },
    "shipToAddress": {
      "country": "CH",
      "postCode": "8001",
      "townName": "Zürich",
      "streetName": "Bahnhofstrasse",
      "buildingNumber": "10",
      "name": "Haus zur Linde",
      "postBox": "Postfach 1234",
      "administrativeArea": "Zürich",
      "recipients": [
        "Anna Meier"
      ],
      "organization": "Muster AG",
      "source": [
        "Muster AG",
        "Bahnhofstrasse 10",
        "8001 Zürich"
      ]
    },
    "supplierAddress": {
      "country": "CH",
      "postCode": "8001",
      "townName": "Zürich",
      "streetName": "Bahnhofstrasse",
      "buildingNumber": "10",
      "name": "Haus zur Linde",
      "postBox": "Postfach 1234",
      "administrativeArea": "Zürich",
      "recipients": [
        "Anna Meier"
      ],
      "organization": "Muster AG",
      "source": [
        "Muster AG",
        "Bahnhofstrasse 10",
        "8001 Zürich"
      ]
    },
    "supplierBankAccounts": [
      {
        "bankAddress": {
          "country": "CH",
          "postCode": "8001",
          "townName": "Zürich",
          "streetName": "Bahnhofstrasse",
          "buildingNumber": "10",
          "name": "Haus zur Linde",
          "postBox": "Postfach 1234",
          "administrativeArea": "Zürich",
          "recipients": [
            "Anna Meier"
          ],
          "organization": "Muster AG",
          "source": [
            "Muster AG",
            "Bahnhofstrasse 10",
            "8001 Zürich"
          ]
        },
        "currency": "CHF"
      }
    ],
    "totalAmount": {
      "amount": 1250.5,
      "currency": "CHF"
    },
    "totalTaxAmount": {
      "amount": 1250.5,
      "currency": "CHF"
    },
    "items": [
      {
        "amount": {
          "amount": 1250.5,
          "currency": "CHF"
        },
        "discountAmount": {
          "amount": 1250.5,
          "currency": "CHF"
        },
        "productId": "Pr4wJ8tM1xNq6zRb3vKf",
        "taxAmount": {
          "amount": 1250.5,
          "currency": "CHF"
        },
        "taxTypeId": "Tt9mC5rL2wQz7nVb4kHp",
        "unitPrice": {
          "amount": 1250.5,
          "currency": "CHF"
        }
      }
    ],
    "taxes": [
      {
        "netAmountBeforeTax": {
          "amount": 1250.5,
          "currency": "CHF"
        },
        "taxAmount": {
          "amount": 1250.5,
          "currency": "CHF"
        }
      }
    ]
  }
}'
{
  "data": {
    "firestoreId": "Iv5zP2nK7wRt3xMq9bLd",
    "workspaceId": "Wk7fQ2xR9bLm4tZp8sNv",
    "creation": {
      "creationDateTime": "2026-03-02T09:15:00.000Z",
      "createdBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
    },
    "invoiceStatus": "drafted",
    "processingStatus": "uploaded",
    "accountingType": "payable",
    "reconciled": true,
    "processed": true,
    "paymentSubmitted": true,
    "sentDateTime": "2026-03-02T09:30:00.000Z",
    "paymentMethod": "creditCard",
    "supplierCounterpartyId": "Cp2nG7vB4xLq9wRt5hMz",
    "receiverCounterpartyId": "Cp2nG7vB4xLq9wRt5hMz",
    "storagePath": "string",
    "fileChecksumMd5": "string",
    "fileChecksumCrc32c": "string",
    "amountDue": {
      "amount": 1250.5,
      "currency": "CHF"
    },
    "amountPaidSinceLastInvoice": {
      "amount": 1250.5,
      "currency": "CHF"
    },
    "clientId": "string",
    "currency": "CHF",
    "dueDate": "2026-03-02",
    "invoiceDate": "2026-03-02",
    "invoiceId": "string",
    "isUnpaidReminder": 0,
    "netAmount": {
      "amount": 1250.5,
      "currency": "CHF"
    },
    "paymentTerms": "string",
    "purchaseOrder": "string",
    "receiverAddress": {…},
    "receiverBankAccount": {…},
    "receiverContactName": "string",
    "receiverEmail": "string",
    "receiverName": "string",
    "receiverPhone": "string",
    "receiverTaxId": "string",
    "remitToAddress": {…},
    "remitToName": "string",
    "shipToAddress": {…},
    "shipToName": "string",
    "supplierAddress": {…},
    "supplierBankAccounts": […],
    "supplierContactName": "string",
    "supplierEmail": "string",
    "supplierName": "string",
    "supplierPaymentRef": "string",
    "supplierPhone": "string",
    "supplierTaxId": "string",
    "supplierWebsite": "string",
    "totalAmount": {
      "amount": 1250.5,
      "currency": "CHF"
    },
    "totalTaxAmount": {
      "amount": 1250.5,
      "currency": "CHF"
    },
    "items": […],
    "taxes": […],
    "draftPaymentIds": [
      "string"
    ],
    "initiatedPaymentIds": [
      "string"
    ],
    "transactionCandidateMatchIds": [
      "string"
    ],
    "transactionConfirmedMatchIds": [
      "string"
    ],
    "transactionCandidateMatches": […],
    "transactionConfirmedMatches": […]
  }
}
POST/workspaces/{workspaceId}/invoices/{invoiceId}/update-status

Update the status of an invoice

Portéeinvoices:write

Paramètres de chemin

workspaceIdstringobligatoire

ID of the workspace.

invoiceIdstringobligatoire

ID of the invoice.

Paramètres de requête

fieldsstring

Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.

Corps de la requête

statusstring

Status of the invoice in its lifecycle.

  • drafted

    Draft that may lack mandatory fields; an uploaded invoice starts here and moves to created once its data passes validation.

  • created

    Validated invoice, whose mandatory fields are all present and valid.

  • deleted

    Deleted invoice, which can no longer change status and is left out of transaction matching.

  • authorised

    Validated invoice that a user approved.

  • paid

    Validated invoice settled in full by matched bank transactions or marked as paid by a user; its mandatory fields can no longer change.

  • voided

    Cancelled invoice, left out of transaction matching.

processedboolean
paymentSubmittedboolean

Renvoie

200

Successful response

dataInvoiceobligatoire
curl -X POST 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/invoices/Iv5zP2nK7wRt3xMq9bLd/update-status' \
  -H "Authorization: Bearer $SWAY_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "status": "drafted"
}'
{
  "data": {
    "firestoreId": "Iv5zP2nK7wRt3xMq9bLd",
    "workspaceId": "Wk7fQ2xR9bLm4tZp8sNv",
    "creation": {
      "creationDateTime": "2026-03-02T09:15:00.000Z",
      "createdBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
    },
    "invoiceStatus": "drafted",
    "processingStatus": "uploaded",
    "accountingType": "payable",
    "reconciled": true,
    "processed": true,
    "paymentSubmitted": true,
    "sentDateTime": "2026-03-02T09:30:00.000Z",
    "paymentMethod": "creditCard",
    "supplierCounterpartyId": "Cp2nG7vB4xLq9wRt5hMz",
    "receiverCounterpartyId": "Cp2nG7vB4xLq9wRt5hMz",
    "storagePath": "string",
    "fileChecksumMd5": "string",
    "fileChecksumCrc32c": "string",
    "amountDue": {
      "amount": 1250.5,
      "currency": "CHF"
    },
    "amountPaidSinceLastInvoice": {
      "amount": 1250.5,
      "currency": "CHF"
    },
    "clientId": "string",
    "currency": "CHF",
    "dueDate": "2026-03-02",
    "invoiceDate": "2026-03-02",
    "invoiceId": "string",
    "isUnpaidReminder": 0,
    "netAmount": {
      "amount": 1250.5,
      "currency": "CHF"
    },
    "paymentTerms": "string",
    "purchaseOrder": "string",
    "receiverAddress": {…},
    "receiverBankAccount": {…},
    "receiverContactName": "string",
    "receiverEmail": "string",
    "receiverName": "string",
    "receiverPhone": "string",
    "receiverTaxId": "string",
    "remitToAddress": {…},
    "remitToName": "string",
    "shipToAddress": {…},
    "shipToName": "string",
    "supplierAddress": {…},
    "supplierBankAccounts": […],
    "supplierContactName": "string",
    "supplierEmail": "string",
    "supplierName": "string",
    "supplierPaymentRef": "string",
    "supplierPhone": "string",
    "supplierTaxId": "string",
    "supplierWebsite": "string",
    "totalAmount": {
      "amount": 1250.5,
      "currency": "CHF"
    },
    "totalTaxAmount": {
      "amount": 1250.5,
      "currency": "CHF"
    },
    "items": […],
    "taxes": […],
    "draftPaymentIds": [
      "string"
    ],
    "initiatedPaymentIds": [
      "string"
    ],
    "transactionCandidateMatchIds": [
      "string"
    ],
    "transactionConfirmedMatchIds": [
      "string"
    ],
    "transactionCandidateMatches": […],
    "transactionConfirmedMatches": […]
  }
}
POST/workspaces/{workspaceId}/invoices/{invoiceId}/update-counterparty

Update the counterparty associated with an invoice

Portéeinvoices:write

Paramètres de chemin

workspaceIdstringobligatoire

ID of the workspace.

invoiceIdstringobligatoire

ID of the invoice.

Paramètres de requête

fieldsstring

Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.

Corps de la requête

counterpartyIdstring | nullobligatoire

ID of the counterparty.

Renvoie

200

Successful response

dataInvoiceobligatoire
curl -X POST 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/invoices/Iv5zP2nK7wRt3xMq9bLd/update-counterparty' \
  -H "Authorization: Bearer $SWAY_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "counterpartyId": "Cp2nG7vB4xLq9wRt5hMz"
}'
{
  "data": {
    "firestoreId": "Iv5zP2nK7wRt3xMq9bLd",
    "workspaceId": "Wk7fQ2xR9bLm4tZp8sNv",
    "creation": {
      "creationDateTime": "2026-03-02T09:15:00.000Z",
      "createdBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
    },
    "invoiceStatus": "drafted",
    "processingStatus": "uploaded",
    "accountingType": "payable",
    "reconciled": true,
    "processed": true,
    "paymentSubmitted": true,
    "sentDateTime": "2026-03-02T09:30:00.000Z",
    "paymentMethod": "creditCard",
    "supplierCounterpartyId": "Cp2nG7vB4xLq9wRt5hMz",
    "receiverCounterpartyId": "Cp2nG7vB4xLq9wRt5hMz",
    "storagePath": "string",
    "fileChecksumMd5": "string",
    "fileChecksumCrc32c": "string",
    "amountDue": {
      "amount": 1250.5,
      "currency": "CHF"
    },
    "amountPaidSinceLastInvoice": {
      "amount": 1250.5,
      "currency": "CHF"
    },
    "clientId": "string",
    "currency": "CHF",
    "dueDate": "2026-03-02",
    "invoiceDate": "2026-03-02",
    "invoiceId": "string",
    "isUnpaidReminder": 0,
    "netAmount": {
      "amount": 1250.5,
      "currency": "CHF"
    },
    "paymentTerms": "string",
    "purchaseOrder": "string",
    "receiverAddress": {…},
    "receiverBankAccount": {…},
    "receiverContactName": "string",
    "receiverEmail": "string",
    "receiverName": "string",
    "receiverPhone": "string",
    "receiverTaxId": "string",
    "remitToAddress": {…},
    "remitToName": "string",
    "shipToAddress": {…},
    "shipToName": "string",
    "supplierAddress": {…},
    "supplierBankAccounts": […],
    "supplierContactName": "string",
    "supplierEmail": "string",
    "supplierName": "string",
    "supplierPaymentRef": "string",
    "supplierPhone": "string",
    "supplierTaxId": "string",
    "supplierWebsite": "string",
    "totalAmount": {
      "amount": 1250.5,
      "currency": "CHF"
    },
    "totalTaxAmount": {
      "amount": 1250.5,
      "currency": "CHF"
    },
    "items": […],
    "taxes": […],
    "draftPaymentIds": [
      "string"
    ],
    "initiatedPaymentIds": [
      "string"
    ],
    "transactionCandidateMatchIds": [
      "string"
    ],
    "transactionConfirmedMatchIds": [
      "string"
    ],
    "transactionCandidateMatches": […],
    "transactionConfirmedMatches": […]
  }
}
POST/workspaces/{workspaceId}/invoices/{invoiceId}/matches/add

Add a confirmed match between an invoice and a bank transaction

Portéeinvoices:write

Paramètres de chemin

workspaceIdstringobligatoire

ID of the workspace.

invoiceIdstringobligatoire

ID of the invoice.

Corps de la requête

bankAccountIdstringobligatoire

ID of the bank account.

bankTransactionIdstringobligatoire

ID of the bank transaction.

Renvoie

204

No content

curl -X POST 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/invoices/Iv5zP2nK7wRt3xMq9bLd/matches/add' \
  -H "Authorization: Bearer $SWAY_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
  "bankTransactionId": "trx_MjAyNjAzMDJUMDk"
}'
{
  "error": {
    "code": "invalid-argument",
    "message": "Invalid request"
  }
}
POST/workspaces/{workspaceId}/invoices/{invoiceId}/matches/confirm

Confirm a candidate match between an invoice and a bank transaction

Portéeinvoices:write

Paramètres de chemin

workspaceIdstringobligatoire

ID of the workspace.

invoiceIdstringobligatoire

ID of the invoice.

Paramètres de requête

fieldsstring

Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.

Corps de la requête

matchReferencestringobligatoire

Renvoie

200

Successful response

dataInvoiceMatchobligatoire
Afficher les 2 champs enfants
targetstringobligatoire
dataobjectobligatoire
Afficher 1 champ enfant
confidencenumberobligatoire
curl -X POST 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/invoices/Iv5zP2nK7wRt3xMq9bLd/matches/confirm' \
  -H "Authorization: Bearer $SWAY_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "matchReference": "string"
}'
{
  "data": {
    "target": "string",
    "data": {
      "confidence": 0
    }
  }
}
POST/workspaces/{workspaceId}/invoices/{invoiceId}/matches/remove

Remove a confirmed match between an invoice and a bank transaction

Portéeinvoices:write

Paramètres de chemin

workspaceIdstringobligatoire

ID of the workspace.

invoiceIdstringobligatoire

ID of the invoice.

Corps de la requête

matchReferencestringobligatoire

Renvoie

204

No content

curl -X POST 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/invoices/Iv5zP2nK7wRt3xMq9bLd/matches/remove' \
  -H "Authorization: Bearer $SWAY_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "matchReference": "string"
}'
{
  "error": {
    "code": "invalid-argument",
    "message": "Invalid request"
  }
}
POST/workspaces/{workspaceId}/invoices/{invoiceId}/matches/remove-candidate

Remove a candidate match suggestion for an invoice

Portéeinvoices:write

Paramètres de chemin

workspaceIdstringobligatoire

ID of the workspace.

invoiceIdstringobligatoire

ID of the invoice.

Corps de la requête

matchReferencestringobligatoire

Renvoie

204

No content

curl -X POST 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/invoices/Iv5zP2nK7wRt3xMq9bLd/matches/remove-candidate' \
  -H "Authorization: Bearer $SWAY_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "matchReference": "string"
}'
{
  "error": {
    "code": "invalid-argument",
    "message": "Invalid request"
  }
}
POST/workspaces/{workspaceId}/invoices/export

Export an invoice to a downloadable file

Portéeinvoices:write

Paramètres de chemin

workspaceIdstringobligatoire

ID of the workspace.

Paramètres de requête

fieldsstring

Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.

Corps de la requête

exportTypestringobligatoire

Format of the invoice export.

  • csv

    CSV file of the invoices, with the columns in fields.

  • pain.001

    ISO 20022 pain.001 payment file that pays the invoices from the bank account bankAccountId.

invoiceIdsstring[]obligatoire

ID of the invoice.

bankAccountIdstring

ID of the bank account.

counterpartyCashAccountIdsRecord<string, string>
requestedExecutionDatestring
requestedExecutionDateModestring

ValeursdueDatecommonDate

localTimeZonestring
markAsPaymentSubmittedboolean
fieldsobject[]
Afficher les 4 champs enfants
fieldstringobligatoire
Afficher les 40 valeurs

invoice_idinvoice_datedue_datenet_amounttax_amounttotal_amountamount_duecurrencystatusprocessing_statusaccounting_typepurchase_orderpayment_termsclient_idsupplier_namesupplier_addresssupplier_contactsupplier_emailsupplier_phonesupplier_tax_idsupplier_bank_accountsreceiver_namereceiver_addressreceiver_contactreceiver_emailreceiver_phonereceiver_tax_idreceiver_bank_accountship_to_nameship_to_addressremit_to_nameremit_to_addresspayment_referenceline_itemstaxescreation_dateis_unpaid_reminderreconciledprocessedpayment_submitted

namestring
defaultValuestring
formatstring

Renvoie

200

Successful response

dataInvoiceExportobligatoire
Afficher les 3 champs enfants
startedbooleanobligatoire
workspaceIdstringobligatoire
filesobject[]obligatoire
Afficher les 4 champs enfants
exportIdstringobligatoire
targetFileNamestringobligatoire
downloadUrlstringuriobligatoire

Time-limited URL to download the file. The file may not be ready the moment the export call returns: poll this URL and retry while it responds with 404 until the download succeeds.

expiresAtstringobligatoire

Instant after which downloadUrl stops working.

curl -X POST 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/invoices/export' \
  -H "Authorization: Bearer $SWAY_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "exportType": "csv",
  "invoiceIds": [
    "Iv5zP2nK7wRt3xMq9bLd"
  ],
  "bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
  "requestedExecutionDate": "2026-03-02",
  "requestedExecutionDateMode": "dueDate",
  "fields": [
    {
      "field": "invoice_id"
    }
  ]
}'
{
  "data": {
    "started": true,
    "workspaceId": "string",
    "files": [
      {
        "exportId": "string",
        "targetFileName": "string",
        "downloadUrl": "https://example.com",
        "expiresAt": "2026-03-02T09:30:00.000Z"
      }
    ]
  }
}

Construisez sur vos propres données.

Créez un compte, ouvrez Profil › Développeur et créez une clé limitée aux ressources dont vous avez besoin. Une question sur une intégration ? L’équipe y répond lors d’un appel.