Aller au contenu
Ressource · Billing

Counterparties

A counterparty is a customer or a supplier the workspace trades with.

counterparties:readcounterparties:write
MéthodeCheminRésumé
GET…/counterpartiesList counterparties (customers, vendors) in the workspace
POST…/counterpartiesCreate a counterparty or merge with an existing one
GET…/counterparties/searchSearch counterparties by name or other attributes
PATCH…/counterparties/{counterpartyId}Update a counterparty
DELETE…/counterparties/{counterpartyId}Delete (soft-delete) a counterparty
POST…/counterparties/{counterpartyId}/restoreRestore a previously deleted counterparty

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

L’objet Counterparty

firestoreIdstringobligatoire

ID of the counterparty.

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.

activationobjectobligatoire

Whether the resource is enabled, and when and by whom it was last enabled or disabled.

Afficher les 3 champs enfants
enabledbooleanobligatoire

Whether the resource is enabled.

updateDateTimestringdate-timeobligatoire

Date and time when enabled was last set.

updatedBystring

ID of the user who last set enabled, when recorded.

entityTypestring

Kind of entity: an individual or an organization.

  • individual

    A natural person.

  • organization

    A company or another organization.

namestringobligatoire
phonesstring[]obligatoire
Afficher les 16 champs
emailsstring[]obligatoire
addressPostalAddress

Postal address, with the parts of an ISO 20022 postal address.

Afficher les 12 champs enfants
countrystringobligatoire

ISO 3166-1 alpha-2 country code

postCodestringobligatoire

Post code of the address.

townNamestringobligatoire

Name of the town or city.

streetNamestring

Name of the street.

buildingNumberstring

Number of the building in the street.

namestring

Name of the building or place.

sortingCodestring

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

postBoxstring

Post office box.

administrativeAreastring

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

recipientsstring[]

Names of the people the address is for.

organizationstring

Name of the organization at the address.

sourcestring[]

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

contactPersonsobject[]obligatoire
Afficher les 3 champs enfants
namestringobligatoire
phonestring
emailstring
taxIdentificationstring
notesstring
cashAccountsobject[]obligatoire
Afficher les 6 champs enfants
identificationsobject[]obligatoire
Afficher les 2 champs enfants
typestringobligatoire

Kind of identifier of a bank account or of its bank.

Afficher les 14 valeurs
  • bic

    Bank Identifier Code of the bank.

  • sortCode

    Six-digit code of a bank and branch in the United Kingdom.

  • iban

    International Bank Account Number.

  • bban

    Basic Bank Account Number, the country-specific format of an account number.

  • accountNumber

    Account number that the bank assigns, unique within the bank or the branch.

  • pan

    Primary Account Number, the number of a credit or debit card.

  • email

    Email address that identifies the account.

  • msisdn

    Mobile phone number that identifies the account.

  • virtualAccountId

    Identifier of a virtual sub-account of a main account.

  • globalWallet

    Identifier of a digital wallet that holds and pays in several currencies.

  • clabe

    CLABE, the 18-digit standardized bank code of a Mexican bank account.

  • bitcoinAddress

    Single Bitcoin address, the only address the account tracks.

  • bitcoinXpub

    Bitcoin extended public key (xpub, ypub or zpub), from which the addresses of the wallet are derived.

  • other

    Another kind of identifier.

valuestringobligatoire

Value of the identifier, for example the IBAN or the BIC.

currencystringobligatoire

ISO 4217 currency code

bankAddressobjectobligatoire
Afficher les 12 champs enfants
countrystringobligatoire

ISO 3166-1 alpha-2 country code

postCodestring

Post code of the address.

townNamestring

Name of the town or city.

streetNamestring

Name of the street.

buildingNumberstring

Number of the building in the street.

namestring

Name of the building or place.

sortingCodestring

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

postBoxstring

Post office box.

administrativeAreastring

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

recipientsstring[]

Names of the people the address is for.

organizationstring

Name of the organization at the address.

sourcestring[]

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

internalIdstringobligatoire
nicknamestring
verificationobject
Afficher les 4 champs enfants
idstringobligatoire
statusstringobligatoire

Valeursverifiedpendingrejected

