Payout by token
Overview
This section covers payout by a token using Gate.
Token is a unique string of 64 characters associated within the payment platform with a certain payment card. Tokens contain no confidential information and can be stored in your system without violation of any payment card data security standards. For more information about using tokens, see Tokens.
The payout workflow
To perform a payout by a token using Gate your system is required to do the following:
- Send the payout request with all the required parameters and signature to the Rocketpay URL.
- If necessary, submit additional payment information.
For more information about submitting additional payment information, see Submission of additional payment information.
- Accept the callback with the payout result from the payment platform.
The following diagram provides the information about the basic payout processing case (without submitting additional payment information).
Figure: Payout flow
- The customer initiates a payout in your system.
- Your system sends the payout request to the payment platform by using Gate.
- The payment platform receives the payout request.
- The payment platform checks whether the request contains all the required parameters and correct signature.
- The payment platform sends you a response in which it acknowledges your request and provides the request validation result. (For more information about the response format, see Response structure.)
- The payment platform processes the request and forwards it to the provider service.
- The provider service processes the payout.
- The provider service informs the payment platform about the payout result.
- The payment platform sends the callback with the payout result to your system.
- Your system sends the payout result to the customer.
The sections that follow discuss in more details the request structure and the parameters to be used in requests for payouts, as well as provide information about the callbacks with the payout results.
Request
This section provides the instructions on how to request a payout by token.
HTTP request method | POST |
Request body format | JSON |
API endpoint | /v2/payment/card/payout/token |
Full API endpoint specification | /v2/payment/card/payout/token |
|
|||
---|---|---|---|
Object | Parameter | Description | |
general |
project_id |
Project ID you obtained from Rocketpay when integrating. Example: |
|
payment_id |
Payment ID unique within your project. Example: |
||
signature |
Signature created after you've specified all the request parameters. For more information about signature generation, see Signature generation and verification. | ||
customer |
id |
Unique ID of the customer within your project. Example: |
|
first_name |
Customer's first name. Example: |
||
middle_name |
Customer's middle name. Example: |
||
last_name |
Customer's last name. Example: |
||
ip_address |
IP address of the customer's device. Example: |
||
payment |
amount |
Payout amount in minor currency units without any decimal point or comma except for the cases when the currency doesn't have any minor currency units. If the currency doesn't have any minor units (i.e. the number of digits for minor currency units is zero), set this parameter to the amount in the major currency units. To check whether the currency has any minor units, see Currency codes. Example: 100,00 USD must be sent as |
|
currency |
Code of the purchase currency in the ISO-4217 alpha-3 format. Example: |
||
token |
A token of the customer's payment card. A token is a unique string of 64 characters associated with a specific bank card. Example: For more information see Tokens |
||
card |
card_holder |
Cardholder's first and last name (as indicated on the card). This parameter is strictly required if the payout is performed by the token that was created without using the cardholder's name. Example: |
|
You can also add any other optional parameters to the purchase request, if necessary. For the list of all the parameters available in Gate, see API Reference. |
Figure: Example of the data from the request for a payout by a token
{ "general": { "project_id": 123, "payment_id": "payment_47", "signature": "1wR1YgDoDlJppOdLzFOFK...Y4YonbWmspbFh7x1o1ut5PxxTIJfQ==" }, "customer": { "id": "customer_123", "ip_address": "198.51.100.47" }, "payment": { "amount": 10000, "currency": "USD" }, "token": "pkmawa3khb7wninntq8g8q3592fjjxwvzfebwbegqkl1c16akpgo6sgxac6wulz7" }
Callback
The payment platform returns the payout result in a callback. For the information about the callback structure, see Callbacks in Gate.
The following is the example of a callback with information about successful 100.00 USD payout made to the card number 553691******0802 of the customer_123 customer in the 123 project.
Figure: Example of the data from a successful payout callback
{ "project_id": 123, "payment": { "id": "payment_47", "type": "payout", "status": "success", "date": "2019-06-24T11:08:49+0000", "method": "card", "sum": { "amount": 10000, "currency": "USD" }, "description": "payout" }, "account": { "number": "553691******0802" }, "customer": { "id": "customer_123" }, "operation": { "id": 14, "type": "payout", "status": "success", "date": "2019-06-24T11:08:49+0000", "created_date": "2019-06-24T11:07:42+0000", "request_id": "71228f54d21e776a481", "sum_initial": { "amount": 10000, "currency": "USD" }, "sum_converted": { "amount": 10000, "currency": "USD" }, "provider": { "id": 1496, "payment_id": "60-1c6072de6000", "date": "2019-06-24T11:08:47+0000", "auth_code": "" }, "code": "0", "message": "Success" }, "signature": "+GTEzb3Xw4A9Ap8q/LE8TyyJM+MEXXja28RXtr8v2EITaK4UzSg...==" }
The following is the example of a callback for a payout rejected due to the maximum payout limit being exceeded.
Figure: Example of a declined payout callback
{ "project_id": 123, "payment": { "id": "payment_47", "type": "payout", "status": "decline", "date": "2019-06-24T11:08:49+0000", "method": "card", "sum": { "amount": 10000, "currency": "USD" }, "description": "payout" }, "account": { "number": "553691******0802" }, "customer": { "id": "customer_123" }, "operation": { "id": 14, "type": "payout", "status": "decline", "date": "2019-06-24T11:08:49+0000", "created_date": "2019-06-24T11:07:42+0000", "request_id": "71228f54d21e776a481", "sum_initial": { "amount": 10000, "currency": "USD" }, "sum_converted": { "amount": 10000, "currency": "USD" }, "provider": { "id": 1496, "payment_id": "60-1c6072de6000", "date": "2019-06-24T11:08:47+0000", "auth_code": "" }, "code": "3104", "message": "Payment Constraint Invalid Payout Amount" }, "signature": "+GTEzb3Xw4A9Ap8q/LE8TyyJM+MEXXja28RXtr8v2EITaK4UzSg...==" }