| Méthode | Chemin | Résumé |
|---|---|---|
| GET | …/tax-types | List tax types in the workspace |
| POST | …/tax-types | Create a tax type |
| PATCH | …/tax-types/{taxTypeId} | Update a tax type |
| DELETE | …/tax-types/{taxTypeId} | Delete a tax type |
Les chemins commencent par /workspaces/{workspaceId}. Les endpoints GET demandent tax-types:read, les autres tax-types:write.
L’objet TaxType
firestoreIdstringobligatoireID of the tax type.
workspaceIdstringobligatoireID of the workspace.
namestringobligatoiredescriptionstringratenumberobligatoireexternalIdstringobligatoirecodestringAfficher les 10 champsMasquer la liste des champs
ledgerAccountstringmilliRoundingFactornumbercreationobjectobligatoireWhen 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.
{
"firestoreId": "Tt9mC5rL2wQz7nVb4kHp",
"workspaceId": "Wk7fQ2xR9bLm4tZp8sNv",
"name": "string",
"description": "string",
"rate": 0,
"externalId": "string",
"code": "string",
"ledgerAccount": "string",
"milliRoundingFactor": 0,
"creation": {
"creationDateTime": "2026-03-02T09:15:00.000Z",
"createdBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
}
}/workspaces/{workspaceId}/tax-typesList tax types in the workspace
Portéetax-types: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.
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/tax-types' \
-H "Authorization: Bearer $SWAY_API_KEY"const response = await fetch('https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/tax-types', {
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/tax-types",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
)
print(response.json()){
"data": [
{
"firestoreId": "Tt9mC5rL2wQz7nVb4kHp",
"workspaceId": "Wk7fQ2xR9bLm4tZp8sNv",
"name": "string",
"description": "string",
"rate": 0,
"externalId": "string",
"code": "string",
"ledgerAccount": "string",
"milliRoundingFactor": 0,
"creation": {
"creationDateTime": "2026-03-02T09:15:00.000Z",
"createdBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
}
}
],
"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}/tax-typesCreate a tax type
Portéetax-types: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
namestringobligatoiredescriptionstringratenumberobligatoireexternalIdstringobligatoirecodestringledgerAccountstringmilliRoundingFactornumberRenvoie
Successful response
curl -X POST 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/tax-types' \
-H "Authorization: Bearer $SWAY_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"name": "string",
"description": "string",
"rate": 0,
"externalId": "string",
"code": "string",
"ledgerAccount": "string",
"milliRoundingFactor": 0
}'const response = await fetch('https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/tax-types', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SWAY_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "string",
"description": "string",
"rate": 0,
"externalId": "string",
"code": "string",
"ledgerAccount": "string",
"milliRoundingFactor": 0
}),
});
console.log(await response.json());import os
import requests
response = requests.post(
"https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/tax-types",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
json={
"name": "string",
"description": "string",
"rate": 0,
"externalId": "string",
"code": "string",
"ledgerAccount": "string",
"milliRoundingFactor": 0,
},
)
print(response.json()){
"data": {
"firestoreId": "Tt9mC5rL2wQz7nVb4kHp",
"workspaceId": "Wk7fQ2xR9bLm4tZp8sNv",
"name": "string",
"description": "string",
"rate": 0,
"externalId": "string",
"code": "string",
"ledgerAccount": "string",
"milliRoundingFactor": 0,
"creation": {
"creationDateTime": "2026-03-02T09:15:00.000Z",
"createdBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
}
}
}{
"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}/tax-types/{taxTypeId}Update a tax type
Portéetax-types:write
Paramètres de chemin
workspaceIdstringobligatoireID of the workspace.
taxTypeIdstringobligatoireID of the tax type.
Corps de la requête
namestringdescriptionstring | nullratenumberexternalIdstringcodestring | nullledgerAccountstring | nullmilliRoundingFactornumber | nullRenvoie
No content
curl -X PATCH 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/tax-types/Tt9mC5rL2wQz7nVb4kHp' \
-H "Authorization: Bearer $SWAY_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"name": "string",
"description": "string",
"rate": 0,
"externalId": "string",
"code": "string",
"ledgerAccount": "string",
"milliRoundingFactor": 0
}'const response = await fetch('https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/tax-types/Tt9mC5rL2wQz7nVb4kHp', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.SWAY_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "string",
"description": "string",
"rate": 0,
"externalId": "string",
"code": "string",
"ledgerAccount": "string",
"milliRoundingFactor": 0
}),
});
console.log(response.status);import os
import requests
response = requests.patch(
"https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/tax-types/Tt9mC5rL2wQz7nVb4kHp",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
json={
"name": "string",
"description": "string",
"rate": 0,
"externalId": "string",
"code": "string",
"ledgerAccount": "string",
"milliRoundingFactor": 0,
},
)
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}/tax-types/{taxTypeId}Delete a tax type
Portéetax-types:write
Paramètres de chemin
workspaceIdstringobligatoireID of the workspace.
taxTypeIdstringobligatoireID of the tax type.
Renvoie
No content
curl -X DELETE 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/tax-types/Tt9mC5rL2wQz7nVb4kHp' \
-H "Authorization: Bearer $SWAY_API_KEY"const response = await fetch('https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/tax-types/Tt9mC5rL2wQz7nVb4kHp', {
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/tax-types/Tt9mC5rL2wQz7nVb4kHp",
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"
}
}