| Méthode | Chemin | Résumé |
|---|---|---|
| GET | …/account-coding-rules | List account coding rules in the workspace |
| POST | …/account-coding-rules | Create a new account coding rule |
| PATCH | …/account-coding-rules/{ruleId} | Update an existing account coding rule |
| DELETE | …/account-coding-rules/{ruleId} | Delete an account coding rule |
| POST | …/account-coding-rules/reorder | Reorder account coding rules to change their evaluation priority |
| POST | …/account-coding-rules/{ruleId}/conditions | Add a condition to an account coding rule |
| DELETE | …/account-coding-rules/{ruleId}/conditions/{conditionId} | Delete a condition from an account coding rule |
| PATCH | …/account-coding-rules/{ruleId}/conditions/{conditionId} | Edit a condition on an account coding rule |
| POST | …/account-coding-rules/{ruleId}/actions | Add an action to an account coding rule |
| DELETE | …/account-coding-rules/{ruleId}/actions/{actionId} | Delete an action from an account coding rule |
| PATCH | …/account-coding-rules/{ruleId}/actions/{actionId} | Edit an action on an account coding rule |
Les chemins commencent par /workspaces/{workspaceId}. Les endpoints GET demandent account-coding-rules:read, les autres account-coding-rules:write.
L’objet AccountCodingRule
firestoreIdstringobligatoireID of the account coding rule.
workspaceIdstringobligatoireID of the workspace.
namestringobligatoiredescriptionstringbankAccountIdstringID of the bank account.
conditionsOperatorstringobligatoireValeursANDOR
conditionsobject[]obligatoirefield: TEXT
idstringobligatoirefieldstringobligatoireValeursTEXT
operatorstringobligatoireValeursCONTAINSNOT_CONTAINS
valuestringobligatoirefield: MILLI_AMOUNT
idstringobligatoirefieldstringobligatoireValeursMILLI_AMOUNT
operatorstringobligatoireValeursLTGTLTEGTEEQNEQ
valuenumberobligatoirefield: CURRENCY
idstringobligatoirefieldstringobligatoireValeursCURRENCY
operatorstringobligatoireValeursEQNEQ
valuestringobligatoireISO 4217 currency code
Afficher les 11 champsMasquer la liste des champs
actionsobject[]obligatoireAfficher les 3 champs enfants
idstringobligatoiretypestringobligatoireValeursASSIGN_ACCOUNTASSIGN_TAX_TYPESET_ENTRY_DESCRIPTION
valuestringobligatoireordernumberobligatoirecreationobjectobligatoireWhen 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.
{
"firestoreId": "Ru7bX2kQ9mWp4tLz6nHc",
"workspaceId": "Wk7fQ2xR9bLm4tZp8sNv",
"name": "string",
"description": "string",
"bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
"conditionsOperator": "AND",
"conditions": [
{
"id": "string",
"field": "TEXT",
"operator": "CONTAINS",
"value": "string"
}
],
"actions": [
{
"id": "string",
"type": "ASSIGN_ACCOUNT",
"value": "string"
}
],
"order": 0,
"creation": {
"creationDateTime": "2026-03-02T09:15:00.000Z",
"createdBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
},
"activation": {
"enabled": true,
"updateDateTime": "2026-03-02T09:15:00.000Z",
"updatedBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
}
}/workspaces/{workspaceId}/account-coding-rulesList account coding rules in the workspace
Portéeaccount-coding-rules: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/account-coding-rules' \
-H "Authorization: Bearer $SWAY_API_KEY"const response = await fetch('https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/account-coding-rules', {
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/account-coding-rules",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
)
print(response.json()){
"data": [
{
"firestoreId": "Ru7bX2kQ9mWp4tLz6nHc",
"workspaceId": "Wk7fQ2xR9bLm4tZp8sNv",
"name": "string",
"description": "string",
"bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
"conditionsOperator": "AND",
"conditions": […],
"actions": […],
"order": 0,
"creation": {
"creationDateTime": "2026-03-02T09:15:00.000Z",
"createdBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
},
"activation": {
"enabled": true,
"updateDateTime": "2026-03-02T09:15:00.000Z",
"updatedBy": "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}/account-coding-rulesCreate a new account coding rule
Portéeaccount-coding-rules: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
namestringobligatoiredescriptionstringbankAccountIdstringID of the bank account.
conditionsOperatorstringobligatoireValeursANDOR
conditionsobject[]obligatoirefield: TEXT
fieldstringobligatoireValeursTEXT
operatorstringobligatoireValeursCONTAINSNOT_CONTAINS
valuestringobligatoirefield: MILLI_AMOUNT
fieldstringobligatoireValeursMILLI_AMOUNT
operatorstringobligatoireValeursLTGTLTEGTEEQNEQ
valuenumberobligatoirefield: CURRENCY
fieldstringobligatoireValeursCURRENCY
operatorstringobligatoireValeursEQNEQ
valuestringobligatoireISO 4217 currency code
actionsobject[]obligatoireAfficher les 2 champs enfants
typestringobligatoireValeursASSIGN_ACCOUNTASSIGN_TAX_TYPESET_ENTRY_DESCRIPTION
valuestringobligatoireencodeDaysOfHistoricalDataintegerRenvoie
Successful response
curl -X POST 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/account-coding-rules' \
-H "Authorization: Bearer $SWAY_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"name": "string",
"description": "string",
"bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
"conditionsOperator": "AND",
"conditions": [
{
"field": "TEXT",
"operator": "CONTAINS",
"value": "string"
}
],
"actions": [
{
"type": "ASSIGN_ACCOUNT",
"value": "string"
}
],
"encodeDaysOfHistoricalData": 0
}'const response = await fetch('https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/account-coding-rules', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SWAY_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "string",
"description": "string",
"bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
"conditionsOperator": "AND",
"conditions": [
{
"field": "TEXT",
"operator": "CONTAINS",
"value": "string"
}
],
"actions": [
{
"type": "ASSIGN_ACCOUNT",
"value": "string"
}
],
"encodeDaysOfHistoricalData": 0
}),
});
console.log(await response.json());import os
import requests
response = requests.post(
"https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/account-coding-rules",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
json={
"name": "string",
"description": "string",
"bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
"conditionsOperator": "AND",
"conditions": [
{
"field": "TEXT",
"operator": "CONTAINS",
"value": "string",
},
],
"actions": [
{
"type": "ASSIGN_ACCOUNT",
"value": "string",
},
],
"encodeDaysOfHistoricalData": 0,
},
)
print(response.json()){
"data": {
"firestoreId": "Ru7bX2kQ9mWp4tLz6nHc",
"workspaceId": "Wk7fQ2xR9bLm4tZp8sNv",
"name": "string",
"description": "string",
"bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
"conditionsOperator": "AND",
"conditions": […],
"actions": […],
"order": 0,
"creation": {
"creationDateTime": "2026-03-02T09:15:00.000Z",
"createdBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
},
"activation": {
"enabled": true,
"updateDateTime": "2026-03-02T09:15:00.000Z",
"updatedBy": "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}/account-coding-rules/{ruleId}Update an existing account coding rule
Portéeaccount-coding-rules:write
Paramètres de chemin
workspaceIdstringobligatoireID of the workspace.
ruleIdstringobligatoireID of the account coding rule.
Corps de la requête
namestringdescriptionstring | nullbankAccountIdstring | nullID of the bank account.
conditionsOperatorstringValeursANDOR
activebooleanencodeDaysOfHistoricalDataintegerRenvoie
No content
curl -X PATCH 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/account-coding-rules/Ru7bX2kQ9mWp4tLz6nHc' \
-H "Authorization: Bearer $SWAY_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
"conditionsOperator": "AND"
}'const response = await fetch('https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/account-coding-rules/Ru7bX2kQ9mWp4tLz6nHc', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.SWAY_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
"conditionsOperator": "AND"
}),
});
console.log(response.status);import os
import requests
response = requests.patch(
"https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/account-coding-rules/Ru7bX2kQ9mWp4tLz6nHc",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
json={
"bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
"conditionsOperator": "AND",
},
)
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}/account-coding-rules/{ruleId}Delete an account coding rule
Portéeaccount-coding-rules:write
Paramètres de chemin
workspaceIdstringobligatoireID of the workspace.
ruleIdstringobligatoireID of the account coding rule.
Renvoie
No content
curl -X DELETE 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/account-coding-rules/Ru7bX2kQ9mWp4tLz6nHc' \
-H "Authorization: Bearer $SWAY_API_KEY"const response = await fetch('https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/account-coding-rules/Ru7bX2kQ9mWp4tLz6nHc', {
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/account-coding-rules/Ru7bX2kQ9mWp4tLz6nHc",
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}/account-coding-rules/reorderReorder account coding rules to change their evaluation priority
Portéeaccount-coding-rules:write
Paramètres de chemin
workspaceIdstringobligatoireID of the workspace.
Corps de la requête
ruleIdstringobligatoireID of the account coding rule.
newOrderintegerobligatoireRenvoie
No content
curl -X POST 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/account-coding-rules/reorder' \
-H "Authorization: Bearer $SWAY_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"ruleId": "Ru7bX2kQ9mWp4tLz6nHc",
"newOrder": 0
}'const response = await fetch('https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/account-coding-rules/reorder', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SWAY_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"ruleId": "Ru7bX2kQ9mWp4tLz6nHc",
"newOrder": 0
}),
});
console.log(response.status);import os
import requests
response = requests.post(
"https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/account-coding-rules/reorder",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
json={
"ruleId": "Ru7bX2kQ9mWp4tLz6nHc",
"newOrder": 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}/account-coding-rules/{ruleId}/conditionsAdd a condition to an account coding rule
Portéeaccount-coding-rules:write
Paramètres de chemin
workspaceIdstringobligatoireID of the workspace.
ruleIdstringobligatoireID of the account coding rule.
Corps de la requête
conditionobjectobligatoirefield: TEXT
fieldstringobligatoireValeursTEXT
operatorstringobligatoireValeursCONTAINSNOT_CONTAINS
valuestringobligatoirefield: MILLI_AMOUNT
fieldstringobligatoireValeursMILLI_AMOUNT
operatorstringobligatoireValeursLTGTLTEGTEEQNEQ
valuenumberobligatoirefield: CURRENCY
fieldstringobligatoireValeursCURRENCY
operatorstringobligatoireValeursEQNEQ
valuestringobligatoireISO 4217 currency code
Renvoie
No content
curl -X POST 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/account-coding-rules/Ru7bX2kQ9mWp4tLz6nHc/conditions' \
-H "Authorization: Bearer $SWAY_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"condition": {
"field": "TEXT",
"operator": "CONTAINS",
"value": "string"
}
}'const response = await fetch('https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/account-coding-rules/Ru7bX2kQ9mWp4tLz6nHc/conditions', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SWAY_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"condition": {
"field": "TEXT",
"operator": "CONTAINS",
"value": "string"
}
}),
});
console.log(response.status);import os
import requests
response = requests.post(
"https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/account-coding-rules/Ru7bX2kQ9mWp4tLz6nHc/conditions",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
json={
"condition": {
"field": "TEXT",
"operator": "CONTAINS",
"value": "string",
},
},
)
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}/account-coding-rules/{ruleId}/conditions/{conditionId}Delete a condition from an account coding rule
Portéeaccount-coding-rules:write
Paramètres de chemin
workspaceIdstringobligatoireID of the workspace.
ruleIdstringobligatoireID of the account coding rule.
conditionIdstringobligatoireID of the condition in the account coding rule.
Renvoie
No content
curl -X DELETE 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/account-coding-rules/Ru7bX2kQ9mWp4tLz6nHc/conditions/k3j9x2m7q1p' \
-H "Authorization: Bearer $SWAY_API_KEY"const response = await fetch('https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/account-coding-rules/Ru7bX2kQ9mWp4tLz6nHc/conditions/k3j9x2m7q1p', {
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/account-coding-rules/Ru7bX2kQ9mWp4tLz6nHc/conditions/k3j9x2m7q1p",
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}/account-coding-rules/{ruleId}/conditions/{conditionId}Edit a condition on an account coding rule
Portéeaccount-coding-rules:write
Paramètres de chemin
workspaceIdstringobligatoireID of the workspace.
ruleIdstringobligatoireID of the account coding rule.
conditionIdstringobligatoireID of the condition in the account coding rule.
Corps de la requête
conditionobjectobligatoirefield: TEXT
fieldstringobligatoireValeursTEXT
operatorstringobligatoireValeursCONTAINSNOT_CONTAINS
valuestringobligatoirefield: MILLI_AMOUNT
fieldstringobligatoireValeursMILLI_AMOUNT
operatorstringobligatoireValeursLTGTLTEGTEEQNEQ
valuenumberobligatoirefield: CURRENCY
fieldstringobligatoireValeursCURRENCY
operatorstringobligatoireValeursEQNEQ
valuestringobligatoireISO 4217 currency code
Renvoie
No content
curl -X PATCH 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/account-coding-rules/Ru7bX2kQ9mWp4tLz6nHc/conditions/k3j9x2m7q1p' \
-H "Authorization: Bearer $SWAY_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"condition": {
"field": "TEXT",
"operator": "CONTAINS",
"value": "string"
}
}'const response = await fetch('https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/account-coding-rules/Ru7bX2kQ9mWp4tLz6nHc/conditions/k3j9x2m7q1p', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.SWAY_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"condition": {
"field": "TEXT",
"operator": "CONTAINS",
"value": "string"
}
}),
});
console.log(response.status);import os
import requests
response = requests.patch(
"https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/account-coding-rules/Ru7bX2kQ9mWp4tLz6nHc/conditions/k3j9x2m7q1p",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
json={
"condition": {
"field": "TEXT",
"operator": "CONTAINS",
"value": "string",
},
},
)
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}/account-coding-rules/{ruleId}/actionsAdd an action to an account coding rule
Portéeaccount-coding-rules:write
Paramètres de chemin
workspaceIdstringobligatoireID of the workspace.
ruleIdstringobligatoireID of the account coding rule.
Corps de la requête
actionobjectobligatoireAfficher les 2 champs enfants
typestringobligatoireValeursASSIGN_ACCOUNTASSIGN_TAX_TYPESET_ENTRY_DESCRIPTION
valuestringobligatoireRenvoie
No content
curl -X POST 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/account-coding-rules/Ru7bX2kQ9mWp4tLz6nHc/actions' \
-H "Authorization: Bearer $SWAY_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"action": {
"type": "ASSIGN_ACCOUNT",
"value": "string"
}
}'const response = await fetch('https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/account-coding-rules/Ru7bX2kQ9mWp4tLz6nHc/actions', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SWAY_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"action": {
"type": "ASSIGN_ACCOUNT",
"value": "string"
}
}),
});
console.log(response.status);import os
import requests
response = requests.post(
"https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/account-coding-rules/Ru7bX2kQ9mWp4tLz6nHc/actions",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
json={
"action": {
"type": "ASSIGN_ACCOUNT",
"value": "string",
},
},
)
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}/account-coding-rules/{ruleId}/actions/{actionId}Delete an action from an account coding rule
Portéeaccount-coding-rules:write
Paramètres de chemin
workspaceIdstringobligatoireID of the workspace.
ruleIdstringobligatoireID of the account coding rule.
actionIdstringobligatoireID of the action in the account coding rule.
Renvoie
No content
curl -X DELETE 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/account-coding-rules/Ru7bX2kQ9mWp4tLz6nHc/actions/w8f4n1c6z5t' \
-H "Authorization: Bearer $SWAY_API_KEY"const response = await fetch('https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/account-coding-rules/Ru7bX2kQ9mWp4tLz6nHc/actions/w8f4n1c6z5t', {
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/account-coding-rules/Ru7bX2kQ9mWp4tLz6nHc/actions/w8f4n1c6z5t",
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}/account-coding-rules/{ruleId}/actions/{actionId}Edit an action on an account coding rule
Portéeaccount-coding-rules:write
Paramètres de chemin
workspaceIdstringobligatoireID of the workspace.
ruleIdstringobligatoireID of the account coding rule.
actionIdstringobligatoireID of the action in the account coding rule.
Corps de la requête
actionobjectobligatoireAfficher les 2 champs enfants
typestringobligatoireValeursASSIGN_ACCOUNTASSIGN_TAX_TYPESET_ENTRY_DESCRIPTION
valuestringobligatoireRenvoie
No content
curl -X PATCH 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/account-coding-rules/Ru7bX2kQ9mWp4tLz6nHc/actions/w8f4n1c6z5t' \
-H "Authorization: Bearer $SWAY_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"action": {
"type": "ASSIGN_ACCOUNT",
"value": "string"
}
}'const response = await fetch('https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/account-coding-rules/Ru7bX2kQ9mWp4tLz6nHc/actions/w8f4n1c6z5t', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.SWAY_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"action": {
"type": "ASSIGN_ACCOUNT",
"value": "string"
}
}),
});
console.log(response.status);import os
import requests
response = requests.patch(
"https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/account-coding-rules/Ru7bX2kQ9mWp4tLz6nHc/actions/w8f4n1c6z5t",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
json={
"action": {
"type": "ASSIGN_ACCOUNT",
"value": "string",
},
},
)
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"
}
}