curl --request POST \
--url https://api.malga.io/v1/merchants \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--header 'X-Client-Id: <api-key>' \
--data '
{
"mcc": "4040",
"status": true,
"providers": [
{
"name": "PagSeguro",
"priority": 1,
"credentials": {
"type": "PAGSEGURO",
"token": "1B2B32530CA24641324AB63843240F5633",
"email": "email@gmail.com"
},
"acquirer": {
"merchantId": "1111111111",
"bin": [
{
"brand": "Mastercard",
"value": "550259",
"merchantId": "2222222222"
},
{
"brand": "Visa",
"value": "448768",
"merchantId": "3333333333"
}
]
}
}
]
}
'import requests
url = "https://api.malga.io/v1/merchants"
payload = {
"mcc": "4040",
"status": True,
"providers": [
{
"name": "PagSeguro",
"priority": 1,
"credentials": {
"type": "PAGSEGURO",
"token": "1B2B32530CA24641324AB63843240F5633",
"email": "email@gmail.com"
},
"acquirer": {
"merchantId": "1111111111",
"bin": [
{
"brand": "Mastercard",
"value": "550259",
"merchantId": "2222222222"
},
{
"brand": "Visa",
"value": "448768",
"merchantId": "3333333333"
}
]
}
}
]
}
headers = {
"X-Client-Id": "<api-key>",
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Client-Id': '<api-key>',
'X-Api-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
mcc: '4040',
status: true,
providers: [
{
name: 'PagSeguro',
priority: 1,
credentials: {
type: 'PAGSEGURO',
token: '1B2B32530CA24641324AB63843240F5633',
email: 'email@gmail.com'
},
acquirer: {
merchantId: '1111111111',
bin: [
{brand: 'Mastercard', value: '550259', merchantId: '2222222222'},
{brand: 'Visa', value: '448768', merchantId: '3333333333'}
]
}
}
]
})
};
fetch('https://api.malga.io/v1/merchants', 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.malga.io/v1/merchants",
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([
'mcc' => '4040',
'status' => true,
'providers' => [
[
'name' => 'PagSeguro',
'priority' => 1,
'credentials' => [
'type' => 'PAGSEGURO',
'token' => '1B2B32530CA24641324AB63843240F5633',
'email' => 'email@gmail.com'
],
'acquirer' => [
'merchantId' => '1111111111',
'bin' => [
[
'brand' => 'Mastercard',
'value' => '550259',
'merchantId' => '2222222222'
],
[
'brand' => 'Visa',
'value' => '448768',
'merchantId' => '3333333333'
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>",
"X-Client-Id: <api-key>"
],
]);
$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.malga.io/v1/merchants"
payload := strings.NewReader("{\n \"mcc\": \"4040\",\n \"status\": true,\n \"providers\": [\n {\n \"name\": \"PagSeguro\",\n \"priority\": 1,\n \"credentials\": {\n \"type\": \"PAGSEGURO\",\n \"token\": \"1B2B32530CA24641324AB63843240F5633\",\n \"email\": \"email@gmail.com\"\n },\n \"acquirer\": {\n \"merchantId\": \"1111111111\",\n \"bin\": [\n {\n \"brand\": \"Mastercard\",\n \"value\": \"550259\",\n \"merchantId\": \"2222222222\"\n },\n {\n \"brand\": \"Visa\",\n \"value\": \"448768\",\n \"merchantId\": \"3333333333\"\n }\n ]\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Client-Id", "<api-key>")
req.Header.Add("X-Api-Key", "<api-key>")
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.malga.io/v1/merchants")
.header("X-Client-Id", "<api-key>")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"mcc\": \"4040\",\n \"status\": true,\n \"providers\": [\n {\n \"name\": \"PagSeguro\",\n \"priority\": 1,\n \"credentials\": {\n \"type\": \"PAGSEGURO\",\n \"token\": \"1B2B32530CA24641324AB63843240F5633\",\n \"email\": \"email@gmail.com\"\n },\n \"acquirer\": {\n \"merchantId\": \"1111111111\",\n \"bin\": [\n {\n \"brand\": \"Mastercard\",\n \"value\": \"550259\",\n \"merchantId\": \"2222222222\"\n },\n {\n \"brand\": \"Visa\",\n \"value\": \"448768\",\n \"merchantId\": \"3333333333\"\n }\n ]\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.malga.io/v1/merchants")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Client-Id"] = '<api-key>'
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mcc\": \"4040\",\n \"status\": true,\n \"providers\": [\n {\n \"name\": \"PagSeguro\",\n \"priority\": 1,\n \"credentials\": {\n \"type\": \"PAGSEGURO\",\n \"token\": \"1B2B32530CA24641324AB63843240F5633\",\n \"email\": \"email@gmail.com\"\n },\n \"acquirer\": {\n \"merchantId\": \"1111111111\",\n \"bin\": [\n {\n \"brand\": \"Mastercard\",\n \"value\": \"550259\",\n \"merchantId\": \"2222222222\"\n },\n {\n \"brand\": \"Visa\",\n \"value\": \"448768\",\n \"merchantId\": \"3333333333\"\n }\n ]\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "69aea152-ba70-49a3-a31c-044ac1651146",
"updatedAt": "2021-03-12T15:57:20.239Z",
"createdAt": "2021-03-12T15:57:20.239Z",
"clientId": "523afbe7-36dc-4654-9dba-e7167d0e5e2d",
"mcc": "4040",
"status": true,
"platformFeeEnabled": true,
"platformFees": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"paymentMethod": "credit",
"percentage": 2.5,
"fixedAmount": null,
"installment": null,
"createdAt": "2021-03-12T15:57:20.239Z",
"updatedAt": "2021-03-12T15:57:20.239Z"
},
{
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"paymentMethod": "pix",
"percentage": null,
"fixedAmount": 50,
"installment": null,
"createdAt": "2021-03-12T15:57:20.239Z",
"updatedAt": "2021-03-12T15:57:20.239Z"
}
],
"providers": [
{
"id": "72cc1ff1-5f6e-4eb2-9cc5-6a3a85525e4b",
"updatedAt": "2021-03-12T15:57:20.239Z",
"createdAt": "2021-03-12T15:57:20.239Z",
"name": "PagSeguro",
"priority": 1,
"credentials": {
"type": "PAGSEGURO",
"token": "1B2B32530CA23412AB63843240F5633",
"email": "email@gmail.com"
},
"acquirer": {
"merchantId": "1111111111",
"bin": [
{
"brand": "Mastercard",
"value": "550259",
"merchantId": "2222222222"
},
{
"brand": "Visa",
"value": "448768",
"merchantId": "3333333333"
}
]
}
}
]
}Criação de novo merchant para cobrança
curl --request POST \
--url https://api.malga.io/v1/merchants \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--header 'X-Client-Id: <api-key>' \
--data '
{
"mcc": "4040",
"status": true,
"providers": [
{
"name": "PagSeguro",
"priority": 1,
"credentials": {
"type": "PAGSEGURO",
"token": "1B2B32530CA24641324AB63843240F5633",
"email": "email@gmail.com"
},
"acquirer": {
"merchantId": "1111111111",
"bin": [
{
"brand": "Mastercard",
"value": "550259",
"merchantId": "2222222222"
},
{
"brand": "Visa",
"value": "448768",
"merchantId": "3333333333"
}
]
}
}
]
}
'import requests
url = "https://api.malga.io/v1/merchants"
payload = {
"mcc": "4040",
"status": True,
"providers": [
{
"name": "PagSeguro",
"priority": 1,
"credentials": {
"type": "PAGSEGURO",
"token": "1B2B32530CA24641324AB63843240F5633",
"email": "email@gmail.com"
},
"acquirer": {
"merchantId": "1111111111",
"bin": [
{
"brand": "Mastercard",
"value": "550259",
"merchantId": "2222222222"
},
{
"brand": "Visa",
"value": "448768",
"merchantId": "3333333333"
}
]
}
}
]
}
headers = {
"X-Client-Id": "<api-key>",
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Client-Id': '<api-key>',
'X-Api-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
mcc: '4040',
status: true,
providers: [
{
name: 'PagSeguro',
priority: 1,
credentials: {
type: 'PAGSEGURO',
token: '1B2B32530CA24641324AB63843240F5633',
email: 'email@gmail.com'
},
acquirer: {
merchantId: '1111111111',
bin: [
{brand: 'Mastercard', value: '550259', merchantId: '2222222222'},
{brand: 'Visa', value: '448768', merchantId: '3333333333'}
]
}
}
]
})
};
fetch('https://api.malga.io/v1/merchants', 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.malga.io/v1/merchants",
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([
'mcc' => '4040',
'status' => true,
'providers' => [
[
'name' => 'PagSeguro',
'priority' => 1,
'credentials' => [
'type' => 'PAGSEGURO',
'token' => '1B2B32530CA24641324AB63843240F5633',
'email' => 'email@gmail.com'
],
'acquirer' => [
'merchantId' => '1111111111',
'bin' => [
[
'brand' => 'Mastercard',
'value' => '550259',
'merchantId' => '2222222222'
],
[
'brand' => 'Visa',
'value' => '448768',
'merchantId' => '3333333333'
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>",
"X-Client-Id: <api-key>"
],
]);
$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.malga.io/v1/merchants"
payload := strings.NewReader("{\n \"mcc\": \"4040\",\n \"status\": true,\n \"providers\": [\n {\n \"name\": \"PagSeguro\",\n \"priority\": 1,\n \"credentials\": {\n \"type\": \"PAGSEGURO\",\n \"token\": \"1B2B32530CA24641324AB63843240F5633\",\n \"email\": \"email@gmail.com\"\n },\n \"acquirer\": {\n \"merchantId\": \"1111111111\",\n \"bin\": [\n {\n \"brand\": \"Mastercard\",\n \"value\": \"550259\",\n \"merchantId\": \"2222222222\"\n },\n {\n \"brand\": \"Visa\",\n \"value\": \"448768\",\n \"merchantId\": \"3333333333\"\n }\n ]\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Client-Id", "<api-key>")
req.Header.Add("X-Api-Key", "<api-key>")
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.malga.io/v1/merchants")
.header("X-Client-Id", "<api-key>")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"mcc\": \"4040\",\n \"status\": true,\n \"providers\": [\n {\n \"name\": \"PagSeguro\",\n \"priority\": 1,\n \"credentials\": {\n \"type\": \"PAGSEGURO\",\n \"token\": \"1B2B32530CA24641324AB63843240F5633\",\n \"email\": \"email@gmail.com\"\n },\n \"acquirer\": {\n \"merchantId\": \"1111111111\",\n \"bin\": [\n {\n \"brand\": \"Mastercard\",\n \"value\": \"550259\",\n \"merchantId\": \"2222222222\"\n },\n {\n \"brand\": \"Visa\",\n \"value\": \"448768\",\n \"merchantId\": \"3333333333\"\n }\n ]\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.malga.io/v1/merchants")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Client-Id"] = '<api-key>'
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mcc\": \"4040\",\n \"status\": true,\n \"providers\": [\n {\n \"name\": \"PagSeguro\",\n \"priority\": 1,\n \"credentials\": {\n \"type\": \"PAGSEGURO\",\n \"token\": \"1B2B32530CA24641324AB63843240F5633\",\n \"email\": \"email@gmail.com\"\n },\n \"acquirer\": {\n \"merchantId\": \"1111111111\",\n \"bin\": [\n {\n \"brand\": \"Mastercard\",\n \"value\": \"550259\",\n \"merchantId\": \"2222222222\"\n },\n {\n \"brand\": \"Visa\",\n \"value\": \"448768\",\n \"merchantId\": \"3333333333\"\n }\n ]\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "69aea152-ba70-49a3-a31c-044ac1651146",
"updatedAt": "2021-03-12T15:57:20.239Z",
"createdAt": "2021-03-12T15:57:20.239Z",
"clientId": "523afbe7-36dc-4654-9dba-e7167d0e5e2d",
"mcc": "4040",
"status": true,
"platformFeeEnabled": true,
"platformFees": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"paymentMethod": "credit",
"percentage": 2.5,
"fixedAmount": null,
"installment": null,
"createdAt": "2021-03-12T15:57:20.239Z",
"updatedAt": "2021-03-12T15:57:20.239Z"
},
{
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"paymentMethod": "pix",
"percentage": null,
"fixedAmount": 50,
"installment": null,
"createdAt": "2021-03-12T15:57:20.239Z",
"updatedAt": "2021-03-12T15:57:20.239Z"
}
],
"providers": [
{
"id": "72cc1ff1-5f6e-4eb2-9cc5-6a3a85525e4b",
"updatedAt": "2021-03-12T15:57:20.239Z",
"createdAt": "2021-03-12T15:57:20.239Z",
"name": "PagSeguro",
"priority": 1,
"credentials": {
"type": "PAGSEGURO",
"token": "1B2B32530CA23412AB63843240F5633",
"email": "email@gmail.com"
},
"acquirer": {
"merchantId": "1111111111",
"bin": [
{
"brand": "Mastercard",
"value": "550259",
"merchantId": "2222222222"
},
{
"brand": "Visa",
"value": "448768",
"merchantId": "3333333333"
}
]
}
}
]
}Body
código de segmento do lojista no adquirente, solicite ao seu provedor caso não saiba qual o seu Merchant Category Code.
Nome do merchant que será exibido na Dashboard (Subcontas, Fluxos Inteligentes, etc.)
Nome do merchant que será exibido em caso de desafio no 3DS. Caso esse merchant não use 3DS, esse campo é opcional.
URL do merchant que serve como informativo durante a autenticação 3DS. Caso o merchant não use 3DS, esse campo é opcional.
Show child attributes
Show child attributes
Response
Created
Identificador do merchant
Data de criação
Identificador do client
Código mcc do cadatro do lojista no adquirente
Status do merchant
active, deleted, pending Show child attributes
Show child attributes
Indica se o platform fee está ativo para o merchant
false
Regras de platform fee cadastradas para o merchant
Show child attributes
Show child attributes
Was this page helpful?