Search lists every tournament that is not a draft. Drafts are hidden. Signing up and withdrawing use the active profile, so switch to a child first when the entry should be in the child’s name. A free draw is entered straight away. A draw with an entry fee returns a payment instead, and the player is entered only after PayFast confirms it. Post payfast.fields as a form to payfast.url. Card details go to PayFast, not to Raqets. When confirm_locally is true, PayFast is not set up and the app can confirm the fee on this server.
GET
/tournaments/search
Token required
All published tournaments, newest start date first. Leave a filter off to ignore it. q matches the tournament name or the club name, city, or province. province must be one of the provinces in the response. club is a club id from clubs. from and to are dates, YYYY-MM-DD. from keeps tournaments that have not ended before that day. to keeps tournaments that start on or before that day. status is entries_open, in_progress, or completed. page starts at 1. per_page defaults to 15 and cannot be more than 50.
Send
q, province, club, from, to, status
page, per_page
Returns
{ "tournaments": [{ "id", "name", "status", "status_label", "starts_on", "ends_on", "entry_fee_cents", "entry_fee", "club": { "id", "name", "city", "province" }, "draws": [{ "id", "name", "format", "format_label", "gender", "age", "locked", "limit", "entered_count", "open" }] }],
"provinces": [],
"clubs": [{ "id", "name" }],
"meta": { "current_page", "last_page", "per_page", "total" } }
GET
/tournaments/{id}
Token required
One tournament and each draw, for the active profile. entered is true when that profile is already in the draw. blocked is why that profile cannot enter, or null when they can. open is false when the draw is locked, full, or the tournament is not taking entries. A draft returns 404.
Returns
{ "tournament": { the search tournament, plus "description", and each draw also has "entered", "registration_id", "blocked" } }
POST
/tournaments/{id}/draws/{draw}
Token required
Signs the active profile up for that draw. A free entry returns 201 and the registration. An entry fee returns 200 with entered false and a payment; nobody is in the draw until that payment is finished. A locked draw, a closed tournament, a full draw, a second entry, or a profile that does not match the draw returns 422 with message.
Returns
{ "entered": true, "message", "registration" }
or
{ "entered": false, "message", "payment": { "id", "status", "amount", "amount_cents", "currency": "ZAR", "confirm_locally", "payfast": { "url", "fields" } } }
POST
/tournaments/{id}/payments/{payment}
Token required
Finishes a pending entry when confirm_locally is true. Otherwise this returns 403. The payment must belong to this tournament and the active profile.
Returns
{ "entered", "message", "registration" }
DELETE
/tournaments/registrations/{id}
Token required
Withdraws the active profile from that draw. Another profile’s entry returns 403. A locked draw returns 422 and the entry stays.
Returns
{ "message": "Registration withdrawn." }
GET
/tournaments
Token required
Tournaments the active profile is already signed up for. The same list is included on GET /profile. This is not the full catalogue. Use search for that.
Returns
{ "tournaments": [{ "registration_id", "seed", "draw": { "id", "name" }, "tournament": { "id", "name", "starts_on", "ends_on", "status", "club" } }] }