Select matches and deduct credit
POST/search/:searchId/select
Selects matches. After selection, matches cannot be changed and only the results endpoint is available.
Whether this call spends a credit depends on the user's paymentStage
(see User.paymentStage on GET /users/me):
selection(or absent): one credit is deducted here. With no credits available the call returns 402 and the selection is rolled back, so it can be retried after buying credits.results: nothing is charged here; the credit is charged by GET /search/{searchId}/results.
Important: This operation can only be performed once per search. If matches are already selected, returns 400 error.
Request
Responses
- 200
- 400
- 401
- 402
- 404
- 500
Matches selected (and a credit deducted when paymentStage is selection)
Bad request - matches already selected or invalid selection. Selection cannot be changed after credit is deducted. Also returned when more matches are selected than the search allows: see maxSelectable on GET /search/{searchId}/matches.
Unauthorized
No credits available. Returned only when paymentStage is selection. The selection is rolled back, so the call can be repeated after the user buys credits or a plan.
Not found
Internal server error