curl --request POST \
--url https://api-global.fastpaybrasil.com/v1/submerchants \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"legalName": "ACME Corp",
"tradeName": "ACME",
"companyTaxId": "12.345.678/0001-99",
"website": "https://google.com",
"averageMonthlyRevenue": 5000,
"averageOrderValue": 100,
"productType": "digital",
"legalRepresentative": {
"fullName": "John Doe",
"dateOfBirth": "1980-01-01",
"nationality": "United State",
"email": "john.doe@example.com",
"motherName": "Jane Doe",
"gender": "M",
"phones": [
{
"type": "mobile",
"number": "5551234"
}
],
"idNumber": "1234567890",
"idType": "passport",
"issuingCountry": "USA"
},
"contactEmail": "contact@merchant.com",
"productDescription": "We sell electronic gadgets and accessories.",
"address": {
"addressLine1": "123 Main St",
"addressLine2": "Apt 1",
"neighborhood": "Downtown",
"city": "New York",
"state": "CA",
"country": "USA",
"postalCode": "12345"
},
"phones": [
{
"type": "mobile",
"number": "5551234"
}
],
"bankAccount": {
"bankCode": "001",
"agencyCode": "1234",
"accountNumber": "567890",
"accountDigit": "0",
"accountType": "checking",
"bankName": "Bank of America",
"recipientName": "John Doe",
"recipientDocument": "12345678900",
"routingNumber": "021000021"
},
"softDescriptor": "ACME*GADGETS",
"postbackUrl": "https://merchant.com/webhooks/merchant-status",
"canAccessDashboard": true
}
'import requests
url = "https://api-global.fastpaybrasil.com/v1/submerchants"
payload = {
"legalName": "ACME Corp",
"tradeName": "ACME",
"companyTaxId": "12.345.678/0001-99",
"website": "https://google.com",
"averageMonthlyRevenue": 5000,
"averageOrderValue": 100,
"productType": "digital",
"legalRepresentative": {
"fullName": "John Doe",
"dateOfBirth": "1980-01-01",
"nationality": "United State",
"email": "john.doe@example.com",
"motherName": "Jane Doe",
"gender": "M",
"phones": [
{
"type": "mobile",
"number": "5551234"
}
],
"idNumber": "1234567890",
"idType": "passport",
"issuingCountry": "USA"
},
"contactEmail": "contact@merchant.com",
"productDescription": "We sell electronic gadgets and accessories.",
"address": {
"addressLine1": "123 Main St",
"addressLine2": "Apt 1",
"neighborhood": "Downtown",
"city": "New York",
"state": "CA",
"country": "USA",
"postalCode": "12345"
},
"phones": [
{
"type": "mobile",
"number": "5551234"
}
],
"bankAccount": {
"bankCode": "001",
"agencyCode": "1234",
"accountNumber": "567890",
"accountDigit": "0",
"accountType": "checking",
"bankName": "Bank of America",
"recipientName": "John Doe",
"recipientDocument": "12345678900",
"routingNumber": "021000021"
},
"softDescriptor": "ACME*GADGETS",
"postbackUrl": "https://merchant.com/webhooks/merchant-status",
"canAccessDashboard": True
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
legalName: 'ACME Corp',
tradeName: 'ACME',
companyTaxId: '12.345.678/0001-99',
website: 'https://google.com',
averageMonthlyRevenue: 5000,
averageOrderValue: 100,
productType: 'digital',
legalRepresentative: {
fullName: 'John Doe',
dateOfBirth: '1980-01-01',
nationality: 'United State',
email: 'john.doe@example.com',
motherName: 'Jane Doe',
gender: 'M',
phones: [{type: 'mobile', number: '5551234'}],
idNumber: '1234567890',
idType: 'passport',
issuingCountry: 'USA'
},
contactEmail: 'contact@merchant.com',
productDescription: 'We sell electronic gadgets and accessories.',
address: {
addressLine1: '123 Main St',
addressLine2: 'Apt 1',
neighborhood: 'Downtown',
city: 'New York',
state: 'CA',
country: 'USA',
postalCode: '12345'
},
phones: [{type: 'mobile', number: '5551234'}],
bankAccount: {
bankCode: '001',
agencyCode: '1234',
accountNumber: '567890',
accountDigit: '0',
accountType: 'checking',
bankName: 'Bank of America',
recipientName: 'John Doe',
recipientDocument: '12345678900',
routingNumber: '021000021'
},
softDescriptor: 'ACME*GADGETS',
postbackUrl: 'https://merchant.com/webhooks/merchant-status',
canAccessDashboard: true
})
};
fetch('https://api-global.fastpaybrasil.com/v1/submerchants', 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://api-global.fastpaybrasil.com/v1/submerchants",
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([
'legalName' => 'ACME Corp',
'tradeName' => 'ACME',
'companyTaxId' => '12.345.678/0001-99',
'website' => 'https://google.com',
'averageMonthlyRevenue' => 5000,
'averageOrderValue' => 100,
'productType' => 'digital',
'legalRepresentative' => [
'fullName' => 'John Doe',
'dateOfBirth' => '1980-01-01',
'nationality' => 'United State',
'email' => 'john.doe@example.com',
'motherName' => 'Jane Doe',
'gender' => 'M',
'phones' => [
[
'type' => 'mobile',
'number' => '5551234'
]
],
'idNumber' => '1234567890',
'idType' => 'passport',
'issuingCountry' => 'USA'
],
'contactEmail' => 'contact@merchant.com',
'productDescription' => 'We sell electronic gadgets and accessories.',
'address' => [
'addressLine1' => '123 Main St',
'addressLine2' => 'Apt 1',
'neighborhood' => 'Downtown',
'city' => 'New York',
'state' => 'CA',
'country' => 'USA',
'postalCode' => '12345'
],
'phones' => [
[
'type' => 'mobile',
'number' => '5551234'
]
],
'bankAccount' => [
'bankCode' => '001',
'agencyCode' => '1234',
'accountNumber' => '567890',
'accountDigit' => '0',
'accountType' => 'checking',
'bankName' => 'Bank of America',
'recipientName' => 'John Doe',
'recipientDocument' => '12345678900',
'routingNumber' => '021000021'
],
'softDescriptor' => 'ACME*GADGETS',
'postbackUrl' => 'https://merchant.com/webhooks/merchant-status',
'canAccessDashboard' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://api-global.fastpaybrasil.com/v1/submerchants"
payload := strings.NewReader("{\n \"legalName\": \"ACME Corp\",\n \"tradeName\": \"ACME\",\n \"companyTaxId\": \"12.345.678/0001-99\",\n \"website\": \"https://google.com\",\n \"averageMonthlyRevenue\": 5000,\n \"averageOrderValue\": 100,\n \"productType\": \"digital\",\n \"legalRepresentative\": {\n \"fullName\": \"John Doe\",\n \"dateOfBirth\": \"1980-01-01\",\n \"nationality\": \"United State\",\n \"email\": \"john.doe@example.com\",\n \"motherName\": \"Jane Doe\",\n \"gender\": \"M\",\n \"phones\": [\n {\n \"type\": \"mobile\",\n \"number\": \"5551234\"\n }\n ],\n \"idNumber\": \"1234567890\",\n \"idType\": \"passport\",\n \"issuingCountry\": \"USA\"\n },\n \"contactEmail\": \"contact@merchant.com\",\n \"productDescription\": \"We sell electronic gadgets and accessories.\",\n \"address\": {\n \"addressLine1\": \"123 Main St\",\n \"addressLine2\": \"Apt 1\",\n \"neighborhood\": \"Downtown\",\n \"city\": \"New York\",\n \"state\": \"CA\",\n \"country\": \"USA\",\n \"postalCode\": \"12345\"\n },\n \"phones\": [\n {\n \"type\": \"mobile\",\n \"number\": \"5551234\"\n }\n ],\n \"bankAccount\": {\n \"bankCode\": \"001\",\n \"agencyCode\": \"1234\",\n \"accountNumber\": \"567890\",\n \"accountDigit\": \"0\",\n \"accountType\": \"checking\",\n \"bankName\": \"Bank of America\",\n \"recipientName\": \"John Doe\",\n \"recipientDocument\": \"12345678900\",\n \"routingNumber\": \"021000021\"\n },\n \"softDescriptor\": \"ACME*GADGETS\",\n \"postbackUrl\": \"https://merchant.com/webhooks/merchant-status\",\n \"canAccessDashboard\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://api-global.fastpaybrasil.com/v1/submerchants")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"legalName\": \"ACME Corp\",\n \"tradeName\": \"ACME\",\n \"companyTaxId\": \"12.345.678/0001-99\",\n \"website\": \"https://google.com\",\n \"averageMonthlyRevenue\": 5000,\n \"averageOrderValue\": 100,\n \"productType\": \"digital\",\n \"legalRepresentative\": {\n \"fullName\": \"John Doe\",\n \"dateOfBirth\": \"1980-01-01\",\n \"nationality\": \"United State\",\n \"email\": \"john.doe@example.com\",\n \"motherName\": \"Jane Doe\",\n \"gender\": \"M\",\n \"phones\": [\n {\n \"type\": \"mobile\",\n \"number\": \"5551234\"\n }\n ],\n \"idNumber\": \"1234567890\",\n \"idType\": \"passport\",\n \"issuingCountry\": \"USA\"\n },\n \"contactEmail\": \"contact@merchant.com\",\n \"productDescription\": \"We sell electronic gadgets and accessories.\",\n \"address\": {\n \"addressLine1\": \"123 Main St\",\n \"addressLine2\": \"Apt 1\",\n \"neighborhood\": \"Downtown\",\n \"city\": \"New York\",\n \"state\": \"CA\",\n \"country\": \"USA\",\n \"postalCode\": \"12345\"\n },\n \"phones\": [\n {\n \"type\": \"mobile\",\n \"number\": \"5551234\"\n }\n ],\n \"bankAccount\": {\n \"bankCode\": \"001\",\n \"agencyCode\": \"1234\",\n \"accountNumber\": \"567890\",\n \"accountDigit\": \"0\",\n \"accountType\": \"checking\",\n \"bankName\": \"Bank of America\",\n \"recipientName\": \"John Doe\",\n \"recipientDocument\": \"12345678900\",\n \"routingNumber\": \"021000021\"\n },\n \"softDescriptor\": \"ACME*GADGETS\",\n \"postbackUrl\": \"https://merchant.com/webhooks/merchant-status\",\n \"canAccessDashboard\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-global.fastpaybrasil.com/v1/submerchants")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"legalName\": \"ACME Corp\",\n \"tradeName\": \"ACME\",\n \"companyTaxId\": \"12.345.678/0001-99\",\n \"website\": \"https://google.com\",\n \"averageMonthlyRevenue\": 5000,\n \"averageOrderValue\": 100,\n \"productType\": \"digital\",\n \"legalRepresentative\": {\n \"fullName\": \"John Doe\",\n \"dateOfBirth\": \"1980-01-01\",\n \"nationality\": \"United State\",\n \"email\": \"john.doe@example.com\",\n \"motherName\": \"Jane Doe\",\n \"gender\": \"M\",\n \"phones\": [\n {\n \"type\": \"mobile\",\n \"number\": \"5551234\"\n }\n ],\n \"idNumber\": \"1234567890\",\n \"idType\": \"passport\",\n \"issuingCountry\": \"USA\"\n },\n \"contactEmail\": \"contact@merchant.com\",\n \"productDescription\": \"We sell electronic gadgets and accessories.\",\n \"address\": {\n \"addressLine1\": \"123 Main St\",\n \"addressLine2\": \"Apt 1\",\n \"neighborhood\": \"Downtown\",\n \"city\": \"New York\",\n \"state\": \"CA\",\n \"country\": \"USA\",\n \"postalCode\": \"12345\"\n },\n \"phones\": [\n {\n \"type\": \"mobile\",\n \"number\": \"5551234\"\n }\n ],\n \"bankAccount\": {\n \"bankCode\": \"001\",\n \"agencyCode\": \"1234\",\n \"accountNumber\": \"567890\",\n \"accountDigit\": \"0\",\n \"accountType\": \"checking\",\n \"bankName\": \"Bank of America\",\n \"recipientName\": \"John Doe\",\n \"recipientDocument\": \"12345678900\",\n \"routingNumber\": \"021000021\"\n },\n \"softDescriptor\": \"ACME*GADGETS\",\n \"postbackUrl\": \"https://merchant.com/webhooks/merchant-status\",\n \"canAccessDashboard\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "2vorkDcXyvzifL63YX09S9VqcnI"
}{
"statusCode": 401,
"message": "Unauthorized"
}{
"statusCode": 403,
"message": "Forbidden"
}{
"statusCode": 422,
"error": "Unprocessable Entity",
"message": "The items list contains one of more items with invalid type."
}{
"statusCode": 500,
"message": "Internal server error"
}Create a new Submerchant
Creates a submerchant FastPay account linked to the MerchantMaster.
curl --request POST \
--url https://api-global.fastpaybrasil.com/v1/submerchants \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"legalName": "ACME Corp",
"tradeName": "ACME",
"companyTaxId": "12.345.678/0001-99",
"website": "https://google.com",
"averageMonthlyRevenue": 5000,
"averageOrderValue": 100,
"productType": "digital",
"legalRepresentative": {
"fullName": "John Doe",
"dateOfBirth": "1980-01-01",
"nationality": "United State",
"email": "john.doe@example.com",
"motherName": "Jane Doe",
"gender": "M",
"phones": [
{
"type": "mobile",
"number": "5551234"
}
],
"idNumber": "1234567890",
"idType": "passport",
"issuingCountry": "USA"
},
"contactEmail": "contact@merchant.com",
"productDescription": "We sell electronic gadgets and accessories.",
"address": {
"addressLine1": "123 Main St",
"addressLine2": "Apt 1",
"neighborhood": "Downtown",
"city": "New York",
"state": "CA",
"country": "USA",
"postalCode": "12345"
},
"phones": [
{
"type": "mobile",
"number": "5551234"
}
],
"bankAccount": {
"bankCode": "001",
"agencyCode": "1234",
"accountNumber": "567890",
"accountDigit": "0",
"accountType": "checking",
"bankName": "Bank of America",
"recipientName": "John Doe",
"recipientDocument": "12345678900",
"routingNumber": "021000021"
},
"softDescriptor": "ACME*GADGETS",
"postbackUrl": "https://merchant.com/webhooks/merchant-status",
"canAccessDashboard": true
}
'import requests
url = "https://api-global.fastpaybrasil.com/v1/submerchants"
payload = {
"legalName": "ACME Corp",
"tradeName": "ACME",
"companyTaxId": "12.345.678/0001-99",
"website": "https://google.com",
"averageMonthlyRevenue": 5000,
"averageOrderValue": 100,
"productType": "digital",
"legalRepresentative": {
"fullName": "John Doe",
"dateOfBirth": "1980-01-01",
"nationality": "United State",
"email": "john.doe@example.com",
"motherName": "Jane Doe",
"gender": "M",
"phones": [
{
"type": "mobile",
"number": "5551234"
}
],
"idNumber": "1234567890",
"idType": "passport",
"issuingCountry": "USA"
},
"contactEmail": "contact@merchant.com",
"productDescription": "We sell electronic gadgets and accessories.",
"address": {
"addressLine1": "123 Main St",
"addressLine2": "Apt 1",
"neighborhood": "Downtown",
"city": "New York",
"state": "CA",
"country": "USA",
"postalCode": "12345"
},
"phones": [
{
"type": "mobile",
"number": "5551234"
}
],
"bankAccount": {
"bankCode": "001",
"agencyCode": "1234",
"accountNumber": "567890",
"accountDigit": "0",
"accountType": "checking",
"bankName": "Bank of America",
"recipientName": "John Doe",
"recipientDocument": "12345678900",
"routingNumber": "021000021"
},
"softDescriptor": "ACME*GADGETS",
"postbackUrl": "https://merchant.com/webhooks/merchant-status",
"canAccessDashboard": True
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
legalName: 'ACME Corp',
tradeName: 'ACME',
companyTaxId: '12.345.678/0001-99',
website: 'https://google.com',
averageMonthlyRevenue: 5000,
averageOrderValue: 100,
productType: 'digital',
legalRepresentative: {
fullName: 'John Doe',
dateOfBirth: '1980-01-01',
nationality: 'United State',
email: 'john.doe@example.com',
motherName: 'Jane Doe',
gender: 'M',
phones: [{type: 'mobile', number: '5551234'}],
idNumber: '1234567890',
idType: 'passport',
issuingCountry: 'USA'
},
contactEmail: 'contact@merchant.com',
productDescription: 'We sell electronic gadgets and accessories.',
address: {
addressLine1: '123 Main St',
addressLine2: 'Apt 1',
neighborhood: 'Downtown',
city: 'New York',
state: 'CA',
country: 'USA',
postalCode: '12345'
},
phones: [{type: 'mobile', number: '5551234'}],
bankAccount: {
bankCode: '001',
agencyCode: '1234',
accountNumber: '567890',
accountDigit: '0',
accountType: 'checking',
bankName: 'Bank of America',
recipientName: 'John Doe',
recipientDocument: '12345678900',
routingNumber: '021000021'
},
softDescriptor: 'ACME*GADGETS',
postbackUrl: 'https://merchant.com/webhooks/merchant-status',
canAccessDashboard: true
})
};
fetch('https://api-global.fastpaybrasil.com/v1/submerchants', 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://api-global.fastpaybrasil.com/v1/submerchants",
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([
'legalName' => 'ACME Corp',
'tradeName' => 'ACME',
'companyTaxId' => '12.345.678/0001-99',
'website' => 'https://google.com',
'averageMonthlyRevenue' => 5000,
'averageOrderValue' => 100,
'productType' => 'digital',
'legalRepresentative' => [
'fullName' => 'John Doe',
'dateOfBirth' => '1980-01-01',
'nationality' => 'United State',
'email' => 'john.doe@example.com',
'motherName' => 'Jane Doe',
'gender' => 'M',
'phones' => [
[
'type' => 'mobile',
'number' => '5551234'
]
],
'idNumber' => '1234567890',
'idType' => 'passport',
'issuingCountry' => 'USA'
],
'contactEmail' => 'contact@merchant.com',
'productDescription' => 'We sell electronic gadgets and accessories.',
'address' => [
'addressLine1' => '123 Main St',
'addressLine2' => 'Apt 1',
'neighborhood' => 'Downtown',
'city' => 'New York',
'state' => 'CA',
'country' => 'USA',
'postalCode' => '12345'
],
'phones' => [
[
'type' => 'mobile',
'number' => '5551234'
]
],
'bankAccount' => [
'bankCode' => '001',
'agencyCode' => '1234',
'accountNumber' => '567890',
'accountDigit' => '0',
'accountType' => 'checking',
'bankName' => 'Bank of America',
'recipientName' => 'John Doe',
'recipientDocument' => '12345678900',
'routingNumber' => '021000021'
],
'softDescriptor' => 'ACME*GADGETS',
'postbackUrl' => 'https://merchant.com/webhooks/merchant-status',
'canAccessDashboard' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://api-global.fastpaybrasil.com/v1/submerchants"
payload := strings.NewReader("{\n \"legalName\": \"ACME Corp\",\n \"tradeName\": \"ACME\",\n \"companyTaxId\": \"12.345.678/0001-99\",\n \"website\": \"https://google.com\",\n \"averageMonthlyRevenue\": 5000,\n \"averageOrderValue\": 100,\n \"productType\": \"digital\",\n \"legalRepresentative\": {\n \"fullName\": \"John Doe\",\n \"dateOfBirth\": \"1980-01-01\",\n \"nationality\": \"United State\",\n \"email\": \"john.doe@example.com\",\n \"motherName\": \"Jane Doe\",\n \"gender\": \"M\",\n \"phones\": [\n {\n \"type\": \"mobile\",\n \"number\": \"5551234\"\n }\n ],\n \"idNumber\": \"1234567890\",\n \"idType\": \"passport\",\n \"issuingCountry\": \"USA\"\n },\n \"contactEmail\": \"contact@merchant.com\",\n \"productDescription\": \"We sell electronic gadgets and accessories.\",\n \"address\": {\n \"addressLine1\": \"123 Main St\",\n \"addressLine2\": \"Apt 1\",\n \"neighborhood\": \"Downtown\",\n \"city\": \"New York\",\n \"state\": \"CA\",\n \"country\": \"USA\",\n \"postalCode\": \"12345\"\n },\n \"phones\": [\n {\n \"type\": \"mobile\",\n \"number\": \"5551234\"\n }\n ],\n \"bankAccount\": {\n \"bankCode\": \"001\",\n \"agencyCode\": \"1234\",\n \"accountNumber\": \"567890\",\n \"accountDigit\": \"0\",\n \"accountType\": \"checking\",\n \"bankName\": \"Bank of America\",\n \"recipientName\": \"John Doe\",\n \"recipientDocument\": \"12345678900\",\n \"routingNumber\": \"021000021\"\n },\n \"softDescriptor\": \"ACME*GADGETS\",\n \"postbackUrl\": \"https://merchant.com/webhooks/merchant-status\",\n \"canAccessDashboard\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://api-global.fastpaybrasil.com/v1/submerchants")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"legalName\": \"ACME Corp\",\n \"tradeName\": \"ACME\",\n \"companyTaxId\": \"12.345.678/0001-99\",\n \"website\": \"https://google.com\",\n \"averageMonthlyRevenue\": 5000,\n \"averageOrderValue\": 100,\n \"productType\": \"digital\",\n \"legalRepresentative\": {\n \"fullName\": \"John Doe\",\n \"dateOfBirth\": \"1980-01-01\",\n \"nationality\": \"United State\",\n \"email\": \"john.doe@example.com\",\n \"motherName\": \"Jane Doe\",\n \"gender\": \"M\",\n \"phones\": [\n {\n \"type\": \"mobile\",\n \"number\": \"5551234\"\n }\n ],\n \"idNumber\": \"1234567890\",\n \"idType\": \"passport\",\n \"issuingCountry\": \"USA\"\n },\n \"contactEmail\": \"contact@merchant.com\",\n \"productDescription\": \"We sell electronic gadgets and accessories.\",\n \"address\": {\n \"addressLine1\": \"123 Main St\",\n \"addressLine2\": \"Apt 1\",\n \"neighborhood\": \"Downtown\",\n \"city\": \"New York\",\n \"state\": \"CA\",\n \"country\": \"USA\",\n \"postalCode\": \"12345\"\n },\n \"phones\": [\n {\n \"type\": \"mobile\",\n \"number\": \"5551234\"\n }\n ],\n \"bankAccount\": {\n \"bankCode\": \"001\",\n \"agencyCode\": \"1234\",\n \"accountNumber\": \"567890\",\n \"accountDigit\": \"0\",\n \"accountType\": \"checking\",\n \"bankName\": \"Bank of America\",\n \"recipientName\": \"John Doe\",\n \"recipientDocument\": \"12345678900\",\n \"routingNumber\": \"021000021\"\n },\n \"softDescriptor\": \"ACME*GADGETS\",\n \"postbackUrl\": \"https://merchant.com/webhooks/merchant-status\",\n \"canAccessDashboard\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-global.fastpaybrasil.com/v1/submerchants")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"legalName\": \"ACME Corp\",\n \"tradeName\": \"ACME\",\n \"companyTaxId\": \"12.345.678/0001-99\",\n \"website\": \"https://google.com\",\n \"averageMonthlyRevenue\": 5000,\n \"averageOrderValue\": 100,\n \"productType\": \"digital\",\n \"legalRepresentative\": {\n \"fullName\": \"John Doe\",\n \"dateOfBirth\": \"1980-01-01\",\n \"nationality\": \"United State\",\n \"email\": \"john.doe@example.com\",\n \"motherName\": \"Jane Doe\",\n \"gender\": \"M\",\n \"phones\": [\n {\n \"type\": \"mobile\",\n \"number\": \"5551234\"\n }\n ],\n \"idNumber\": \"1234567890\",\n \"idType\": \"passport\",\n \"issuingCountry\": \"USA\"\n },\n \"contactEmail\": \"contact@merchant.com\",\n \"productDescription\": \"We sell electronic gadgets and accessories.\",\n \"address\": {\n \"addressLine1\": \"123 Main St\",\n \"addressLine2\": \"Apt 1\",\n \"neighborhood\": \"Downtown\",\n \"city\": \"New York\",\n \"state\": \"CA\",\n \"country\": \"USA\",\n \"postalCode\": \"12345\"\n },\n \"phones\": [\n {\n \"type\": \"mobile\",\n \"number\": \"5551234\"\n }\n ],\n \"bankAccount\": {\n \"bankCode\": \"001\",\n \"agencyCode\": \"1234\",\n \"accountNumber\": \"567890\",\n \"accountDigit\": \"0\",\n \"accountType\": \"checking\",\n \"bankName\": \"Bank of America\",\n \"recipientName\": \"John Doe\",\n \"recipientDocument\": \"12345678900\",\n \"routingNumber\": \"021000021\"\n },\n \"softDescriptor\": \"ACME*GADGETS\",\n \"postbackUrl\": \"https://merchant.com/webhooks/merchant-status\",\n \"canAccessDashboard\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "2vorkDcXyvzifL63YX09S9VqcnI"
}{
"statusCode": 401,
"message": "Unauthorized"
}{
"statusCode": 403,
"message": "Forbidden"
}{
"statusCode": 422,
"error": "Unprocessable Entity",
"message": "The items list contains one of more items with invalid type."
}{
"statusCode": 500,
"message": "Internal server error"
}Authorizations
HTTP Basic authentication. Use your secret key as the username and an empty string as password. The API key should be base64 encoded in the format 'username:' when sending the Authorization header.
Body
The legal name of the merchant.
"ACME Corp"
The trade name of the merchant.
"ACME"
The tax identification number of the merchant.
"12.345.678/0001-99"
The website URL of the merchant.
"https://google.com"
The average monthly revenue of the merchant.
5000
The average order value of the merchant.
100
The type of products sold by the merchant.
digital, physical, both "digital"
Show child attributes
Show child attributes
The contact email of the merchant.
"contact@merchant.com"
A brief description of the products or services offered by the merchant.
"We sell electronic gadgets and accessories."
The address of the merchant.
Show child attributes
Show child attributes
List of phone numbers for the merchant.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
The soft descriptor that will appear on customers' credit card statements.
40"ACME*GADGETS"
Optional URL to receive a webhook notification when the merchant approval status changes.
"https://merchant.com/webhooks/merchant-status"
Defines if the merchant can access the dashboard.
true
Required when canAccessDashboard is true.
Show child attributes
Show child attributes
Response
The charge has been successfully created
The unique identifier of the created charge
"2vorkDcXyvzifL63YX09S9VqcnI"