Skip to content
Resource · Billing

Products

A product is a good or a service with the sale and purchase details used on invoices.

products:readproducts:write
MethodPathSummary
GET…/productsList products in the workspace catalog
POST…/productsCreate a product
PATCH…/products/{productId}Update a product
DELETE…/products/{productId}Soft-delete (archive) a product
POST…/products/{productId}/restoreRestore a previously deleted product

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

The Product object

firestoreIdstringrequired

ID of the product.

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.

codestringrequired
nameobjectrequired
Show 1 child field
defaultstringrequired

Text in the default language.

unitobject
Show 1 child field
defaultstringrequired

Text in the default language.

Show all 21 fields
purchaseNameobject
Show 1 child field
defaultstringrequired

Text in the default language.

purchaseCurrencystring

ISO 4217 currency code

purchaseMilliAmountnumber
purchaseDescriptionobject
Show 1 child field
defaultstringrequired

Text in the default language.

purchaseAccountstring

Code of an account in the chart of accounts.

purchaseTaxTypeIdstring

ID of the tax type.

saleNameobject
Show 1 child field
defaultstringrequired

Text in the default language.

saleCurrencystring

ISO 4217 currency code

saleMilliAmountnumber
saleDescriptionobject
Show 1 child field
defaultstringrequired

Text in the default language.

saleAccountstring

Code of an account in the chart of accounts.

saleTaxTypeIdstring

ID of the tax type.

supplierReferencesobject[]required
Show 3 child fields
counterpartyIdstring

ID of the counterparty.

codestring
namestring
tagsstring[]required
The Product object
{
  "firestoreId": "Pr4wJ8tM1xNq6zRb3vKf",
  "workspaceId": "Wk7fQ2xR9bLm4tZp8sNv",
  "creation": {
    "creationDateTime": "2026-03-02T09:15:00.000Z",
    "createdBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
  },
  "activation": {
    "enabled": true,
    "updateDateTime": "2026-03-02T09:15:00.000Z",
    "updatedBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
  },
  "code": "string",
  "name": {
    "default": "string"
  },
  "unit": {
    "default": "string"
  },
  "purchaseName": {
    "default": "string"
  },
  "purchaseCurrency": "CHF",
  "purchaseMilliAmount": 0,
  "purchaseDescription": {
    "default": "string"
  },
  "purchaseAccount": "1020",
  "purchaseTaxTypeId": "Tt9mC5rL2wQz7nVb4kHp",
  "saleName": {
    "default": "string"
  },
  "saleCurrency": "CHF",
  "saleMilliAmount": 0,
  "saleDescription": {
    "default": "string"
  },
  "saleAccount": "1020",
  "saleTaxTypeId": "Tt9mC5rL2wQz7nVb4kHp",
  "supplierReferences": [
    {
      "counterpartyId": "Cp2nG7vB4xLq9wRt5hMz",
      "code": "string",
      "name": "string"
    }
  ],
  "tags": [
    "string"
  ]
}
GET/workspaces/{workspaceId}/products

List products in the workspace catalog

Scopeproducts: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

dataProduct[]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/products' \
  -H "Authorization: Bearer $SWAY_API_KEY"
{
  "data": [
    {
      "firestoreId": "Pr4wJ8tM1xNq6zRb3vKf",
      "workspaceId": "Wk7fQ2xR9bLm4tZp8sNv",
      "creation": {
        "creationDateTime": "2026-03-02T09:15:00.000Z",
        "createdBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
      },
      "activation": {
        "enabled": true,
        "updateDateTime": "2026-03-02T09:15:00.000Z",
        "updatedBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
      },
      "code": "string",
      "name": {
        "default": "string"
      },
      "unit": {
        "default": "string"
      },
      "purchaseName": {
        "default": "string"
      },
      "purchaseCurrency": "CHF",
      "purchaseMilliAmount": 0,
      "purchaseDescription": {
        "default": "string"
      },
      "purchaseAccount": "1020",
      "purchaseTaxTypeId": "Tt9mC5rL2wQz7nVb4kHp",
      "saleName": {
        "default": "string"
      },
      "saleCurrency": "CHF",
      "saleMilliAmount": 0,
      "saleDescription": {
        "default": "string"
      },
      "saleAccount": "1020",
      "saleTaxTypeId": "Tt9mC5rL2wQz7nVb4kHp",
      "supplierReferences": […],
      "tags": [
        "string"
      ]
    }
  ],
  "limit": 0,
  "nextCursor": "string"
}
POST/workspaces/{workspaceId}/products

Create a product

Scopeproducts: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

codestringrequired
nameobjectrequired
Show 1 child field
defaultstringrequired

Text in the default language.

unitobject
Show 1 child field
defaultstringrequired

Text in the default language.

purchaseNameobject
Show 1 child field
defaultstringrequired

Text in the default language.

purchaseCurrencystring

ISO 4217 currency code

purchaseMilliAmountnumber
purchaseDescriptionobject
Show 1 child field
defaultstringrequired

Text in the default language.

purchaseAccountstring

Code of an account in the chart of accounts.

purchaseTaxTypeIdstring

ID of the tax type.

saleNameobject
Show 1 child field
defaultstringrequired

