Create Inbound Transaction (Brazil)
curl --request POST \
--url https://hg.cash/api/v1/br/transactions/inbound \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 123,
"email": "jsmith@example.com",
"document": "<string>",
"webhookUrl": "<string>"
}
'import requests
url = "https://hg.cash/api/v1/br/transactions/inbound"
payload = {
"accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 123,
"email": "jsmith@example.com",
"document": "<string>",
"webhookUrl": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
accountId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
amount: 123,
email: 'jsmith@example.com',
document: '<string>',
webhookUrl: '<string>'
})
};
fetch('https://hg.cash/api/v1/br/transactions/inbound', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://hg.cash/api/v1/br/transactions/inbound",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'accountId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'amount' => 123,
'email' => 'jsmith@example.com',
'document' => '<string>',
'webhookUrl' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://hg.cash/api/v1/br/transactions/inbound"
payload := strings.NewReader("{\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount\": 123,\n \"email\": \"jsmith@example.com\",\n \"document\": \"<string>\",\n \"webhookUrl\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://hg.cash/api/v1/br/transactions/inbound")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount\": 123,\n \"email\": \"jsmith@example.com\",\n \"document\": \"<string>\",\n \"webhookUrl\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://hg.cash/api/v1/br/transactions/inbound")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount\": 123,\n \"email\": \"jsmith@example.com\",\n \"document\": \"<string>\",\n \"webhookUrl\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"qrCode": "<string>",
"pixCopiaECola": "<string>"
}{
"error": "Account is not operative",
"code": "ACCOUNT_NOT_OPERATIVE"
}{
"error": "<string>",
"code": "<string>",
"type": "<string>"
}Brazil
Create Inbound Transaction (Brazil)
Create an inbound transaction to receive a payment. Returns a QR code for the payer to scan.
Account must be a Brazil (BRL) account. Transaction starts in pending status until payment is confirmed.
POST
/
br
/
transactions
/
inbound
Create Inbound Transaction (Brazil)
curl --request POST \
--url https://hg.cash/api/v1/br/transactions/inbound \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 123,
"email": "jsmith@example.com",
"document": "<string>",
"webhookUrl": "<string>"
}
'import requests
url = "https://hg.cash/api/v1/br/transactions/inbound"
payload = {
"accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 123,
"email": "jsmith@example.com",
"document": "<string>",
"webhookUrl": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
accountId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
amount: 123,
email: 'jsmith@example.com',
document: '<string>',
webhookUrl: '<string>'
})
};
fetch('https://hg.cash/api/v1/br/transactions/inbound', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://hg.cash/api/v1/br/transactions/inbound",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'accountId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'amount' => 123,
'email' => 'jsmith@example.com',
'document' => '<string>',
'webhookUrl' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://hg.cash/api/v1/br/transactions/inbound"
payload := strings.NewReader("{\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount\": 123,\n \"email\": \"jsmith@example.com\",\n \"document\": \"<string>\",\n \"webhookUrl\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://hg.cash/api/v1/br/transactions/inbound")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount\": 123,\n \"email\": \"jsmith@example.com\",\n \"document\": \"<string>\",\n \"webhookUrl\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://hg.cash/api/v1/br/transactions/inbound")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount\": 123,\n \"email\": \"jsmith@example.com\",\n \"document\": \"<string>\",\n \"webhookUrl\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"qrCode": "<string>",
"pixCopiaECola": "<string>"
}{
"error": "Account is not operative",
"code": "ACCOUNT_NOT_OPERATIVE"
}{
"error": "<string>",
"code": "<string>",
"type": "<string>"
}Authorizations
User API authentication token with format cash_<64-char-hex>. Sample value cash_16cdc3b6f83c72d9d2680adca4f430962981f6bf32613a129dded0aa060387d2.
Body
application/json
Request to create an inbound transaction (receive payment) for Brazil BRL accounts
ID of the account to receive funds into
Amount to receive (positive)
Payer email for the charge
Payer CPF or CNPJ (digits only, or formatted with punctuation)
Optional URL to receive status updates

