Skip to content
Resource · Billing

Counterparties

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

counterparties:readcounterparties:write
MethodPathSummary
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

Paths start with /workspaces/{workspaceId}. GET endpoints need counterparties:read, the others counterparties:write.

The Counterparty object

firestoreIdstringrequired

ID of the counterparty.

workspaceIdstringrequired

ID of the workspace.

creationobjectrequired

When and by whom the resource was created.

Show 2 child fields
creationDateTimestringdate-timerequired

Date and time when the resource was created.

createdBystring

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

activationobjectrequired

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

Show 3 child fields
enabledbooleanrequired

Whether the resource is enabled.

updateDateTimestringdate-timerequired

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.

namestringrequired
phonesstring[]required
Show all 16 fields
emailsstring[]required
addressPostalAddress

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

Show 12 child fields
countrystringrequired

ISO 3166-1 alpha-2 country code

postCodestringrequired

Post code of the address.

townNamestringrequired

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[]required
Show 3 child fields
namestringrequired
phonestring
emailstring
taxIdentificationstring
notesstring
cashAccountsobject[]required
Show 6 child fields
identificationsobject[]required
Show 2 child fields
typestringrequired

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

Show 14 values
  • 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.

valuestringrequired

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

currencystringrequired

ISO 4217 currency code

bankAddressobjectrequired
Show 12 child fields
countrystringrequired

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.

internalIdstringrequired
nicknamestring
verificationobject
Show 4 child fields
idstringrequired
statusstringrequired

Valuesverifiedpendingrejected

holderNamestringrequired
dateTimestringdate-timerequired
cashAccountIdentificationsstring[]required
approvedCashAccountIdsstring[]required
bankAccountIdstring | nullrequired
The Counterparty object
{
  "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

Scopecounterparties:read

Path parameters

workspaceIdstringrequired

ID of the workspace.

Query parameters

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.

Default20

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.

Returns

200

List of items

dataCounterparty[]required

Items of the page, in list order.

limitintegerrequired

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

Scopecounterparties:write

Path parameters

workspaceIdstringrequired

ID of the workspace.

Query parameters

fieldsstring

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

Request body

entityTypestring

Kind of entity: an individual or an organization.

  • individual

    A natural person.

  • organization

    A company or another organization.

namestringrequired
phonesstring[]required
emailsstring[]required
addressPostalAddress

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

Show 12 child fields
countrystringrequired

ISO 3166-1 alpha-2 country code

postCodestringrequired

Post code of the address.

townNamestringrequired

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[]required
Show 3 child fields
namestringrequired
phonestring
emailstring
taxIdentificationstring
notesstring
cashAccountsobject[]required
Show 6 child fields
identificationsobject[]required
Show 2 child fields
typestringrequired

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

Show 14 values
  • 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.

valuestringrequired

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

currencystringrequired

ISO 4217 currency code

bankAddressobjectrequired
Show 12 child fields
countrystringrequired

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
Show 4 child fields
idstringrequired
statusstringrequired

Valuesverifiedpendingrejected

holderNamestringrequired
dateTimestringdate-timerequired
bankAccountIdstring | null
mergebooleanrequired

Returns

200

Successful response

dataCounterpartyrequired
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

Scopecounterparties:write

Path parameters

workspaceIdstringrequired

ID of the workspace.

counterpartyIdstringrequired

ID of the counterparty.

Request body

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.

Show 12 child fields
countrystringrequired

ISO 3166-1 alpha-2 country code

postCodestringrequired

Post code of the address.

townNamestringrequired

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
Show 3 child fields
namestringrequired
phonestring
emailstring
taxIdentificationstring | null
notesstring | null
newCashAccountsobject[] | null
Show 6 child fields
identificationsobject[]required
Show 2 child fields
typestringrequired

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

Show 14 values
  • 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.

valuestringrequired

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

currencystringrequired

ISO 4217 currency code

bankAddressobjectrequired
Show 12 child fields
countrystringrequired

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
Show 4 child fields
idstringrequired
statusstringrequired

Valuesverifiedpendingrejected

holderNamestringrequired
dateTimestringdate-timerequired
cashAccountUpdatesobject[] | null
Show 2 child fields
internalIdstringrequired
bicstringrequired

Returns

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

Scopecounterparties:write

Path parameters

workspaceIdstringrequired

ID of the workspace.

counterpartyIdstringrequired

ID of the counterparty.

Returns

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

Scopecounterparties:write

Path parameters

workspaceIdstringrequired

ID of the workspace.

counterpartyIdstringrequired

ID of the counterparty.

Query parameters

fieldsstring

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

Returns

200

Successful response

dataCounterpartyrequired
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"
  }
}

Start building on your own data.

Create an account, open Profile › Developer and create a key scoped to the resources you need. Questions about an integration? The team answers them on a call.