Publish Checkout Configuration
Publishes configuration and/or styling for a checkout by its checkout code
curl --request PUT \
--url https://api.y.uno/v1/checkouts/{checkout_code} \
--header 'Content-Type: application/json' \
--header 'PRIVATE-SECRET-KEY: <api-key>' \
--header 'PUBLIC-API-KEY: <api-key>' \
--header 'X-Account-Code: <api-key>' \
--data '
{
"config": {
"payment_methods": [
{
"payment_method_type": "CARD",
"order_to_show": 0,
"is_active": true,
"active_enrollment_type": "BOTH",
"conditions_to_override": [],
"required_fields_to_override": {
"is_active": true,
"fields": [
{
"field_name": "security_code",
"is_active": true,
"current_value": "ALWAYS",
"conditions_to_override": [
{
"name": "BR only",
"is_active": true,
"priority": 1,
"conditions": [
{
"condition_type": "COUNTRY",
"conditional": "ONE_OF",
"values": [
"BR"
]
}
]
}
]
}
],
"enrollment_fields": [],
"is_enrollment_active": true
}
}
],
"general_settings": {
"country_documents": [
{
"country_code": "BR",
"documents": [
"CPF",
"CNPJ"
]
}
]
}
},
"styling": {
"styles": {
"global": {
"accent_color": "#1A73E8",
"primary_background_color": "#FFFFFF",
"font_family": "Inter"
},
"header": {
"logo": "https://cdn.example.com/logo.png",
"font_weight": 600
},
"button": {
"corner_radius": 8,
"font_weight": 500
}
},
"flags": {
"force_default_styles": false
}
}
}
'import requests
url = "https://api.y.uno/v1/checkouts/{checkout_code}"
payload = {
"config": {
"payment_methods": [
{
"payment_method_type": "CARD",
"order_to_show": 0,
"is_active": True,
"active_enrollment_type": "BOTH",
"conditions_to_override": [],
"required_fields_to_override": {
"is_active": True,
"fields": [
{
"field_name": "security_code",
"is_active": True,
"current_value": "ALWAYS",
"conditions_to_override": [
{
"name": "BR only",
"is_active": True,
"priority": 1,
"conditions": [
{
"condition_type": "COUNTRY",
"conditional": "ONE_OF",
"values": ["BR"]
}
]
}
]
}
],
"enrollment_fields": [],
"is_enrollment_active": True
}
}
],
"general_settings": { "country_documents": [
{
"country_code": "BR",
"documents": ["CPF", "CNPJ"]
}
] }
},
"styling": {
"styles": {
"global": {
"accent_color": "#1A73E8",
"primary_background_color": "#FFFFFF",
"font_family": "Inter"
},
"header": {
"logo": "https://cdn.example.com/logo.png",
"font_weight": 600
},
"button": {
"corner_radius": 8,
"font_weight": 500
}
},
"flags": { "force_default_styles": False }
}
}
headers = {
"PUBLIC-API-KEY": "<api-key>",
"PRIVATE-SECRET-KEY": "<api-key>",
"X-Account-Code": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'PUBLIC-API-KEY': '<api-key>',
'PRIVATE-SECRET-KEY': '<api-key>',
'X-Account-Code': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
config: {
payment_methods: [
{
payment_method_type: 'CARD',
order_to_show: 0,
is_active: true,
active_enrollment_type: 'BOTH',
conditions_to_override: [],
required_fields_to_override: {
is_active: true,
fields: [
{
field_name: 'security_code',
is_active: true,
current_value: 'ALWAYS',
conditions_to_override: [
{
name: 'BR only',
is_active: true,
priority: 1,
conditions: [{condition_type: 'COUNTRY', conditional: 'ONE_OF', values: ['BR']}]
}
]
}
],
enrollment_fields: [],
is_enrollment_active: true
}
}
],
general_settings: {country_documents: [{country_code: 'BR', documents: ['CPF', 'CNPJ']}]}
},
styling: {
styles: {
global: {
accent_color: '#1A73E8',
primary_background_color: '#FFFFFF',
font_family: 'Inter'
},
header: {logo: 'https://cdn.example.com/logo.png', font_weight: 600},
button: {corner_radius: 8, font_weight: 500}
},
flags: {force_default_styles: false}
}
})
};
fetch('https://api.y.uno/v1/checkouts/{checkout_code}', 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.y.uno/v1/checkouts/{checkout_code}",
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([
'config' => [
'payment_methods' => [
[
'payment_method_type' => 'CARD',
'order_to_show' => 0,
'is_active' => true,
'active_enrollment_type' => 'BOTH',
'conditions_to_override' => [
],
'required_fields_to_override' => [
'is_active' => true,
'fields' => [
[
'field_name' => 'security_code',
'is_active' => true,
'current_value' => 'ALWAYS',
'conditions_to_override' => [
[
'name' => 'BR only',
'is_active' => true,
'priority' => 1,
'conditions' => [
[
'condition_type' => 'COUNTRY',
'conditional' => 'ONE_OF',
'values' => [
'BR'
]
]
]
]
]
]
],
'enrollment_fields' => [
],
'is_enrollment_active' => true
]
]
],
'general_settings' => [
'country_documents' => [
[
'country_code' => 'BR',
'documents' => [
'CPF',
'CNPJ'
]
]
]
]
],
'styling' => [
'styles' => [
'global' => [
'accent_color' => '#1A73E8',
'primary_background_color' => '#FFFFFF',
'font_family' => 'Inter'
],
'header' => [
'logo' => 'https://cdn.example.com/logo.png',
'font_weight' => 600
],
'button' => [
'corner_radius' => 8,
'font_weight' => 500
]
],
'flags' => [
'force_default_styles' => false
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"PRIVATE-SECRET-KEY: <api-key>",
"PUBLIC-API-KEY: <api-key>",
"X-Account-Code: <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.y.uno/v1/checkouts/{checkout_code}"
payload := strings.NewReader("{\n \"config\": {\n \"payment_methods\": [\n {\n \"payment_method_type\": \"CARD\",\n \"order_to_show\": 0,\n \"is_active\": true,\n \"active_enrollment_type\": \"BOTH\",\n \"conditions_to_override\": [],\n \"required_fields_to_override\": {\n \"is_active\": true,\n \"fields\": [\n {\n \"field_name\": \"security_code\",\n \"is_active\": true,\n \"current_value\": \"ALWAYS\",\n \"conditions_to_override\": [\n {\n \"name\": \"BR only\",\n \"is_active\": true,\n \"priority\": 1,\n \"conditions\": [\n {\n \"condition_type\": \"COUNTRY\",\n \"conditional\": \"ONE_OF\",\n \"values\": [\n \"BR\"\n ]\n }\n ]\n }\n ]\n }\n ],\n \"enrollment_fields\": [],\n \"is_enrollment_active\": true\n }\n }\n ],\n \"general_settings\": {\n \"country_documents\": [\n {\n \"country_code\": \"BR\",\n \"documents\": [\n \"CPF\",\n \"CNPJ\"\n ]\n }\n ]\n }\n },\n \"styling\": {\n \"styles\": {\n \"global\": {\n \"accent_color\": \"#1A73E8\",\n \"primary_background_color\": \"#FFFFFF\",\n \"font_family\": \"Inter\"\n },\n \"header\": {\n \"logo\": \"https://cdn.example.com/logo.png\",\n \"font_weight\": 600\n },\n \"button\": {\n \"corner_radius\": 8,\n \"font_weight\": 500\n }\n },\n \"flags\": {\n \"force_default_styles\": false\n }\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("PUBLIC-API-KEY", "<api-key>")
req.Header.Add("PRIVATE-SECRET-KEY", "<api-key>")
req.Header.Add("X-Account-Code", "<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.y.uno/v1/checkouts/{checkout_code}")
.header("PUBLIC-API-KEY", "<api-key>")
.header("PRIVATE-SECRET-KEY", "<api-key>")
.header("X-Account-Code", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"config\": {\n \"payment_methods\": [\n {\n \"payment_method_type\": \"CARD\",\n \"order_to_show\": 0,\n \"is_active\": true,\n \"active_enrollment_type\": \"BOTH\",\n \"conditions_to_override\": [],\n \"required_fields_to_override\": {\n \"is_active\": true,\n \"fields\": [\n {\n \"field_name\": \"security_code\",\n \"is_active\": true,\n \"current_value\": \"ALWAYS\",\n \"conditions_to_override\": [\n {\n \"name\": \"BR only\",\n \"is_active\": true,\n \"priority\": 1,\n \"conditions\": [\n {\n \"condition_type\": \"COUNTRY\",\n \"conditional\": \"ONE_OF\",\n \"values\": [\n \"BR\"\n ]\n }\n ]\n }\n ]\n }\n ],\n \"enrollment_fields\": [],\n \"is_enrollment_active\": true\n }\n }\n ],\n \"general_settings\": {\n \"country_documents\": [\n {\n \"country_code\": \"BR\",\n \"documents\": [\n \"CPF\",\n \"CNPJ\"\n ]\n }\n ]\n }\n },\n \"styling\": {\n \"styles\": {\n \"global\": {\n \"accent_color\": \"#1A73E8\",\n \"primary_background_color\": \"#FFFFFF\",\n \"font_family\": \"Inter\"\n },\n \"header\": {\n \"logo\": \"https://cdn.example.com/logo.png\",\n \"font_weight\": 600\n },\n \"button\": {\n \"corner_radius\": 8,\n \"font_weight\": 500\n }\n },\n \"flags\": {\n \"force_default_styles\": false\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.y.uno/v1/checkouts/{checkout_code}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["PUBLIC-API-KEY"] = '<api-key>'
request["PRIVATE-SECRET-KEY"] = '<api-key>'
request["X-Account-Code"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"config\": {\n \"payment_methods\": [\n {\n \"payment_method_type\": \"CARD\",\n \"order_to_show\": 0,\n \"is_active\": true,\n \"active_enrollment_type\": \"BOTH\",\n \"conditions_to_override\": [],\n \"required_fields_to_override\": {\n \"is_active\": true,\n \"fields\": [\n {\n \"field_name\": \"security_code\",\n \"is_active\": true,\n \"current_value\": \"ALWAYS\",\n \"conditions_to_override\": [\n {\n \"name\": \"BR only\",\n \"is_active\": true,\n \"priority\": 1,\n \"conditions\": [\n {\n \"condition_type\": \"COUNTRY\",\n \"conditional\": \"ONE_OF\",\n \"values\": [\n \"BR\"\n ]\n }\n ]\n }\n ]\n }\n ],\n \"enrollment_fields\": [],\n \"is_enrollment_active\": true\n }\n }\n ],\n \"general_settings\": {\n \"country_documents\": [\n {\n \"country_code\": \"BR\",\n \"documents\": [\n \"CPF\",\n \"CNPJ\"\n ]\n }\n ]\n }\n },\n \"styling\": {\n \"styles\": {\n \"global\": {\n \"accent_color\": \"#1A73E8\",\n \"primary_background_color\": \"#FFFFFF\",\n \"font_family\": \"Inter\"\n },\n \"header\": {\n \"logo\": \"https://cdn.example.com/logo.png\",\n \"font_weight\": 600\n },\n \"button\": {\n \"corner_radius\": 8,\n \"font_weight\": 500\n }\n },\n \"flags\": {\n \"force_default_styles\": false\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "8005ca91-dcfb-4428-b9f6-49c6e3446474",
"name": "Main Checkout",
"status": "PUBLISHED",
"is_default": true,
"config": {
"payment_methods": [],
"general_settings": {}
},
"styling": {
"styles": {},
"settings": {},
"flags": {}
}
}{
"code": "INVALID_PARAMETERS",
"messages": [
"payment_methods[0].order_to_show must be >= 0",
"styles.global.accent_color must be a 6- or 8-digit hex color (#RRGGBB or #RRGGBBAA)"
]
}{
"code": "NOT_AUTHENTICATED",
"messages": [
"Not authenticated"
]
}{
"code": "<string>",
"messages": [
"<string>"
]
}Authorizations
Merchant public API key. Found in Yuno dashboard → Settings → API Keys.
Merchant private secret key, paired with the public key. Never embed in client-side code.
UUID of the merchant account scope for the request. The tenant is resolved only from this header.
Headers
Client-generated UUID. Re-sending the same request with the same key is safe and will not double-publish.
Path Parameters
The unique identifier of the checkout to update (UUID, 36 chars). Non-UUID values are rejected with 400 before processing.
Body
At least one of config or styling is required.
Checkout configuration: payment methods and general settings. Sparse upsert — omitted payment methods keep their previous state.
Show child attributes
Show child attributes
Checkout styling and SDK settings. Partial merge — omitted or null fields are preserved; use flags.force_default_styles to reset. settings.urls, settings.click_to_pay, settings.form and settings.google_pay are beta-locked and rejected if sent with a non-empty value.
Show child attributes
Show child attributes
Response
The updated checkout (configuration + styling composed). Its identifier is exposed as the top-level id.
The response is of type object.
Was this page helpful?
curl --request PUT \
--url https://api.y.uno/v1/checkouts/{checkout_code} \
--header 'Content-Type: application/json' \
--header 'PRIVATE-SECRET-KEY: <api-key>' \
--header 'PUBLIC-API-KEY: <api-key>' \
--header 'X-Account-Code: <api-key>' \
--data '
{
"config": {
"payment_methods": [
{
"payment_method_type": "CARD",
"order_to_show": 0,
"is_active": true,
"active_enrollment_type": "BOTH",
"conditions_to_override": [],
"required_fields_to_override": {
"is_active": true,
"fields": [
{
"field_name": "security_code",
"is_active": true,
"current_value": "ALWAYS",
"conditions_to_override": [
{
"name": "BR only",
"is_active": true,
"priority": 1,
"conditions": [
{
"condition_type": "COUNTRY",
"conditional": "ONE_OF",
"values": [
"BR"
]
}
]
}
]
}
],
"enrollment_fields": [],
"is_enrollment_active": true
}
}
],
"general_settings": {
"country_documents": [
{
"country_code": "BR",
"documents": [
"CPF",
"CNPJ"
]
}
]
}
},
"styling": {
"styles": {
"global": {
"accent_color": "#1A73E8",
"primary_background_color": "#FFFFFF",
"font_family": "Inter"
},
"header": {
"logo": "https://cdn.example.com/logo.png",
"font_weight": 600
},
"button": {
"corner_radius": 8,
"font_weight": 500
}
},
"flags": {
"force_default_styles": false
}
}
}
'import requests
url = "https://api.y.uno/v1/checkouts/{checkout_code}"
payload = {
"config": {
"payment_methods": [
{
"payment_method_type": "CARD",
"order_to_show": 0,
"is_active": True,
"active_enrollment_type": "BOTH",
"conditions_to_override": [],
"required_fields_to_override": {
"is_active": True,
"fields": [
{
"field_name": "security_code",
"is_active": True,
"current_value": "ALWAYS",
"conditions_to_override": [
{
"name": "BR only",
"is_active": True,
"priority": 1,
"conditions": [
{
"condition_type": "COUNTRY",
"conditional": "ONE_OF",
"values": ["BR"]
}
]
}
]
}
],
"enrollment_fields": [],
"is_enrollment_active": True
}
}
],
"general_settings": { "country_documents": [
{
"country_code": "BR",
"documents": ["CPF", "CNPJ"]
}
] }
},
"styling": {
"styles": {
"global": {
"accent_color": "#1A73E8",
"primary_background_color": "#FFFFFF",
"font_family": "Inter"
},
"header": {
"logo": "https://cdn.example.com/logo.png",
"font_weight": 600
},
"button": {
"corner_radius": 8,
"font_weight": 500
}
},
"flags": { "force_default_styles": False }
}
}
headers = {
"PUBLIC-API-KEY": "<api-key>",
"PRIVATE-SECRET-KEY": "<api-key>",
"X-Account-Code": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'PUBLIC-API-KEY': '<api-key>',
'PRIVATE-SECRET-KEY': '<api-key>',
'X-Account-Code': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
config: {
payment_methods: [
{
payment_method_type: 'CARD',
order_to_show: 0,
is_active: true,
active_enrollment_type: 'BOTH',
conditions_to_override: [],
required_fields_to_override: {
is_active: true,
fields: [
{
field_name: 'security_code',
is_active: true,
current_value: 'ALWAYS',
conditions_to_override: [
{
name: 'BR only',
is_active: true,
priority: 1,
conditions: [{condition_type: 'COUNTRY', conditional: 'ONE_OF', values: ['BR']}]
}
]
}
],
enrollment_fields: [],
is_enrollment_active: true
}
}
],
general_settings: {country_documents: [{country_code: 'BR', documents: ['CPF', 'CNPJ']}]}
},
styling: {
styles: {
global: {
accent_color: '#1A73E8',
primary_background_color: '#FFFFFF',
font_family: 'Inter'
},
header: {logo: 'https://cdn.example.com/logo.png', font_weight: 600},
button: {corner_radius: 8, font_weight: 500}
},
flags: {force_default_styles: false}
}
})
};
fetch('https://api.y.uno/v1/checkouts/{checkout_code}', 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.y.uno/v1/checkouts/{checkout_code}",
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([
'config' => [
'payment_methods' => [
[
'payment_method_type' => 'CARD',
'order_to_show' => 0,
'is_active' => true,
'active_enrollment_type' => 'BOTH',
'conditions_to_override' => [
],
'required_fields_to_override' => [
'is_active' => true,
'fields' => [
[
'field_name' => 'security_code',
'is_active' => true,
'current_value' => 'ALWAYS',
'conditions_to_override' => [
[
'name' => 'BR only',
'is_active' => true,
'priority' => 1,
'conditions' => [
[
'condition_type' => 'COUNTRY',
'conditional' => 'ONE_OF',
'values' => [
'BR'
]
]
]
]
]
]
],
'enrollment_fields' => [
],
'is_enrollment_active' => true
]
]
],
'general_settings' => [
'country_documents' => [
[
'country_code' => 'BR',
'documents' => [
'CPF',
'CNPJ'
]
]
]
]
],
'styling' => [
'styles' => [
'global' => [
'accent_color' => '#1A73E8',
'primary_background_color' => '#FFFFFF',
'font_family' => 'Inter'
],
'header' => [
'logo' => 'https://cdn.example.com/logo.png',
'font_weight' => 600
],
'button' => [
'corner_radius' => 8,
'font_weight' => 500
]
],
'flags' => [
'force_default_styles' => false
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"PRIVATE-SECRET-KEY: <api-key>",
"PUBLIC-API-KEY: <api-key>",
"X-Account-Code: <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.y.uno/v1/checkouts/{checkout_code}"
payload := strings.NewReader("{\n \"config\": {\n \"payment_methods\": [\n {\n \"payment_method_type\": \"CARD\",\n \"order_to_show\": 0,\n \"is_active\": true,\n \"active_enrollment_type\": \"BOTH\",\n \"conditions_to_override\": [],\n \"required_fields_to_override\": {\n \"is_active\": true,\n \"fields\": [\n {\n \"field_name\": \"security_code\",\n \"is_active\": true,\n \"current_value\": \"ALWAYS\",\n \"conditions_to_override\": [\n {\n \"name\": \"BR only\",\n \"is_active\": true,\n \"priority\": 1,\n \"conditions\": [\n {\n \"condition_type\": \"COUNTRY\",\n \"conditional\": \"ONE_OF\",\n \"values\": [\n \"BR\"\n ]\n }\n ]\n }\n ]\n }\n ],\n \"enrollment_fields\": [],\n \"is_enrollment_active\": true\n }\n }\n ],\n \"general_settings\": {\n \"country_documents\": [\n {\n \"country_code\": \"BR\",\n \"documents\": [\n \"CPF\",\n \"CNPJ\"\n ]\n }\n ]\n }\n },\n \"styling\": {\n \"styles\": {\n \"global\": {\n \"accent_color\": \"#1A73E8\",\n \"primary_background_color\": \"#FFFFFF\",\n \"font_family\": \"Inter\"\n },\n \"header\": {\n \"logo\": \"https://cdn.example.com/logo.png\",\n \"font_weight\": 600\n },\n \"button\": {\n \"corner_radius\": 8,\n \"font_weight\": 500\n }\n },\n \"flags\": {\n \"force_default_styles\": false\n }\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("PUBLIC-API-KEY", "<api-key>")
req.Header.Add("PRIVATE-SECRET-KEY", "<api-key>")
req.Header.Add("X-Account-Code", "<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.y.uno/v1/checkouts/{checkout_code}")
.header("PUBLIC-API-KEY", "<api-key>")
.header("PRIVATE-SECRET-KEY", "<api-key>")
.header("X-Account-Code", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"config\": {\n \"payment_methods\": [\n {\n \"payment_method_type\": \"CARD\",\n \"order_to_show\": 0,\n \"is_active\": true,\n \"active_enrollment_type\": \"BOTH\",\n \"conditions_to_override\": [],\n \"required_fields_to_override\": {\n \"is_active\": true,\n \"fields\": [\n {\n \"field_name\": \"security_code\",\n \"is_active\": true,\n \"current_value\": \"ALWAYS\",\n \"conditions_to_override\": [\n {\n \"name\": \"BR only\",\n \"is_active\": true,\n \"priority\": 1,\n \"conditions\": [\n {\n \"condition_type\": \"COUNTRY\",\n \"conditional\": \"ONE_OF\",\n \"values\": [\n \"BR\"\n ]\n }\n ]\n }\n ]\n }\n ],\n \"enrollment_fields\": [],\n \"is_enrollment_active\": true\n }\n }\n ],\n \"general_settings\": {\n \"country_documents\": [\n {\n \"country_code\": \"BR\",\n \"documents\": [\n \"CPF\",\n \"CNPJ\"\n ]\n }\n ]\n }\n },\n \"styling\": {\n \"styles\": {\n \"global\": {\n \"accent_color\": \"#1A73E8\",\n \"primary_background_color\": \"#FFFFFF\",\n \"font_family\": \"Inter\"\n },\n \"header\": {\n \"logo\": \"https://cdn.example.com/logo.png\",\n \"font_weight\": 600\n },\n \"button\": {\n \"corner_radius\": 8,\n \"font_weight\": 500\n }\n },\n \"flags\": {\n \"force_default_styles\": false\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.y.uno/v1/checkouts/{checkout_code}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["PUBLIC-API-KEY"] = '<api-key>'
request["PRIVATE-SECRET-KEY"] = '<api-key>'
request["X-Account-Code"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"config\": {\n \"payment_methods\": [\n {\n \"payment_method_type\": \"CARD\",\n \"order_to_show\": 0,\n \"is_active\": true,\n \"active_enrollment_type\": \"BOTH\",\n \"conditions_to_override\": [],\n \"required_fields_to_override\": {\n \"is_active\": true,\n \"fields\": [\n {\n \"field_name\": \"security_code\",\n \"is_active\": true,\n \"current_value\": \"ALWAYS\",\n \"conditions_to_override\": [\n {\n \"name\": \"BR only\",\n \"is_active\": true,\n \"priority\": 1,\n \"conditions\": [\n {\n \"condition_type\": \"COUNTRY\",\n \"conditional\": \"ONE_OF\",\n \"values\": [\n \"BR\"\n ]\n }\n ]\n }\n ]\n }\n ],\n \"enrollment_fields\": [],\n \"is_enrollment_active\": true\n }\n }\n ],\n \"general_settings\": {\n \"country_documents\": [\n {\n \"country_code\": \"BR\",\n \"documents\": [\n \"CPF\",\n \"CNPJ\"\n ]\n }\n ]\n }\n },\n \"styling\": {\n \"styles\": {\n \"global\": {\n \"accent_color\": \"#1A73E8\",\n \"primary_background_color\": \"#FFFFFF\",\n \"font_family\": \"Inter\"\n },\n \"header\": {\n \"logo\": \"https://cdn.example.com/logo.png\",\n \"font_weight\": 600\n },\n \"button\": {\n \"corner_radius\": 8,\n \"font_weight\": 500\n }\n },\n \"flags\": {\n \"force_default_styles\": false\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "8005ca91-dcfb-4428-b9f6-49c6e3446474",
"name": "Main Checkout",
"status": "PUBLISHED",
"is_default": true,
"config": {
"payment_methods": [],
"general_settings": {}
},
"styling": {
"styles": {},
"settings": {},
"flags": {}
}
}{
"code": "INVALID_PARAMETERS",
"messages": [
"payment_methods[0].order_to_show must be >= 0",
"styles.global.accent_color must be a 6- or 8-digit hex color (#RRGGBB or #RRGGBBAA)"
]
}{
"code": "NOT_AUTHENTICATED",
"messages": [
"Not authenticated"
]
}{
"code": "<string>",
"messages": [
"<string>"
]
}