LogoLogo
Tupay Website
English
English
  • 😀Welcome to Tupay API
  • API Documentation
    • Deposit
      • Technical Aspects
      • Signature Authorization and Calculation
      • Deposit Creation Endpoint
      • Deposit Status Endpoint
      • Notifications Process
    • Cashout
      • Technical Aspects
      • Authentication and Signature Calculation
      • Cashout Creation Endpoint
      • Cashout Status Endpoint
      • Notification Process
    • Reconciliation API
      • Technical and Security Aspects
      • Endpoints
Con tecnología de GitBook
En esta página
  • LOGIN ENPOINT
  • Endpoint Login
  • BEARER_TOKEN cookie
  • DEPOSITS ENDPOINT
  • Retrieve deposit details
  • CASHOUT ENDPOINT
  • Retrieve Cashout details
  • BALANCE REPORT
  • Balance Report Endpoint
  • Total Available Balance Endpoint
  • LOGOUT
  • Endpoint Logout

¿Te fue útil?

  1. API Documentation
  2. Reconciliation API

Endpoints

AnteriorTechnical and Security Aspects

Última actualización hace 2 meses

¿Te fue útil?

Learn how to automate your reconciliation tasks by integrating our Reconciliation API endpoint.

LOGIN ENPOINT

Once your account is ready to use the Merchant API, the first step will be to authenticate. This authentication process requires sending a POST request to the login endpoint. Mentioned below. This request must include the access key (email) and secret key (password) in JSON format to validate and establish the user's credentials.

Endpoint Login

POST https://merchants-api-stg.tupayonline.com/v1/auth/login

Staging

Producción

Request Body

Name
Type
Description

accessKey*

string

Configured API user email address

secretKey*

string

Password of the configured API user

{
    "idUser": 123,
    "username": "[email protected]",
    "idMerchant": 456
}
{
    "idUser": 123,
    "username": "[email protected]",
    "idMerchant": 456
}

{
    "code": 83,
    "description": "You are not permitted to log in from this location, please contact your account administrator."
}

Make sure to add the following value to the request header: Content-Type: application/json


BEARER_TOKEN cookie

The response will include a header field called Set-Cookie. This particular field will carry a cookie labeled BEARER_TOKEN which must be sent back to the server in all subsequent requests to stay logged in.

Example of cookie in header with value BEARER_TOKEN:

cookie: BEARER_TOKEN=U3dcUx8IRJ5nLjb0WYM4cHa3qHFqnrqAk

The endpoints for each type of transaction are described below.

To send requests, be sure to include the BEARER_TOKEN obtained from the login endpoint in the authentication header field of the requests. You can use it in the following ways:

As part of the header:

Authorization: Bearer U3dcUx8IRJ5nLjb0WYM4cHa3qHFqnrqAk

Or as a cookie:

cookie: BEARER_TOKEN=U3dcUx8IRJ5nLjb0WYM4cHa3qHFqnrqAk

There are certain parameters that you can send in the GET request. These parameters come in name-value pairs known as name-value. They are added to the URL after a “?” sign, and multiple parameters can be used, separated by an “&” sign. The name and value are always separated by an “=” sign.

The syntax is as follows (examples):

Staging

https://merchants-api-stg.tupayonline.com/v1/cashouts?page=0&from=1577836800&to=1580515200 

Production

https://merchants-api.tupayonline.com/v1/cashouts?page=0&from=1577836800&to=1580515200

A basic answer has the following format:

{
 "data": [],
 "page": 0,
 "rows": 0,
 "maxRows": 50
 }
  • The data field is an array that will contain multiple JSON objects, one for each transaction. Each one with its own details.

  • The response from these endpoints can display a maximum of 50 records per page. In case there are more than 50 records, you will need to request the next page using the page parameter in the GET request. Always start with page = 0.

  • The rows field indicates how many transactions the request returned.

  • The maxRows field shows the maximum transactions a request can retrieve. In case the "rows" is equal to "maxRows", you should do another request specifying the page plus one. Repeat this until the rows value is lesser than the maxRows one.


DEPOSITS ENDPOINT

Retrieve deposit details

Staging https://merchants-api-stg.tupayonline.com/v1/deposits

Production https://merchants-api.tupayonline.com/v1/deposits

Query Parameters

Name
Type
Description

from

integer

Transaction creation date range in format

paymentMethod

string

(max legth: 2)

Payment method code. (XA/XAQR)

country

string

(PE)

Country code

page

integer

The page number. Each page contains as many transactions as indicated by the maxRows value.

to

integer

Transaction creation date range in format

clienteDocument

String

The client document.

status

Transaction status values: PENDING APPROVED COMPLETED CANCELLED DECLINED

Headers

Name
Type
Description

Content-Type

String

application/json

Cookie

String

BEARER_TOKEN=U3dcUx8IRJ5nLjb0WYM4cHa3qHFqnrqAk

Authorization

String

BEARER_TOKEN=U3dcUx8IRJ5nLjb0WYM4cHa3qHFqnrqAk

