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": {
"interval": "DAY",
"intervalCount": 183,
"anchors": [
{
"type": "WEEKDAY",
"day": 16,
"month": 6,
"cutoffDay": 16
}
],
"minCycles": 2,
"maxCycles": 2
},
"deliveryPolicy": {
"interval": "DAY",
"intervalCount": 183,
"anchors": [
{
"type": "WEEKDAY",
"day": 16,
"month": 6,
"cutoffDay": 16
}
]
}
}
'import requests
url = "https://api.juo.io/admin/v1/subscriptions/{subscriptionId}/items/{itemId}"
payload = {
"quantity": 1,
"billingPolicy": {
"interval": "DAY",
"intervalCount": 183,
"anchors": [
{
"type": "WEEKDAY",
"day": 16,
"month": 6,
"cutoffDay": 16
}
],
"minCycles": 2,
"maxCycles": 2
},
"deliveryPolicy": {
"interval": "DAY",
"intervalCount": 183,
"anchors": [
{
"type": "WEEKDAY",
"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: {
interval: 'DAY',
intervalCount: 183,
anchors: [{type: 'WEEKDAY', day: 16, month: 6, cutoffDay: 16}],
minCycles: 2,
maxCycles: 2
},
deliveryPolicy: {
interval: 'DAY',
intervalCount: 183,
anchors: [{type: 'WEEKDAY', 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' => [
'interval' => 'DAY',
'intervalCount' => 183,
'anchors' => [
[
'type' => 'WEEKDAY',
'day' => 16,
'month' => 6,
'cutoffDay' => 16
]
],
'minCycles' => 2,
'maxCycles' => 2
],
'deliveryPolicy' => [
'interval' => 'DAY',
'intervalCount' => 183,
'anchors' => [
[
'type' => 'WEEKDAY',
'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 \"interval\": \"DAY\",\n \"intervalCount\": 183,\n \"anchors\": [\n {\n \"type\": \"WEEKDAY\",\n \"day\": 16,\n \"month\": 6,\n \"cutoffDay\": 16\n }\n ],\n \"minCycles\": 2,\n \"maxCycles\": 2\n },\n \"deliveryPolicy\": {\n \"interval\": \"DAY\",\n \"intervalCount\": 183,\n \"anchors\": [\n {\n \"type\": \"WEEKDAY\",\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 \"interval\": \"DAY\",\n \"intervalCount\": 183,\n \"anchors\": [\n {\n \"type\": \"WEEKDAY\",\n \"day\": 16,\n \"month\": 6,\n \"cutoffDay\": 16\n }\n ],\n \"minCycles\": 2,\n \"maxCycles\": 2\n },\n \"deliveryPolicy\": {\n \"interval\": \"DAY\",\n \"intervalCount\": 183,\n \"anchors\": [\n {\n \"type\": \"WEEKDAY\",\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 \"interval\": \"DAY\",\n \"intervalCount\": 183,\n \"anchors\": [\n {\n \"type\": \"WEEKDAY\",\n \"day\": 16,\n \"month\": 6,\n \"cutoffDay\": 16\n }\n ],\n \"minCycles\": 2,\n \"maxCycles\": 2\n },\n \"deliveryPolicy\": {\n \"interval\": \"DAY\",\n \"intervalCount\": 183,\n \"anchors\": [\n {\n \"type\": \"WEEKDAY\",\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": 183,
"anchors": [
{
"type": "WEEKDAY",
"day": 16,
"month": 6,
"cutoffDay": 16
}
],
"minCycles": 2,
"maxCycles": 2
},
"deliveryPolicy": {
"interval": "DAY",
"intervalCount": 183,
"anchors": [
{
"type": "WEEKDAY",
"day": 16,
"month": 6,
"cutoffDay": 16
}
]
},
"customAttributes": [
{
"key": "<string>",
"value": "<string>"
}
],
"variant": "<string>",
"product": "<string>"
}Update subscription item
Used to 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": {
"interval": "DAY",
"intervalCount": 183,
"anchors": [
{
"type": "WEEKDAY",
"day": 16,
"month": 6,
"cutoffDay": 16
}
],
"minCycles": 2,
"maxCycles": 2
},
"deliveryPolicy": {
"interval": "DAY",
"intervalCount": 183,
"anchors": [
{
"type": "WEEKDAY",
"day": 16,
"month": 6,
"cutoffDay": 16
}
]
}
}
'import requests
url = "https://api.juo.io/admin/v1/subscriptions/{subscriptionId}/items/{itemId}"
payload = {
"quantity": 1,
"billingPolicy": {
"interval": "DAY",
"intervalCount": 183,
"anchors": [
{
"type": "WEEKDAY",
"day": 16,
"month": 6,
"cutoffDay": 16
}
],
"minCycles": 2,
"maxCycles": 2
},
"deliveryPolicy": {
"interval": "DAY",
"intervalCount": 183,
"anchors": [
{
"type": "WEEKDAY",
"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: {
interval: 'DAY',
intervalCount: 183,
anchors: [{type: 'WEEKDAY', day: 16, month: 6, cutoffDay: 16}],
minCycles: 2,
maxCycles: 2
},
deliveryPolicy: {
interval: 'DAY',
intervalCount: 183,
anchors: [{type: 'WEEKDAY', 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' => [
'interval' => 'DAY',
'intervalCount' => 183,
'anchors' => [
[
'type' => 'WEEKDAY',
'day' => 16,
'month' => 6,
'cutoffDay' => 16
]
],
'minCycles' => 2,
'maxCycles' => 2
],
'deliveryPolicy' => [
'interval' => 'DAY',
'intervalCount' => 183,
'anchors' => [
[
'type' => 'WEEKDAY',
'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 \"interval\": \"DAY\",\n \"intervalCount\": 183,\n \"anchors\": [\n {\n \"type\": \"WEEKDAY\",\n \"day\": 16,\n \"month\": 6,\n \"cutoffDay\": 16\n }\n ],\n \"minCycles\": 2,\n \"maxCycles\": 2\n },\n \"deliveryPolicy\": {\n \"interval\": \"DAY\",\n \"intervalCount\": 183,\n \"anchors\": [\n {\n \"type\": \"WEEKDAY\",\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 \"interval\": \"DAY\",\n \"intervalCount\": 183,\n \"anchors\": [\n {\n \"type\": \"WEEKDAY\",\n \"day\": 16,\n \"month\": 6,\n \"cutoffDay\": 16\n }\n ],\n \"minCycles\": 2,\n \"maxCycles\": 2\n },\n \"deliveryPolicy\": {\n \"interval\": \"DAY\",\n \"intervalCount\": 183,\n \"anchors\": [\n {\n \"type\": \"WEEKDAY\",\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 \"interval\": \"DAY\",\n \"intervalCount\": 183,\n \"anchors\": [\n {\n \"type\": \"WEEKDAY\",\n \"day\": 16,\n \"month\": 6,\n \"cutoffDay\": 16\n }\n ],\n \"minCycles\": 2,\n \"maxCycles\": 2\n },\n \"deliveryPolicy\": {\n \"interval\": \"DAY\",\n \"intervalCount\": 183,\n \"anchors\": [\n {\n \"type\": \"WEEKDAY\",\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": 183,
"anchors": [
{
"type": "WEEKDAY",
"day": 16,
"month": 6,
"cutoffDay": 16
}
],
"minCycles": 2,
"maxCycles": 2
},
"deliveryPolicy": {
"interval": "DAY",
"intervalCount": 183,
"anchors": [
{
"type": "WEEKDAY",
"day": 16,
"month": 6,
"cutoffDay": 16
}
]
},
"customAttributes": [
{
"key": "<string>",
"value": "<string>"
}
],
"variant": "<string>",
"product": "<string>"
}Authorizations
Long-lived Admin API key issued from the Juo merchant portal. Pass as the X-Juo-Admin-Api-Key header.
Headers
Unique identifier of the tenant in the system (usually a store identifier)
Path Parameters
The subscription identifier
The subscription item identifier
Body
Response
Default Response
Unique subscription item identifier (UUID).
"a1b2c3d4-e5f6-7890-abcd-ef1234567890"
subscription-item Product title.
1"Monthly Coffee Blend"
Variant title. Matches the variant title in most cases.
1"250g / Ground"
Number of units ordered per billing cycle.
x >= 11
Final item price per billing cycle including all applicable discounts.
x >= 024.99
Maximum number of billing cycles this item remains on the subscription. The item is automatically removed once this limit is reached. Null means no limit.
x >= 13
Cancellation date of the item.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Arbitrary key-value pairs attached to this subscription item. In the Customer API, attributes whose key starts with _ are hidden and excluded.
Show child attributes
Show child attributes
ProductVariant id when not expanded, or the full ProductVariant object when the field name is included in the expand query parameter. Can be null.
1Product id when not expanded, or the full Product object when the field name is included in the expand query parameter. Can be null.
1