Substitui fee tiers do merchant para um tipo de ordem
curl --request PUT \
--url https://api.astronpay.co/api/v1/fee-tiers/{orderType} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-api-secret: <api-key>' \
--data '
[
{
"minVolumeBrl": 0,
"maxVolumeBrl": 10000,
"merchantFeePercentage": 0.01
},
{
"minVolumeBrl": 10000,
"maxVolumeBrl": null,
"merchantFeePercentage": 0.008
}
]
'import requests
url = "https://api.astronpay.co/api/v1/fee-tiers/{orderType}"
payload = [
{
"minVolumeBrl": 0,
"maxVolumeBrl": 10000,
"merchantFeePercentage": 0.01
},
{
"minVolumeBrl": 10000,
"maxVolumeBrl": None,
"merchantFeePercentage": 0.008
}
]
headers = {
"x-api-key": "<api-key>",
"x-api-secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'x-api-key': '<api-key>',
'x-api-secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify([
{minVolumeBrl: 0, maxVolumeBrl: 10000, merchantFeePercentage: 0.01},
{minVolumeBrl: 10000, maxVolumeBrl: null, merchantFeePercentage: 0.008}
])
};
fetch('https://api.astronpay.co/api/v1/fee-tiers/{orderType}', 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.astronpay.co/api/v1/fee-tiers/{orderType}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
[
'minVolumeBrl' => 0,
'maxVolumeBrl' => 10000,
'merchantFeePercentage' => 0.01
],
[
'minVolumeBrl' => 10000,
'maxVolumeBrl' => null,
'merchantFeePercentage' => 0.008
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-api-secret: <api-key>"
],
]);
$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.astronpay.co/api/v1/fee-tiers/{orderType}"
payload := strings.NewReader("[\n {\n \"minVolumeBrl\": 0,\n \"maxVolumeBrl\": 10000,\n \"merchantFeePercentage\": 0.01\n },\n {\n \"minVolumeBrl\": 10000,\n \"maxVolumeBrl\": null,\n \"merchantFeePercentage\": 0.008\n }\n]")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-api-secret", "<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))
}HttpResponse<String> response = Unirest.put("https://api.astronpay.co/api/v1/fee-tiers/{orderType}")
.header("x-api-key", "<api-key>")
.header("x-api-secret", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"minVolumeBrl\": 0,\n \"maxVolumeBrl\": 10000,\n \"merchantFeePercentage\": 0.01\n },\n {\n \"minVolumeBrl\": 10000,\n \"maxVolumeBrl\": null,\n \"merchantFeePercentage\": 0.008\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.astronpay.co/api/v1/fee-tiers/{orderType}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["x-api-secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"minVolumeBrl\": 0,\n \"maxVolumeBrl\": 10000,\n \"merchantFeePercentage\": 0.01\n },\n {\n \"minVolumeBrl\": 10000,\n \"maxVolumeBrl\": null,\n \"merchantFeePercentage\": 0.008\n }\n]"
response = http.request(request)
puts response.read_body{
"success": true,
"tiers": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"minVolumeBrl": 0,
"maxVolumeBrl": 10000,
"platformFeePercentage": 0.005,
"merchantFeePercentage": 0.01,
"totalFeePercentage": 0.015
}
]
}{
"error": "VALIDATION_ERROR",
"message": "Campo 'amountBrl' é obrigatório",
"details": {},
"requestId": "req_abc123"
}Fee Tiers
Atualiza fee tiers
Envia um array completo de faixas de volume para PAYIN ou PAYOUT. O merchantFeePercentage de cada faixa é atualizado; o platformFeePercentage da faixa correspondente é preservado. O array passado substitui todas as faixas existentes para aquele orderType.
PUT
/
fee-tiers
/
{orderType}
Substitui fee tiers do merchant para um tipo de ordem
curl --request PUT \
--url https://api.astronpay.co/api/v1/fee-tiers/{orderType} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-api-secret: <api-key>' \
--data '
[
{
"minVolumeBrl": 0,
"maxVolumeBrl": 10000,
"merchantFeePercentage": 0.01
},
{
"minVolumeBrl": 10000,
"maxVolumeBrl": null,
"merchantFeePercentage": 0.008
}
]
'import requests
url = "https://api.astronpay.co/api/v1/fee-tiers/{orderType}"
payload = [
{
"minVolumeBrl": 0,
"maxVolumeBrl": 10000,
"merchantFeePercentage": 0.01
},
{
"minVolumeBrl": 10000,
"maxVolumeBrl": None,
"merchantFeePercentage": 0.008
}
]
headers = {
"x-api-key": "<api-key>",
"x-api-secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'x-api-key': '<api-key>',
'x-api-secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify([
{minVolumeBrl: 0, maxVolumeBrl: 10000, merchantFeePercentage: 0.01},
{minVolumeBrl: 10000, maxVolumeBrl: null, merchantFeePercentage: 0.008}
])
};
fetch('https://api.astronpay.co/api/v1/fee-tiers/{orderType}', 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.astronpay.co/api/v1/fee-tiers/{orderType}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
[
'minVolumeBrl' => 0,
'maxVolumeBrl' => 10000,
'merchantFeePercentage' => 0.01
],
[
'minVolumeBrl' => 10000,
'maxVolumeBrl' => null,
'merchantFeePercentage' => 0.008
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-api-secret: <api-key>"
],
]);
$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.astronpay.co/api/v1/fee-tiers/{orderType}"
payload := strings.NewReader("[\n {\n \"minVolumeBrl\": 0,\n \"maxVolumeBrl\": 10000,\n \"merchantFeePercentage\": 0.01\n },\n {\n \"minVolumeBrl\": 10000,\n \"maxVolumeBrl\": null,\n \"merchantFeePercentage\": 0.008\n }\n]")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-api-secret", "<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))
}HttpResponse<String> response = Unirest.put("https://api.astronpay.co/api/v1/fee-tiers/{orderType}")
.header("x-api-key", "<api-key>")
.header("x-api-secret", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"minVolumeBrl\": 0,\n \"maxVolumeBrl\": 10000,\n \"merchantFeePercentage\": 0.01\n },\n {\n \"minVolumeBrl\": 10000,\n \"maxVolumeBrl\": null,\n \"merchantFeePercentage\": 0.008\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.astronpay.co/api/v1/fee-tiers/{orderType}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["x-api-secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"minVolumeBrl\": 0,\n \"maxVolumeBrl\": 10000,\n \"merchantFeePercentage\": 0.01\n },\n {\n \"minVolumeBrl\": 10000,\n \"maxVolumeBrl\": null,\n \"merchantFeePercentage\": 0.008\n }\n]"
response = http.request(request)
puts response.read_body{
"success": true,
"tiers": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"minVolumeBrl": 0,
"maxVolumeBrl": 10000,
"platformFeePercentage": 0.005,
"merchantFeePercentage": 0.01,
"totalFeePercentage": 0.015
}
]
}{
"error": "VALIDATION_ERROR",
"message": "Campo 'amountBrl' é obrigatório",
"details": {},
"requestId": "req_abc123"
}Authorizations
apiKey & apiSecretbearerAuth
Path Parameters
Available options:
PAYIN, PAYOUT Body
application/json
⌘I
