API - 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: 140.82.47.220

Bank Slip (Boleto) - Brazil

Issuing Bank Slip.

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

Bank Slip Request

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

curl -X POST \
  https://cubopay.net/api/bank_slip/Generate \
  -H 'Content-Type: application/json' \
 
  -d  '{
    "api_key": "XXXXXXXXXXXXXXXXXXX",
    "invoice": "123456",
    "amount": "100.00",
    "description": "Invoice #123456",
    "customer_name": "Jhon Carl",
    "email": "jhon@site.com",
    "document": "96249433031",
    "phone": "0155998632",
    "zip": "01021200",
    "city": "Sao Paulo",
    "state": "SP",
    "street": "Rua 25 de Marco",
    "numberhome": "744",
    "district": "Centro"
}'
                    
                    
                    
				

Request Example in PHP/CURL

             
    $ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://cubopay.net/api/bank_slip/Generate');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\n    \"api_key\": \"XXXXXXXXXXXXXXXXXXX\",\n    \"invoice\": \"123456\",\n    \"amount\": \"100.00\",\n    \"description\": \"Invoice #123456\",\n    \"customer_name\": \"Jhon Carl\",\n    \"email\": \"jhon@site.com\",\n    \"document\": \"87459518533\",\n    \"phone\": \"0155998632\",\n    \"zip\": \"0184000\",\n    \"city\": \"Sao Paulo\",\n    \"state\": \"SP\",\n    \"street\": \"Rua 25 de Marco\",\n    \"numberhome\": \"744\",\n    \"district\": \"Centro\"\n}");

$headers = array();
$headers[] = 'Content-Type: application/json';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}
curl_close($ch);            
                
   

Example Response

{
  "Due_date": "2021-10-29",
  "Amount": "100.00",
  "Boleto_url": "https://cubopay.net/api/bank_slip/Boleto?invoice=12345",
  "Invoice": "12345",
  "Message": "Success",
  "Status": "200"
}
                

POST Bank Slip Request

https://cubopay.net/api/bank_slip/Generate
  • api_key

  • Api key found on the dashboard.

  • invoice

  • Unique ID received by the merchant, this identification cannot be repeated.

  • amount

  • Format 100.00 BRL.

  • description

  • Free text for merchant.

  • customer_name

  • Customer full name.

  • email

  • Customer email.

  • document

  • CPF customer, only number.

  • phone

  • Phone custumer.

  • zip

  • Zip code custumer.

  • city

  • City custumer.

  • state

  • State custumer.

  • street

  • Street custumer.

  • numberhome

  • Numberhome custumer.

  • district

  • Neighborhood custumer.

TED(bank wire transfer) - Brazil

Local bank transfers.

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

Endpoint

https://cubopay.net/api/ted/Payment
curl -X POST \
  https://cubopay.net/api/ted/Payment \
  -H 'Content-Type: application/json' \
 
  -d  '{
    "api_key": "XXXXXXXXXXXXXXXXXXX",
    "invoice": "123456",
    "amount": "100.00",
    "description": "Payment Invoice# 123456"
    
}'
                    
                    
                    
				

Request Example in PHP/CURL

             
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://cubopay.net/api/ted/Payment');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\n    \"api_key\": \"XXXXXXXXXXXXXXXXXXX\",\n    \"invoice\": \"123456\",\n    \"amount\": \"100.00\",\n    \"description\": \"Payment Invoice# 123456\"\n    \n}");

$headers = array();
$headers[] = 'Content-Type: application/json';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}
curl_close($ch);           
                
   

Example Response

{
  "Due_date": "2021-10-25",
  "Amount": "100.00",
  "Banco": "341 - BANCO ITAU UNIBANCO S.A",
  "Ag": "0258",
  "Conta": "12548-9",
  "Titular": "CuboPay Ltd",
  "CNPJ": "35.996.074/0001-68",
  "TxId": "XXXXXXXXXX",
  "Invoice": "123456",
  "Message": "Success",
  "Status": "200"
}
                

You receive the bank details to display to your client to be able to make the bank transfer and then you must enable the sending of bank transfer receipt to our system.
The file must be sent together with TxId, supported file extensions: PNG, JPG, PDF. Max 2mb.

Bank Transfer Proof Sending

Endpoint

https://cubopay.net/api/ted/Proof




PIX(bank wire transfer) - Brazil

Local bank transfers.

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

Endpoint

https://cubopay.net/api/pix/Payment
curl -X POST \
  https://cubopay.net/api/pix/Payment \
  -H 'Content-Type: application/json' \
 
  -d  '{
    "api_key": "XXXXXXXXXXXXXXXXXXX",
    "invoice": "123456",
    "amount": "100.00",
    "description": "Payment Invoice# 123456"
    
}'
                    
                    
                    

