API Mexico - CuboPay

Welcome To CuboPay

All CuboPay Developers APIs were developed based on REST technology, following the current technical standards of the market. All this so that the experience at the time of integration is as easy as possible. All URLs are friendly and resource oriented and use HTTP protocol standards such as authentication, verbs and return codes. This allows APIs to be used by existing HTTP clients. All responses are returned in JSON format.
As can be seen below, the APIs have been carefully crafted so that the terms of business contained are easily understood by developers who have no prior knowledge of the system. They have been meticulously studied so that a field name in an endpoint has exactly the same meaning in other resources.
Attention: All tests must be carried out in production.

SERVER IP: 45.77.94.219

OXXO

OXXO Mexico.

Your website will request the order through the REST API and will receive the return via JSON with Invoice data.
After confirmation of payment by the issuing bank, we will return the confirmation to the IPN registered on the dashboard.

OXXO Request

Every request you must use for API_KEY authentication, which is located on your dashboard.

curl -X POST \
  https://cubopay.net/api/mx/OXXO \
  -H 'Content-Type: application/json' \
 
  -d  '{
    "api_key": "XXXXXXXXXXXXXXXXXXX",
    "invoice": "123456",
    "amount": "100.00",
    "description": "Invoice #123456",
    "currency": "2"
    
}'
                    
Currency = 1(BRL), 2(USD)
Conversion to mexico local currency is done automatically.

Example Response

{
  "Due_date": "2024-12-12",
  "Amount": "100.00",
  "Coin": "USD",
  "Amount_MXN": "956.42",
  "URL_Payment": "https://cubopay.net/api/mx/Printer?id=9874",
  "Invoice": "12345",
  "Message": "Success",
  "Status": "200"
}
                

PayCash

PayCash Mexico.

Your website will request the order through the REST API and will receive the return via JSON with Invoice data.
After confirmation of payment by the issuing bank, we will return the confirmation to the IPN registered on the dashboard.





PayCash Request

Every request you must use for API_KEY authentication, which is located on your dashboard.

curl -X POST \
  https://cubopay.net/api/mx/PayCash \
  -H 'Content-Type: application/json' \
 
  -d  '{
    "api_key": "XXXXXXXXXXXXXXXXXXX",
    "invoice": "123456",
    "amount": "100.00",
    "description": "Invoice #123456",
    "currency": "2"
    
}'
                    
Currency = 1(BRL), 2(USD)
Conversion to mexico local currency is done automatically.

Example Response

{
  "Due_date": "2024-12-12",
  "Amount": "100.00",
  "Coin": "USD",
  "Amount_MXN": "956.42",
  "URL_Payment": "https://cubopay.net/api/mx/Printer?id=9874",
  "Invoice": "12345",
  "Message": "Success",
  "Status": "200"
}
                




Credit Card - Direct

Credit Card - Mexico.

Your website will request the order through the REST API and will receive the return via JSON with Invoice data.
After confirmation of payment by the issuing bank, we will return the confirmation in the same request and then to the IPN registered on the dashboard.

Credit Card Request

Every request you must use for API_KEY authentication, which is located on your dashboard.

curl -X POST \
  https://cubopay.net/api/mx/CreditCard \
  -H 'Content-Type: application/json' \
 
  -d  '{
    "api_key": "XXXXXXXXXXXXXXXXXXX",
    "invoice": "123456",
    "amount": "100.00",
    "description": "Invoice #123456",
    "currency": "2",
    "cardholder": "Jhon Carl",
    "number": "5555444411112222",
    "expiry": "07/2023",
    "cvv": "123"
}'
                    
Currency = 1(BRL), 2(USD)
Conversion to mexico local currency is done automatically.

Example Response

{
  "Date": "2024-12-07 23:30:28",
  "Amount": "100.00",
  "Coin": "USD",
  "Amount_MXN": "956.42",
  "Payment_Status": "Paid",
  "Invoice": "12345",
  "Message": "Success",
  "Status": "200"
}
                








