Skip to main content
PATCH
/
subscriptions
/
{subscriptionId}
cURL
curl --request PATCH \
  --url https://api.juo.io/admin/v1/subscriptions/{subscriptionId} \
  --header 'Content-Type: application/json' \
  --header 'X-Juo-Admin-Api-Key: <api-key>' \
  --header 'X-Tenant-ID: <x-tenant-id>' \
  --data '
{
  "deliveryPrice": 1,
  "paymentMethod": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "deliveryAddress": {
    "firstName": "<unknown>",
    "lastName": "<unknown>",
    "address1": "<unknown>",
    "address2": "<unknown>",
    "zip": "<unknown>",
    "city": "<unknown>",
    "country": "<unknown>",
    "countryCode": "<unknown>",
    "provinceCode": "<unknown>",
    "province": "<unknown>",
    "phone": "<unknown>",
    "company": "<unknown>"
  },
  "deliveryMethod": {
    "type": "shipping",
    "title": "<string>",
    "description": "<string>"
  },
  "nextBillingDate": "2023-11-07T05:31:56Z"
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "resource": "subscription",
  "serial": "<string>",
  "status": "active",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "canceledAt": "<unknown>",
  "customer": "<string>",
  "nextBillingDate": "<unknown>",
  "currentCycle": 1,
  "items": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "resource": "subscription-item",
      "title": "<string>",
      "subtitle": "<unknown>",
      "quantity": 2,
      "totalPrice": 1,
      "variant": "<string>",
      "recurringCycleLimit": "<unknown>",
      "canceledAt": "<unknown>"
    }
  ],
  "discounts": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "resource": "subscription-discount",
      "title": "<unknown>",
      "target": {
        "type": "shipping"
      },
      "value": {
        "amount": 123,
        "type": "fixed-amount",
        "appliesOnEachItem": true
      },
      "recurringCycleLimit": "<unknown>"
    }
  ],
  "paymentMethod": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "currencyCode": "<string>",
  "deliveryAddress": "<unknown>",
  "deliveryMethod": "<unknown>",
  "deliveryPrice": 1
}

Authorizations

X-Juo-Admin-Api-Key
string
header
required

Headers

X-Tenant-ID
string
required

Unique identifier of the tenant in the system (usually a store identifier)

Path Parameters

subscriptionId
string<uuid>
required

The subscription identifier

Body

application/json
deliveryPrice
number

The delivery price for the upcoming renewal.

Required range: x >= 0
paymentMethod
string<uuid>
deliveryAddress
object
deliveryMethod
object
nextBillingDate

Response

200 - application/json

Default Response

id
string<uuid>
required
resource
enum<string>
required
Available options:
subscription
serial
string
required

Unique serial number that increments sequentially with each new subscription within a store.

Minimum string length: 1
status
enum<string>
required
Available options:
active,
paused,
canceled,
failed,
expired,
merged
createdAt
string<date-time>
required

Purchase date of the subscription.

updatedAt
string<date-time>
required

Last update date of the subscription.

canceledAt
null | string<date-time>
required

Cancellation date of the subscription.

customer
required

This field is expandable.

Minimum string length: 1
nextBillingDate
null | string<date-time>
required

The next billing date determines when the renewal process begins its billing phase. When billing succeeds, it creates one order—or multiple orders for prepaid subscriptions.

currentCycle
integer
required

The subscription's billing cycle count. It starts at 0 (before the first billing is completed), changes to 1 (after one billing is completed), and increases by 1 with each subsequent billing.

Required range: x >= 0
items
SubscriptionItem · object[]
required
Minimum array length: 1
discounts
SubscriptionDiscount · object[]
required
paymentMethod
required

This field is expandable.

currencyCode
string
required

The currency that applies to both item prices and delivery price.

Required string length: 3
deliveryAddress
object
required
deliveryMethod
object
required
deliveryPrice
number
required

The delivery price for the upcoming renewal.

Required range: x >= 0