Skip to content

Settle the cash a driver is carrying

POST
/cash/settle
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.

Media typeapplication/json
object
driverUserId
required
string
takingIds
Array<string>
<= 500 items
amountPence
integer
<= 100000000
note
string | null
<= 500 characters

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
Allowed values: validation
message
required
string
issues
required
Array<object>
object
path
required
string
message
required
string
Example
{
"error": "validation",
"issues": [
{
"path": "email",
"message": "Invalid email"
}
]
}