Checkout / Credit Card - Mexico

Checkout.

Your website will request the order through the REST API and will receive the return via JSON with Payment URL.
After creating the payment order, you receive a payment link, where you must direct your user to our website, so he can choose the payment method including credit card

Endpoint

https://cubopay.net/api/mx/Generate
curl -X POST \
  https://cubopay.net/api/mx/Generate \
  -H 'Content-Type: application/json' \
 
  -d  '{
    "api_key": "XXXXXXXXXXXXXXXXXXX",
    "invoice": "123456",
    "amount": "100.00",
    "currency": "1",
    "payment_option": "10",
    "url_retorn": "https://yoursite.com",
    "description": "Payment Invoice# 123456"
    
}'
                    
                    
                    
Invoice: numbers and letters
Currency: 1(BRL), 2(USD)
Payment Option: 10( Credit Card)
URL Retorn: After Payment, retorn your site

Example Response

{
  "Date": "2024-12-08",
  "Amount": "100.00",
  "Payment_Url": "https://cubopay.net/api/mx/Payment?token=zgY9jcFmv32xEIo7HVZi6fRstPQWAr",
  "Invoice": "123456",
  "Message": "Success",
  "Status": "200"
}

                

After payment, the user will see an approval or disapproval response on the screen.
And the company will have callback in the api by the ipn url.









IPN

Instant Payment Notification

All payments will be notified via POST to the URL registered in Settings on the Dashboard.

Data sent to IPN

{
  "Date": "2024-12-07 23:30:28",
  "Coin": "USD",
  "Invoice": "12345",
  "Type": "OXXO",
  "Amount": "100.00",
  "Message": "Paid",
  "Status": "1"
}

Example page to receive IPN

< ?php
//prepare to receive in post,as in the php example below

$Date = $_POST['Date'];
$Coin = $_POST['Coin'];
$Invoice = $_POST['Invoice'];
$Type = $_POST['Type'];
$Amount = $_POST['Amount'];
$Message = $_POST['Message'];
$Status = $_POST['Status'];

echo '200';
?>

After correctly receiving the callback, you should print the answer on page: "200".
To let us know that you have correctly received the IPN, if you do not return the 200 number, we will continue to resubmit the IPN every 30 minutes, the resubmission number will be a maximum of 5.


Coin: BRL, USD
Type: OXXO, PayCash
Invoice: Your invoice
Message/Status: 1(Paid), 2(Denied), 3(Canceled/Expired)









Payment Status

Checking a payment status

You can check a payment status with a simple request via JSON POST.

Endpoint

https://cubopay.net/api/Status
curl -X POST \
  https://cubopay.net/api/Status \
  -H 'Content-Type: application/json' \
 
  -d  '{
    "api_key": "XXXXXXXXXXXXXXXXXXX",
    "invoice": "1234"
}'

Example Response

{
  "Date": "2024-12-07 23:30:28",
  "Amount": "100.00",
  "Currency": "BRL",
  "Type": "Boleto",
  "Invoice": "123456",
  "Message": "Paid",
  "Status": "1"
}
                

Currency: 1(BRL), 2(USD)
Type: OXXO, PayCash
Invoice: Your invoice
Message/Status: 0(Pending), 1(Paid), 2(Denied), 3(Canceled)





Account Balance

Balance

You can check balance with a simple request via JSON POST.

Endpoint

https://cubopay.net/api/Balance
curl -X POST \
  https://cubopay.net/api/Balance \
  -H 'Content-Type: application/json' \
 
  -d  '{
    "api_key": "XXXXXXXXXXXXXXXXXXX",
    "currency": "BRL"
}'

Example Response

{
  "Date": "2024-12-07 23:30:28",
  "Balance": "100.00",
  "Currency": "BRL",
  "Message": "success",
  "Status": "200"
}