Update plan
curl --request PATCH \
--url https://api.lojou.app/v1/plans/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"product_pid": "<string>",
"price": 1,
"name": "<string>",
"description": "<string>",
"plan_id": "<string>",
"billing_interval_count": 2,
"trial_days": 1,
"is_active": true
}
'import requests
url = "https://api.lojou.app/v1/plans/{id}"
payload = {
"product_pid": "<string>",
"price": 1,
"name": "<string>",
"description": "<string>",
"plan_id": "<string>",
"billing_interval_count": 2,
"trial_days": 1,
"is_active": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
product_pid: '<string>',
price: 1,
name: '<string>',
description: '<string>',
plan_id: '<string>',
billing_interval_count: 2,
trial_days: 1,
is_active: true
})
};
fetch('https://api.lojou.app/v1/plans/{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://api.lojou.app/v1/plans/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'product_pid' => '<string>',
'price' => 1,
'name' => '<string>',
'description' => '<string>',
'plan_id' => '<string>',
'billing_interval_count' => 2,
'trial_days' => 1,
'is_active' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.lojou.app/v1/plans/{id}"
payload := strings.NewReader("{\n \"product_pid\": \"<string>\",\n \"price\": 1,\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"plan_id\": \"<string>\",\n \"billing_interval_count\": 2,\n \"trial_days\": 1,\n \"is_active\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://api.lojou.app/v1/plans/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"product_pid\": \"<string>\",\n \"price\": 1,\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"plan_id\": \"<string>\",\n \"billing_interval_count\": 2,\n \"trial_days\": 1,\n \"is_active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lojou.app/v1/plans/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"product_pid\": \"<string>\",\n \"price\": 1,\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"plan_id\": \"<string>\",\n \"billing_interval_count\": 2,\n \"trial_days\": 1,\n \"is_active\": true\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Plan updated successfully.",
"data": {
"id": 14,
"store_product_id": 300,
"plan_id": "8k2mZ",
"name": "Mensal",
"description": "Acesso a todo o conteúdo, renovado todo mês.",
"price": 1800,
"currency": "MZN",
"billing_interval": "monthly",
"billing_interval_count": 1,
"trial_days": 7,
"is_active": true,
"product": {
"id": 300,
"name": "Mentoria Mensal",
"product_pid": "J5bgs",
"type": "recurring",
"price": 1800
},
"created_at": "2026-08-31T16:15:00.000000Z",
"updated_at": "2026-08-31T17:00:00.000000Z"
}
}{
"status": "error",
"message": "Unauthorized user."
}{
"status": "error",
"message": "Permission denied for this endpoint.",
"error_code": "insufficient_scope",
"required_scopes": [
"orders.read"
],
"missing_scopes": [
"orders.read"
],
"granted_scopes": [
"products.read",
"products.write"
]
}{
"status": "error",
"message": "Resource not found."
}{
"status": "error",
"message": "Validation failed.",
"errors": {
"amount": [
"The amount field is required."
]
}
}Plans
Update plan
PATCH
/
v1
/
plans
/
{id}
Update plan
curl --request PATCH \
--url https://api.lojou.app/v1/plans/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"product_pid": "<string>",
"price": 1,
"name": "<string>",
"description": "<string>",
"plan_id": "<string>",
"billing_interval_count": 2,
"trial_days": 1,
"is_active": true
}
'import requests
url = "https://api.lojou.app/v1/plans/{id}"
payload = {
"product_pid": "<string>",
"price": 1,
"name": "<string>",
"description": "<string>",
"plan_id": "<string>",
"billing_interval_count": 2,
"trial_days": 1,
"is_active": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
product_pid: '<string>',
price: 1,
name: '<string>',
description: '<string>',
plan_id: '<string>',
billing_interval_count: 2,
trial_days: 1,
is_active: true
})
};
fetch('https://api.lojou.app/v1/plans/{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://api.lojou.app/v1/plans/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'product_pid' => '<string>',
'price' => 1,
'name' => '<string>',
'description' => '<string>',
'plan_id' => '<string>',
'billing_interval_count' => 2,
'trial_days' => 1,
'is_active' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.lojou.app/v1/plans/{id}"
payload := strings.NewReader("{\n \"product_pid\": \"<string>\",\n \"price\": 1,\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"plan_id\": \"<string>\",\n \"billing_interval_count\": 2,\n \"trial_days\": 1,\n \"is_active\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://api.lojou.app/v1/plans/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"product_pid\": \"<string>\",\n \"price\": 1,\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"plan_id\": \"<string>\",\n \"billing_interval_count\": 2,\n \"trial_days\": 1,\n \"is_active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lojou.app/v1/plans/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"product_pid\": \"<string>\",\n \"price\": 1,\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"plan_id\": \"<string>\",\n \"billing_interval_count\": 2,\n \"trial_days\": 1,\n \"is_active\": true\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Plan updated successfully.",
"data": {
"id": 14,
"store_product_id": 300,
"plan_id": "8k2mZ",
"name": "Mensal",
"description": "Acesso a todo o conteúdo, renovado todo mês.",
"price": 1800,
"currency": "MZN",
"billing_interval": "monthly",
"billing_interval_count": 1,
"trial_days": 7,
"is_active": true,
"product": {
"id": 300,
"name": "Mentoria Mensal",
"product_pid": "J5bgs",
"type": "recurring",
"price": 1800
},
"created_at": "2026-08-31T16:15:00.000000Z",
"updated_at": "2026-08-31T17:00:00.000000Z"
}
}{
"status": "error",
"message": "Unauthorized user."
}{
"status": "error",
"message": "Permission denied for this endpoint.",
"error_code": "insufficient_scope",
"required_scopes": [
"orders.read"
],
"missing_scopes": [
"orders.read"
],
"granted_scopes": [
"products.read",
"products.write"
]
}{
"status": "error",
"message": "Resource not found."
}{
"status": "error",
"message": "Validation failed.",
"errors": {
"amount": [
"The amount field is required."
]
}
}Autorizações
Send an API key or an OAuth access token in the Authorization header
as a Bearer token. See Authentication for details.
Parâmetros de caminho
Resource identifier.
Corpo
application/json
Intervalo necessário:
x >= 0Opções disponíveis:
daily, weekly, monthly, yearly Intervalo necessário:
x >= 1Intervalo necessário:
x >= 0Resposta
Success
The response is of type object.