holderNamestringobligatoire
dateTimestringdate-timeobligatoire
cashAccountIdentificationsstring[]obligatoire
approvedCashAccountIdsstring[]obligatoire
bankAccountIdstring | nullobligatoire
L’objet Counterparty
{
  "firestoreId": "Cp2nG7vB4xLq9wRt5hMz",
  "workspaceId": "Wk7fQ2xR9bLm4tZp8sNv",
  "creation": {
    "creationDateTime": "2026-03-02T09:15:00.000Z",
    "createdBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
  },
  "activation": {
    "enabled": true,
    "updateDateTime": "2026-03-02T09:15:00.000Z",
    "updatedBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
  },
  "entityType": "individual",
  "name": "string",
  "phones": [
    "string"
  ],
  "emails": [
    "string"
  ],
  "address": {
    "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"
    ]
  },
  "contactPersons": [
    {
      "name": "string",
      "phone": "string",
      "email": "string"
    }
  ],
  "taxIdentification": "string",
  "notes": "string",
  "cashAccounts": [
    {
      "identifications": [
        {
          "type": "bic",
          "value": "string"
        }
      ],
      "currency": "CHF",
      "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"
        ]
      },
      "internalId": "string",
      "nickname": "string",
      "verification": {
        "id": "3f2c8a1e-6b4d-4e7a-9c15-8d2b7f0e4a61",
        "status": "verified",
        "holderName": "string",
        "dateTime": "2026-03-02T09:30:00.000Z"
      }
    }
  ],
  "cashAccountIdentifications": [
    "string"
  ],
  "approvedCashAccountIds": [
    "string"
  ],
  "bankAccountId": "string"
}
GET/workspaces/{workspaceId}/counterparties

List counterparties (customers, vendors) in the workspace

Portéecounterparties: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.

activation.enabledboolean

Whether the resource is enabled.

Renvoie

200

List of items

dataCounterparty[]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/counterparties' \
  -H "Authorization: Bearer $SWAY_API_KEY"
{
  "data": [
    {
      "firestoreId": "Cp2nG7vB4xLq9wRt5hMz",
      "workspaceId": "Wk7fQ2xR9bLm4tZp8sNv",
      "creation": {
        "creationDateTime": "2026-03-02T09:15:00.000Z",
        "createdBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
      },
      "activation": {
        "enabled": true,
        "updateDateTime": "2026-03-02T09:15:00.000Z",
        "updatedBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
      },
      "entityType": "individual",
      "name": "string",
      "phones": [
        "string"
      ],
      "emails": [
        "string"
      ],
      "address": {…},
      "contactPersons": […],
      "taxIdentification": "string",
      "notes": "string",
      "cashAccounts": […],
      "cashAccountIdentifications": [
        "string"
      ],
      "approvedCashAccountIds": [
        "string"
      ],
      "bankAccountId": "string"
    }
  ],
  "limit": 0,
  "nextCursor": "string"
}
POST/workspaces/{workspaceId}/counterparties

Create a counterparty or merge with an existing one

Portéecounterparties: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

entityTypestring

Kind of entity: an individual or an organization.

  • individual

    A natural person.

  • organization

    A company or another organization.

namestringobligatoire
phonesstring[]obligatoire
emailsstring[]obligatoire
addressPostalAddress

Postal address, with the parts of an ISO 20022 postal address.

Afficher les 12 champs enfants
countrystringobligatoire

ISO 3166-1 alpha-2 country code

postCodestringobligatoire

Post code of the address.

townNamestringobligatoire

Name of the town or city.

streetNamestring

Name of the street.

buildingNumberstring

Number of the building in the street.

namestring

Name of the building or place.

sortingCodestring

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

postBoxstring

Post office box.

administrativeAreastring

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

recipientsstring[]

Names of the people the address is for.

organizationstring

Name of the organization at the address.

sourcestring[]

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

contactPersonsobject[]obligatoire
Afficher les 3 champs enfants
namestringobligatoire
phonestring
emailstring
taxIdentificationstring
notesstring
cashAccountsobject[]obligatoire
Afficher les 6 champs enfants
identificationsobject[]obligatoire
Afficher les 2 champs enfants
typestringobligatoire

Kind of identifier of a bank account or of its bank.

Afficher les 14 valeurs
  • bic

    Bank Identifier Code of the bank.

  • sortCode

    Six-digit code of a bank and branch in the United Kingdom.

  • iban

    International Bank Account Number.

  • bban

    Basic Bank Account Number, the country-specific format of an account number.

  • accountNumber

    Account number that the bank assigns, unique within the bank or the branch.

  • pan

    Primary Account Number, the number of a credit or debit card.

  • email

    Email address that identifies the account.

  • msisdn

    Mobile phone number that identifies the account.

  • virtualAccountId

    Identifier of a virtual sub-account of a main account.

  • globalWallet

    Identifier of a digital wallet that holds and pays in several currencies.

  • clabe

    CLABE, the 18-digit standardized bank code of a Mexican bank account.

  • bitcoinAddress

    Single Bitcoin address, the only address the account tracks.

  • bitcoinXpub

    Bitcoin extended public key (xpub, ypub or zpub), from which the addresses of the wallet are derived.

  • other

    Another kind of identifier.