Request Example in PHP/CURL

             
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://cubopay.net/api/pix/Payment');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\n    \"api_key\": \"XXXXXXXXXXXXXXXXXXX\",\n    \"invoice\": \"123456\",\n    \"amount\": \"100.00\",\n    \"description\": \"Payment Invoice# 123456\"\n    \n}");

$headers = array();
$headers[] = 'Content-Type: application/json';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}
curl_close($ch);           
                
   

Example Response

{
  "Due_date": "2021-10-25",
  "Amount": "100.00",
  "QRCODE": "https://cubopay.net/api/pix/pix.jpg",
  "QR": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "TxId": "XXXXXXXXXX",
  "Invoice": "123456",
  "Message": "Success",
  "Status": "200"
}
                

You receive bank details to display to your client, the QRCODE image and also QR which is the code for the client to copy and paste into internet banking.
After the customer makes the payment, confirmation is instant and automatic. You will receive a CallBack at the IPN URL.
If the customer does not make the payment, the transaction will expire in 24 hours.





PICPAY - Brazil

QRCODE Payment.

PicPay is one of the main payment methods in Brazil today. Upon request, the customer pays by QR CODE through the PicPay app itself. Your website will request the order through the REST API and will receive the return via JSON with QRCODE.
After confirmation of payment by PicPay, we will return the confirmation to the IPN registered on the panel.

Endpoint

https://cubopay.net/api/picpay/Payment
curl -X POST \
  https://cubopay.net/api/picpay/Payment \
  -H 'Content-Type: application/json' \
 
  -d  '{
    "api_key": "XXXXXXXXXXXXXXXXXXX",
    "invoice": "123456",
    "amount": "100.00",
    "document": "88657412599",
    "description": "Payment Invoice# 123456"
    
}'
                    
                    
                    

We remind you that your Invoice cannot be repeated, and in document = CPF of the client.

Request Example in PHP/CURL

             
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://cubopay.net/api/picpay/Payment');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\n    \"api_key\": \"XXXXXXXXXXXXXXXXXXX\",\n    \"invoice\": \"123456\",\n    \"amount\": \"100.00\",\n    \"document\": \"88657412599\",\n    \"description\": \"Payment Invoice# 123456\"\n    \n}");

$headers = array();
$headers[] = 'Content-Type: application/json';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}
curl_close($ch);           
                
   

Example Response

{
  "Due_date": "2021-10-24 00:39:25",
  "Amount": "100.00",
  "Payment_url": "https://app.picpay.com/checkout/NWFmMGRjNmViZDc0Y2EwMDMwNzZlYzEw",
  "QRCODE": "XXXXXXXXXXXXXXXX",
  "Invoice": "123456",
  "Message": "Success",
  "Status": "200"
}
                




Wire Transfer - United States, Costa Rica

Bank transfers.

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

Endpoint

https://cubopay.net/api/wire/Payment
curl -X POST \
  https://cubopay.net/api/wire/Payment \
  -H 'Content-Type: application/json' \
 
  -d  '{
    "api_key": "XXXXXXXXXXXXXXXXXXX",
    "invoice": "123456",
    "amount": "100.00",
    "currency": "2",
    "description": "Payment Invoice# 123456"
    
}'
                    
                    
                    
				
Currency = 2 (USD)

Example Response

{
"Due_date":"2021-01-24",
"Amount":"100.00",
"Currency":"USD",
"TxId":"sc213opXqL",
"Invoice":"123456",
"Message":"Success",
"Status":"200",
"Info":[
   {
   "Bank":"Scotiabank S.A",
   "Recipient":"Corporacion GYS S.A",
   "Data":"IBAN: CR41012300130006484036\r\nSwift Code: NOSCCRSJ",
   "Address":"Sabana Norte, Avenida Las Americas San Jose, Costa Rica"
   },
   {
   "Bank":"Chase Bank",
   "Recipient":"ATR Import and Export Corp",
   "Data":"Account Number: 599872055\r\nRouting Number: 267084131",
   "Address":"535 E Sample Rd, Deerfield Beach\r\nOrlando Florida\r\nZip 33064\r\nUnited States"
   }
   ]}
                

You receive the bank details to display to your client to be able to make the wire transfer and then you must enable the sending of bank transfer receipt to our system.
The file must be sent together with TxId, supported file extensions: PNG, JPG, PDF. Max 2mb.

Wire Transfer Proof Sending

