POST https://gate.reviopay.com/api/v1/purchases/{id}/charge/Description
Charge or Hold a purchase using a recurring_token provided in the request body. Its value should be an id of a Purchase that has is_recurring_token == true. This purchase will be paid using the same method (e.g. same card) as the one used to pay the recurring_token purchase. The Hold will be performed if the Purchase this method is used on has skip_capture: true. If this operation takes too long to be processed on the acquirer side - you will get a response with status code 200 and a Purchase object having status = pending_charge in body (you will receive a corresponding Webhook callback too for a purchase.pending_charge event). To be notified of a successful operation completion, please subscribe to purchase.paid (or purchase.hold) callback event - it will deliver an updated Purchase with status = paid or hold respectively. Alternatively, if charge fails, you will receive a purchase.payment_failure callback event. If recurring charge fails due to payment processing error, you will receive HTTP response code 400 with error code purchase_charge_error. In this case, to get more details about the error, you should perform a GET /purchase/ request for the Purchase you tried to charge. In transaction_data.attempts[] array (newest element first) you’ll find the corresponding attempt with error code and description in .error parameter.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
recurring_token | string (uuid) | no | ID of a recurring token (Purchase having is_recurring_token == true) to use. |
Example
curl -X POST https://gate.reviopay.com/api/v1/purchases/{id}/charge/ \
-H 'Authorization: Bearer <YOUR_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"recurring_token": "ea582899-78ec-4c3a-9cb3-08f922e556b6"
}'Responses
| Status | Description |
|---|---|
200 | OK |
400 | Invalid data submitted or request processing error |
404 | No such object |