curl --location 'https://sandbox-api-pay.lytex.com.br/v2/invoices' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{token}}' \
--data '{
"_clientId": "69efc5b276b510aa8e66b498",
"description": "Mensalidade referente ao mês 05",
"totalValue": 5000,
"paymentMethods": {
"pix": {
"enable": false
},
"boleto": {
"enable": false
},
"creditCard": {
"enable": true,
"maxParcels": 3
}
},
"dueDate": "2026-04-29"
}'
$url = 'https://sandbox-api-pay.lytex.com.br/v2/invoices';
$data = [
"_clientId" => "69efc5b276b510aa8e66b498",
"description" => "Mensalidade referente ao mês 05",
"totalValue" => 5000,
"paymentMethods" => [
"pix" => [
"enable" => false
],
"boleto" => [
"enable" => false
],
"creditCard" => [
"enable" => true,
"maxParcels" => 3
]
],
"dueDate" => "2026-04-29"
];
$headers = [
'Content-Type: application/json',
'Authorization: Bearer {{token}}'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $response;
import requests
url = "https://sandbox-api-pay.lytex.com.br/v2/invoices"
payload = {
"_clientId": "69efc5b276b510aa8e66b498",
"description": "Mensalidade referente ao mês 05",
"totalValue": 5000,
"paymentMethods": {
"pix": {
"enable": False
},
"boleto": {
"enable": False
},
"creditCard": {
"enable": True,
"maxParcels": 3
}
},
"dueDate": "2026-04-29"
}
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer {{token}}"
}
response = requests.post(
url,
json=payload,
headers=headers
)
print(response.status_code)
print(response.json())
const axios = require('axios');
const url = 'https://sandbox-api-pay.lytex.com.br/v2/invoices';
const payload = {
_clientId: '69efc5b276b510aa8e66b498',
description: 'Mensalidade referente ao mês 05',
totalValue: 5000,
paymentMethods: {
pix: {
enable: false
},
boleto: {
enable: false
},
creditCard: {
enable: true,
maxParcels: 3
}
},
dueDate: '2026-04-29'
};
const headers = {
'Content-Type': 'application/json',
Authorization: 'Bearer {{token}}'
};
axios.post(url, payload, { headers })
.then((response) => {
console.log(response.status);
console.log(response.data);
})
.catch((error) => {
console.error(error.response?.data || error.message);
});
package main
import (
"bytes"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://sandbox-api-pay.lytex.com.br/v2/invoices"
payload := []byte(`{
"_clientId": "69efc5b276b510aa8e66b498",
"description": "Mensalidade referente ao mês 05",
"totalValue": 5000,
"paymentMethods": {
"pix": {
"enable": false
},
"boleto": {
"enable": false
},
"creditCard": {
"enable": true,
"maxParcels": 3
}
},
"dueDate": "2026-04-29"
}`)
req, err := http.NewRequest("POST", url, bytes.NewBuffer(payload))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer {{token}}")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(resp.Status)
fmt.Println(string(body))
}
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
using var client = new HttpClient();
client.DefaultRequestHeaders.Add(
"Authorization",
"Bearer {{token}}"
);
var json = @"{
""_clientId"": ""69efc5b276b510aa8e66b498"",
""description"": ""Mensalidade referente ao mês 05"",
""totalValue"": 5000,
""paymentMethods"": {
""pix"": {
""enable"": false
},
""boleto"": {
""enable"": false
},
""creditCard"": {
""enable"": true,
""maxParcels"": 3
}
},
""dueDate"": ""2026-04-29""
}";
var content = new StringContent(
json,
Encoding.UTF8,
"application/json"
);
var response = await client.PostAsync(
"https://sandbox-api-pay.lytex.com.br/v2/invoices",
content
);
var responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(responseBody);
}
}
require 'net/http'
require 'uri'
require 'json'
url = URI.parse('https://sandbox-api-pay.lytex.com.br/v2/invoices')
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url.path)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer {{token}}'
request.body = {
_clientId: '69efc5b276b510aa8e66b498',
description: 'Mensalidade referente ao mês 05',
totalValue: 5000,
paymentMethods: {
pix: {
enable: false
},
boleto: {
enable: false
},
creditCard: {
enable: true,
maxParcels: 3
}
},
dueDate: '2026-04-29'
}.to_json
response = http.request(request)
puts response.code
puts response.body