Settle the cash a driver is carrying
POST
/cash/settle
const url = 'https://example.com/cash/settle';const options = { method: 'POST', headers: { cookie: 'bottle.session_token=<bottle.session_token>', 'Content-Type': 'application/json' }, body: '{"driverUserId":"example","takingIds":["019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f"],"amountPence":1,"note":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/cash/settle \ --header 'Content-Type: application/json' \ --cookie bottle.session_token=<bottle.session_token> \ --data '{ "driverUserId": "example", "takingIds": [ "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f" ], "amountPence": 1, "note": "example" }'Counts a driver in: everything outstanding at once, because that is what handing over a bag of notes is. An amount may be given and must match what the ledger says, so a disagreement is settled in the yard rather than papered over with whatever was typed.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
driverUserId
required
string
takingIds
Array<string>
amountPence
integer
note
string | null
Responses
Section titled “Responses”Counted in
Media typeapplication/json
object
settledPence
required
integer
drops
required
integer
handoverId
required
string
Examplegenerated
{ "settledPence": 1, "drops": 1, "handoverId": "example"}Not signed in
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Not a member, or without the permission this needs
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Nothing outstanding, or the amount does not match
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Validation failed
Media typeapplication/json
object
error
required
string
message
required
string
issues
required
Array<object>
object
path
required
string
message
required
string
Example
{ "error": "validation", "issues": [ { "path": "email", "message": "Invalid email" } ]}