valuestringobligatoire

Value of the identifier, for example the IBAN or the BIC.

currencystringobligatoire

ISO 4217 currency code

bankAddressobjectobligatoire
Afficher les 12 champs enfants
countrystringobligatoire

ISO 3166-1 alpha-2 country code

postCodestring

Post code of the address.

townNamestring

Name of the town or city.

streetNamestring

Name of the street.

buildingNumberstring

Number of the building in the street.

namestring

Name of the building or place.

sortingCodestring

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

postBoxstring

Post office box.

administrativeAreastring

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

recipientsstring[]

Names of the people the address is for.

organizationstring

Name of the organization at the address.

sourcestring[]

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

internalIdstring
nicknamestring
verificationobject
Afficher les 4 champs enfants
idstringobligatoire
statusstringobligatoire

Valeursverifiedpendingrejected

holderNamestringobligatoire
dateTimestringdate-timeobligatoire
bankAccountIdstring | null
mergebooleanobligatoire

Renvoie

200

Successful response

dataCounterpartyobligatoire
curl -X POST 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/counterparties' \
  -H "Authorization: Bearer $SWAY_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "entityType": "individual",
  "name": "string",
  "phones": [
    "string"
  ],
  "emails": [
    "string"
  ],
  "address": {
    "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"
    ]
  },
  "contactPersons": [
    {
      "name": "string",
      "phone": "string",
      "email": "string"
    }
  ],
  "taxIdentification": "string",
  "notes": "string",
  "cashAccounts": [
    {
      "identifications": [
        {
          "type": "bic",
          "value": "string"
        }
      ],
      "currency": "CHF",
      "bankAddress": {
        "country": "CH",
        "postCode": "string",
        "townName": "string",
        "streetName": "string",
        "buildingNumber": "string",
        "name": "string",
        "sortingCode": "string",
        "postBox": "string",
        "administrativeArea": "string",
        "recipients": [
          "string"
        ],
        "organization": "string",
        "source": [
          "string"
        ]
      },
      "internalId": "string",
      "nickname": "string",
      "verification": {
        "id": "3f2c8a1e-6b4d-4e7a-9c15-8d2b7f0e4a61",
        "status": "verified",
        "holderName": "string",
        "dateTime": "2026-03-02T09:30:00.000Z"
      }
    }
  ],
  "bankAccountId": "string",
  "merge": true
}'
{
  "data": {
    "firestoreId": "Cp2nG7vB4xLq9wRt5hMz",
    "workspaceId": "Wk7fQ2xR9bLm4tZp8sNv",
    "creation": {
      "creationDateTime": "2026-03-02T09:15:00.000Z",
      "createdBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
    },
    "activation": {
      "enabled": true,
      "updateDateTime": "2026-03-02T09:15:00.000Z",
      "updatedBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
    },
    "entityType": "individual",
    "name": "string",
    "phones": [
      "string"
    ],
    "emails": [
      "string"
    ],
    "address": {…},
    "contactPersons": […],
    "taxIdentification": "string",
    "notes": "string",
    "cashAccounts": […],
    "cashAccountIdentifications": [
      "string"
    ],
    "approvedCashAccountIds": [
      "string"
    ],
    "bankAccountId": "string"
  }
}
PATCH/workspaces/{workspaceId}/counterparties/{counterpartyId}

Update a counterparty

Portéecounterparties:write

Paramètres de chemin

workspaceIdstringobligatoire

ID of the workspace.

counterpartyIdstringobligatoire

ID of the counterparty.

Corps de la requête

entityTypestring | null

Kind of entity: an individual or an organization.

  • individual

    A natural person.

  • organization

    A company or another organization.

namestring | null
phonesstring[] | null
emailsstring[] | null
addressPostalAddress | null

Postal address, with the parts of an ISO 20022 postal address.

Afficher les 12 champs enfants
countrystringobligatoire

ISO 3166-1 alpha-2 country code

postCodestringobligatoire

Post code of the address.

townNamestringobligatoire

Name of the town or city.

streetNamestring

Name of the street.

buildingNumberstring

Number of the building in the street.

namestring

Name of the building or place.

sortingCodestring

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

postBoxstring

Post office box.

administrativeAreastring

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

recipientsstring[]

Names of the people the address is for.

organizationstring

Name of the organization at the address.

sourcestring[]

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

