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": "E7A789A98981048DEDBA6E4B823254EEE3",
"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: 'E7A789A98981048DEDBA6E4B823254EEE3',
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\": \"E7A789A98981048DEDBA6E4B823254EEE3\",\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": "9b4f66f3-d45d-4946-b719-48f43fb90c52",
"updatedAt": "2021-03-12T15:57:20.239Z",
"createdAt": "2021-03-12T15:57:20.239Z",
"clientId": "1b2c2ef7-03cd-4012-9d1c-aff50551fae3",
"mcc": "4040",
"status": true,
"platformFeeEnabled": true,
"platformFees": [
{
"id": "74739f85-1bfa-40ae-a003-1c464c8e3c94",
"paymentMethod": "credit",
"percentage": 2.5,
"fixedAmount": null,
"installment": null,
"createdAt": "2021-03-12T15:57:20.239Z",
"updatedAt": "2021-03-12T15:57:20.239Z"
},
{
"id": "0bb96a26-fc53-405c-8e3a-21762913f1a0",
"paymentMethod": "pix",
"percentage": null,
"fixedAmount": 50,
"installment": null,
"createdAt": "2021-03-12T15:57:20.239Z",
"updatedAt": "2021-03-12T15:57:20.239Z"
}
],
"providers": [
{
"id": "cb39fc36-8c4b-4deb-b0c1-2fdd8db2e1ab",
"updatedAt": "2021-03-12T15:57:20.239Z",
"createdAt": "2021-03-12T15:57:20.239Z",
"name": "PagSeguro",
"priority": 1,
"credentials": {
"type": "PAGSEGURO",
"token": "88502FE6602826D6CB38AE64B1419AC",
"email": "email@gmail.com"
},
"acquirer": {
"merchantId": "1111111111",
"bin": [
{
"brand": "Mastercard",
"value": "550259",
"merchantId": "2222222222"
},
{
"brand": "Visa",
"value": "448768",
"merchantId": "3333333333"
}
]
}
}
]
}Merchants
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.
POST
/
v1
/
merchants
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": "E7A789A98981048DEDBA6E4B823254EEE3",
"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: 'E7A789A98981048DEDBA6E4B823254EEE3',
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\": \"E7A789A98981048DEDBA6E4B823254EEE3\",\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": "9b4f66f3-d45d-4946-b719-48f43fb90c52",
"updatedAt": "2021-03-12T15:57:20.239Z",
"createdAt": "2021-03-12T15:57:20.239Z",
"clientId": "1b2c2ef7-03cd-4012-9d1c-aff50551fae3",
"mcc": "4040",
"status": true,
"platformFeeEnabled": true,
"platformFees": [
{
"id": "74739f85-1bfa-40ae-a003-1c464c8e3c94",
"paymentMethod": "credit",
"percentage": 2.5,
"fixedAmount": null,
"installment": null,
"createdAt": "2021-03-12T15:57:20.239Z",
"updatedAt": "2021-03-12T15:57:20.239Z"
},
{
"id": "0bb96a26-fc53-405c-8e3a-21762913f1a0",
"paymentMethod": "pix",
"percentage": null,
"fixedAmount": 50,
"installment": null,
"createdAt": "2021-03-12T15:57:20.239Z",
"updatedAt": "2021-03-12T15:57:20.239Z"
}
],
"providers": [
{
"id": "cb39fc36-8c4b-4deb-b0c1-2fdd8db2e1ab",
"updatedAt": "2021-03-12T15:57:20.239Z",
"createdAt": "2021-03-12T15:57:20.239Z",
"name": "PagSeguro",
"priority": 1,
"credentials": {
"type": "PAGSEGURO",
"token": "88502FE6602826D6CB38AE64B1419AC",
"email": "email@gmail.com"
},
"acquirer": {
"merchantId": "1111111111",
"bin": [
{
"brand": "Mastercard",
"value": "550259",
"merchantId": "2222222222"
},
{
"brand": "Visa",
"value": "448768",
"merchantId": "3333333333"
}
]
}
}
]
}Body
application/json
Response
201 - application/json
Created
Was this page helpful?