Deposit Creation Endpoint
Deposit creation
POST
https://api-stg.tupayonline.com/v3/deposits
This endpoint allows you to generate deposit transactions.
Headers
Name | Type | Description |
---|---|---|
Content-Type | string |
|
X-Date | string | ISO8601 Datetime with Timezone:
|
X-Login | string | Merchant X-Login API Key |
Authorization | string | Authorization control hash |
X-Idempotency-Key | string | Unique idempotency key |
Request Body
Name | Type | Description |
---|---|---|
country* | string | Country of the deposit |
amount* | number | Amount of the deposit |
invoice_id* | string | Unique deposit ID on your side |
currency* | string | Currency of the deposit |
request_payer_data_on_validation_failure | boolean | Flag specifying if you want to ignore errors because of invalid phone, zip_code and/or city's state |
payer* | object | Object containing details about the customer. See "Payer object" section for details |
client_ip | string | Valid IPv4/v6 Address of the customer |
device_id | string | Unique customer's device ID created using our JS library |
back_url* | string | HTTPS URL used to redirect the customer in case of cancelling the deposit |
success_url* | string | HTTPS URL used to redirect the customer in case of success |
error_url* | string | HTTPS URL used to redirect the customer in case of error while generating the payment |
notification_url* | string | HTTPS URL used to send the notifications about deposit's change of status |
logo | string | HTTPS URL used as the Merchant logo on our cashier |
test | boolean | Used to mark a deposit as test. If true, the deposit will not affect the merchant's balance |
mobile | boolean | Used to specify if the redirection will be made on a mobile device |
payment_method* | string | Must be sent with value |
Flows
ONE_SHOT | HOSTED |
---|---|
The deposit request was successfully completed in One Shot and the user will be directly presented with the information to complete the payment. | The information sent is missing details required to complete the request. Redirect the customer to our Hosted Checkout to collect those details. |
If required fields are missing, the |
Example Request
Request fields
Required | Field name | Format | Description | Default | Validations |
---|---|---|---|---|---|
| string (length: 2) | Country code of the deposit in ISO 3166-1 alpha-2 code format | | ||
| decimal (max decimals: 2) | Deposit amount in the currency specified | | Number of up to 18 integers and 2 decimals places | |
| string (length: 3) | Currency code of the amount in ISO 4217 format |
| ||
| string (max length: 128) | Unique deposit ID on the merchant end | random |
| |
| object[] | Object containing details about the customer | | ||
| string (length: 2) | Must be sent with value |
| ||
| string (max length: 2048) | Valid URL over HTTPS used to redirect the customer in case the deposit flow was completed. | |
| |
| string (max length: 2048) | Valid URL over HTTPS used to redirect the customer. | |
| |
| string (max length: 2048) | Valid URL over HTTPS used to redirect the customer in case of error while generating the deposit | |
| |
| string (max length: 2048) | Valid URL over HTTPS used to receive the notifications about the deposit's changes of status. If none is sent, we will use the one configured on the Tupay Panel | |
| |
| boolean | Choose if the deposit's fee will be paid by the customer or debited from your balance |
|
| |
| string | Valid IPv4 or IPv6 Address | |
| |
| string (max length: 100) | Unique customer's device ID. Used to identify and prevent fraud. | | String of up to 100 characters | |
| boolean | Used to flag a deposit as test. If true, the deposit will not affect the merchant's balance |
|
| |
| boolean | Used to specify if the redirection will be made on a mobile device |
|
| |
| boolean | Boolean used to specify if you want to receive declines by invalid data even if it is not required by the payment method. here for more info |
|
|
Payer Object
Required | Field name | Format | Description | Default | Validations |
---|---|---|---|---|---|
| string (max length: 128) | Customer's ID generated on your end. Used to locate user's transaction on our Tupay Panel | If none is sent, we will autogenerate it |
| |
| string (max length: 30) | Customer's document ID. Ensure it is correct and the user can't change it every time he/she deposits | | ||
| string (max length: 10) | Customer's document type. Optional, if sent must be a valid document type | | ||
| string (max length: 255) | Valid customer's email address | | ||
| string (max length: 128) | Customer's first name | | String of up to 128 characters | |
| string (max length: 128) | Customer's last_name | | String of up to 128 characters | |
| string (max length: 32) | Valid customer's phone number | | ||
| object | Object containing customer's address details | |
Payer.address Object
Required | Field name | Format | Description | Validations |
---|---|---|---|---|
| string (max length: 255) | Customer's street | String of up to 255 characters | |
| string (max length: 128) | Customer's city | String of up to 128 characters | |
| string (max length: 3) | Customer's state code in ISO 3166-2 code format | Valid state code in ISO 3166-2 format. Check our States endpoint here | |
| string (max length: 16) | Customer's zip code |
Flags
We recommend sending the following flags to prevent declines and improve conversion rates.
mobile
mobile
The flag mobile
is a boolean and has to be sent equal to true
if the customer generating the deposit is using a mobile device/application. If not sent it defaults to false
.
There are some payment methods that have a different flow on mobile devices compared to the flow on web devices because the payment method doesn't work the same way in those devices. When a deposit gets created as ONE_SHOT
, it means the flow is assigned before the user navigates into our website, and therefore, we can't identify if the customer comes from a mobile device or not.
Considering that, if the flag mobile
is not sent we could route a mobile user through the web flow, therefore, affecting the ability of the customer to complete the deposit.
request_payer_data_on_validation_failure
request_payer_data_on_validation_failure
The flag request_payer_data_on_validation_failure
can be used to prevent the request to be declined in case you send an invalid payer.phone
, payer.address.state
and/or payer.address.zip_code
.
Última actualización