contactPersonsobject[] | null
Afficher les 3 champs enfants
namestringobligatoire
phonestring
emailstring
taxIdentificationstring | null
notesstring | null
newCashAccountsobject[] | null
Afficher les 6 champs enfants
identificationsobject[]obligatoire
Afficher les 2 champs enfants
typestringobligatoire

Kind of identifier of a bank account or of its bank.

Afficher les 14 valeurs
  • bic

    Bank Identifier Code of the bank.

  • sortCode

    Six-digit code of a bank and branch in the United Kingdom.

  • iban

    International Bank Account Number.

  • bban

    Basic Bank Account Number, the country-specific format of an account number.

  • accountNumber

    Account number that the bank assigns, unique within the bank or the branch.

  • pan

    Primary Account Number, the number of a credit or debit card.

  • email

    Email address that identifies the account.

  • msisdn

    Mobile phone number that identifies the account.

  • virtualAccountId

    Identifier of a virtual sub-account of a main account.

  • globalWallet

    Identifier of a digital wallet that holds and pays in several currencies.

  • clabe

    CLABE, the 18-digit standardized bank code of a Mexican bank account.

  • bitcoinAddress

    Single Bitcoin address, the only address the account tracks.

  • bitcoinXpub

    Bitcoin extended public key (xpub, ypub or zpub), from which the addresses of the wallet are derived.

  • other

    Another kind of identifier.

valuestringobligatoire

Value of the identifier, for example the IBAN or the BIC.

currencystringobligatoire

ISO 4217 currency code

bankAddressobjectobligatoire
Afficher les 12 champs enfants
countrystringobligatoire

ISO 3166-1 alpha-2 country code

postCodestring

Post code of the address.

townNamestring

Name of the town or city.

streetNamestring

Name of the street.

buildingNumberstring

Number of the building in the street.

namestring

Name of the building or place.

sortingCodestring

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

postBoxstring

Post office box.

administrativeAreastring

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

recipientsstring[]

Names of the people the address is for.

organizationstring

Name of the organization at the address.

sourcestring[]

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

internalIdstring
nicknamestring
verificationobject
Afficher les 4 champs enfants
idstringobligatoire
statusstringobligatoire

Valeursverifiedpendingrejected

holderNamestringobligatoire
dateTimestringdate-timeobligatoire
cashAccountUpdatesobject[] | null
Afficher les 2 champs enfants
internalIdstringobligatoire
bicstringobligatoire

Renvoie

204

No content

curl -X PATCH 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/counterparties/Cp2nG7vB4xLq9wRt5hMz' \
  -H "Authorization: Bearer $SWAY_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "entityType": "individual",
  "address": {
    "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"
    ]
  }
}'
{
  "error": {
    "code": "invalid-argument",
    "message": "Invalid request"
  }
}
DELETE/workspaces/{workspaceId}/counterparties/{counterpartyId}

Delete (soft-delete) a counterparty

Portéecounterparties:write

Paramètres de chemin

workspaceIdstringobligatoire

ID of the workspace.

counterpartyIdstringobligatoire

ID of the counterparty.

Renvoie

204

No content

curl -X DELETE 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/counterparties/Cp2nG7vB4xLq9wRt5hMz' \
  -H "Authorization: Bearer $SWAY_API_KEY"
{
  "error": {
    "code": "invalid-argument",
    "message": "Invalid request"
  }
}
POST/workspaces/{workspaceId}/counterparties/{counterpartyId}/restore

Restore a previously deleted counterparty

Portéecounterparties:write

Paramètres de chemin

workspaceIdstringobligatoire

ID of the workspace.

counterpartyIdstringobligatoire

ID of the counterparty.

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.

Renvoie

200

Successful response

dataCounterpartyobligatoire
curl -X POST 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/counterparties/Cp2nG7vB4xLq9wRt5hMz/restore' \
  -H "Authorization: Bearer $SWAY_API_KEY"
{
  "data": {
    "firestoreId": "Cp2nG7vB4xLq9wRt5hMz",
    "workspaceId": "Wk7fQ2xR9bLm4tZp8sNv",
    "creation": {
      "creationDateTime": "2026-03-02T09:15:00.000Z",
      "createdBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
    },
    "activation": {
      "enabled": true,
      "updateDateTime": "2026-03-02T09:15:00.000Z",
      "updatedBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
    },
    "entityType": "individual",
    "name": "string",
    "phones": [
      "string"
    ],
    "emails": [
      "string"
    ],
    "address": {…},
    "contactPersons": […],
    "taxIdentification": "string",
    "notes": "string",
    "cashAccounts": […],
    "cashAccountIdentifications": [
      "string"
    ],
    "approvedCashAccountIds": [
      "string"
    ],
    "bankAccountId": "string"
  }
}

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.