curl --request GET \
--url https://besimplo.com/api/v1/prices/{id} \
--header 'Authorization: <api-key>'import requests
url = "https://besimplo.com/api/v1/prices/{id}"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://besimplo.com/api/v1/prices/{id}', 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://besimplo.com/api/v1/prices/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <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"
"net/http"
"io"
)
func main() {
url := "https://besimplo.com/api/v1/prices/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://besimplo.com/api/v1/prices/{id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://besimplo.com/api/v1/prices/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "price_01h455vb4pex5vsknk084sn02q",
"object": "price",
"active": true,
"live_mode": true,
"created": 1704672000,
"currency": "brl",
"product": "prod_01h455vb4pex5vsknk084sn02q",
"type": "recurring",
"unit_amount": 2990,
"card_installments_enabled": false,
"max_card_installments": 1,
"description": "Plano Mensal Premium",
"unit_amount_decimal": "2990",
"recurring": {
"interval": "month",
"interval_count": 1
},
"external_code": "price_premium_monthly",
"effective_max_card_installments": 1,
"installment_selection_available": false
}Buscar preço
Retorna um preço pelo ID
curl --request GET \
--url https://besimplo.com/api/v1/prices/{id} \
--header 'Authorization: <api-key>'import requests
url = "https://besimplo.com/api/v1/prices/{id}"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://besimplo.com/api/v1/prices/{id}', 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://besimplo.com/api/v1/prices/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <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"
"net/http"
"io"
)
func main() {
url := "https://besimplo.com/api/v1/prices/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://besimplo.com/api/v1/prices/{id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://besimplo.com/api/v1/prices/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "price_01h455vb4pex5vsknk084sn02q",
"object": "price",
"active": true,
"live_mode": true,
"created": 1704672000,
"currency": "brl",
"product": "prod_01h455vb4pex5vsknk084sn02q",
"type": "recurring",
"unit_amount": 2990,
"card_installments_enabled": false,
"max_card_installments": 1,
"description": "Plano Mensal Premium",
"unit_amount_decimal": "2990",
"recurring": {
"interval": "month",
"interval_count": 1
},
"external_code": "price_premium_monthly",
"effective_max_card_installments": 1,
"installment_selection_available": false
}Authorizations
A chave de API usada para autenticar a requisição e identificar a sua conta.
Exemplo: Authorization: ApiKey my-secure-key
Path Parameters
ID do preço, no formato TypeID com prefixo price_.
^price_[0-9a-z]{26}$"price_01h455vb4pex5vsknk084sn02q"
Response
Preço encontrado
ID único do preço, no formato TypeID com prefixo price_.
^price_[0-9a-z]{26}$"price_01h455vb4pex5vsknk084sn02q"
Tipo do objeto. Sempre 'price'.
price "price"
Se o preço está ativo para novas compras.
true
Indica ambiente de produção (true) ou sandbox (false). Dados de sandbox são limpos periodicamente.
true
Timestamp Unix de quando o preço foi criado.
1704672000
Moeda do valor. Sempre 'brl' (Real brasileiro).
brl "brl"
ID do produto associado, no formato TypeID com prefixo prod_.
^prod_[0-9a-z]{26}$"prod_01h455vb4pex5vsknk084sn02q"
Tipo de cobrança:
- one_time: Cobrança única.
- recurring: Cobrança recorrente.
one_time, recurring "recurring"
Valor em centavos. R$ 29,90 = 2990. Máximo R$ 9.999,99.
0 <= x <= 9999992990
Indica se este preço permite parcelamento no cartão de crédito. Regras:
- preços avulsos podem permitir parcelamento
- recorrências diárias e semanais não podem permitir parcelamento
- recorrências mensais exigem pelo menos 2 meses para permitir parcelamento
false
Máximo de parcelas aceitas no cartão. Regras:
- quando
card_installments_enabled=false, o valor efetivo é1 - preços recorrentes não podem exceder a recorrência em meses, com limite global de
12 - o valor mínimo por parcela é
R$ 5,00
1 <= x <= 121
Nome amigável do preço.
"Plano Mensal Premium"
Valor em centavos como string.
"2990"
Configuração de recorrência (apenas para type=recurring).
Show child attributes
Show child attributes
Código externo para idempotência.
"price_premium_monthly"
Máximo efetivo de parcelas aceitas no cartão após aplicar as regras de recorrência e valor mínimo.
1 <= x <= 121
Indica se a seleção de parcelas está disponível para o preço.
false

