Create Payin with Inline Markup
curl --request POST \
--url https://api.sandbox.wepayout.com.br/v2/payin/payments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"markup": {
"mode": "<string>",
"amount": 123,
"min_charge_value": 123,
"max_charge_value": 123
}
}
'import requests
url = "https://api.sandbox.wepayout.com.br/v2/payin/payments"
payload = { "markup": {
"mode": "<string>",
"amount": 123,
"min_charge_value": 123,
"max_charge_value": 123
} }
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({
markup: {mode: '<string>', amount: 123, min_charge_value: 123, max_charge_value: 123}
})
};
fetch('https://api.sandbox.wepayout.com.br/v2/payin/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/payin/payments",
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([
'markup' => [
'mode' => '<string>',
'amount' => 123,
'min_charge_value' => 123,
'max_charge_value' => 123
]
]),
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/payin/payments"
payload := strings.NewReader("{\n \"markup\": {\n \"mode\": \"<string>\",\n \"amount\": 123,\n \"min_charge_value\": 123,\n \"max_charge_value\": 123\n }\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/payin/payments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"markup\": {\n \"mode\": \"<string>\",\n \"amount\": 123,\n \"min_charge_value\": 123,\n \"max_charge_value\": 123\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.wepayout.com.br/v2/payin/payments")
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 \"markup\": {\n \"mode\": \"<string>\",\n \"amount\": 123,\n \"min_charge_value\": 123,\n \"max_charge_value\": 123\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 51687,
"merchant": {
"id": 477,
"name": "Merchant Name"
},
"hash": "abc123def456",
"payment_page": "https://payment.wepayments.com.br/abc123def456",
"invoice": "YOUR-CODE1234",
"payment_method": "pix",
"amount": 10000,
"currency": {
"id": 1,
"code": "BRL"
},
"status": "pending",
"markup": {
"mode": "percent",
"amount": 2.5,
"min_charge_value": 0.50,
"max_charge_value": 10.00
}
}
{
"message": "Os dados fornecidos são inválidos.",
"errors": {
"markup.mode": [
"The markup.mode field is invalid"
]
}
}
{
"message": "Os dados fornecidos são inválidos.",
"errors": {
"markup.amount": [
"The markup.amount must be at least 0.01"
]
}
}
{
"error": "Internal server error"
}
Payin
Create Payin with Inline Markup
Create a payin charge with inline markup configuration.
POST
/
v2
/
payin
/
payments
Create Payin with Inline Markup
curl --request POST \
--url https://api.sandbox.wepayout.com.br/v2/payin/payments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"markup": {
"mode": "<string>",
"amount": 123,
"min_charge_value": 123,
"max_charge_value": 123
}
}
'import requests
url = "https://api.sandbox.wepayout.com.br/v2/payin/payments"
payload = { "markup": {
"mode": "<string>",
"amount": 123,
"min_charge_value": 123,
"max_charge_value": 123
} }
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({
markup: {mode: '<string>', amount: 123, min_charge_value: 123, max_charge_value: 123}
})
};
fetch('https://api.sandbox.wepayout.com.br/v2/payin/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/payin/payments",
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([
'markup' => [
'mode' => '<string>',
'amount' => 123,
'min_charge_value' => 123,
'max_charge_value' => 123
]
]),
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/payin/payments"
payload := strings.NewReader("{\n \"markup\": {\n \"mode\": \"<string>\",\n \"amount\": 123,\n \"min_charge_value\": 123,\n \"max_charge_value\": 123\n }\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/payin/payments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"markup\": {\n \"mode\": \"<string>\",\n \"amount\": 123,\n \"min_charge_value\": 123,\n \"max_charge_value\": 123\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.wepayout.com.br/v2/payin/payments")
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 \"markup\": {\n \"mode\": \"<string>\",\n \"amount\": 123,\n \"min_charge_value\": 123,\n \"max_charge_value\": 123\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 51687,
"merchant": {
"id": 477,
"name": "Merchant Name"
},
"hash": "abc123def456",
"payment_page": "https://payment.wepayments.com.br/abc123def456",
"invoice": "YOUR-CODE1234",
"payment_method": "pix",
"amount": 10000,
"currency": {
"id": 1,
"code": "BRL"
},
"status": "pending",
"markup": {
"mode": "percent",
"amount": 2.5,
"min_charge_value": 0.50,
"max_charge_value": 10.00
}
}
{
"message": "Os dados fornecidos são inválidos.",
"errors": {
"markup.mode": [
"The markup.mode field is invalid"
]
}
}
{
"message": "Os dados fornecidos são inválidos.",
"errors": {
"markup.amount": [
"The markup.amount must be at least 0.01"
]
}
}
{
"error": "Internal server error"
}
Create Payin with Inline Markup
When creating a payin charge, you can include aninline markup object in the request payload.
Inline markup takes precedence: If you send a
markup object in the charge creation request, it will override any global or submerchant markup configurations.Markup Object Structure
Themarkup object should be added to the request body when creating a charge via POST /v2/payin/payments.
object
Optional inline markup configuration for this specific charge.
Show Markup Object
Show Markup Object
string
required
How the markup value will be applied.Allowed values:
fixed: fixed amount per chargepercent: percentage over the charge amount
number
required
Markup value to be applied.Constraints:
- Must be greater than or equal to
0.01
number
Minimum markup amount when mode is
percent.Business rules:- Required when
mode=percent - Prohibited when
mode=fixed - Must be greater than or equal to
0.01
number
Maximum markup amount when mode is
percent.Business rules:- Optional
- Must be greater than or equal to
min_charge_value - Prohibited when
mode=fixed
When
mode is fixed, do not send min_charge_value or max_charge_value.Request Examples
{
"payment_method": "pix",
"invoice": "YOUR-CODE1234",
"currency": "BRL",
"amount": 10000,
"country": "BR",
"buyer": {
"name": "Buyer Name",
"document": {
"type": "CPF",
"number": "34960826312"
},
"email": "buyer-email@wepayments.com.br"
},
"pix": {
"expire_date": "2025-12-31T23:59:59"
},
"markup": {
"mode": "percent",
"amount": 2.5,
"min_charge_value": 0.50,
"max_charge_value": 10.00
}
}
{
"payment_method": "pix",
"invoice": "YOUR-CODE1234",
"currency": "BRL",
"amount": 10000,
"country": "BR",
"buyer": {
"name": "Buyer Name",
"document": {
"type": "CPF",
"number": "34960826312"
},
"email": "buyer-email@wepayments.com.br"
},
"pix": {
"expire_date": "2025-12-31T23:59:59"
},
"markup": {
"mode": "fixed",
"amount": 5.0
}
}
{
"payment_method": "boleto",
"invoice": "YOUR-INVOICE-CODE",
"currency": "BRL",
"amount": 50000,
"country": "BR",
"buyer": {
"name": "Buyer Name",
"email": "buyer@example.com",
"document": {
"type": "CPF",
"number": "12345678901"
},
"address": {
"street": "Street Name",
"number": "123",
"complement": "Apt 456",
"zipcode": "12345000",
"city": "City Name",
"district": "District Name",
"state_code": "SP"
}
},
"originator_legal_entity": {
"name": "Company Name",
"document": "12345678901",
"helpdesk": "company.com"
},
"boleto": {
"expire_date": "2025-12-31"
},
"markup": {
"mode": "percent",
"amount": 2.5,
"min_charge_value": 0.50,
"max_charge_value": 10.00
}
}
curl -X POST "https://api.sandbox.wepayout.com.br/v2/payin/payments" \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{
"payment_method": "pix",
"invoice": "YOUR-CODE1234",
"currency": "BRL",
"amount": 10000,
"country": "BR",
"buyer": {
"name": "Buyer Name",
"document": {
"type": "CPF",
"number": "34960826312"
},
"email": "buyer-email@wepayments.com.br"
},
"pix": {
"expire_date": "2025-12-31T23:59:59"
},
"markup": {
"mode": "percent",
"amount": 2.5,
"min_charge_value": 0.50,
"max_charge_value": 10.00
}
}'
curl -X POST "https://api.sandbox.wepayout.com.br/v2/payin/payments" \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{
"payment_method": "pix",
"invoice": "YOUR-CODE1234",
"currency": "BRL",
"amount": 10000,
"country": "BR",
"buyer": {
"name": "Buyer Name",
"document": {
"type": "CPF",
"number": "34960826312"
},
"email": "buyer-email@wepayments.com.br"
},
"pix": {
"expire_date": "2025-12-31T23:59:59"
},
"markup": {
"mode": "fixed",
"amount": 5.0
}
}'
curl -X POST "https://api.sandbox.wepayout.com.br/v2/payin/payments" \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{
"payment_method": "boleto",
"invoice": "YOUR-INVOICE-CODE",
"currency": "BRL",
"amount": 50000,
"country": "BR",
"buyer": {
"name": "Buyer Name",
"email": "buyer@example.com",
"document": {
"type": "CPF",
"number": "12345678901"
},
"address": {
"street": "Street Name",
"number": "123",
"complement": "Apt 456",
"zipcode": "12345000",
"city": "City Name",
"district": "District Name",
"state_code": "SP"
}
},
"originator_legal_entity": {
"name": "Company Name",
"document": "12345678901",
"helpdesk": "company.com"
},
"boleto": {
"expire_date": "2025-12-31"
},
"markup": {
"mode": "percent",
"amount": 2.5,
"min_charge_value": 0.50,
"max_charge_value": 10.00
}
}'
Response
integer
WEpayment’s auto generated id, use this id to perform conciliation or perform queries via API / Dashboard.
object
string
WEpayments auto generated hash, use this hash to send your user to the payment page.
string
The WEpayments payment page is the place where you will redirect the end customer to pay the bill.
string
Your identification number.
string
Payment method that will be used in payin.Values:
pix, boletointeger
The payin total amount in cents.
string
Current status of the payin.Example:
pendingobject
Inline markup configuration applied to this charge.
Show Markup Object
Show Markup Object
{
"id": 51687,
"merchant": {
"id": 477,
"name": "Merchant Name"
},
"hash": "abc123def456",
"payment_page": "https://payment.wepayments.com.br/abc123def456",
"invoice": "YOUR-CODE1234",
"payment_method": "pix",
"amount": 10000,
"currency": {
"id": 1,
"code": "BRL"
},
"status": "pending",
"markup": {
"mode": "percent",
"amount": 2.5,
"min_charge_value": 0.50,
"max_charge_value": 10.00
}
}
{
"message": "Os dados fornecidos são inválidos.",
"errors": {
"markup.mode": [
"The markup.mode field is invalid"
]
}
}
{
"message": "Os dados fornecidos são inválidos.",
"errors": {
"markup.amount": [
"The markup.amount must be at least 0.01"
]
}
}
{
"error": "Internal server error"
}
How It Works
- Priority: The inline markup configuration takes precedence over global and submerchant markup settings.
-
Calculation (for percent mode):
- The system converts the markup amount to percentage:
amount * 100 = percentage% - Then calculates:
transaction_amount * (amount) - If calculated value <
min_charge_value→ appliesmin_charge_value - If calculated value >
max_charge_value→ appliesmax_charge_value - Otherwise → applies the calculated value
- The system converts the markup amount to percentage:
-
Fixed Mode: When using
fixedmode, the markup amount is applied directly regardless of the transaction value.
Related Resources
Create Charge
Complete documentation for creating payin charges
About Markup
Learn about markup types and configuration levels
Was this page helpful?
⌘I

