Deposit Creation Endpoint
Última actualización
Última actualización
POST
https://api-stg.tupayonline.com/v3/deposits
This endpoint allows you to generate deposit transactions.
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Body parameters marked with * are required fields.
Within the Tupay API, it will be possible to find different payment methods, represented by different payment method codes, these are used to filter exactly which payment_methods they want to show to the end customer. "payment_method":"XAQR" / "payment_method":"XA"
Within the Tupay API, it will be possible to find different types of identity documents, for this there is validation by the number of digits. "document_type":"DNI" ,"document":"86970864"
We group the error codes into different categories for better understanding.
1xx
- Header errors
2xx
- Call or trade setup error
3xx
- User-specific errors
4xx
- Payment errors
5xx
- Other errors
7xx
- Internal Errors
ONE_SHOT | HOSTED |
---|---|
Value | Description |
---|---|
document_type (valores) | document (Longitud de caracteres) |
---|---|
API Code | HTTP Code | Type | Message | Description |
---|---|---|---|---|
Content-Type
string
application/json
X-Date
string
ISO8601 Datetime with Timezone:
yyyy-MM-dd'T'HH:mm:ssZ
X-Login
string
Merchant X-Login API Key
Authorization
string
Authorization control hash
X-Idempotency-Key
string
Unique idempotency key
country*
string
(PE)
Country of deposit
amount*
number
Amount of the deposit
invoice_id*
string
(max length: 128)
(random: ^[A-Za-z0-9-_]*$ )
Unique deposit ID by the merchant.
currency*
string
(PEN / USD)
Currency of the deposit
request_payer_data_on_validation_failure
boolean
(default:false)
Flag used to specify whether to ignore error for invalid phone, zip_code and/or state.
payer{}*
object
Object containing details of the payer.
client_ip
string
Valid IPv4/v6 Address of the customer
device_id
string
(max length: 100)
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
test
boolean
Mark to indicate that it is a test deposit. If it is sent as true, it will not affect the balance of the trade.
mobile
boolean
(default: false)
The mobile flag is a boolean and has to be sent with the value true if the customer generates the deposit from a mobile device. If it is not sent, the default value is false.
payment_method*
string
It must be sent with the value XA/XAQR (Payment Method)
prayer.last_name
string
(max length: 128)
Customer's last_name
prayer.first_name
string
(max length: 128)
Customer's first name
prayer.email
string
(max length: 255)
Valid customer's email address
prayer.document_type
string
(max length: 10)
Client document type. Optional, if sent it must be a valid value. (Type of document of identy)
prayer.document
string
(max length: 30)
Make sure it is correct and that the user cannot change it every time they want to generate a new deposit.
prayer.id
string
(max length: 128)
Customer identifier generated at your end, used to identify customer transactions in the Tupay Panel. If you do not send, we will autogenerate it
prayer.address.zip_code
string
(max length: 16)
Customer's zip code
prayer.address.city
string
(max length: 128)
Customer's city
prayer.address.street
string
(max length: 255)
Customer's street
prayer.address{}
object
Object containing customer's address details
prayer.phone
string
(max length: 32)
Valid customer's phone number
fee_on_payer
boolean
(default: false)
Choose whether the deposit fee will be paid by the client or debited from their balance
XA
The payment method "XA" represents all Tupay payment methods, by using this code, the client will be offered with all the options we offer to make the final payment
XAQR
By using this code, the end client will be presented with all the options that offer a QR to scan and make the final payment, this is represented in the request as
XABT
The ‘XABT’ payment method provides the end user with the payment code for use at all banks and agents.
XACC
By using this code, the end user will be able to pay with visa and mastercard.
PASS
Min 9 Max 12 digits Alphanumeric
RUC
Numeric 11 digits
CE
Min 9 Max 12 digits
DNI
Numeric 8 digits
100
401
INVALID_CREDENTIALS
Invalid Credentials
The X-Login
you sent is incorrect or it is not yet active
101
400
MISSING_REQUIRED_HEADER
Missing or invalid format for required header {headerName}
Make sure all the headers are correct. Click here for details
102
400
INVALID_SIGNATURE
Invalid signature
Invalid Authorization
signature. Click here for instructions
103
400
INVALID_DATE_RANGE
X-Date header value out of valid range
The X-Date
value you sent in the header is outside the allowed time-frame. Click here for details
104
400
IDEMPOTENCY_KEY_ALREADY_USED
Idempotency key {key} has been already used
The X-Idempotency-Key you sent has already been used
105
400
EMPTY_HEADER_VALUE
Optional header {headerName} must not be blank
If an optional header is sent, it can't be blank
201
400
BEAN_VALIDATION_ERROR
Field validation error. Check details
One or more fields sent were incorrect
202
401
INVALID_IP
Unregistered IP address
You must whitelist your IP Address. Click here for instructions
203
429
VELOCITY_CHECK
Too many consecutive attempts for user (Velocity Check)
The user has created many deposits in a short period of time
204
400
INVALID_MEDIA_TYPE
Invalid media type
The payload format is in an unsupported format. Make sure the header Content-Type
is application/json
205
400
MISSING_REQUEST_PARAMETER
Missing request parameter
The request is missing an important parameter
206
400
MISSING_PATH_VARIABLE
Missing path variable
The request is missing an important path variable
207
400
INVALID_REQUEST_PARAMETER_TYPE
Invalid request parameter type
A parameter type sent was incorrect
208
404
RESOURCE_NOT_FOUND
Resource not found
The deposit_id
being used doesn't exist
209
400
INVALID_REQUEST_BODY
Invalid request body: {details}
There is a syntax error in the JSON payload
217
403
FORBIDDEN_MERCHANT
Merchant has no authorization to use this API
Your Merchant Account is not enabled to use this API. Contact your Account Manager for more information
300
400
USER_BLACKLISTED
User blacklisted
The user is known for committing fraud
301
400
USER_GREYLISTED
User greylisted
The user is banned because we detected suspicious behavior
302
400
USER_UNAUTHORIZED
User unauthorized
The user is blocked. For further information go to the "Clients" section on the Tupay Panel
303
400
USER_UNAUTHORIZED_REG_STATUS
User unauthorized due to cadastral situation
Check the user's cadastral situation
304
400
USER_LIMIT_EXCEEDED
The user limit has been exceeded: {TRANSACTION|DAILY|WEEKLY|MONTHLY}
Check the user's limit on the Tupay Panel under the "Clients" section
305
400
PAYMENT_METHOD_RESTRICTED
Restricted payment method type
The payment type is disallowed for the payer
400
400
INVALID_AMOUNT
Invalid amount. The minimum is USD 2 or equivalent in local currency
The amount does not reach the minimum limit
401
400
PAYMENT_METHOD_NOT_FOUND
Payment method not found
The payment_method
code sent isn't correct.
402
400
INVOICE_ALREADY_USED
Invoice already used
The invoice_id
sent has already been used
404
400
ERROR_CREATING_PAYMENT
Payment method provider unavailable
Our provider is temporarily unavailable. Use a different payment method or try again
406
400
INVALID_ADDRESS
Invalid address
The address
sent is invalid
407
400
INVALID_CITY
Invalid city
The city
sent is invalid
408
400
PAYMENT_METHOD_LIMIT_EXCEEDED
Payment method limit exceeded
The amount
sent exceeds the provider's payment method limit. Try with a smaller amount
410
400
PAYMENT_METHOD_MINIMUM_REQUIRED
Payment method minimum required
The amount
sent is smaller than the provider's payment method minimum limit. Try with a bigger amount
411
400
INVALID_USER_DOCUMENT
Invalid user document ID
The document
specified was rejected by the provider itself. Check it is valid
412
400
PAYMENT_METHOD_UNAVAILABLE
Payment Method Unavailable
The payment method is temporarily unavailable, please try again later
418
400
MISSING_REQUIRED_FIELDS
Missing required fields in order to generate Deposit
The request is missing a required field. Please check here.
419
400
MISSING_PAYER_ID_OR_DOCUMENT
payer.id or payer.document field is missing
The request is missing the payer.id
or payer.document
field and at least one of them is mandatory to create the deposit
500
500
GENERIC_ERROR
Oh no! Something has gone wrong. Please contact a system administrator
Internal error, please contact support
720
400
MISSING_CONFIGURATION
Missing configuration for merchant account
Please contact your AM/TAM
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.
Below you will find all the Required fields with a checkbox
If required fields are missing, the HOSTED
flow will take place