Endpoint

https://cubopay.net/api/wire/Proof








Checkout / Credit Card - Brazil

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/checkout/Generate
curl -X POST \
  https://cubopay.net/api/checkout/Generate \
  -H 'Content-Type: application/json' \
 
  -d  '{
    "api_key": "XXXXXXXXXXXXXXXXXXX",
    "invoice": "123456",
    "amount": "100.00",
    "select": "3",
    "url_retorn": "https://yoursite.com",
    "description": "Payment Invoice# 123456"
    
}'
                    
                    
                    

Request Example in PHP/CURL

             
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://cubopay.net/api/checkout/Generate');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\n    \"api_key\": \"XXXXXXXXXXXXXXXXXXX\",\n    \"invoice\": \"123456\",\n    \"amount\": \"100.00\",\n    \"select\": \"3\",\n    \"url_retorn\": \"https://yoursite.com\",\n    \"description\": \"Payment Invoice# 123456\"\n    \n}");

$headers = array();
$headers[] = 'Content-Type: application/json';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}
curl_close($ch);        
                
   

Example Response

{
  "Date": "2021-10-25",
  "Amount": "100.00",
  "Payment_Url": "https://cubopay.net/api/checkout/Payment?token=zgY9jcFmv32xEIo7HVZi6fRstPQWAr",
  "Invoice": "123456",
  "Message": "Success",
  "Status": "200"
}
                

After making the payment, he will be able to return to your site, sent in url_retorn.
If payment is accepted or not you will receive a notification in IPN.
To enable the credit card function at checkout ask for team.
Field Select = This is a pre-selection of payment methods, it is not a required field.
select = 1(Boleto), 3(Pix), 5(Picpay)









Cryptocurrency

Cryptocurrency Payments

In this method you send a request with a value in USD and we return via JSON the data for payment in the chosen cryptocurrency, according to the availability of the currency on our platform.
After the payment is completed by the customer, we will return the payment confirmation to the IPN URL.
The Customer has up to 4 hours to make the payment.

Endpoint

https://cubopay.net/api/cryptocurrency/Payment
curl -X POST \
  https://cubopay.net/api/cryptocurrency/Payment \
  -H 'Content-Type: application/json' \
 
  -d  '{
    "api_key": "XXXXXXXXXXXXXXXXXXX",
    "invoice": "123456",
    "amount": "50.00",
    "currency": "BTC",
    "description": "Payment Invoice# 123456"
    
}'
  • api_key

  • Api key found on the dashboard.

  • invoice

  • Unique ID received by the merchant, this identification cannot be repeated.

  • amount

  • Format 100.00 USD.

  • description

  • Free text for merchant.

  • currency

  • Available Currency Acronym: BTC, ETC, USDT

The USD amount is automatically converted to the amount of currencies equivalent to the chosen cryptocurrency quote.

Example Response

{
  "Date": "2021-10-24 00:39:25",
  "Invoice": "123456",
  "Coin": "BTC",
  "Amount": "0.00526",
  "Wallet": "1PomhTxs3hc4rimnELUfbCcD1yn9TPtQFF",
  "QRCODE": "https://chart.googleapis.com/chart?chs=200x200&cht=qr&chl=1PomhTxs3hc4rimnELUfbCcD1yn9TPtQFF",
  "Message": "Success",
  "Status": "200"
}

Payment Notification Example

The deposit notification is sent to the IPN URL that you registered on the dashboard.







Generate Wallet

You can generate a wallet of the currencies available to each customer individually.
In this way, any deposit that your customer makes in this wallet generated by you for him, will be directed and credited to your merchant account.
When a customer makes a deposit, we will notify you via the IPN URL registered on the dashboard.
The amounts will remain in the same currency in which they are deposited and will be concentrated in your merchant account.

Generate Wallet Request

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

Endpoint

https://cubopay.net/api/cryptocurrency/Wallet
curl -X POST \
  https://cubopay.net/api/cryptocurrency/Wallet \
  -H 'Content-Type: application/json' \
 
  -d  '{
    "api_key": "XXXXXXXXXXXXXXXXXXX",
    "coin": "BTC"
}'
                    
                    
                    
				

Example Response

{
  "Date": "2021-10-24 00:39:25",
  "Coin": "BTC",
  "Wallet": "1PomhTxs3hc4rimnELUfbCcD1yn9TPtQFF",
  "Sign": "1PomhTxs3hc4rimnELUfbCcD1yn9TPtQFF1PomhTxs3hc4rimnELUfbCcD1yn9TPtQ",
  "Message": "Success",
  "Status": "200"
}
                

