{"openapi":"3.1.0","info":{"title":"Clubtab API","version":"1","description":"Read and change a team’s money as the Clubtab app does. The guide: https://clubtab.co.uk/developers/api"},"servers":[{"url":"https://app.clubtab.co.uk/api/v1"}],"security":[{"token":[]}],"paths":{"/me":{"get":{"operationId":"me","summary":"Who the token belongs to","tags":["Me"],"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountData"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/teams":{"get":{"operationId":"teams","summary":"The teams you can see","tags":["Teams"],"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TeamSummaryData"}}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/teams/{team}/cash":{"get":{"operationId":"cash","summary":"Cash in hand, what’s paid in and the latest entries","tags":["Cash"],"parameters":[{"name":"team","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CashPageData"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/teams/{team}/cash/bank":{"post":{"operationId":"cashBank","summary":"Pay the cash in hand into the bank","tags":["Cash"],"parameters":[{"name":"team","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A new UUID for each change; the same one when sending it again.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"client_uuid":{"type":"string","format":"uuid"}},"required":["client_uuid"]}}}},"responses":{"201":{"description":"Made","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CashResultData"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/StillWorking"},"422":{"$ref":"#/components/responses/Unprocessable"},"428":{"$ref":"#/components/responses/KeyMissing"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/teams/{team}/cash/count":{"post":{"operationId":"cashCount","summary":"Count up the cash, with a note for any difference","tags":["Cash"],"parameters":[{"name":"team","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A new UUID for each change; the same one when sending it again.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"counted":{"type":"string"},"client_uuid":{"type":"string","format":"uuid"},"note":{"type":["string","null"]}},"required":["counted","client_uuid"]}}}},"responses":{"201":{"description":"Made","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CashResultData"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/StillWorking"},"422":{"$ref":"#/components/responses/Unprocessable"},"428":{"$ref":"#/components/responses/KeyMissing"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/teams/{team}/cash/other":{"get":{"operationId":"cashOther","summary":"The pots other cash can go to","tags":["Cash"],"parameters":[{"name":"team","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OtherCashPageData"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"post":{"operationId":"cashOtherRecord","summary":"Record a sponsor, donation or collection","tags":["Cash"],"parameters":[{"name":"team","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A new UUID for each change; the same one when sending it again.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["sponsor","donation","collection"]},"amount":{"type":"string"},"client_uuid":{"type":"string","format":"uuid"},"name":{"type":["string","null"]},"pot_id":{"type":["string","null"]},"counted_with":{"type":["string","null"]},"contact":{"type":["string","null"]},"save":{"type":"boolean"}},"required":["kind","amount","client_uuid"]}}}},"responses":{"201":{"description":"Made","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CashResultData"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/StillWorking"},"422":{"$ref":"#/components/responses/Unprocessable"},"428":{"$ref":"#/components/responses/KeyMissing"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/teams/{team}/cash/out":{"post":{"operationId":"cashOut","summary":"Record cash spent","tags":["Cash"],"parameters":[{"name":"team","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A new UUID for each change; the same one when sending it again.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"string"},"what":{"type":"string"},"client_uuid":{"type":"string","format":"uuid"}},"required":["amount","what","client_uuid"]}}}},"responses":{"201":{"description":"Made","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CashResultData"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/StillWorking"},"422":{"$ref":"#/components/responses/Unprocessable"},"428":{"$ref":"#/components/responses/KeyMissing"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/teams/{team}/cash/training":{"get":{"operationId":"cashTraining","summary":"What cash at training can be for, and the squad","tags":["Cash"],"parameters":[{"name":"team","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CashTrainingData"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"post":{"operationId":"cashTrainingRecord","summary":"Record cash taken at training, for several children","tags":["Cash"],"parameters":[{"name":"team","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A new UUID for each change; the same one when sending it again.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"for":{"type":"string"},"amount":{"type":"string"},"player_ids":{"type":"array","items":{"type":"string"}},"client_uuid":{"type":"string","format":"uuid"}},"required":["for","amount","player_ids","client_uuid"]}}}},"responses":{"201":{"description":"Made","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CashResultData"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/StillWorking"},"422":{"$ref":"#/components/responses/Unprocessable"},"428":{"$ref":"#/components/responses/KeyMissing"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/teams/{team}/cash/{transaction}/reverse":{"post":{"operationId":"cashReverse","summary":"Put a cash entry right, with a reason","tags":["Cash"],"parameters":[{"name":"team","in":"path","required":true,"schema":{"type":"string"}},{"name":"transaction","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A new UUID for each change; the same one when sending it again.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"client_uuid":{"type":"string","format":"uuid"},"reason":{"type":["string","null"]}},"required":["client_uuid"]}}}},"responses":{"201":{"description":"Made","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CashResultData"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/StillWorking"},"422":{"$ref":"#/components/responses/Unprocessable"},"428":{"$ref":"#/components/responses/KeyMissing"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/teams/{team}/inbox":{"get":{"operationId":"inbox","summary":"Payments waiting to be matched, with suggestions","tags":["Inbox"],"parameters":[{"name":"team","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxData"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/teams/{team}/inbox/confirm-sure":{"post":{"operationId":"inboxConfirmSure","summary":"Confirm every sure match at once","tags":["Inbox"],"parameters":[{"name":"team","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A new UUID for each change; the same one when sending it again.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"client_uuid":{"type":"string","format":"uuid"}},"required":["client_uuid"]}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SureMatchesData"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/StillWorking"},"422":{"$ref":"#/components/responses/Unprocessable"},"428":{"$ref":"#/components/responses/KeyMissing"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/teams/{team}/inbox/{transaction}/confirm":{"post":{"operationId":"inboxConfirm","summary":"Confirm a suggested match","tags":["Inbox"],"parameters":[{"name":"team","in":"path","required":true,"schema":{"type":"string"}},{"name":"transaction","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A new UUID for each change; the same one when sending it again.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"client_uuid":{"type":"string","format":"uuid"}},"required":["client_uuid"]}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatchResultData"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/StillWorking"},"422":{"$ref":"#/components/responses/Unprocessable"},"428":{"$ref":"#/components/responses/KeyMissing"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/teams/{team}/inbox/{transaction}/match":{"post":{"operationId":"inboxMatch","summary":"Match a payment yourself, split across parts","tags":["Inbox"],"parameters":[{"name":"team","in":"path","required":true,"schema":{"type":"string"}},{"name":"transaction","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A new UUID for each change; the same one when sending it again.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"parts":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string","enum":["charge","general_income","pot_contribution","sponsorship","donation","bucket_collection","spending","due_to_club","provider_fees","refund","internal_transfer","opening_balance","cash_difference","savings"]},"amount":{"type":["string","null"]},"player_id":{"type":["string","null"]},"charge_id":{"type":["string","null"]},"pot_id":{"type":["string","null"]},"note":{"type":["string","null"]}},"required":["category"]}},"split_evenly":{"type":"boolean"},"client_uuid":{"type":"string","format":"uuid"}},"required":["parts","client_uuid"]}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatchResultData"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/StillWorking"},"422":{"$ref":"#/components/responses/Unprocessable"},"428":{"$ref":"#/components/responses/KeyMissing"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/teams/{team}/inbox/{transaction}/undo":{"post":{"operationId":"inboxUndo","summary":"Undo a match","tags":["Inbox"],"parameters":[{"name":"team","in":"path","required":true,"schema":{"type":"string"}},{"name":"transaction","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A new UUID for each change; the same one when sending it again.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"client_uuid":{"type":"string","format":"uuid"}},"required":["client_uuid"]}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatchResultData"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/StillWorking"},"422":{"$ref":"#/components/responses/Unprocessable"},"428":{"$ref":"#/components/responses/KeyMissing"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/teams/{team}/items":{"get":{"operationId":"items","summary":"What the team collects","tags":["Squad"],"parameters":[{"name":"team","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamItemsData"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"post":{"operationId":"itemsSave","summary":"Save what the team collects, and charge the squad for the season so far","tags":["Squad"],"parameters":[{"name":"team","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A new UUID for each change; the same one when sending it again.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["one_off","monthly","per_event"]},"amount":{"type":"string"},"passes_to_club":{"type":"boolean"},"first_month":{"type":["integer","null"]},"last_month":{"type":["integer","null"]},"pot_id":{"type":["string","null"]},"due_day":{"type":["integer","null"]}},"required":["name","type","amount"]}},"client_uuid":{"type":"string","format":"uuid"}},"required":["items","client_uuid"]}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ItemsSavedData"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/StillWorking"},"422":{"$ref":"#/components/responses/Unprocessable"},"428":{"$ref":"#/components/responses/KeyMissing"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/teams/{team}/players/{player}/cash":{"post":{"operationId":"cashRecord","summary":"Record cash for what a child owes","tags":["Cash"],"parameters":[{"name":"team","in":"path","required":true,"schema":{"type":"string"}},{"name":"player","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A new UUID for each change; the same one when sending it again.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"charge_ids":{"type":"array","items":{"type":"string"}},"client_uuid":{"type":"string","format":"uuid"},"send_receipt":{"type":"boolean"}},"required":["charge_ids","client_uuid"]}}}},"responses":{"201":{"description":"Made","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CashResultData"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/StillWorking"},"422":{"$ref":"#/components/responses/Unprocessable"},"428":{"$ref":"#/components/responses/KeyMissing"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/teams/{team}/players/{player}/charges/{charge}/let-off":{"post":{"operationId":"letOff","summary":"Let a family off a charge, with a reason","tags":["Squad"],"parameters":[{"name":"team","in":"path","required":true,"schema":{"type":"string"}},{"name":"player","in":"path","required":true,"schema":{"type":"string"}},{"name":"charge","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A new UUID for each change; the same one when sending it again.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string"},"client_uuid":{"type":"string","format":"uuid"}},"required":["reason","client_uuid"]}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LetOffResultData"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/StillWorking"},"422":{"$ref":"#/components/responses/Unprocessable"},"428":{"$ref":"#/components/responses/KeyMissing"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/teams/{team}/players/{player}/charges/{charge}/let-off/undo":{"post":{"operationId":"letOffUndo","summary":"Make a let-off charge owed again","tags":["Squad"],"parameters":[{"name":"team","in":"path","required":true,"schema":{"type":"string"}},{"name":"player","in":"path","required":true,"schema":{"type":"string"}},{"name":"charge","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A new UUID for each change; the same one when sending it again.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"client_uuid":{"type":"string","format":"uuid"}},"required":["client_uuid"]}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LetOffResultData"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/StillWorking"},"422":{"$ref":"#/components/responses/Unprocessable"},"428":{"$ref":"#/components/responses/KeyMissing"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/teams/{team}/players/{player}/request":{"post":{"operationId":"paymentRequest","summary":"Draft a payment request, with the parent’s link","tags":["Squad"],"parameters":[{"name":"team","in":"path","required":true,"schema":{"type":"string"}},{"name":"player","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A new UUID for each change; the same one when sending it again.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"client_uuid":{"type":"string","format":"uuid"}},"required":["client_uuid"]}}}},"responses":{"201":{"description":"Made","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequestData"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/StillWorking"},"422":{"$ref":"#/components/responses/Unprocessable"},"428":{"$ref":"#/components/responses/KeyMissing"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/teams/{team}/players/{player}/statement":{"get":{"operationId":"statement","summary":"A child’s statement","tags":["Teams"],"parameters":[{"name":"team","in":"path","required":true,"schema":{"type":"string"}},{"name":"player","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlayerStatementData"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/teams/{team}/receipts":{"post":{"operationId":"receiptsStore","summary":"Add an uploaded photo by its path","tags":["Receipts"],"parameters":[{"name":"team","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A new UUID for each change; the same one when sending it again.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":["string","null"]},"transaction_id":{"type":["string","null"]},"client_uuid":{"type":"string","format":"uuid"}},"required":["path","client_uuid"]}}}},"responses":{"201":{"description":"Made","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceiptAddedData"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/StillWorking"},"422":{"$ref":"#/components/responses/Unprocessable"},"428":{"$ref":"#/components/responses/KeyMissing"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/teams/{team}/receipts/new":{"get":{"operationId":"receiptsStart","summary":"Start a receipt, for a payment out if one is named","tags":["Receipts"],"parameters":[{"name":"team","in":"path","required":true,"schema":{"type":"string"}},{"name":"transaction","in":"query","required":false,"description":"The payment out the receipt is for.","schema":{"type":"string"}}],"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceiptStartData"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/teams/{team}/receipts/uploads":{"post":{"operationId":"receiptsUpload","summary":"Get a link to send a photo straight to storage","tags":["Receipts"],"parameters":[{"name":"team","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A new UUID for each change; the same one when sending it again.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"extension":{"type":"string"},"type":{"type":"string"},"size":{"type":"integer"},"client_uuid":{"type":"string","format":"uuid"}},"required":["extension","type","size","client_uuid"]}}}},"responses":{"201":{"description":"Made","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DirectUploadData"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/StillWorking"},"422":{"$ref":"#/components/responses/Unprocessable"},"428":{"$ref":"#/components/responses/KeyMissing"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/teams/{team}/receipts/{receipt}":{"get":{"operationId":"receiptsShow","summary":"What was read from a receipt, and the payments out it could be for","tags":["Receipts"],"parameters":[{"name":"team","in":"path","required":true,"schema":{"type":"string"}},{"name":"receipt","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceiptPageData"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/teams/{team}/receipts/{receipt}/confirm":{"post":{"operationId":"receiptsConfirm","summary":"Attach a checked receipt to its payment out","tags":["Receipts"],"parameters":[{"name":"team","in":"path","required":true,"schema":{"type":"string"}},{"name":"receipt","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A new UUID for each change; the same one when sending it again.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"supplier":{"type":"string"},"total":{"type":"string"},"date":{"type":"string"},"transaction_id":{"type":"string"},"client_uuid":{"type":"string","format":"uuid"}},"required":["supplier","total","date","transaction_id","client_uuid"]}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceiptResultData"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/StillWorking"},"422":{"$ref":"#/components/responses/Unprocessable"},"428":{"$ref":"#/components/responses/KeyMissing"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/teams/{team}/receipts/{receipt}/image":{"get":{"operationId":"receiptsImage","summary":"The receipt’s photo","tags":["Receipts"],"parameters":[{"name":"team","in":"path","required":true,"schema":{"type":"string"}},{"name":"receipt","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The file","content":{"image/*":{"schema":{"type":"string","format":"binary"}},"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/teams/{team}/setup":{"get":{"operationId":"teamsSetup","summary":"What’s left to set up for a team","tags":["Teams"],"parameters":[{"name":"team","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamSetupData"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/teams/{team}/squad":{"get":{"operationId":"squad","summary":"The squad, with what each child owes","tags":["Squad"],"parameters":[{"name":"team","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SquadData"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"post":{"operationId":"squadAdd","summary":"Add children to the squad","tags":["Squad"],"parameters":[{"name":"team","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A new UUID for each change; the same one when sending it again.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"children":{"type":"array","items":{"type":"object","properties":{"first_name":{"type":"string"},"last_name":{"type":["string","null"]},"parent_name":{"type":["string","null"]},"parent_email":{"type":["string","null"]},"parent_phone":{"type":["string","null"]}},"required":["first_name"]}},"client_uuid":{"type":"string","format":"uuid"}},"required":["children","client_uuid"]}}}},"responses":{"201":{"description":"Made","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChildrenAddedData"}}}},"200":{"description":"Nothing new to make","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChildrenAddedData"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/StillWorking"},"422":{"$ref":"#/components/responses/Unprocessable"},"428":{"$ref":"#/components/responses/KeyMissing"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}}},"components":{"securitySchemes":{"token":{"type":"http","scheme":"bearer"}},"schemas":{"AccountData":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"initials":{"type":"string"}},"required":["id","name","email","initials"]},"CashEntryData":{"type":"object","properties":{"id":{"type":"string"},"date":{"type":"string"},"what":{"type":"string"},"amountPence":{"type":"integer"},"receivedBy":{"type":["string","null"]},"state":{"type":"string","enum":["in_hand","paid_in","banked","reversed"]},"stateLabel":{"type":"string"},"canReverse":{"type":"boolean"}},"required":["id","date","what","amountPence","receivedBy","state","stateLabel","canReverse"]},"CashPageData":{"type":"object","properties":{"inHandPence":{"type":"integer"},"paidInPence":{"type":"integer"},"toPayInPence":{"type":"integer"},"entries":{"type":"array","items":{"$ref":"#/components/schemas/CashEntryData"}}},"required":["inHandPence","paidInPence","toPayInPence","entries"]},"CashReceiptData":{"type":"object","properties":{"message":{"type":"string"},"whatsappUrl":{"type":"string"},"smsUrl":{"type":"string"},"emailedTo":{"type":["string","null"]}},"required":["message","whatsappUrl","smsUrl","emailedTo"]},"CashResultData":{"type":"object","properties":{"message":{"type":"string"},"receipt":{"oneOf":[{"$ref":"#/components/schemas/CashReceiptData"},{"type":"null"}]},"transactionId":{"type":["string","null"]}},"required":["message","receipt","transactionId"]},"CashTrainingData":{"type":"object","properties":{"options":{"type":"array","items":{"$ref":"#/components/schemas/TrainingOptionData"}},"players":{"type":"array","items":{"$ref":"#/components/schemas/TrainingPlayerData"}}},"required":["options","players"]},"ChildrenAddedData":{"type":"object","properties":{"count":{"type":"integer"},"message":{"type":"string"}},"required":["count","message"]},"ChoiceData":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"]},"DirectUploadData":{"type":"object","properties":{"url":{"type":"string"},"headers":{"type":"object","additionalProperties":true},"path":{"type":"string"}},"required":["url","headers","path"]},"InboxData":{"type":"object","properties":{"lead":{"type":"string"},"cards":{"type":"array","items":{"$ref":"#/components/schemas/MatchCardData"}},"sureCount":{"type":"integer"},"autoConfirm":{"type":"boolean"},"matchedForYou":{"type":"array","items":{"$ref":"#/components/schemas/MatchedLineData"}},"choices":{"$ref":"#/components/schemas/MatchChoicesData"}},"required":["lead","cards","sureCount","autoConfirm","matchedForYou","choices"]},"ItemData":{"type":"object","properties":{"id":{"type":["string","null"]},"name":{"type":"string"},"type":{"type":"string","enum":["one_off","monthly","per_event"]},"amountPence":{"type":"integer"},"amount":{"type":"string"},"passesToClub":{"type":"boolean"},"firstMonth":{"type":["integer","null"]},"lastMonth":{"type":["integer","null"]},"dueDay":{"type":"integer"},"summary":{"type":"string"}},"required":["id","name","type","amountPence","amount","passesToClub","firstMonth","lastMonth","dueDay","summary"]},"ItemsSavedData":{"type":"object","properties":{"charged":{"type":"integer"},"message":{"type":"string"}},"required":["charged","message"]},"LetOffResultData":{"type":"object","properties":{"chargeId":{"type":"string"},"message":{"type":"string"}},"required":["chargeId","message"]},"MatchCardData":{"type":"object","properties":{"id":{"type":"string"},"date":{"type":"string"},"amountPence":{"type":"integer"},"amount":{"type":"string"},"payer":{"type":"string"},"reference":{"type":["string","null"]},"kind":{"oneOf":[{"type":"string","enum":["sure","split","likely","receipt","transfer"]},{"type":"null"}]},"kindLabel":{"type":"string"},"reason":{"type":["string","null"]},"who":{"type":["string","null"]},"initials":{"type":["string","null"]},"purpose":{"type":["string","null"]},"confirmLabel":{"type":"string"},"parts":{"type":"array","items":{"$ref":"#/components/schemas/MatchPartData"}}},"required":["id","date","amountPence","amount","payer","reference","kind","kindLabel","reason","who","initials","purpose","confirmLabel","parts"]},"MatchChargeData":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"owedPence":{"type":"integer"},"owed":{"type":"string"}},"required":["id","label","owedPence","owed"]},"MatchChoicesData":{"type":"object","properties":{"players":{"type":"array","items":{"$ref":"#/components/schemas/MatchPlayerData"}},"pots":{"type":"array","items":{"$ref":"#/components/schemas/MatchPotData"}}},"required":["players","pots"]},"MatchPartData":{"type":"object","properties":{"category":{"type":"string","enum":["charge","general_income","pot_contribution","sponsorship","donation","bucket_collection","spending","due_to_club","provider_fees","refund","internal_transfer","opening_balance","cash_difference","savings"]},"amountPence":{"type":"integer"},"amount":{"type":"string"},"label":{"type":"string"},"playerId":{"type":["string","null"]},"chargeId":{"type":["string","null"]},"potId":{"type":["string","null"]}},"required":["category","amountPence","amount","label","playerId","chargeId","potId"]},"MatchPlayerData":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"initials":{"type":"string"},"charges":{"type":"array","items":{"$ref":"#/components/schemas/MatchChargeData"}}},"required":["id","name","initials","charges"]},"MatchPotData":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"MatchResultData":{"type":"object","properties":{"transactionId":{"type":"string"},"message":{"type":"string"},"needsReceipt":{"type":"boolean"}},"required":["transactionId","message","needsReceipt"]},"MatchedLineData":{"type":"object","properties":{"id":{"type":"string"},"date":{"type":"string"},"amountPence":{"type":"integer"},"payer":{"type":"string"},"purpose":{"type":"string"}},"required":["id","date","amountPence","payer","purpose"]},"OtherCashPageData":{"type":"object","properties":{"pots":{"type":"array","items":{"$ref":"#/components/schemas/ChoiceData"}},"nextReceipt":{"type":"string"}},"required":["pots","nextReceipt"]},"PaymentRequestData":{"type":"object","properties":{"amountPence":{"type":"integer"},"reference":{"type":"string"},"message":{"type":"string"},"whatsappUrl":{"type":"string"},"smsUrl":{"type":"string"}},"required":["amountPence","reference","message","whatsappUrl","smsUrl"]},"PlayerStatementData":{"type":"object","properties":{"player":{"$ref":"#/components/schemas/SquadPlayerData"},"owedPence":{"type":"integer"},"rows":{"type":"array","items":{"$ref":"#/components/schemas/StatementRowData"}},"requestReference":{"type":["string","null"]}},"required":["player","owedPence","rows","requestReference"]},"ReceiptAddedData":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pending","read","failed","confirmed"]}},"required":["id","status"]},"ReceiptLineData":{"type":"object","properties":{"id":{"type":"string"},"payee":{"type":"string"},"date":{"type":"string"},"amountPence":{"type":"integer"},"why":{"type":"string"}},"required":["id","payee","date","amountPence","why"]},"ReceiptPageData":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pending","read","failed","confirmed"]},"lead":{"type":"string"},"supplier":{"type":"string"},"total":{"type":"string"},"date":{"type":"string"},"imageUrl":{"type":"string"},"isPdf":{"type":"boolean"},"chosen":{"type":["string","null"]},"lines":{"type":"array","items":{"$ref":"#/components/schemas/ReceiptLineData"}}},"required":["id","status","lead","supplier","total","date","imageUrl","isPdf","chosen","lines"]},"ReceiptResultData":{"type":"object","properties":{"message":{"type":"string"},"transactionId":{"type":"string"}},"required":["message","transactionId"]},"ReceiptStartData":{"type":"object","properties":{"forLine":{"type":["string","null"]},"transactionId":{"type":["string","null"]},"direct":{"type":"boolean"}},"required":["forLine","transactionId","direct"]},"SetupStepData":{"type":"object","properties":{"key":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"done":{"type":"boolean"},"href":{"type":["string","null"]}},"required":["key","title","detail","done","href"]},"SquadData":{"type":"object","properties":{"summary":{"type":"string"},"players":{"type":"array","items":{"$ref":"#/components/schemas/SquadPlayerData"}}},"required":["summary","players"]},"SquadPlayerData":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"initials":{"type":"string"},"code":{"type":"string"},"payerName":{"type":["string","null"]},"owedPence":{"type":"integer"},"overdue":{"type":"boolean"}},"required":["id","name","initials","code","payerName","owedPence","overdue"]},"StatementRowData":{"type":"object","properties":{"chargeId":{"type":"string"},"label":{"type":"string"},"note":{"type":"string"},"amountPence":{"type":"integer"},"owedPence":{"type":"integer"},"status":{"type":"string","enum":["paid","part_paid","owed","overdue","waived"]},"statusLabel":{"type":"string"}},"required":["chargeId","label","note","amountPence","owedPence","status","statusLabel"]},"SureMatchesData":{"type":"object","properties":{"count":{"type":"integer"},"message":{"type":"string"}},"required":["count","message"]},"TeamItemsData":{"type":"object","properties":{"lead":{"type":"string"},"current":{"type":"array","items":{"$ref":"#/components/schemas/ItemData"}},"suggestions":{"type":"array","items":{"$ref":"#/components/schemas/ItemData"}},"dueDays":{"type":"array","items":{"$ref":"#/components/schemas/ChoiceData"}}},"required":["lead","current","suggestions","dueDays"]},"TeamSetupData":{"type":"object","properties":{"teamId":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string"},"steps":{"type":"array","items":{"$ref":"#/components/schemas/SetupStepData"}},"allDone":{"type":"boolean"}},"required":["teamId","title","summary","steps","allDone"]},"TeamSummaryData":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"test":{"type":"boolean"}},"required":["id","name","test"]},"TrainingOptionData":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"},"usualAmount":{"type":["string","null"]}},"required":["value","label","usualAmount"]},"TrainingPlayerData":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"initials":{"type":"string"}},"required":["id","name","initials"]},"Error":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"ValidationError":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["message","errors"]}},"responses":{"Unauthenticated":{"description":"No token, or the token was deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The token can’t do this: it’s read only, the role doesn’t allow it, or the plan doesn’t include it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Nothing there that this token can see.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"StillWorking":{"description":"The same change is still being worked on. Send it again shortly.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unprocessable":{"description":"Something sent needs fixing, or the key was already used for a different request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"KeyMissing":{"description":"A write without an Idempotency-Key or client_uuid, or one that isn’t a UUID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"TooManyRequests":{"description":"Too many calls. Wait a minute.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}