Skip to main content
PATCH
/
subscriptions
/
{subscriptionId}
cURL
curl --request PATCH \
  --url https://api.juo.io/customer/v1/subscriptions/{subscriptionId} \
  --header 'Content-Type: application/json' \
  --header 'X-Delegated-Token: <api-key>' \
  --header 'X-Tenant-ID: <x-tenant-id>' \
  --data '
{
  "paymentMethod": {
    "id": "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>"
  },
  "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>",
  "nextBillingDate": "<unknown>",
  "currentCycle": 1,
  "currencyCode": "<string>",
  "deliveryMethod": "<unknown>",
  "items": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "resource": "subscription-item",
      "title": "<string>",
      "subtitle": "<unknown>",
      "quantity": 2,
      "totalPrice": 1,
      "recurringCycleLimit": "<unknown>",
      "canceledAt": "<unknown>",
      "billingPolicy": "<unknown>",
      "deliveryPolicy": "<unknown>",
      "variant": "<string>"
    }
  ],
  "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",
  "deliveryAddress": "<unknown>",
  "deliveryPrice": 1
}

Authorizations

X-Delegated-Token
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
paymentMethod
object
deliveryAddress
Address · 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.

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
currencyCode
string
required

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

Required string length: 3
deliveryMethod
object
required
items
SubscriptionItem · object[]
required
Minimum array length: 1
discounts
SubscriptionDiscount · object[]
required
paymentMethod
required

This field is expandable.

deliveryAddress
object
required
deliveryPrice
number
required

The base delivery price associated with the selected delivery method.

Required range: x >= 0