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",
"idNumber": "1234567890",
"email": "[email protected]",
"motherName": "Jane Doe",
"gender": "M",
"phones": [
{
"type": "mobile",
"number": "5551234"
}
],
"idType": "passport",
"issuingCountry": "USA"
},
"contactEmail": "[email protected]",
"productDescription": "We sell electronic gadgets and accessories.",
"address": {
"addressLine1": "123 Main St",
"neighborhood": "Downtown",
"city": "New York",
"state": "CA",
"country": "USA",
"postalCode": "12345",
"addressLine2": "Apt 1"
},
"phones": [
{
"type": "mobile",
"number": "5551234"
}
],
"canAccessDashboard": true,
"bankAccount": {
"bankCode": "001",
"agencyCode": "1234",
"accountNumber": "567890",
"accountDigit": "0",
"accountType": "checking",
"bankName": "Bank of America",
"recipientName": "John Doe",
"recipientDocument": "12345678900",
"routingNumber": "021000021"
},
"additionalRepresentatives": [
{
"fullName": "Bruno Sócio",
"dateOfBirth": "1985-05-10",
"nationality": "Brazilian",
"idNumber": "98765432100",
"email": "[email protected]",
"motherName": "Maria Sócio",
"gender": "M",
"phones": [
{
"type": "mobile",
"number": "5551234"
}
],
"idType": "cpf",
"issuingCountry": "BR"
}
],
"softDescriptor": "ACME*GADGETS",
"postbackUrl": "https://merchant.com/webhooks/merchant-status"
}
'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",
"idNumber": "1234567890",
"email": "[email protected]",
"motherName": "Jane Doe",
"gender": "M",
"phones": [
{
"type": "mobile",
"number": "5551234"
}
],
"idType": "passport",
"issuingCountry": "USA"
},
"contactEmail": "[email protected]",
"productDescription": "We sell electronic gadgets and accessories.",
"address": {
"addressLine1": "123 Main St",
"neighborhood": "Downtown",
"city": "New York",
"state": "CA",
"country": "USA",
"postalCode": "12345",
"addressLine2": "Apt 1"
},
"phones": [
{
"type": "mobile",
"number": "5551234"
}
],
"canAccessDashboard": True,
"bankAccount": {
"bankCode": "001",
"agencyCode": "1234",
"accountNumber": "567890",
"accountDigit": "0",
"accountType": "checking",
"bankName": "Bank of America",
"recipientName": "John Doe",
"recipientDocument": "12345678900",
"routingNumber": "021000021"
},
"additionalRepresentatives": [
{
"fullName": "Bruno Sócio",
"dateOfBirth": "1985-05-10",
"nationality": "Brazilian",
"idNumber": "98765432100",
"email": "[email protected]",
"motherName": "Maria Sócio",
"gender": "M",
"phones": [
{
"type": "mobile",
"number": "5551234"
}
],
"idType": "cpf",
"issuingCountry": "BR"
}
],
"softDescriptor": "ACME*GADGETS",
"postbackUrl": "https://merchant.com/webhooks/merchant-status"
}
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',
idNumber: '1234567890',
email: '[email protected]',
motherName: 'Jane Doe',
gender: 'M',
phones: [{type: 'mobile', number: '5551234'}],
idType: 'passport',
issuingCountry: 'USA'
},
contactEmail: '[email protected]',
productDescription: 'We sell electronic gadgets and accessories.',
address: {
addressLine1: '123 Main St',
neighborhood: 'Downtown',
city: 'New York',
state: 'CA',
country: 'USA',
postalCode: '12345',
addressLine2: 'Apt 1'
},
phones: [{type: 'mobile', number: '5551234'}],
canAccessDashboard: true,
bankAccount: {
bankCode: '001',
agencyCode: '1234',
accountNumber: '567890',
accountDigit: '0',
accountType: 'checking',
bankName: 'Bank of America',
recipientName: 'John Doe',
recipientDocument: '12345678900',
routingNumber: '021000021'
},
additionalRepresentatives: [
{
fullName: 'Bruno Sócio',
dateOfBirth: '1985-05-10',
nationality: 'Brazilian',
idNumber: '98765432100',
email: '[email protected]',
motherName: 'Maria Sócio',
gender: 'M',
phones: [{type: 'mobile', number: '5551234'}],
idType: 'cpf',
issuingCountry: 'BR'
}
],
softDescriptor: 'ACME*GADGETS',
postbackUrl: 'https://merchant.com/webhooks/merchant-status'
})
};
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',
'idNumber' => '1234567890',
'email' => '[email protected]',
'motherName' => 'Jane Doe',
'gender' => 'M',
'phones' => [
[
'type' => 'mobile',
'number' => '5551234'
]
],
'idType' => 'passport',
'issuingCountry' => 'USA'
],
'contactEmail' => '[email protected]',
'productDescription' => 'We sell electronic gadgets and accessories.',
'address' => [
'addressLine1' => '123 Main St',
'neighborhood' => 'Downtown',
'city' => 'New York',
'state' => 'CA',
'country' => 'USA',
'postalCode' => '12345',
'addressLine2' => 'Apt 1'
],
'phones' => [
[
'type' => 'mobile',
'number' => '5551234'
]
],
'canAccessDashboard' => true,
'bankAccount' => [
'bankCode' => '001',
'agencyCode' => '1234',
'accountNumber' => '567890',
'accountDigit' => '0',
'accountType' => 'checking',
'bankName' => 'Bank of America',
'recipientName' => 'John Doe',
'recipientDocument' => '12345678900',
'routingNumber' => '021000021'
],
'additionalRepresentatives' => [
[
'fullName' => 'Bruno Sócio',
'dateOfBirth' => '1985-05-10',
'nationality' => 'Brazilian',
'idNumber' => '98765432100',
'email' => '[email protected]',
'motherName' => 'Maria Sócio',
'gender' => 'M',
'phones' => [
[
'type' => 'mobile',
'number' => '5551234'
]
],
'idType' => 'cpf',
'issuingCountry' => 'BR'
]
],
'softDescriptor' => 'ACME*GADGETS',
'postbackUrl' => 'https://merchant.com/webhooks/merchant-status'
]),
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 \"idNumber\": \"1234567890\",\n \"email\": \"[email protected]\",\n \"motherName\": \"Jane Doe\",\n \"gender\": \"M\",\n \"phones\": [\n {\n \"type\": \"mobile\",\n \"number\": \"5551234\"\n }\n ],\n \"idType\": \"passport\",\n \"issuingCountry\": \"USA\"\n },\n \"contactEmail\": \"[email protected]\",\n \"productDescription\": \"We sell electronic gadgets and accessories.\",\n \"address\": {\n \"addressLine1\": \"123 Main St\",\n \"neighborhood\": \"Downtown\",\n \"city\": \"New York\",\n \"state\": \"CA\",\n \"country\": \"USA\",\n \"postalCode\": \"12345\",\n \"addressLine2\": \"Apt 1\"\n },\n \"phones\": [\n {\n \"type\": \"mobile\",\n \"number\": \"5551234\"\n }\n ],\n \"canAccessDashboard\": true,\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 \"additionalRepresentatives\": [\n {\n \"fullName\": \"Bruno Sócio\",\n \"dateOfBirth\": \"1985-05-10\",\n \"nationality\": \"Brazilian\",\n \"idNumber\": \"98765432100\",\n \"email\": \"[email protected]\",\n \"motherName\": \"Maria Sócio\",\n \"gender\": \"M\",\n \"phones\": [\n {\n \"type\": \"mobile\",\n \"number\": \"5551234\"\n }\n ],\n \"idType\": \"cpf\",\n \"issuingCountry\": \"BR\"\n }\n ],\n \"softDescriptor\": \"ACME*GADGETS\",\n \"postbackUrl\": \"https://merchant.com/webhooks/merchant-status\"\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 \"idNumber\": \"1234567890\",\n \"email\": \"[email protected]\",\n \"motherName\": \"Jane Doe\",\n \"gender\": \"M\",\n \"phones\": [\n {\n \"type\": \"mobile\",\n \"number\": \"5551234\"\n }\n ],\n \"idType\": \"passport\",\n \"issuingCountry\": \"USA\"\n },\n \"contactEmail\": \"[email protected]\",\n \"productDescription\": \"We sell electronic gadgets and accessories.\",\n \"address\": {\n \"addressLine1\": \"123 Main St\",\n \"neighborhood\": \"Downtown\",\n \"city\": \"New York\",\n \"state\": \"CA\",\n \"country\": \"USA\",\n \"postalCode\": \"12345\",\n \"addressLine2\": \"Apt 1\"\n },\n \"phones\": [\n {\n \"type\": \"mobile\",\n \"number\": \"5551234\"\n }\n ],\n \"canAccessDashboard\": true,\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 \"additionalRepresentatives\": [\n {\n \"fullName\": \"Bruno Sócio\",\n \"dateOfBirth\": \"1985-05-10\",\n \"nationality\": \"Brazilian\",\n \"idNumber\": \"98765432100\",\n \"email\": \"[email protected]\",\n \"motherName\": \"Maria Sócio\",\n \"gender\": \"M\",\n \"phones\": [\n {\n \"type\": \"mobile\",\n \"number\": \"5551234\"\n }\n ],\n \"idType\": \"cpf\",\n \"issuingCountry\": \"BR\"\n }\n ],\n \"softDescriptor\": \"ACME*GADGETS\",\n \"postbackUrl\": \"https://merchant.com/webhooks/merchant-status\"\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 \"idNumber\": \"1234567890\",\n \"email\": \"[email protected]\",\n \"motherName\": \"Jane Doe\",\n \"gender\": \"M\",\n \"phones\": [\n {\n \"type\": \"mobile\",\n \"number\": \"5551234\"\n }\n ],\n \"idType\": \"passport\",\n \"issuingCountry\": \"USA\"\n },\n \"contactEmail\": \"[email protected]\",\n \"productDescription\": \"We sell electronic gadgets and accessories.\",\n \"address\": {\n \"addressLine1\": \"123 Main St\",\n \"neighborhood\": \"Downtown\",\n \"city\": \"New York\",\n \"state\": \"CA\",\n \"country\": \"USA\",\n \"postalCode\": \"12345\",\n \"addressLine2\": \"Apt 1\"\n },\n \"phones\": [\n {\n \"type\": \"mobile\",\n \"number\": \"5551234\"\n }\n ],\n \"canAccessDashboard\": true,\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 \"additionalRepresentatives\": [\n {\n \"fullName\": \"Bruno Sócio\",\n \"dateOfBirth\": \"1985-05-10\",\n \"nationality\": \"Brazilian\",\n \"idNumber\": \"98765432100\",\n \"email\": \"[email protected]\",\n \"motherName\": \"Maria Sócio\",\n \"gender\": \"M\",\n \"phones\": [\n {\n \"type\": \"mobile\",\n \"number\": \"5551234\"\n }\n ],\n \"idType\": \"cpf\",\n \"issuingCountry\": \"BR\"\n }\n ],\n \"softDescriptor\": \"ACME*GADGETS\",\n \"postbackUrl\": \"https://merchant.com/webhooks/merchant-status\"\n}"
response = http.request(request)
puts response.read_body{
"id": "2vorkDcXyvzifL63YX09S9VqcnI",
"legalRepresentatives": [
{
"id": "2vorkEaaaBbbCccDddEeeFffGgg",
"fullName": "Ana Principal",
"isPrimary": true
},
{
"id": "2vorkEbbbCccDddEeeFffGggHhh",
"fullName": "Bruno Sócio",
"isPrimary": false
}
]
}{
"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",
"idNumber": "1234567890",
"email": "[email protected]",
"motherName": "Jane Doe",
"gender": "M",
"phones": [
{
"type": "mobile",
"number": "5551234"
}
],
"idType": "passport",
"issuingCountry": "USA"
},
"contactEmail": "[email protected]",
"productDescription": "We sell electronic gadgets and accessories.",
"address": {
"addressLine1": "123 Main St",
"neighborhood": "Downtown",
"city": "New York",
"state": "CA",
"country": "USA",
"postalCode": "12345",
"addressLine2": "Apt 1"
},
"phones": [
{
"type": "mobile",
"number": "5551234"
}
],
"canAccessDashboard": true,
"bankAccount": {
"bankCode": "001",
"agencyCode": "1234",
"accountNumber": "567890",
"accountDigit": "0",
"accountType": "checking",
"bankName": "Bank of America",
"recipientName": "John Doe",
"recipientDocument": "12345678900",
"routingNumber": "021000021"
},
"additionalRepresentatives": [
{
"fullName": "Bruno Sócio",
"dateOfBirth": "1985-05-10",
"nationality": "Brazilian",
"idNumber": "98765432100",
"email": "[email protected]",
"motherName": "Maria Sócio",
"gender": "M",
"phones": [
{
"type": "mobile",
"number": "5551234"
}
],
"idType": "cpf",
"issuingCountry": "BR"
}
],
"softDescriptor": "ACME*GADGETS",
"postbackUrl": "https://merchant.com/webhooks/merchant-status"
}
'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",
"idNumber": "1234567890",
"email": "[email protected]",
"motherName": "Jane Doe",
"gender": "M",
"phones": [
{
"type": "mobile",
"number": "5551234"
}
],
"idType": "passport",
"issuingCountry": "USA"
},
"contactEmail": "[email protected]",
"productDescription": "We sell electronic gadgets and accessories.",
"address": {
"addressLine1": "123 Main St",
"neighborhood": "Downtown",
"city": "New York",
"state": "CA",
"country": "USA",
"postalCode": "12345",
"addressLine2": "Apt 1"
},
"phones": [
{
"type": "mobile",
"number": "5551234"
}
],
"canAccessDashboard": True,
"bankAccount": {
"bankCode": "001",
"agencyCode": "1234",
"accountNumber": "567890",
"accountDigit": "0",
"accountType": "checking",
"bankName": "Bank of America",
"recipientName": "John Doe",
"recipientDocument": "12345678900",
"routingNumber": "021000021"
},
"additionalRepresentatives": [
{
"fullName": "Bruno Sócio",
"dateOfBirth": "1985-05-10",
"nationality": "Brazilian",
"idNumber": "98765432100",
"email": "[email protected]",
"motherName": "Maria Sócio",
"gender": "M",
"phones": [
{
"type": "mobile",
"number": "5551234"
}
],
"idType": "cpf",
"issuingCountry": "BR"
}
],
"softDescriptor": "ACME*GADGETS",
"postbackUrl": "https://merchant.com/webhooks/merchant-status"
}
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',
idNumber: '1234567890',
email: '[email protected]',
motherName: 'Jane Doe',
gender: 'M',
phones: [{type: 'mobile', number: '5551234'}],
idType: 'passport',
issuingCountry: 'USA'
},
contactEmail: '[email protected]',
productDescription: 'We sell electronic gadgets and accessories.',
address: {
addressLine1: '123 Main St',
neighborhood: 'Downtown',
city: 'New York',
state: 'CA',
country: 'USA',
postalCode: '12345',
addressLine2: 'Apt 1'
},
phones: [{type: 'mobile', number: '5551234'}],
canAccessDashboard: true,
bankAccount: {
bankCode: '001',
agencyCode: '1234',
accountNumber: '567890',
accountDigit: '0',
accountType: 'checking',
bankName: 'Bank of America',
recipientName: 'John Doe',
recipientDocument: '12345678900',
routingNumber: '021000021'
},
additionalRepresentatives: [
{
fullName: 'Bruno Sócio',
dateOfBirth: '1985-05-10',
nationality: 'Brazilian',
idNumber: '98765432100',
email: '[email protected]',
motherName: 'Maria Sócio',
gender: 'M',
phones: [{type: 'mobile', number: '5551234'}],
idType: 'cpf',
issuingCountry: 'BR'
}
],
softDescriptor: 'ACME*GADGETS',
postbackUrl: 'https://merchant.com/webhooks/merchant-status'
})
};
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',
'idNumber' => '1234567890',
'email' => '[email protected]',
'motherName' => 'Jane Doe',
'gender' => 'M',
'phones' => [
[
'type' => 'mobile',
'number' => '5551234'
]
],
'idType' => 'passport',
'issuingCountry' => 'USA'
],
'contactEmail' => '[email protected]',
'productDescription' => 'We sell electronic gadgets and accessories.',
'address' => [
'addressLine1' => '123 Main St',
'neighborhood' => 'Downtown',
'city' => 'New York',
'state' => 'CA',
'country' => 'USA',
'postalCode' => '12345',
'addressLine2' => 'Apt 1'
],
'phones' => [
[
'type' => 'mobile',
'number' => '5551234'
]
],
'canAccessDashboard' => true,
'bankAccount' => [
'bankCode' => '001',
'agencyCode' => '1234',
'accountNumber' => '567890',
'accountDigit' => '0',
'accountType' => 'checking',
'bankName' => 'Bank of America',
'recipientName' => 'John Doe',
'recipientDocument' => '12345678900',
'routingNumber' => '021000021'
],
'additionalRepresentatives' => [
[
'fullName' => 'Bruno Sócio',
'dateOfBirth' => '1985-05-10',
'nationality' => 'Brazilian',
'idNumber' => '98765432100',
'email' => '[email protected]',
'motherName' => 'Maria Sócio',
'gender' => 'M',
'phones' => [
[
'type' => 'mobile',
'number' => '5551234'
]
],
'idType' => 'cpf',
'issuingCountry' => 'BR'
]
],
'softDescriptor' => 'ACME*GADGETS',
'postbackUrl' => 'https://merchant.com/webhooks/merchant-status'
]),
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 \"idNumber\": \"1234567890\",\n \"email\": \"[email protected]\",\n \"motherName\": \"Jane Doe\",\n \"gender\": \"M\",\n \"phones\": [\n {\n \"type\": \"mobile\",\n \"number\": \"5551234\"\n }\n ],\n \"idType\": \"passport\",\n \"issuingCountry\": \"USA\"\n },\n \"contactEmail\": \"[email protected]\",\n \"productDescription\": \"We sell electronic gadgets and accessories.\",\n \"address\": {\n \"addressLine1\": \"123 Main St\",\n \"neighborhood\": \"Downtown\",\n \"city\": \"New York\",\n \"state\": \"CA\",\n \"country\": \"USA\",\n \"postalCode\": \"12345\",\n \"addressLine2\": \"Apt 1\"\n },\n \"phones\": [\n {\n \"type\": \"mobile\",\n \"number\": \"5551234\"\n }\n ],\n \"canAccessDashboard\": true,\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 \"additionalRepresentatives\": [\n {\n \"fullName\": \"Bruno Sócio\",\n \"dateOfBirth\": \"1985-05-10\",\n \"nationality\": \"Brazilian\",\n \"idNumber\": \"98765432100\",\n \"email\": \"[email protected]\",\n \"motherName\": \"Maria Sócio\",\n \"gender\": \"M\",\n \"phones\": [\n {\n \"type\": \"mobile\",\n \"number\": \"5551234\"\n }\n ],\n \"idType\": \"cpf\",\n \"issuingCountry\": \"BR\"\n }\n ],\n \"softDescriptor\": \"ACME*GADGETS\",\n \"postbackUrl\": \"https://merchant.com/webhooks/merchant-status\"\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 \"idNumber\": \"1234567890\",\n \"email\": \"[email protected]\",\n \"motherName\": \"Jane Doe\",\n \"gender\": \"M\",\n \"phones\": [\n {\n \"type\": \"mobile\",\n \"number\": \"5551234\"\n }\n ],\n \"idType\": \"passport\",\n \"issuingCountry\": \"USA\"\n },\n \"contactEmail\": \"[email protected]\",\n \"productDescription\": \"We sell electronic gadgets and accessories.\",\n \"address\": {\n \"addressLine1\": \"123 Main St\",\n \"neighborhood\": \"Downtown\",\n \"city\": \"New York\",\n \"state\": \"CA\",\n \"country\": \"USA\",\n \"postalCode\": \"12345\",\n \"addressLine2\": \"Apt 1\"\n },\n \"phones\": [\n {\n \"type\": \"mobile\",\n \"number\": \"5551234\"\n }\n ],\n \"canAccessDashboard\": true,\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 \"additionalRepresentatives\": [\n {\n \"fullName\": \"Bruno Sócio\",\n \"dateOfBirth\": \"1985-05-10\",\n \"nationality\": \"Brazilian\",\n \"idNumber\": \"98765432100\",\n \"email\": \"[email protected]\",\n \"motherName\": \"Maria Sócio\",\n \"gender\": \"M\",\n \"phones\": [\n {\n \"type\": \"mobile\",\n \"number\": \"5551234\"\n }\n ],\n \"idType\": \"cpf\",\n \"issuingCountry\": \"BR\"\n }\n ],\n \"softDescriptor\": \"ACME*GADGETS\",\n \"postbackUrl\": \"https://merchant.com/webhooks/merchant-status\"\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 \"idNumber\": \"1234567890\",\n \"email\": \"[email protected]\",\n \"motherName\": \"Jane Doe\",\n \"gender\": \"M\",\n \"phones\": [\n {\n \"type\": \"mobile\",\n \"number\": \"5551234\"\n }\n ],\n \"idType\": \"passport\",\n \"issuingCountry\": \"USA\"\n },\n \"contactEmail\": \"[email protected]\",\n \"productDescription\": \"We sell electronic gadgets and accessories.\",\n \"address\": {\n \"addressLine1\": \"123 Main St\",\n \"neighborhood\": \"Downtown\",\n \"city\": \"New York\",\n \"state\": \"CA\",\n \"country\": \"USA\",\n \"postalCode\": \"12345\",\n \"addressLine2\": \"Apt 1\"\n },\n \"phones\": [\n {\n \"type\": \"mobile\",\n \"number\": \"5551234\"\n }\n ],\n \"canAccessDashboard\": true,\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 \"additionalRepresentatives\": [\n {\n \"fullName\": \"Bruno Sócio\",\n \"dateOfBirth\": \"1985-05-10\",\n \"nationality\": \"Brazilian\",\n \"idNumber\": \"98765432100\",\n \"email\": \"[email protected]\",\n \"motherName\": \"Maria Sócio\",\n \"gender\": \"M\",\n \"phones\": [\n {\n \"type\": \"mobile\",\n \"number\": \"5551234\"\n }\n ],\n \"idType\": \"cpf\",\n \"issuingCountry\": \"BR\"\n }\n ],\n \"softDescriptor\": \"ACME*GADGETS\",\n \"postbackUrl\": \"https://merchant.com/webhooks/merchant-status\"\n}"
response = http.request(request)
puts response.read_body{
"id": "2vorkDcXyvzifL63YX09S9VqcnI",
"legalRepresentatives": [
{
"id": "2vorkEaaaBbbCccDddEeeFffGgg",
"fullName": "Ana Principal",
"isPrimary": true
},
{
"id": "2vorkEbbbCccDddEeeFffGggHhh",
"fullName": "Bruno Sócio",
"isPrimary": false
}
]
}{
"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.
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
Defines if the merchant can access the dashboard.
true
Show child attributes
Show child attributes
Sócios adicionais da empresa (opcional). Cada item tem o mesmo formato
do objeto legalRepresentative. O legalRepresentative continua obrigatório
e é sempre o representante legal da subconta; os adicionais são
cadastrados como sócios não-representantes.
Os documentos dos sócios não vão neste corpo — após a criação, use os
id retornados em legalRepresentatives (resposta) para vincular o upload
de documentos de cada sócio via token de upload.
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"
Required when canAccessDashboard is true.
Show child attributes
Show child attributes
Response
The charge has been successfully created
The unique identifier of the created submerchant
"2vorkDcXyvzifL63YX09S9VqcnI"
Representantes criados — o principal primeiro (isPrimary: true) e
depois os sócios adicionais na ordem enviada. Use os id dos itens com
isPrimary: false para vincular o upload de documentos de cada sócio.
Show child attributes
Show child attributes