Create Payout with Global Markup
curl --request POST \
--url https://api.sandbox.wepayout.com.br/v2/payout/payments \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sandbox.wepayout.com.br/v2/payout/payments"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sandbox.wepayout.com.br/v2/payout/payments', 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/payout/payments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.wepayout.com.br/v2/payout/payments"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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/payout/payments")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.wepayout.com.br/v2/payout/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": 12345,
"merchant": {
"id": 477,
"name": "Merchant Name"
},
"payment_method": "PIX",
"amount": "R$ 100,50",
"currency": "BRL",
"invoice": "e3317882-f821-455b-b082-dc3ba36e8a57",
"status": {
"id": 1,
"name": "Awaiting"
},
"beneficiary": {
"name": "John Doe",
"document": {
"type": "CPF",
"number": "12345678901"
}
},
"markup": null
}
Markup returns null: It is normal for the markup field to return null when using global markup.
{
"message": "The given data was invalid",
"errors": {
"markup": [
"Inline markup is required when no global markup is configured"
]
}
}
{
"error": "Internal server error"
}
Payout
Create Payout with Global Markup
Create a payout payment using global markup configuration.
POST
/
v2
/
payout
/
payments
Create Payout with Global Markup
curl --request POST \
--url https://api.sandbox.wepayout.com.br/v2/payout/payments \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sandbox.wepayout.com.br/v2/payout/payments"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sandbox.wepayout.com.br/v2/payout/payments', 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/payout/payments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.wepayout.com.br/v2/payout/payments"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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/payout/payments")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.wepayout.com.br/v2/payout/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": 12345,
"merchant": {
"id": 477,
"name": "Merchant Name"
},
"payment_method": "PIX",
"amount": "R$ 100,50",
"currency": "BRL",
"invoice": "e3317882-f821-455b-b082-dc3ba36e8a57",
"status": {
"id": 1,
"name": "Awaiting"
},
"beneficiary": {
"name": "John Doe",
"document": {
"type": "CPF",
"number": "12345678901"
}
},
"markup": null
}
Markup returns null: It is normal for the markup field to return null when using global markup.
{
"message": "The given data was invalid",
"errors": {
"markup": [
"Inline markup is required when no global markup is configured"
]
}
}
{
"error": "Internal server error"
}
Create Payout with Global Markup
When creating a payout payment, you can use the global markup configuration that has been set up for your merchant. With global markup, you do not need to send themarkup object in the request payload.
Global markup is applied automatically: If the merchant has the markup feature enabled (
enable_markup = true), the system will automatically search for and apply the submerchant’s own markup or, if there is none, the global markup configuration.How It Works
-
Validation: The system checks if the
enable_markupflag is active for the submerchant. -
Markup Search: If enabled, the system automatically searches for a markup configuration, first for the submerchant and then for the merchant, based on:
account_id(submerchant ID)product(payout)payment_method(markup for payout is currently available for PIX only)
- Application: If the submerchant has its own markup for the payment method, it is applied to the payment. Otherwise, the global markup is applied.
-
Priority: If you send an inline
markupobject, it takes precedence over the submerchant and global markups.
Request Examples
{
"payment_method": "PIX",
"invoice": "e3317882-f821-455b-b082-dc3ba36e8a57",
"currency": "BRL",
"amount": 100.50,
"country": "BR",
"beneficiary": {
"name": "John Doe",
"document": {
"type": "CPF",
"number": "12345678901"
},
"pix": {
"key": "12345678901"
}
}
}
curl -X POST "https://api.sandbox.wepayout.com.br/v2/payout/payments" \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{
"payment_method": "PIX",
"invoice": "e3317882-f821-455b-b082-dc3ba36e8a57",
"currency": "BRL",
"amount": 100.50,
"country": "BR",
"beneficiary": {
"name": "John Doe",
"document": {
"type": "CPF",
"number": "12345678901"
},
"pix": {
"key": "12345678901"
}
}
}'
Response
integer
WEpayment’s auto generated id, use this id to perform conciliation or perform queries via API / Dashboard.
object
string
Payment method used for the payout.Values:
PIXstring
The payout amount formatted with currency symbol.
string
Currency code (ISO 4217).
string
Invoice identifier.
object or null
Markup configuration applied to this payment (submerchant or global).
Show Markup Object
Show Markup Object
string
Markup mode applied.Values:
fixed, percentnumber
Markup value configured for this payment.
number or null
Minimum markup value when
mode is percent. Will be null when mode is fixed.number or null
Maximum markup value when
mode is percent. Will be null when mode is fixed or when not specified.string or null
Level of the markup that was applied.Values:
sub_merchant, global{
"id": 12345,
"merchant": {
"id": 477,
"name": "Merchant Name"
},
"payment_method": "PIX",
"amount": "R$ 100,50",
"currency": "BRL",
"invoice": "e3317882-f821-455b-b082-dc3ba36e8a57",
"status": {
"id": 1,
"name": "Awaiting"
},
"beneficiary": {
"name": "John Doe",
"document": {
"type": "CPF",
"number": "12345678901"
}
},
"markup": null
}
Markup returns null: It is normal for the
markup field to return null when using global markup.{
"message": "The given data was invalid",
"errors": {
"markup": [
"Inline markup is required when no global markup is configured"
]
}
}
{
"error": "Internal server error"
}
Business Rules
Markup Required: If
enable_markup = true for the submerchant and there is neither a submerchant markup nor a global markup configuration for the payment method, you must send an inline markup object. Otherwise, the request will fail with a 422 error.Automatic Application: When
enable_markup = true and a submerchant or global markup exists, it is automatically applied without requiring the markup object in the request.Error Scenarios
Scenario 1: enable_markup = true, No Submerchant or Global Markup, No Inline Markup
If the submerchant hasenable_markup = true but:
- No submerchant markup configuration exists for the payment method
- No global markup configuration exists for the payment method
- No inline markup object is sent in the request
Scenario 2: Error Verifying Global Markup
If there is an error while searching for or verifying the global markup configuration. Result: Returns 422 error with message “Error verifying markup configuration. Please try again or contact support.”Related Resources
Create Payout with Inline Markup
Learn how to create payout with inline markup
Create Merchant Markup
Configure global markup for merchants
About Markup
Understand markup types and configuration levels
Create Payment
Complete documentation for creating payout payments
Was this page helpful?

