Batch Apply Submerchant Markup
curl --request POST \
--url https://api.sandbox.wepayout.com.br/v2/account/{merchantId}/submerchants/markups/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sub_merchant_ids": {},
"markups": {}
}
'import requests
url = "https://api.sandbox.wepayout.com.br/v2/account/{merchantId}/submerchants/markups/batch"
payload = {
"sub_merchant_ids": {},
"markups": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({sub_merchant_ids: {}, markups: {}})
};
fetch('https://api.sandbox.wepayout.com.br/v2/account/{merchantId}/submerchants/markups/batch', 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.sandbox.wepayout.com.br/v2/account/{merchantId}/submerchants/markups/batch",
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([
'sub_merchant_ids' => [
],
'markups' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.sandbox.wepayout.com.br/v2/account/{merchantId}/submerchants/markups/batch"
payload := strings.NewReader("{\n \"sub_merchant_ids\": {},\n \"markups\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.sandbox.wepayout.com.br/v2/account/{merchantId}/submerchants/markups/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sub_merchant_ids\": {},\n \"markups\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.wepayout.com.br/v2/account/{merchantId}/submerchants/markups/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sub_merchant_ids\": {},\n \"markups\": {}\n}"
response = http.request(request)
puts response.read_body{
"total": 3,
"succeeded": 2,
"failed": 1,
"results": [
{
"sub_merchant_id": 1234,
"status": "success",
"error_code": null,
"message": null
},
{
"sub_merchant_id": 1235,
"status": "success",
"error_code": null,
"message": null
},
{
"sub_merchant_id": 7777,
"status": "failed",
"error_code": "sub_merchant_not_child",
"message": "The subaccount 7777 does not belong to this account."
}
]
}
{
"message": "The given data was invalid.",
"errors": {
"sub_merchant_ids": [
"The batch exceeds the limit of 500 subaccounts."
],
"markups.0.min_charge_value": [
"Minimum and maximum values are required when the mode is percent."
]
}
}
{
"error": "Failed to apply the markups in batch."
}
Submerchant
Batch Apply Submerchant Markup
Apply the same markup configuration to many submerchants at once.
POST
/
v2
/
account
/
{merchantId}
/
submerchants
/
markups
/
batch
Batch Apply Submerchant Markup
curl --request POST \
--url https://api.sandbox.wepayout.com.br/v2/account/{merchantId}/submerchants/markups/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sub_merchant_ids": {},
"markups": {}
}
'import requests
url = "https://api.sandbox.wepayout.com.br/v2/account/{merchantId}/submerchants/markups/batch"
payload = {
"sub_merchant_ids": {},
"markups": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({sub_merchant_ids: {}, markups: {}})
};
fetch('https://api.sandbox.wepayout.com.br/v2/account/{merchantId}/submerchants/markups/batch', 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.sandbox.wepayout.com.br/v2/account/{merchantId}/submerchants/markups/batch",
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([
'sub_merchant_ids' => [
],
'markups' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.sandbox.wepayout.com.br/v2/account/{merchantId}/submerchants/markups/batch"
payload := strings.NewReader("{\n \"sub_merchant_ids\": {},\n \"markups\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.sandbox.wepayout.com.br/v2/account/{merchantId}/submerchants/markups/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sub_merchant_ids\": {},\n \"markups\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.wepayout.com.br/v2/account/{merchantId}/submerchants/markups/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sub_merchant_ids\": {},\n \"markups\": {}\n}"
response = http.request(request)
puts response.read_body{
"total": 3,
"succeeded": 2,
"failed": 1,
"results": [
{
"sub_merchant_id": 1234,
"status": "success",
"error_code": null,
"message": null
},
{
"sub_merchant_id": 1235,
"status": "success",
"error_code": null,
"message": null
},
{
"sub_merchant_id": 7777,
"status": "failed",
"error_code": "sub_merchant_not_child",
"message": "The subaccount 7777 does not belong to this account."
}
]
}
{
"message": "The given data was invalid.",
"errors": {
"sub_merchant_ids": [
"The batch exceeds the limit of 500 subaccounts."
],
"markups.0.min_charge_value": [
"Minimum and maximum values are required when the mode is percent."
]
}
}
{
"error": "Failed to apply the markups in batch."
}
Batch Apply Submerchant Markup
Use this endpoint to apply the same markup configuration to up to 500 submerchants in one request. Each submerchant is processed on its own. If one of them fails, the others are still saved, and the response reports the result for each submerchant.The configuration is replaced for each submerchant. Like Configure Submerchant Markup, each listed submerchant keeps only the items sent in
markups. Any product and payment method you leave out goes back to the global markup.Path Parameters
integer
required
ID of the merchant (parent account). It must be one of the authenticated user’s companies.
Request Body
array[integer]
required
IDs of the submerchants that will receive the markup. Send between
1 and 500 IDs. Duplicate IDs are ignored.array[object]
required
Markup configurations to apply. Same fields and rules as the
markups field of Configure Submerchant Markup.Request Examples
{
"sub_merchant_ids": [1234, 1235, 7777],
"markups": [
{
"product": "payin",
"payment_method": "pix",
"mode": "percent",
"amount": 1.4,
"min_charge_value": 1.0,
"max_charge_value": 5.0
},
{
"product": "payout",
"payment_method": "pix",
"mode": "fixed",
"amount": 0.8
}
]
}
curl -X POST "https://api.sandbox.wepayout.com.br/v2/account/123/submerchants/markups/batch" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"sub_merchant_ids": [1234, 1235],
"markups": [
{
"product": "payin",
"payment_method": "pix",
"mode": "fixed",
"amount": 1.0
}
]
}'
Response
The response is200 OK even when some submerchants fail. Check failed and results to find them.
integer
Number of submerchants processed.
integer
Number of submerchants saved.
integer
Number of submerchants that failed.
array[object]
Result for each submerchant.
Show Result Object
Show Result Object
{
"total": 3,
"succeeded": 2,
"failed": 1,
"results": [
{
"sub_merchant_id": 1234,
"status": "success",
"error_code": null,
"message": null
},
{
"sub_merchant_id": 1235,
"status": "success",
"error_code": null,
"message": null
},
{
"sub_merchant_id": 7777,
"status": "failed",
"error_code": "sub_merchant_not_child",
"message": "The subaccount 7777 does not belong to this account."
}
]
}
{
"message": "The given data was invalid.",
"errors": {
"sub_merchant_ids": [
"The batch exceeds the limit of 500 subaccounts."
],
"markups.0.min_charge_value": [
"Minimum and maximum values are required when the mode is percent."
]
}
}
{
"error": "Failed to apply the markups in batch."
}
Related Resources
List Submerchant Markups
Find the submerchants to update
Configure Submerchant Markup
Set the markup of a single submerchant
Was this page helpful?

