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"
}
]
}
}
]
}
'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));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))
}{
"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
Cria uma nova subconta (merchant) vinculada ao X-Client-Id informado no header.
O campo status indica o estado da subconta: true para ativa e false para inativa. É opcional — quando omitido, a subconta é criada como ativa.
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"
}
]
}
}
]
}
'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));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))
}{
"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.
Indica se a subconta está ativa (true) ou inativa (false). Campo opcional — quando omitido, a subconta é criada como ativa.
true
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
Indica se a subconta está ativa (true) ou inativa (false).
true
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?