Update a subscription item
curl --request PATCH \
--url https://api.juo.io/admin/v1/subscriptions/{subscriptionId}/items/{itemId} \
--header 'Content-Type: application/json' \
--header 'X-Juo-Admin-Api-Key: <api-key>' \
--header 'X-Tenant-ID: <x-tenant-id>' \
--data '
{
"quantity": 1,
"billingPolicy": {
"intervalCount": 183,
"anchors": [
{
"day": 16,
"month": 6,
"cutoffDay": 16
}
],
"minCycles": 2,
"maxCycles": 2
},
"deliveryPolicy": {
"intervalCount": 183,
"anchors": [
{
"day": 16,
"month": 6,
"cutoffDay": 16
}
]
}
}
'import requests
url = "https://api.juo.io/admin/v1/subscriptions/{subscriptionId}/items/{itemId}"
payload = {
"quantity": 1,
"billingPolicy": {
"intervalCount": 183,
"anchors": [
{
"day": 16,
"month": 6,
"cutoffDay": 16
}
],
"minCycles": 2,
"maxCycles": 2
},
"deliveryPolicy": {
"intervalCount": 183,
"anchors": [
{
"day": 16,
"month": 6,
"cutoffDay": 16
}
]
}
}
headers = {
"X-Tenant-ID": "<x-tenant-id>",
"X-Juo-Admin-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'X-Tenant-ID': '<x-tenant-id>',
'X-Juo-Admin-Api-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
quantity: 1,
billingPolicy: {
intervalCount: 183,
anchors: [{day: 16, month: 6, cutoffDay: 16}],
minCycles: 2,
maxCycles: 2
},
deliveryPolicy: {intervalCount: 183, anchors: [{day: 16, month: 6, cutoffDay: 16}]}
})
};
fetch('https://api.juo.io/admin/v1/subscriptions/{subscriptionId}/items/{itemId}', 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.juo.io/admin/v1/subscriptions/{subscriptionId}/items/{itemId}",
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([
'quantity' => 1,
'billingPolicy' => [
'intervalCount' => 183,
'anchors' => [
[
'day' => 16,
'month' => 6,
'cutoffDay' => 16
]
],
'minCycles' => 2,
'maxCycles' => 2
],
'deliveryPolicy' => [
'intervalCount' => 183,
'anchors' => [
[
'day' => 16,
'month' => 6,
'cutoffDay' => 16
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Juo-Admin-Api-Key: <api-key>",
"X-Tenant-ID: <x-tenant-id>"
],
]);
$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.juo.io/admin/v1/subscriptions/{subscriptionId}/items/{itemId}"
payload := strings.NewReader("{\n \"quantity\": 1,\n \"billingPolicy\": {\n \"intervalCount\": 183,\n \"anchors\": [\n {\n \"day\": 16,\n \"month\": 6,\n \"cutoffDay\": 16\n }\n ],\n \"minCycles\": 2,\n \"maxCycles\": 2\n },\n \"deliveryPolicy\": {\n \"intervalCount\": 183,\n \"anchors\": [\n {\n \"day\": 16,\n \"month\": 6,\n \"cutoffDay\": 16\n }\n ]\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Tenant-ID", "<x-tenant-id>")
req.Header.Add("X-Juo-Admin-Api-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.patch("https://api.juo.io/admin/v1/subscriptions/{subscriptionId}/items/{itemId}")
.header("X-Tenant-ID", "<x-tenant-id>")
.header("X-Juo-Admin-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"quantity\": 1,\n \"billingPolicy\": {\n \"intervalCount\": 183,\n \"anchors\": [\n {\n \"day\": 16,\n \"month\": 6,\n \"cutoffDay\": 16\n }\n ],\n \"minCycles\": 2,\n \"maxCycles\": 2\n },\n \"deliveryPolicy\": {\n \"intervalCount\": 183,\n \"anchors\": [\n {\n \"day\": 16,\n \"month\": 6,\n \"cutoffDay\": 16\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.juo.io/admin/v1/subscriptions/{subscriptionId}/items/{itemId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Tenant-ID"] = '<x-tenant-id>'
request["X-Juo-Admin-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"quantity\": 1,\n \"billingPolicy\": {\n \"intervalCount\": 183,\n \"anchors\": [\n {\n \"day\": 16,\n \"month\": 6,\n \"cutoffDay\": 16\n }\n ],\n \"minCycles\": 2,\n \"maxCycles\": 2\n },\n \"deliveryPolicy\": {\n \"intervalCount\": 183,\n \"anchors\": [\n {\n \"day\": 16,\n \"month\": 6,\n \"cutoffDay\": 16\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"resource": "subscription-item",
"title": "Monthly Coffee Blend",
"subtitle": "250g / Ground",
"quantity": 1,
"totalPrice": 24.99,
"recurringCycleLimit": 3,
"canceledAt": "2023-11-07T05:31:56Z",
"billingPolicy": {
"interval": "DAY",
"intervalCount": 2,
"anchors": [
{
"type": "WEEKDAY",
"day": 16,
"month": 6,
"cutoffDay": 16
}
],
"minCycles": 2,
"maxCycles": 2
},
"deliveryPolicy": {
"interval": "DAY",
"intervalCount": 2,
"anchors": [
{
"type": "WEEKDAY",
"day": 16,
"month": 6,
"cutoffDay": 16
}
]
},
"customAttributes": [
{
"key": "<string>",
"value": "<string>"
}
],
"variant": "<string>",
"product": "<string>"
}Subscription items
Update subscription item
Used to update a subscription item.
PATCH
/
subscriptions
/
{subscriptionId}
/
items
/
{itemId}
Update a subscription item
curl --request PATCH \
--url https://api.juo.io/admin/v1/subscriptions/{subscriptionId}/items/{itemId} \
--header 'Content-Type: application/json' \
--header 'X-Juo-Admin-Api-Key: <api-key>' \
--header 'X-Tenant-ID: <x-tenant-id>' \
--data '
{
"quantity": 1,
"billingPolicy": {
"intervalCount": 183,
"anchors": [
{
"day": 16,
"month": 6,
"cutoffDay": 16
}
],
"minCycles": 2,
"maxCycles": 2
},
"deliveryPolicy": {
"intervalCount": 183,
"anchors": [
{
"day": 16,
"month": 6,
"cutoffDay": 16
}
]
}
}
'import requests
url = "https://api.juo.io/admin/v1/subscriptions/{subscriptionId}/items/{itemId}"
payload = {
"quantity": 1,
"billingPolicy": {
"intervalCount": 183,
"anchors": [
{
"day": 16,
"month": 6,
"cutoffDay": 16
}
],
"minCycles": 2,
"maxCycles": 2
},
"deliveryPolicy": {
"intervalCount": 183,
"anchors": [
{
"day": 16,
"month": 6,
"cutoffDay": 16
}
]
}
}
headers = {
"X-Tenant-ID": "<x-tenant-id>",
"X-Juo-Admin-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'X-Tenant-ID': '<x-tenant-id>',
'X-Juo-Admin-Api-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
quantity: 1,
billingPolicy: {
intervalCount: 183,
anchors: [{day: 16, month: 6, cutoffDay: 16}],
minCycles: 2,
maxCycles: 2
},
deliveryPolicy: {intervalCount: 183, anchors: [{day: 16, month: 6, cutoffDay: 16}]}
})
};
fetch('https://api.juo.io/admin/v1/subscriptions/{subscriptionId}/items/{itemId}', 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.juo.io/admin/v1/subscriptions/{subscriptionId}/items/{itemId}",
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([
'quantity' => 1,
'billingPolicy' => [
'intervalCount' => 183,
'anchors' => [
[
'day' => 16,
'month' => 6,
'cutoffDay' => 16
]
],
'minCycles' => 2,
'maxCycles' => 2
],
'deliveryPolicy' => [
'intervalCount' => 183,
'anchors' => [
[
'day' => 16,
'month' => 6,
'cutoffDay' => 16
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Juo-Admin-Api-Key: <api-key>",
"X-Tenant-ID: <x-tenant-id>"
],
]);
$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.juo.io/admin/v1/subscriptions/{subscriptionId}/items/{itemId}"
payload := strings.NewReader("{\n \"quantity\": 1,\n \"billingPolicy\": {\n \"intervalCount\": 183,\n \"anchors\": [\n {\n \"day\": 16,\n \"month\": 6,\n \"cutoffDay\": 16\n }\n ],\n \"minCycles\": 2,\n \"maxCycles\": 2\n },\n \"deliveryPolicy\": {\n \"intervalCount\": 183,\n \"anchors\": [\n {\n \"day\": 16,\n \"month\": 6,\n \"cutoffDay\": 16\n }\n ]\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Tenant-ID", "<x-tenant-id>")
req.Header.Add("X-Juo-Admin-Api-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.patch("https://api.juo.io/admin/v1/subscriptions/{subscriptionId}/items/{itemId}")
.header("X-Tenant-ID", "<x-tenant-id>")
.header("X-Juo-Admin-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"quantity\": 1,\n \"billingPolicy\": {\n \"intervalCount\": 183,\n \"anchors\": [\n {\n \"day\": 16,\n \"month\": 6,\n \"cutoffDay\": 16\n }\n ],\n \"minCycles\": 2,\n \"maxCycles\": 2\n },\n \"deliveryPolicy\": {\n \"intervalCount\": 183,\n \"anchors\": [\n {\n \"day\": 16,\n \"month\": 6,\n \"cutoffDay\": 16\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.juo.io/admin/v1/subscriptions/{subscriptionId}/items/{itemId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Tenant-ID"] = '<x-tenant-id>'
request["X-Juo-Admin-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"quantity\": 1,\n \"billingPolicy\": {\n \"intervalCount\": 183,\n \"anchors\": [\n {\n \"day\": 16,\n \"month\": 6,\n \"cutoffDay\": 16\n }\n ],\n \"minCycles\": 2,\n \"maxCycles\": 2\n },\n \"deliveryPolicy\": {\n \"intervalCount\": 183,\n \"anchors\": [\n {\n \"day\": 16,\n \"month\": 6,\n \"cutoffDay\": 16\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"resource": "subscription-item",
"title": "Monthly Coffee Blend",
"subtitle": "250g / Ground",
"quantity": 1,
"totalPrice": 24.99,
"recurringCycleLimit": 3,
"canceledAt": "2023-11-07T05:31:56Z",
"billingPolicy": {
"interval": "DAY",
"intervalCount": 2,
"anchors": [
{
"type": "WEEKDAY",
"day": 16,
"month": 6,
"cutoffDay": 16
}
],
"minCycles": 2,
"maxCycles": 2
},
"deliveryPolicy": {
"interval": "DAY",
"intervalCount": 2,
"anchors": [
{
"type": "WEEKDAY",
"day": 16,
"month": 6,
"cutoffDay": 16
}
]
},
"customAttributes": [
{
"key": "<string>",
"value": "<string>"
}
],
"variant": "<string>",
"product": "<string>"
}Authorizations
AdminApiKeyBearerToken
Headers
Path Parameters
Body
application/json
Response
Default Response