| Méthode | Chemin | Résumé |
|---|---|---|
| GET | …/products | List products in the workspace catalog |
| POST | …/products | Create a product |
| PATCH | …/products/{productId} | Update a product |
| DELETE | …/products/{productId} | Soft-delete (archive) a product |
| POST | …/products/{productId}/restore | Restore a previously deleted product |
Les chemins commencent par /workspaces/{workspaceId}. Les endpoints GET demandent products:read, les autres products:write.
L’objet Product
firestoreIdstringobligatoireID of the product.
workspaceIdstringobligatoireID of the workspace.
creationobjectobligatoireWhen and by whom the resource was created.
Afficher les 2 champs enfants
creationDateTimestringdate-timeobligatoireDate and time when the resource was created.
createdBystringID of the user who created the resource, when recorded.
activationobjectobligatoireWhether the resource is enabled, and when and by whom it was last enabled or disabled.
Afficher les 3 champs enfants
enabledbooleanobligatoireWhether the resource is enabled.
updateDateTimestringdate-timeobligatoireDate and time when enabled was last set.
updatedBystringID of the user who last set enabled, when recorded.
codestringobligatoirenameobjectobligatoireAfficher 1 champ enfant
defaultstringobligatoireText in the default language.
unitobjectAfficher 1 champ enfant
defaultstringobligatoireText in the default language.
Afficher les 21 champsMasquer la liste des champs
purchaseNameobjectAfficher 1 champ enfant
defaultstringobligatoireText in the default language.
purchaseCurrencystringISO 4217 currency code
purchaseMilliAmountnumberpurchaseDescriptionobjectAfficher 1 champ enfant
defaultstringobligatoireText in the default language.
purchaseAccountstringCode of an account in the chart of accounts.
purchaseTaxTypeIdstringID of the tax type.
saleNameobjectAfficher 1 champ enfant
defaultstringobligatoireText in the default language.
saleCurrencystringISO 4217 currency code
saleMilliAmountnumbersaleDescriptionobjectAfficher 1 champ enfant
defaultstringobligatoireText in the default language.
saleAccountstringCode of an account in the chart of accounts.
saleTaxTypeIdstringID of the tax type.
supplierReferencesobject[]obligatoireAfficher les 3 champs enfants
counterpartyIdstringID of the counterparty.
codestringnamestringtagsstring[]obligatoire{
"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"
]
}/workspaces/{workspaceId}/productsList products in the workspace catalog
Portéeproducts:read
Paramètres de chemin
workspaceIdstringobligatoireID of the workspace.
Paramètres de requête
limitintegerMaximum 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
startAfterstringCursor of the page to return: the nextCursor of the previous page.
fieldsstringComma-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.enabledbooleanWhether the resource is enabled.
Renvoie
List of items
Items of the page, in list order.
limitintegerobligatoirePage size of the request, or the number of requested ids.
nextCursorstringCursor 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"const response = await fetch('https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/products', {
headers: {
Authorization: `Bearer ${process.env.SWAY_API_KEY}`,
},
});
console.log(await response.json());import os
import requests
response = requests.get(
"https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/products",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
)
print(response.json()){
"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"
}{
"error": {
"code": "invalid-argument",
"message": "Invalid request"
}
}{
"error": {
"code": "unauthenticated",
"message": "Invalid or expired credentials"
}
}{
"error": {
"code": "permission-denied",
"message": "Missing required scope: invoices:read"
}
}{
"error": {
"code": "not-found",
"message": "Resource not found"
}
}{
"error": {
"code": "internal",
"message": "An internal error occurred"
}
}/workspaces/{workspaceId}/productsCreate a product
Portéeproducts:write
Paramètres de chemin
workspaceIdstringobligatoireID of the workspace.
Paramètres de requête
fieldsstringComma-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
codestringobligatoirenameobjectobligatoireAfficher 1 champ enfant
defaultstringobligatoireText in the default language.
unitobjectAfficher 1 champ enfant
defaultstringobligatoireText in the default language.
purchaseNameobjectAfficher 1 champ enfant
defaultstringobligatoireText in the default language.
purchaseCurrencystringISO 4217 currency code
purchaseMilliAmountnumberpurchaseDescriptionobjectAfficher 1 champ enfant
defaultstringobligatoireText in the default language.
purchaseAccountstringCode of an account in the chart of accounts.
purchaseTaxTypeIdstringID of the tax type.
saleNameobjectAfficher 1 champ enfant
defaultstringobligatoireText in the default language.
saleCurrencystringISO 4217 currency code
saleMilliAmountnumbersaleDescriptionobjectAfficher 1 champ enfant
defaultstringobligatoireText in the default language.
saleAccountstringCode of an account in the chart of accounts.
saleTaxTypeIdstringID of the tax type.
supplierReferencesobject[]Par défaut[]
Afficher les 3 champs enfants
counterpartyIdstringID of the counterparty.
codestringnamestringtagsstring[]Par défaut[]
Renvoie
Successful response
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": []
}'const response = await fetch('https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/products', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SWAY_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"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": []
}),
});
console.log(await response.json());import os
import requests
response = requests.post(
"https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/products",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
json={
"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": [],
},
)
print(response.json()){
"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"
]
}
}{
"error": {
"code": "invalid-argument",
"message": "Invalid request"
}
}{
"error": {
"code": "unauthenticated",
"message": "Invalid or expired credentials"
}
}{
"error": {
"code": "permission-denied",
"message": "Missing required scope: invoices:read"
}
}{
"error": {
"code": "not-found",
"message": "Resource not found"
}
}{
"error": {
"code": "internal",
"message": "An internal error occurred"
}
}/workspaces/{workspaceId}/products/{productId}Update a product
Portéeproducts:write
Paramètres de chemin
workspaceIdstringobligatoireID of the workspace.
productIdstringobligatoireID of the product.
Corps de la requête
codestringnameobjectAfficher 1 champ enfant
defaultstringobligatoireText in the default language.
unitobject | nullAfficher 1 champ enfant
defaultstringobligatoireText in the default language.
purchaseNameobject | nullAfficher 1 champ enfant
defaultstringobligatoireText in the default language.
purchaseCurrencystring | nullISO 4217 currency code
purchaseMilliAmountnumber | nullpurchaseDescriptionobject | nullAfficher 1 champ enfant
defaultstringobligatoireText in the default language.
purchaseAccountstring | nullCode of an account in the chart of accounts.
purchaseTaxTypeIdstring | nullID of the tax type.
saleNameobject | nullAfficher 1 champ enfant
defaultstringobligatoireText in the default language.
saleCurrencystring | nullISO 4217 currency code
saleMilliAmountnumber | nullsaleDescriptionobject | nullAfficher 1 champ enfant
defaultstringobligatoireText in the default language.
saleAccountstring | nullCode of an account in the chart of accounts.
saleTaxTypeIdstring | nullID of the tax type.
supplierReferencesobject[]Afficher les 3 champs enfants
counterpartyIdstringID of the counterparty.
codestringnamestringtagsstring[]Renvoie
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"
}
]
}'const response = await fetch('https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/products/Pr4wJ8tM1xNq6zRb3vKf', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.SWAY_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"purchaseCurrency": "CHF",
"purchaseAccount": "1020",
"purchaseTaxTypeId": "Tt9mC5rL2wQz7nVb4kHp",
"saleCurrency": "CHF",
"saleAccount": "1020",
"saleTaxTypeId": "Tt9mC5rL2wQz7nVb4kHp",
"supplierReferences": [
{
"counterpartyId": "Cp2nG7vB4xLq9wRt5hMz"
}
]
}),
});
console.log(response.status);import os
import requests
response = requests.patch(
"https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/products/Pr4wJ8tM1xNq6zRb3vKf",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
json={
"purchaseCurrency": "CHF",
"purchaseAccount": "1020",
"purchaseTaxTypeId": "Tt9mC5rL2wQz7nVb4kHp",
"saleCurrency": "CHF",
"saleAccount": "1020",
"saleTaxTypeId": "Tt9mC5rL2wQz7nVb4kHp",
"supplierReferences": [
{
"counterpartyId": "Cp2nG7vB4xLq9wRt5hMz",
},
],
},
)
print(response.status_code){
"error": {
"code": "invalid-argument",
"message": "Invalid request"
}
}{
"error": {
"code": "unauthenticated",
"message": "Invalid or expired credentials"
}
}{
"error": {
"code": "permission-denied",
"message": "Missing required scope: invoices:read"
}
}{
"error": {
"code": "not-found",
"message": "Resource not found"
}
}{
"error": {
"code": "internal",
"message": "An internal error occurred"
}
}/workspaces/{workspaceId}/products/{productId}Soft-delete (archive) a product
Portéeproducts:write
Paramètres de chemin
workspaceIdstringobligatoireID of the workspace.
productIdstringobligatoireID of the product.
Renvoie
No content
curl -X DELETE 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/products/Pr4wJ8tM1xNq6zRb3vKf' \
-H "Authorization: Bearer $SWAY_API_KEY"const response = await fetch('https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/products/Pr4wJ8tM1xNq6zRb3vKf', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${process.env.SWAY_API_KEY}`,
},
});
console.log(response.status);import os
import requests
response = requests.delete(
"https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/products/Pr4wJ8tM1xNq6zRb3vKf",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
)
print(response.status_code){
"error": {
"code": "invalid-argument",
"message": "Invalid request"
}
}{
"error": {
"code": "unauthenticated",
"message": "Invalid or expired credentials"
}
}{
"error": {
"code": "permission-denied",
"message": "Missing required scope: invoices:read"
}
}{
"error": {
"code": "not-found",
"message": "Resource not found"
}
}{
"error": {
"code": "internal",
"message": "An internal error occurred"
}
}/workspaces/{workspaceId}/products/{productId}/restoreRestore a previously deleted product
Portéeproducts:write
Paramètres de chemin
workspaceIdstringobligatoireID of the workspace.
productIdstringobligatoireID of the product.
Renvoie
No content
curl -X POST 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/products/Pr4wJ8tM1xNq6zRb3vKf/restore' \
-H "Authorization: Bearer $SWAY_API_KEY"const response = await fetch('https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/products/Pr4wJ8tM1xNq6zRb3vKf/restore', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SWAY_API_KEY}`,
},
});
console.log(response.status);import os
import requests
response = requests.post(
"https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/products/Pr4wJ8tM1xNq6zRb3vKf/restore",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
)
print(response.status_code){
"error": {
"code": "invalid-argument",
"message": "Invalid request"
}
}{
"error": {
"code": "unauthenticated",
"message": "Invalid or expired credentials"
}
}{
"error": {
"code": "permission-denied",
"message": "Missing required scope: invoices:read"
}
}{
"error": {
"code": "not-found",
"message": "Resource not found"
}
}{
"error": {
"code": "internal",
"message": "An internal error occurred"
}
}