curl --request POST \
--url https://api.scoutworks.app/api/v1/transactions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"date": "2023-12-25",
"amount": "<string>",
"bankAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"categoryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.scoutworks.app/api/v1/transactions"
payload = {
"date": "2023-12-25",
"amount": "<string>",
"bankAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"categoryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
date: '2023-12-25',
amount: '<string>',
bankAccountId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
description: '<string>',
categoryId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.scoutworks.app/api/v1/transactions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"date": "2023-12-25",
"type": "income",
"amount": "<string>",
"bankAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"categoryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"eventId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"restrictedFundId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"budgetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"paymentMethod": "bank_transfer",
"source": "csv",
"reconciliationStatus": "unreconciled",
"isReconciled": true,
"isTransfer": true,
"isGiftAidEligible": true,
"giftAidType": "declaration",
"giftAidAmount": "<string>",
"splits": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": "<string>",
"categoryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"eventId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"restrictedFundId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"budgetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"isGiftAidEligible": true,
"giftAidType": "declaration",
"giftAidAmount": "<string>",
"description": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"counterparty": "<string>",
"description": "<string>",
"reference": "<string>",
"memberId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deletedAt": "2023-11-07T05:31:56Z"
}
}{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"date": "2023-12-25",
"type": "income",
"amount": "<string>",
"bankAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"categoryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"eventId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"restrictedFundId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"budgetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"paymentMethod": "bank_transfer",
"source": "csv",
"reconciliationStatus": "unreconciled",
"isReconciled": true,
"isTransfer": true,
"isGiftAidEligible": true,
"giftAidType": "declaration",
"giftAidAmount": "<string>",
"splits": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": "<string>",
"categoryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"eventId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"restrictedFundId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"budgetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"isGiftAidEligible": true,
"giftAidType": "declaration",
"giftAidAmount": "<string>",
"description": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"counterparty": "<string>",
"description": "<string>",
"reference": "<string>",
"memberId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deletedAt": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}Add a transaction
Adds a line to the books, as typed into the app, marked with source: api. Send splits to add it already split. A date in a closed accounting year answers 409 period_closed. An id from another group answers 400. A change is made as the admin who created the key, and the record names the key, so Scoutworks shows a script did it. Writes count towards the key’s usual limit and a second one of 30 changes a minute. A group whose subscription has lapsed answers 402.
Send an Idempotency-Key header (unique per transaction) so a retry after a timeout cannot make it twice; without one the request answers 400. For 24 hours, the same key with the same body answers 200 with the first transaction and an Idempotent-Replayed: true header; with a different body it answers 400; while the first request is still running it answers 409 conflict.
curl --request POST \
--url https://api.scoutworks.app/api/v1/transactions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"date": "2023-12-25",
"amount": "<string>",
"bankAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"categoryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.scoutworks.app/api/v1/transactions"
payload = {
"date": "2023-12-25",
"amount": "<string>",
"bankAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"categoryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
date: '2023-12-25',
amount: '<string>',
bankAccountId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
description: '<string>',
categoryId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.scoutworks.app/api/v1/transactions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"date": "2023-12-25",
"type": "income",
"amount": "<string>",
"bankAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"categoryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"eventId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"restrictedFundId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"budgetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"paymentMethod": "bank_transfer",
"source": "csv",
"reconciliationStatus": "unreconciled",
"isReconciled": true,
"isTransfer": true,
"isGiftAidEligible": true,
"giftAidType": "declaration",
"giftAidAmount": "<string>",
"splits": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": "<string>",
"categoryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"eventId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"restrictedFundId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"budgetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"isGiftAidEligible": true,
"giftAidType": "declaration",
"giftAidAmount": "<string>",
"description": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"counterparty": "<string>",
"description": "<string>",
"reference": "<string>",
"memberId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deletedAt": "2023-11-07T05:31:56Z"
}
}{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"date": "2023-12-25",
"type": "income",
"amount": "<string>",
"bankAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"categoryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"eventId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"restrictedFundId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"budgetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"paymentMethod": "bank_transfer",
"source": "csv",
"reconciliationStatus": "unreconciled",
"isReconciled": true,
"isTransfer": true,
"isGiftAidEligible": true,
"giftAidType": "declaration",
"giftAidAmount": "<string>",
"splits": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": "<string>",
"categoryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"eventId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"restrictedFundId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"budgetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"isGiftAidEligible": true,
"giftAidType": "declaration",
"giftAidAmount": "<string>",
"description": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"counterparty": "<string>",
"description": "<string>",
"reference": "<string>",
"memberId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deletedAt": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}Authorizations
Headers
Body
With splits, the lines carry the category, budget, fund and Gift Aid, so leave those off the transaction. A field not listed here is refused with a 400.