After the request will be returned to the wallet and sign that you must keep it in your database for future consultation and receipt of deposit notification.

Deposit Notification Example

The deposit notification is sent to the IPN URL that you registered on the dashboard.

{
  "Date": "2021-10-24 00:39:25",
  "Coin": "BTC",
  "Wallet": "1PomhTxs3hc4rimnELUfbCcD1yn9TPtQFF",
  "Sign": "1PomhTxs3hc4rimnELUfbCcD1yn9TPtQFF1PomhTxs3hc4rimnELUfbCcD1yn9TPtQ",
  "Type": "Deposit",
  "Amount": "0.00123",
  "Message": "Success",
  "Status": "200"
}
                

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": "2021-10-24 00:39:25",
  "Coin": "BRL",
  "Invoice": "12345",
  "Type": "Boleto",
  "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'];
?>

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: Boleto, TED, PIX, Cryptocurrency, PicPay, Wire Transfer
Invoice: Your invoice
Message/Status: 1(Paid), 2(Denied), 3(Canceled/Expired)









Statement

Account statement by period.

Request

Endpoint

https://cubopay.net/api/Statement
curl -X POST \
  https://cubopay.net/api/Statement \
  -H 'Content-Type: application/json' \
 
  -d  '{
    "api_key": "XXXXXXXXXXXXXXXXXXX",
    "month": "10",
    "year": "2021"
}'










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": "2021-10-24 00:39:25",
  "Amount": "100.00",
  "Currency": "BRL",
  "Type": "Boleto",
  "Invoice": "123456",
  "Message": "Paid",
  "Status": "1"
}
                

Currency: 1(BRL), 2(USD), 3(BTC)
Type: Boleto, TED, PIX, Cryptocurrency, PicPay, Wire Transfer
Invoice: Your invoice
Message/Status: 0(Pending), 1(Paid), 2(Denied), 3(Canceled)





Payouts


Pix

Send payments to your customers

You can send payments to your affiliates, employees, customers through our api with a simple request via JSON POST.
Pix is a new instant payment method created by the central bank of Brazil, the customer can have a pix key created by email, phone, cpf, cnpj or random. You must send this key to make the payment, you must have BRL balance to make the account discount.

Endpoint

https://cubopay.net/api/payout/Pix
curl -X POST \
  https://cubopay.net/api/payout/Pix \
  -H 'Content-Type: application/json' \
 
  -d  '{
    "api_key": "XXXXXXXXXXXXXXXXXXX",
    "invoice": "1234",
    "amount": "100.00",
    "currency": "1",
    "name": "Jhon Carl",
    "email": "jhon@site.com",
    "cpf": "025686598741",
    "phone": "11988774455",
    "key_pix": "XXXXXXXXXXXXXXXXXXX",
    "type_key": "TAX_ID" 
    
}'

Type Key: TAX_ID(CPF or CNPJ), EMAIL, PHONE, EVP(Random Key)

Example Response

{
  "Type": "Pix",
  "Amount": "100.00",
  "Currency": "BRL",
  "Pix_Key": "XXXXXXXXXXXXXXXXXXX",
  "Pix_Key_Type": "TAX_ID", ////TAX_ID, EVP, EMAIL, PHONE
  "Token": "XXXXXXXXXXXXXXXXXXX",
  "Invoice": "123456",
  "Message": "Success",
  "Status": "200"
}
                

The amounts will be sent within 24 hours to the customer's account. After we send the values you will receive a Callback at the IPN URL.





Payout Wallet Cubopay

Send payments to your customers

You can send payments to your affiliates, employees and customers through our API with a simple request via JSON POST.
Cubopay's new option offers your company the convenience of paying directly to your customer's wallet at Cubopay. You must have a balance in BRL to discount your account.
Payment happens instantly and has no fees for your company.

Endpoint

https://cubopay.net/api/payout/Wallet
curl -X POST \
  https://cubopay.net/api/payout/Wallet \
  -H 'Content-Type: application/json' \
 
  -d  '{
    "api_key": "XXXXXXXXXXXXXXXXXXX",
    "invoice": "1234",
    "amount": "100.00",
    "currency": "1",
    "cpf": "123456789987"
    
}'

Example Response

{
  "Type": "Payout Wallet",
  "Amount": "100.00",
  "Currency": "BRL",
  "Name": "Jhon Carl", ///Name Holder
  "Document": "0125456321", ///CPF or CNPJ
  "Invoice": "123456",
  "Message": "Success",
  "Status": "200"
}
                

At the same time that a request is accepted, you also receive a CallBack on the IPN URL.