Text in the default language.

saleCurrencystring

ISO 4217 currency code

saleMilliAmountnumber
saleDescriptionobject
Show 1 child field
defaultstringrequired

Text in the default language.

saleAccountstring

Code of an account in the chart of accounts.

saleTaxTypeIdstring

ID of the tax type.

supplierReferencesobject[]

Default[]

Show 3 child fields
counterpartyIdstring

ID of the counterparty.

codestring
namestring
tagsstring[]

Default[]

Returns

200

Successful response

dataProductrequired
curl -X POST 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/products' \
  -H "Authorization: Bearer $SWAY_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "code": "string",
  "name": {
    "default": "string"
  },
  "unit": {
    "default": "string"
  },
  "purchaseName": {
    "default": "string"
  },
  "purchaseCurrency": "CHF",
  "purchaseMilliAmount": 0,
  "purchaseDescription": {
    "default": "string"
  },
  "purchaseAccount": "1020",
  "purchaseTaxTypeId": "Tt9mC5rL2wQz7nVb4kHp",
  "saleName": {
    "default": "string"
  },
  "saleCurrency": "CHF",
  "saleMilliAmount": 0,
  "saleDescription": {
    "default": "string"
  },
  "saleAccount": "1020",
  "saleTaxTypeId": "Tt9mC5rL2wQz7nVb4kHp",
  "supplierReferences": [],
  "tags": []
}'
{
  "data": {
    "firestoreId": "Pr4wJ8tM1xNq6zRb3vKf",
    "workspaceId": "Wk7fQ2xR9bLm4tZp8sNv",
    "creation": {
      "creationDateTime": "2026-03-02T09:15:00.000Z",
      "createdBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
    },
    "activation": {
      "enabled": true,
      "updateDateTime": "2026-03-02T09:15:00.000Z",
      "updatedBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
    },
    "code": "string",
    "name": {
      "default": "string"
    },
    "unit": {
      "default": "string"
    },
    "purchaseName": {
      "default": "string"
    },
    "purchaseCurrency": "CHF",
    "purchaseMilliAmount": 0,
    "purchaseDescription": {
      "default": "string"
    },
    "purchaseAccount": "1020",
    "purchaseTaxTypeId": "Tt9mC5rL2wQz7nVb4kHp",
    "saleName": {
      "default": "string"
    },
    "saleCurrency": "CHF",
    "saleMilliAmount": 0,
    "saleDescription": {
      "default": "string"
    },
    "saleAccount": "1020",
    "saleTaxTypeId": "Tt9mC5rL2wQz7nVb4kHp",
    "supplierReferences": […],
    "tags": [
      "string"
    ]
  }
}
PATCH/workspaces/{workspaceId}/products/{productId}

Update a product

Scopeproducts:write

Path parameters

workspaceIdstringrequired

ID of the workspace.

productIdstringrequired

ID of the product.

Request body

codestring
nameobject
Show 1 child field
defaultstringrequired

Text in the default language.

unitobject | null
Show 1 child field
defaultstringrequired

Text in the default language.

purchaseNameobject | null
Show 1 child field
defaultstringrequired

Text in the default language.

purchaseCurrencystring | null

ISO 4217 currency code

purchaseMilliAmountnumber | null
purchaseDescriptionobject | null
Show 1 child field
defaultstringrequired

Text in the default language.

purchaseAccountstring | null

Code of an account in the chart of accounts.

purchaseTaxTypeIdstring | null

ID of the tax type.

saleNameobject | null
Show 1 child field
defaultstringrequired

Text in the default language.

saleCurrencystring | null

ISO 4217 currency code

saleMilliAmountnumber | null
saleDescriptionobject | null
Show 1 child field
defaultstringrequired

Text in the default language.

saleAccountstring | null

Code of an account in the chart of accounts.

saleTaxTypeIdstring | null

ID of the tax type.

supplierReferencesobject[]
Show 3 child fields
counterpartyIdstring

ID of the counterparty.

codestring
namestring
tagsstring[]

Returns

204

No content

curl -X PATCH 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/products/Pr4wJ8tM1xNq6zRb3vKf' \
  -H "Authorization: Bearer $SWAY_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "purchaseCurrency": "CHF",
  "purchaseAccount": "1020",
  "purchaseTaxTypeId": "Tt9mC5rL2wQz7nVb4kHp",
  "saleCurrency": "CHF",
  "saleAccount": "1020",
  "saleTaxTypeId": "Tt9mC5rL2wQz7nVb4kHp",
  "supplierReferences": [
    {
      "counterpartyId": "Cp2nG7vB4xLq9wRt5hMz"
    }
  ]
}'
{
  "error": {
    "code": "invalid-argument",
    "message": "Invalid request"
  }
}
DELETE/workspaces/{workspaceId}/products/{productId}

Soft-delete (archive) a product

Scopeproducts:write

Path parameters

workspaceIdstringrequired

ID of the workspace.

productIdstringrequired

ID of the product.

Returns

204

No content

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

Restore a previously deleted product

Scopeproducts:write

Path parameters

workspaceIdstringrequired

ID of the workspace.

productIdstringrequired

ID of the product.

Returns

204

No content

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

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.