API.v1 - 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 and 216.238.119.20
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": "07876237096", "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\": \"07876237096\",\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": "2024-11-26", "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
invoice
amount
description
customer_name
email
document
phone
zip
city
state
street
numberhome
district
Api key found on the dashboard.
Unique ID received by the merchant, this identification cannot be repeated.
Format 100.00 BRL.
Free text for merchant.
Customer full name.
Customer email.
CPF customer, only number.
Phone custumer.
Zip code custumer.
City custumer.
State custumer.
Street custumer.
Numberhome custumer.
Neighborhood custumer.
TED(bank wire transfer) - Brazil
This payment option has been discontinued!
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" "customer_name: "Joao da Silva Nascimento", "email": "joao@site.com", "document": "07876237096", "phone": "11988774411" }'
Request Example in PHP/CURL
// Generated by curl-to-PHP: http://incarnate.github.io/curl-to-php/ $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 \"customer_name: \"Joao da Silva Nascimento\",\n \"email\": \"joao@site.com\",\n \"document\": \"07876237096\",\n \"phone\": \"11988774411\"\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": "2024-11-21 04:07:35", "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", "description": "Payment Invoice# 123456" "customer_name: "Joao da Silva Nascimento", "email": "joao@site.com", "document": "07876237096", "phone": "11988774411" }'
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 \"description\": \"Payment Invoice# 123456\"\n \"customer_name: \"Joao da Silva Nascimento\",\n \"email\": \"joao@site.com\",\n \"document\": \"07876237096\",\n \"phone\": \"11988774411\"\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": "2024-11-21 03:47:35", "Amount": "100.00", "Payment_url": "https://app.picpay.com/checkout/NWFmMGRjNmViZDc0Y2EwMDMwNzZlYzEw", "QRCODE": "XXXXXXXXXXXXXXXX", "Invoice": "123456", "Message": "Success", "Status": "200" }
Wallet Cubopay
Payment
The Cubopay Wallet Payment is a direct payment using the balance of the cubopay user and transferring it directly to the merchant. For this request you only need to send the Cubopay client's CPF and the 6-number Google Authenticator Code.
In this mode you do not receive an IPN, because the payment response is sent at the time of the request.
Endpoint
https://cubopay.net/api/wallet/Payment
curl -X POST \ https://cubopay.net/api/wallet/Payment \ -H 'Content-Type: application/json' \ -d '{ "api_key": "XXXXXXXXXXXXXXXXXXX", "invoice": "123456", "amount": "100.00", "description": "Payment Invoice# 123456" "document": "07876237096", "code": "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/wallet/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 \"document\": \"88657412599\",\n \"code\": \"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": "2024-11-21 03:47:35", "Amount": "100.00", "Type": "Wallet Cubopay", "Invoice": "123456", "Status_Cubopay": "paid", "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": "2024-11-22", "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 or BRL 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", "fiat": "1", "amount": "50.00", "currency": "BTC", "description": "Payment Invoice# 123456" }'
api_key
invoice
amount
description
currency
Api key found on the dashboard.
Unique ID received by the merchant, this identification cannot be repeated.
Format 100.00.
Fiat: 1(BRL) , 2(USD).
Free text for merchant.
Available Currency Acronym: BTC, ETH, USDT, BCH, DASH, LTC, DOGE
For requests in USDT the network used will be TRC20.
The USD or BRL amount is automatically converted to the amount of currencies equivalent to the chosen cryptocurrency quote.
Example Response
{ "Date": "2024-11-21 03:47:35", "Invoice": "123456", "Coin": "BTC", "Fiat": "BRL", "Amount_Fiat": "50.00", "Amount_Crypto": "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": "2024-11-21 03:47:35", "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": "2024-11-21 03:47:35", "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": "2024-11-21 03:47:35", "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']; 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: 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": "11", "year": "2024" }'
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-11-21 03:47:35", "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)
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-11-21 03:47:35", "Balance": "100.00", "Currency": "BRL", "Message": "success", "Status": "200" }
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": "07876237096", "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.
Status Payout
curl -X POST \ https://cubopay.net/api/payout/Status \ -H 'Content-Type: application/json' \ -d '{ "api_key": "XXXXXXXXXXXXXXXXXXX", "invoice": "1234" }'
Example Response
{ "Date": "2021-12-21", "Amount": "100.00", "Currency": "BRL", "Sender": "XXXXXXXXXXXXXXXXXXX", "TransactionDate": "2021-12-21", "Type": "XXXXXXXXXXXXXXXXXXX", "Key_Pix": "XXXXXXXXXXXXXXXXXXX", "Key_Type": "XXXXXXXXXXXXXXXXXXX", "Name": "XXXXXXXXXXXXXXXXXXX", "TxID": "XXXXXXXXXXXXXXXXXXX", "Invoice": "123456", "Message": "Success", "Status": "200" }
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.
Payout Cyptocurrency
Send payments to your customers via cryptocurrency
You can send payments to your affiliates, employees and customers through our API with a simple request via JSON POST.
Cubopay's new option gives your business the convenience of paying directly into your customer's cryptocurrency wallet. You must have a BRL balance to cash your account.
The payment happens quickly, but it can take up to 8 hours depending on the demand and congestion of the coin network.
Endpoint
https://cubopay.net/api/payout/Crypto
curl -X POST \ https://cubopay.net/api/payout/Crypto \ -H 'Content-Type: application/json' \ -d '{ "api_key": "XXXXXXXXXXXXXXXXXXX", "invoice": "1234", "amount": "100.00", "currency": "14", "wallet": "XXXXXXXXXXXXXXXX" }'
Example Response
{ "Type": "Withdrawal", "Amount_BRL": "100.00", "Debited_Currency": "BRL", "Credited_Currency": "USDT", "Estimated_Amount": "35.87", "Wallet": "XXXXXXXXXXXXXXXX", "Invoice": "123456", "Message": "Success", "Status": "200" }
After the cryptocurrency is sent to the wallet you will receive a CallBack on the IPN URL.