{
    "data": [
    {
            "idDeposit": 301393325,
            "externalId": "1-44862-ACP",
            "creationDate": "2024-06-01T13:37:17Z",
            "countryName": "Peru",
            "country": "PE",
            "paymentMethodName": "QR by Tupay",
            "paymentMethodCode": "XAQR",
            "requestedPaymentMethod": "XAQR",
            "requestedPaymentMethodName": "QR by Tupay",
            "clientDocument": "12345678",
            "amount": 7.92,
            "currency": "USD",
            "balanceCurrency": "USD",
            "requestedAmount": 30.0,
            "requestedCurrency": "PEN",
            "localAmount": 30.0,
            "localCurrency": "PEN",
            "localCountryTaxFee": 0.0,
            "usdCountryTaxFee": 0.0,
            "fee": 0.39,
            "feeCurrency": "USD",
            "lastChangeDate": "2024-06-02T13:38:26Z",
            "status": "CANCELLED",
            "idUser": "105",
            "flags": [],
            "idMerchant": 19759,
            "merchantName": "TUPAY TEST",
            "refundAttempted": false,
            "installments": 0,
            "allowPixApiRefund": false
        }
    ],
    "page": 0,
    "rows": 1,
    "maxRows": 50
}

The "Status" parameter can have any of the following states PENDING, APPROVED, COMPLETED, CANCELLED, DECLINED


CASHOUT ENDPOINT

Retrieve Cashout details

Staging https://merchants-api-stg.tupayonline.com/v1/cashout

Producción https://merchants-api.tupayonline.com/v1/cashout

Query Parameters

Name
Type
Description

from

integer

Transaction creation date range in format

paymentMethod

string

(max legth: 2)

Payment method code.(XA/XAQR)

country

string

(PE)

Country code

page

integer

The page number. Each page contains as many transactions as indicated by the maxRows value.

to

integer

Transaction creation date range in format

clienteDocument

string

The client document.

status

string

Transaction status values:

ON_HOLD PENDING DELIVERED COMPLETED REJECTED CANCELLED DECLINED

Headers

Name
Type
Description

Content-Type

String

application/json

Cookie

String

BEARER_TOKEN=U3dcUx8IRJ5nLjb0WYM4cHa3qHFqnrqAk

Authorization

String

BEARER_TOKEN=U3dcUx8IRJ5nLjb0WYM4cHa3qHFqnrqAk

{
    "data": [
        {
            "idCashout": 1770,
            "externalId": "test123",
            "creationDate": "2020-01-24T18:17:55Z",
            "country": "BR",
            "currency": "USD",
            "amount": 200.0,
            "creditedCurrency": "USD",
            "creditedAmount": 0.0,
            "merchantCurrency": "USD",
            "merchantAmount": 0.0,
            "feeCurrency": "USD",
            "fee": 0.0,
            "tax": 0.0,
            "lastChangeDate": "2020-01-24T18:17:55Z",
            "status": "PENDING",
            "clientDocument": "12345678901",
            "flags": [],
            "idMerchant": 4,
            "merchantName": "Merchant Test",
            "reason": "",
            "existVoucher": false
        }
    ],
    "page": 0,
    "rows": 1,
    "maxRows": 50
}

The parameter "Status" may have either of the following status ON_HOLD, PENDING, DELIVERED, COMPLETED, REJECTED, CANCELLED, DECLINED


BALANCE REPORT

This endpoint allows you to retrieve the details of your daily Balance Report in a given time.

Balance Report Endpoint

Staging GET https://merchants-api-stg.tupayonline.com/v1/balance/report

Production GET https://merchants-api.tupayonline.com/v1/balance/report

Query Parameters

Name
Type
Description

from

string

to

string

page

string

The page number. Each page contains as many transactions as indicated in the maxRows value.

{
    "data": [
        {
            "idMerchant": 4,
            "depositTotal": 0.0,
            "cashoutTotal": 0.0,
            "noteTotal": 0.0,
            "settlementTotal": 0.0,
            "cancelledSettlementTotal": 0.0,
            "depositFeeTotal": 0.0,
            "netAmount": 0.0,
            "totalBalance": 104642.98,
            "date": "2020-01-30T00:00:00Z",
            "currency": "USD"
        },
        {
            "idMerchant": 4,
            "depositTotal": 12.5,
            "cashoutTotal": 0.0,
            "noteTotal": 0.0,
            "settlementTotal": 0.0,
            "cancelledSettlementTotal": 0.0,
            "depositFeeTotal": 0.1,
            "netAmount": 12.4,
            "totalBalance": 104655.38,
            "date": "2020-01-31T00:00:00Z",
            "currency": "USD"
        }
    ],
    "page": 0,
    "rows": 2,
    "maxRows": 50
}

Total Available Balance Endpoint

This endpoint allows you to retrieve the details of your Total Available Balance.

Staging: GET https://merchants-api-stg.tupayonline.com/v1/balance

Production: GET https://merchants-api-stg.tupayonline.com/v1/balance

LOGOUT

Endpoint Logout

DELETE https://merchants-api-stg.tupayonline.com/v1/auth/session/destroy

Headers

Name
Type
Description

Cookie*

string

BEARER_TOKEN=U3dcUx8IRJ5nLjb0WYM4cHa3qHFqnrqAk

Please see this for more information about cookies.

The "from" and "to" values ​​follow the format, allowing a maximum difference of up to 60 days between them. The "from" value cannot exceed the "to" value.

maximum difference with value "from" 60 days.

maximum difference with value "from" 60 days.

Transaction creation date interval in format.

Transaction creation date interval in format - max difference with "from" value 60 days.

Staging

Producción

Once the token is invalidated, you will need to again before sending a new request.

https://merchants-api-stg.tupayonline.com/v1/auth/login
tps://merchants-api.tupayonline.com/v1/auth/login
page
unixTimeStamp
https://merchants-api-stg.tupayonline.com/v1/auth/login
tps://merchants-api.tupayonline.com/v1/auth/login
authenticate
UnixTimeStamp
UnixTimeStamp
UnixTimeStamp
UnixTimeStamp
UnixTimeStamp
UnixTimeStamp