Installments Plans
Create Installment Plan
Creates a new installment plan for the account.
POST
/
v1
/
installments-plans
Create installment plan
curl --request POST \
--url https://api-sandbox.y.uno/v1/installments-plans \
--header 'Content-Type: application/json' \
--header 'private-secret-key: <api-key>' \
--header 'public-api-key: <api-key>' \
--data '
{
"account_id": [
"1a3a576a-01d0-40ff-a68e-494f82145773"
],
"name": "Standard Plan",
"merchant_reference": "001 08 Agosto 2023",
"installments_plan": [
{
"installment": 1,
"rate": 1
},
{
"installment": 2,
"rate": 1.294
},
{
"installment": 6,
"rate": 1.42
},
{
"installment": 12,
"rate": 1.525
}
],
"country_code": "BR",
"amount": {
"Currency": "BRL",
"min_value": 0,
"max_value": 10000000000
},
"brand": null,
"iin": null
}
'import requests
url = "https://api-sandbox.y.uno/v1/installments-plans"
payload = {
"account_id": ["1a3a576a-01d0-40ff-a68e-494f82145773"],
"name": "Standard Plan",
"merchant_reference": "001 08 Agosto 2023",
"installments_plan": [
{
"installment": 1,
"rate": 1
},
{
"installment": 2,
"rate": 1.294
},
{
"installment": 6,
"rate": 1.42
},
{
"installment": 12,
"rate": 1.525
}
],
"country_code": "BR",
"amount": {
"Currency": "BRL",
"min_value": 0,
"max_value": 10000000000
},
"brand": None,
"iin": None
}
headers = {
"public-api-key": "<api-key>",
"private-secret-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'public-api-key': '<api-key>',
'private-secret-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
account_id: ['1a3a576a-01d0-40ff-a68e-494f82145773'],
name: 'Standard Plan',
merchant_reference: '001 08 Agosto 2023',
installments_plan: [
{installment: 1, rate: 1},
{installment: 2, rate: 1.294},
{installment: 6, rate: 1.42},
{installment: 12, rate: 1.525}
],
country_code: 'BR',
amount: {Currency: 'BRL', min_value: 0, max_value: 10000000000},
brand: null,
iin: null
})
};
fetch('https://api-sandbox.y.uno/v1/installments-plans', 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.y.uno/v1/installments-plans",
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([
'account_id' => [
'1a3a576a-01d0-40ff-a68e-494f82145773'
],
'name' => 'Standard Plan',
'merchant_reference' => '001 08 Agosto 2023',
'installments_plan' => [
[
'installment' => 1,
'rate' => 1
],
[
'installment' => 2,
'rate' => 1.294
],
[
'installment' => 6,
'rate' => 1.42
],
[
'installment' => 12,
'rate' => 1.525
]
],
'country_code' => 'BR',
'amount' => [
'Currency' => 'BRL',
'min_value' => 0,
'max_value' => 10000000000
],
'brand' => null,
'iin' => null
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"private-secret-key: <api-key>",
"public-api-key: <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-sandbox.y.uno/v1/installments-plans"
payload := strings.NewReader("{\n \"account_id\": [\n \"1a3a576a-01d0-40ff-a68e-494f82145773\"\n ],\n \"name\": \"Standard Plan\",\n \"merchant_reference\": \"001 08 Agosto 2023\",\n \"installments_plan\": [\n {\n \"installment\": 1,\n \"rate\": 1\n },\n {\n \"installment\": 2,\n \"rate\": 1.294\n },\n {\n \"installment\": 6,\n \"rate\": 1.42\n },\n {\n \"installment\": 12,\n \"rate\": 1.525\n }\n ],\n \"country_code\": \"BR\",\n \"amount\": {\n \"Currency\": \"BRL\",\n \"min_value\": 0,\n \"max_value\": 10000000000\n },\n \"brand\": null,\n \"iin\": null\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("public-api-key", "<api-key>")
req.Header.Add("private-secret-key", "<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.post("https://api-sandbox.y.uno/v1/installments-plans")
.header("public-api-key", "<api-key>")
.header("private-secret-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"account_id\": [\n \"1a3a576a-01d0-40ff-a68e-494f82145773\"\n ],\n \"name\": \"Standard Plan\",\n \"merchant_reference\": \"001 08 Agosto 2023\",\n \"installments_plan\": [\n {\n \"installment\": 1,\n \"rate\": 1\n },\n {\n \"installment\": 2,\n \"rate\": 1.294\n },\n {\n \"installment\": 6,\n \"rate\": 1.42\n },\n {\n \"installment\": 12,\n \"rate\": 1.525\n }\n ],\n \"country_code\": \"BR\",\n \"amount\": {\n \"Currency\": \"BRL\",\n \"min_value\": 0,\n \"max_value\": 10000000000\n },\n \"brand\": null,\n \"iin\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.y.uno/v1/installments-plans")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["public-api-key"] = '<api-key>'
request["private-secret-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"account_id\": [\n \"1a3a576a-01d0-40ff-a68e-494f82145773\"\n ],\n \"name\": \"Standard Plan\",\n \"merchant_reference\": \"001 08 Agosto 2023\",\n \"installments_plan\": [\n {\n \"installment\": 1,\n \"rate\": 1\n },\n {\n \"installment\": 2,\n \"rate\": 1.294\n },\n {\n \"installment\": 6,\n \"rate\": 1.42\n },\n {\n \"installment\": 12,\n \"rate\": 1.525\n }\n ],\n \"country_code\": \"BR\",\n \"amount\": {\n \"Currency\": \"BRL\",\n \"min_value\": 0,\n \"max_value\": 10000000000\n },\n \"brand\": null,\n \"iin\": null\n}"
response = http.request(request)
puts response.read_body{
"id": "3e599453-e147-4d1c-8643-73e4d980c2ae",
"name": "Standard Plan",
"account_id": [
"1a3a576a-01d0-40ff-a68e-494f82145773"
],
"merchant_reference": "001 08 Agosto 2023",
"installments_plan": [
{
"installment": 1,
"rate": 1
},
{
"installment": 2,
"rate": 1.294
},
{
"installment": 12,
"rate": 1.525
}
],
"brand": null,
"iin": null,
"country_code": "BR",
"first_installment_deferral": 1,
"amount": {
"Currency": "BRL",
"min_value": 0,
"max_value": 10000000000
}
}{
"code": "VALIDATION_ERROR",
"messages": [
"amount must be greater than 0",
"country must not be blank"
]
}Authorizations
Your public API key from the Yuno Dashboard
Your private secret key (server-side only)
Body
application/json
Account IDs this plan applies to
Example:
["1a3a576a-01d0-40ff-a68e-494f82145773"]
Name of the installment plan
Example:
"Standard Plan"
Merchant reference for the plan
Example:
"001 08 Agosto 2023"
Array of installment options with rates
Show child attributes
Show child attributes
ISO 3166-1 alpha-2 country code
Pattern:
^[A-Z]{2}$Example:
"BR"
Show child attributes
Show child attributes
Card brand filter (optional)
IIN/BIN filter (optional)
Response
Installment plan created successfully
Unique installment plan identifier
Example:
"3e599453-e147-4d1c-8643-73e4d980c2ae"
Example:
"Standard Plan"
Example:
["1a3a576a-01d0-40ff-a68e-494f82145773"]
Example:
"001 08 Agosto 2023"
Show child attributes
Show child attributes
Example:
"BR"
Number of periods before first installment
Example:
1
Show child attributes
Show child attributes
⌘I
Create installment plan
curl --request POST \
--url https://api-sandbox.y.uno/v1/installments-plans \
--header 'Content-Type: application/json' \
--header 'private-secret-key: <api-key>' \
--header 'public-api-key: <api-key>' \
--data '
{
"account_id": [
"1a3a576a-01d0-40ff-a68e-494f82145773"
],
"name": "Standard Plan",
"merchant_reference": "001 08 Agosto 2023",
"installments_plan": [
{
"installment": 1,
"rate": 1
},
{
"installment": 2,
"rate": 1.294
},
{
"installment": 6,
"rate": 1.42
},
{
"installment": 12,
"rate": 1.525
}
],
"country_code": "BR",
"amount": {
"Currency": "BRL",
"min_value": 0,
"max_value": 10000000000
},
"brand": null,
"iin": null
}
'import requests
url = "https://api-sandbox.y.uno/v1/installments-plans"
payload = {
"account_id": ["1a3a576a-01d0-40ff-a68e-494f82145773"],
"name": "Standard Plan",
"merchant_reference": "001 08 Agosto 2023",
"installments_plan": [
{
"installment": 1,
"rate": 1
},
{
"installment": 2,
"rate": 1.294
},
{
"installment": 6,
"rate": 1.42
},
{
"installment": 12,
"rate": 1.525
}
],
"country_code": "BR",
"amount": {
"Currency": "BRL",
"min_value": 0,
"max_value": 10000000000
},
"brand": None,
"iin": None
}
headers = {
"public-api-key": "<api-key>",
"private-secret-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'public-api-key': '<api-key>',
'private-secret-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
account_id: ['1a3a576a-01d0-40ff-a68e-494f82145773'],
name: 'Standard Plan',
merchant_reference: '001 08 Agosto 2023',
installments_plan: [
{installment: 1, rate: 1},
{installment: 2, rate: 1.294},
{installment: 6, rate: 1.42},
{installment: 12, rate: 1.525}
],
country_code: 'BR',
amount: {Currency: 'BRL', min_value: 0, max_value: 10000000000},
brand: null,
iin: null
})
};
fetch('https://api-sandbox.y.uno/v1/installments-plans', 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.y.uno/v1/installments-plans",
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([
'account_id' => [
'1a3a576a-01d0-40ff-a68e-494f82145773'
],
'name' => 'Standard Plan',
'merchant_reference' => '001 08 Agosto 2023',
'installments_plan' => [
[
'installment' => 1,
'rate' => 1
],
[
'installment' => 2,
'rate' => 1.294
],
[
'installment' => 6,
'rate' => 1.42
],
[
'installment' => 12,
'rate' => 1.525
]
],
'country_code' => 'BR',
'amount' => [
'Currency' => 'BRL',
'min_value' => 0,
'max_value' => 10000000000
],
'brand' => null,
'iin' => null
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"private-secret-key: <api-key>",
"public-api-key: <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-sandbox.y.uno/v1/installments-plans"
payload := strings.NewReader("{\n \"account_id\": [\n \"1a3a576a-01d0-40ff-a68e-494f82145773\"\n ],\n \"name\": \"Standard Plan\",\n \"merchant_reference\": \"001 08 Agosto 2023\",\n \"installments_plan\": [\n {\n \"installment\": 1,\n \"rate\": 1\n },\n {\n \"installment\": 2,\n \"rate\": 1.294\n },\n {\n \"installment\": 6,\n \"rate\": 1.42\n },\n {\n \"installment\": 12,\n \"rate\": 1.525\n }\n ],\n \"country_code\": \"BR\",\n \"amount\": {\n \"Currency\": \"BRL\",\n \"min_value\": 0,\n \"max_value\": 10000000000\n },\n \"brand\": null,\n \"iin\": null\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("public-api-key", "<api-key>")
req.Header.Add("private-secret-key", "<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.post("https://api-sandbox.y.uno/v1/installments-plans")
.header("public-api-key", "<api-key>")
.header("private-secret-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"account_id\": [\n \"1a3a576a-01d0-40ff-a68e-494f82145773\"\n ],\n \"name\": \"Standard Plan\",\n \"merchant_reference\": \"001 08 Agosto 2023\",\n \"installments_plan\": [\n {\n \"installment\": 1,\n \"rate\": 1\n },\n {\n \"installment\": 2,\n \"rate\": 1.294\n },\n {\n \"installment\": 6,\n \"rate\": 1.42\n },\n {\n \"installment\": 12,\n \"rate\": 1.525\n }\n ],\n \"country_code\": \"BR\",\n \"amount\": {\n \"Currency\": \"BRL\",\n \"min_value\": 0,\n \"max_value\": 10000000000\n },\n \"brand\": null,\n \"iin\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.y.uno/v1/installments-plans")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["public-api-key"] = '<api-key>'
request["private-secret-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"account_id\": [\n \"1a3a576a-01d0-40ff-a68e-494f82145773\"\n ],\n \"name\": \"Standard Plan\",\n \"merchant_reference\": \"001 08 Agosto 2023\",\n \"installments_plan\": [\n {\n \"installment\": 1,\n \"rate\": 1\n },\n {\n \"installment\": 2,\n \"rate\": 1.294\n },\n {\n \"installment\": 6,\n \"rate\": 1.42\n },\n {\n \"installment\": 12,\n \"rate\": 1.525\n }\n ],\n \"country_code\": \"BR\",\n \"amount\": {\n \"Currency\": \"BRL\",\n \"min_value\": 0,\n \"max_value\": 10000000000\n },\n \"brand\": null,\n \"iin\": null\n}"
response = http.request(request)
puts response.read_body{
"id": "3e599453-e147-4d1c-8643-73e4d980c2ae",
"name": "Standard Plan",
"account_id": [
"1a3a576a-01d0-40ff-a68e-494f82145773"
],
"merchant_reference": "001 08 Agosto 2023",
"installments_plan": [
{
"installment": 1,
"rate": 1
},
{
"installment": 2,
"rate": 1.294
},
{
"installment": 12,
"rate": 1.525
}
],
"brand": null,
"iin": null,
"country_code": "BR",
"first_installment_deferral": 1,
"amount": {
"Currency": "BRL",
"min_value": 0,
"max_value": 10000000000
}
}{
"code": "VALIDATION_ERROR",
"messages": [
"amount must be greater than 0",
"country must not be blank"
]
}