Simular parcelamento de um pagamento
curl --request GET \
--url https://api.dooki.com.br/v2/{alias}/checkout/payments/{paymentId}/installments/simulate \
--header 'User-Secret-Key: <api-key>' \
--header 'User-Token: <api-key>'import requests
url = "https://api.dooki.com.br/v2/{alias}/checkout/payments/{paymentId}/installments/simulate"
headers = {
"User-Token": "<api-key>",
"User-Secret-Key": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'User-Token': '<api-key>', 'User-Secret-Key': '<api-key>'}
};
fetch('https://api.dooki.com.br/v2/{alias}/checkout/payments/{paymentId}/installments/simulate', 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.dooki.com.br/v2/{alias}/checkout/payments/{paymentId}/installments/simulate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"User-Secret-Key: <api-key>",
"User-Token: <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://api.dooki.com.br/v2/{alias}/checkout/payments/{paymentId}/installments/simulate"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("User-Token", "<api-key>")
req.Header.Add("User-Secret-Key", "<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://api.dooki.com.br/v2/{alias}/checkout/payments/{paymentId}/installments/simulate")
.header("User-Token", "<api-key>")
.header("User-Secret-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dooki.com.br/v2/{alias}/checkout/payments/{paymentId}/installments/simulate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["User-Token"] = '<api-key>'
request["User-Secret-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"max_installment": 1,
"max_installment_value": 500,
"amount": 500,
"text": "1x de R$ 500,00 sem juros",
"text_with_tax": "1x de R$ 500,00",
"text_discount_percent": null,
"text_discount": null,
"installments": [
{
"amount": 500,
"amount_formated": "R$ 500,00",
"base_value": 500,
"tax": "0",
"tax_value": 0,
"discount_percent": 0,
"discount_value": 0,
"discount_value_formated": "R$ 0,00",
"installment": "1",
"installment_value": 500,
"installment_value_formated": "R$ 500,00",
"text": "1x de R$ 500,00 sem juros",
"text_with_tax": "1x de R$ 500,00",
"text_discount_percent": null,
"text_discount": null
}
]
}
}Parcelamento
Simular parcelamento de um pagamento
Simula o parcelamento de um pagamento, considerando valor total, valor mínimo da parcela, número máximo de parcelas sem juros e taxas associadas
GET
/
{alias}
/
checkout
/
payments
/
{paymentId}
/
installments
/
simulate
Simular parcelamento de um pagamento
curl --request GET \
--url https://api.dooki.com.br/v2/{alias}/checkout/payments/{paymentId}/installments/simulate \
--header 'User-Secret-Key: <api-key>' \
--header 'User-Token: <api-key>'import requests
url = "https://api.dooki.com.br/v2/{alias}/checkout/payments/{paymentId}/installments/simulate"
headers = {
"User-Token": "<api-key>",
"User-Secret-Key": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'User-Token': '<api-key>', 'User-Secret-Key': '<api-key>'}
};
fetch('https://api.dooki.com.br/v2/{alias}/checkout/payments/{paymentId}/installments/simulate', 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.dooki.com.br/v2/{alias}/checkout/payments/{paymentId}/installments/simulate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"User-Secret-Key: <api-key>",
"User-Token: <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://api.dooki.com.br/v2/{alias}/checkout/payments/{paymentId}/installments/simulate"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("User-Token", "<api-key>")
req.Header.Add("User-Secret-Key", "<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://api.dooki.com.br/v2/{alias}/checkout/payments/{paymentId}/installments/simulate")
.header("User-Token", "<api-key>")
.header("User-Secret-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dooki.com.br/v2/{alias}/checkout/payments/{paymentId}/installments/simulate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["User-Token"] = '<api-key>'
request["User-Secret-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"max_installment": 1,
"max_installment_value": 500,
"amount": 500,
"text": "1x de R$ 500,00 sem juros",
"text_with_tax": "1x de R$ 500,00",
"text_discount_percent": null,
"text_discount": null,
"installments": [
{
"amount": 500,
"amount_formated": "R$ 500,00",
"base_value": 500,
"tax": "0",
"tax_value": 0,
"discount_percent": 0,
"discount_value": 0,
"discount_value_formated": "R$ 0,00",
"installment": "1",
"installment_value": 500,
"installment_value_formated": "R$ 500,00",
"text": "1x de R$ 500,00 sem juros",
"text_with_tax": "1x de R$ 500,00",
"text_discount_percent": null,
"text_discount": null
}
]
}
}Query Parameters
Valor total do pagamento
Valor mínimo da parcela
Número máximo de parcelas sem juros
Taxa aplicada nas parcelas
Show child attributes
Show child attributes
Moeda do pagamento
Response
Simulação de parcelamento realizada com sucesso
Resposta detalhada da simulação de parcelamento, incluindo o número máximo de parcelas, valor máximo da parcela, valor total, textos formatados e detalhes das parcelas
Show child attributes
Show child attributes
Was this page helpful?
⌘I