curl --request POST \
--url https://api.scoutworks.app/api/v1/refunds/manual \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"transactionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"allocations": [
{
"amount": "<string>",
"paymentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"paymentRequestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
}
'import requests
url = "https://api.scoutworks.app/api/v1/refunds/manual"
payload = {
"transactionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"allocations": [
{
"amount": "<string>",
"paymentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"paymentRequestId": "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({
transactionId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
allocations: [
{
amount: '<string>',
paymentId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
paymentRequestId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
}
]
})
};
fetch('https://api.scoutworks.app/api/v1/refunds/manual', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"transactionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"refunds": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "direct_debit",
"amount": "<string>",
"date": "2023-12-25",
"status": "pending_submission",
"paymentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"paymentRequestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"transactionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
]
}
}{
"data": {
"transactionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"refunds": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "direct_debit",
"amount": "<string>",
"date": "2023-12-25",
"status": "pending_submission",
"paymentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"paymentRequestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"transactionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "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"
]
}Record a refund paid by bank transfer
Links a money-out bank line, imported from a statement and still in the reconciliation inbox, to the payments it refunds, and takes the line out of the inbox. Each allocation names a payment (paymentId) or a payment request paid by hand (paymentRequestId). The allocations may not add up to more than the bank line, nor refund a payment beyond what it collected less what is already refunded: either answers 409 over_refund. A line that is money in, not from a bank statement, already reconciled, or another group’s, and a payment from another group, answer 400. No money moves: this records a refund the group has already paid by bank transfer, as the reconcile step in Scoutworks does. The API never issues a Direct Debit refund. Needs accounting:write and payments:read (403 without the second). Made as the admin who created the key, and the bank line’s history names the key. 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. A bank line dated in a closed accounting year answers 409 period_closed.
Send an Idempotency-Key header (unique per refund) 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 refund 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/refunds/manual \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"transactionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"allocations": [
{
"amount": "<string>",
"paymentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"paymentRequestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
}
'import requests
url = "https://api.scoutworks.app/api/v1/refunds/manual"
payload = {
"transactionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"allocations": [
{
"amount": "<string>",
"paymentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"paymentRequestId": "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({
transactionId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
allocations: [
{
amount: '<string>',
paymentId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
paymentRequestId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
}
]
})
};
fetch('https://api.scoutworks.app/api/v1/refunds/manual', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"transactionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"refunds": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "direct_debit",
"amount": "<string>",
"date": "2023-12-25",
"status": "pending_submission",
"paymentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"paymentRequestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"transactionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
]
}
}{
"data": {
"transactionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"refunds": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "direct_debit",
"amount": "<string>",
"date": "2023-12-25",
"status": "pending_submission",
"paymentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"paymentRequestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"transactionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "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
A field not listed here is refused with a 400.
The money-out bank line the refund was paid by: a line imported from a bank statement, still in the reconciliation inbox. Find one in Scoutworks’ Bank Inbox.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$