Introduction

YITH WooCommerce Subscription Premium 2.4+ and WooCommerce 5.4+ have been fully integrated with the WordPress REST API. This allows WC and Subscriptions data to be read, updated, and deleted using requests in JSON format and using WordPress REST API Authentication methods and standard HTTP verbs which are understood by most HTTP clients.

API VersionWC VersionWP VersionDocumentation
v14.4.x or later5.4 or later-

Requirements

These are the requirements to use the REST API:

  • WordPress 4.4+
  • WooCommerce 5.4+
  • Not plain permalinks in Settings > Permalinks so that the custom endpoints are supported. Default permalinks will not work.
  • You may access the API over either HTTP or HTTPS, but HTTPS is recommended where possible.

Request/Response Format

The default response format is JSON. Requests with a message-body use plain JSON to set or update resource attributes. Successful requests will return a 200 OK HTTP status.

Some general information about responses:

  • Dates are returned in ISO8601 format: YYYY-MM-DDTHH:MM:SS
  • Resource IDs are returned as integers.
  • Any decimal monetary amount, such as prices or totals, will be returned as strings with two decimal places.
  • Other amounts, such as item counts, are returned as integers.
  • Blank fields are generally included as null or empty string instead of being omitted.

Parameters

Almost all endpoints accept optional parameters which can be passed as a HTTP query string parameter, e.g. GET /subscriptions?status=completed. All parameters are documented along each endpoint.

GET /subscriptions?per_page=15

You can specify further pages with the ?page parameter:

GET /subscriptions?page=2

You may also specify the offset from the first resource using the ?offset parameter:

GET /subscriptions?offset=5

Page number is 1-based and omitting the ?page parameter will return the first page.

The total number of resources and pages are always included in the X-WP-Total and X-WP-TotalPages HTTP headers.

Errors

Occasionally, you might encounter errors when accessing the REST API. There are four possible types:

Error Code Error Type
400 Bad Request Invalid request, e.g. using an unsupported HTTP method
401 Unauthorized Authentication or permission error, e.g. incorrect API keys
404 Not Found Requests to resources that don't exist or are missing
500 Internal Server Error Server error

Authentication

WooCommerce includes two ways to authenticate with the WP REST API. It is also possible to authenticate using any WP REST API authentication plugin or method.

Please refer to WooCommerce's guide on generating REST API keys and authentication.

Subscriptions

YITH WooCommerce Subscription Premium allows you to view a list of subscriptions or view, update or delete a single subscription.

Subscription Properties

These are all the properties that will be sent when a subscription is requested. A subscription can be editable or not and this depends on the payment method used to pay the main subscription order. To do this, some properties can be updated only if the subscription is editable.

Attribute Type Description Editable Subscription No Editable Subscription
id integer Unique identifier for the resource. read-only read-only
status string Subscription status. - -
version string Version of YITH Subscription which created the subscription. read-only read-only
order_id integer Main order ID read-only read-only
customer_id integer User ID who owns the subscription. 0 for guests. - -
customer_note string Note left by customer during checkout. - -
currency string Currency the subscription was created with, in ISO format. - read-only
date_created date-time The date the subscription was created, in the site's timezone. read-only read-only
date_created_gmt date-time The date the subscription was created, as GMT. read-only read-only
date_modified date-time The date the subscription was last modified, in the site's timezone. read-only read-only
date_modified_gmt date-time The date the subscription was last modified, as GMT. read-only read-only
start_date date-time The date the subscription started, as GMT. - read-only
next_payment_date date-time The date of the next payment, as GMT. read-only read-only
cancelled_date date-time The cancelled date of the subscription, as GMT. - read-only
expired_date date-time The expiration date of the subscription, as GMT. - read-only
end_date date-time The end date of the subscription, as GMT. - read-only
expired_pause_date date-time The end date of the pause, as GMT. - read-only
created_via string Shows where the subscription was created. read-only read-only
product_id mixed Product ID. - -
variation_id mixed Variation ID. - -
product_name string Product name. - -
order_item_id integer Order Item ID. read-only read-only
quantity integer Quantity ordered. - read-only
subscription_interval integer Recurring interval. - -
subscription_period string Recurring period. - read-only
subscription_length integer Subscription length. - -
trial_interval integer Trial interval. - read-only
trial_period string Trial period. read-only read-only
prices_include_tax boolean If true the prices included tax during checkout. read-only read-only
fee string Fee amount. read-only read-only
discount_total string Total discount amount for the subscription. - read-only
discount_tax string Total discount tax amount for the subscription. - read-only
shipping_total string Total shipping amount for the subscription. - read-only
shipping_tax string Total shipping tax amount for the subscription. - read-only
line_subtotal string Line subtotal for the subscription item. - read-only
line_subtotal_tax string Line subtotal tax for the subscription item. - read-only
line_total string Line total for the subscription item. - read-only
line_tax string Line total tax for the subscription item. - read-only
line_tax_data array Total tax data for the subscription item. - read-only
order_total string Total order for the subscription. - read-only
order_tax string Total order tax for the subscription. - read-only
order_subtotal string Subtotal amount for the subscription. - read-only
total string Grand total. - read-only
billing object Billing address. - -
shipping object Shipping address. - -
payment_method string Payment method ID. read-only read-only
payment_method_title string Payment method title. read-only read-only
paid_orders array Paid order list. - -
shipping_data array Shipping lines data. - -
delivery_schedules array Delivery schedule list read-only read-only
meta_data array Meta data. - -
editable boolean If true it is possible to edit the prices and recurring period. read-only read-only

List all Subscriptions

This API helps you view all the subscriptions.

Available parameters

Parameter Type Description
context string Scope under which the request is made; determines fields present in response. Options: view and edit. Default is view.
page integer Current page of the collection. Default is 1.
per_page integer Maximum number of items to be returned in result set. Default is 10.
exclude array Ensures result set excludes specific IDs.
include array Limit result set to specific IDs.
offset integer Offset the result set by a specific number of items.
order string Order sort attribute ascending or descending. Options: asc and desc. Default is desc.
orderby string Sort collection by object attribute. Options: date, id. Default is date.
status array Limit result set to orders assigned a specific status. Options: any, active, paused, pending, overdue, trial, cancelled, expired and suspended. Default is any.
customer_id integer Limit result set to orders assigned to a specific customer.
product_id integer Limit result set to orders assigned to a specific product.
dp integer Number of decimal points to use in each resource. Default is 2.
GET /wc-yith-ywsbs/v1/subscriptions
 curl https://example.com/wp-json/wc-yith-ywsbs/v1/subscriptions/ \
    -u consumer_key:consumer_secret
							
JSON response example:
[
    {
        "id": 253,
        "status": "trial",
        "order_id": 252,
        "customer_id": 0,
        "currency": "USD",
        "version": "2.3.2",
        "date_created": "2021-06-22T10:48:43",
        "date_created_gmt": "2021-06-22T08:48:43",
        "date_modified": "2021-06-22T11:04:20",
        "date_modified_gmt": "2021-06-22T09:04:20",
        "start_date": "2021-06-22T08:48:43",
        "next_payment_date": "2022-01-01T02:00:00",
        "expired_date": "",
        "cancelled_date": "",
        "end_date": "",
        "expired_pause_date": "",
        "product_id": 222,
        "variation_id": 0,
        "product_name": "Alexa yearly",
        "subscription_interval": 1,
        "subscription_period": "years",
        "subscription_length": "",
        "trial_period": "1",
        "trial_interval": "months",
        "quantity": 1,
        "order_item_id": 170,
        "payment_method": "paypal",
        "payment_method_title": "PayPal",
        "created_via": "checkout",
        "prices_include_tax": true,
        "discount_total": "0.00",
        "discount_tax": "0.00",
        "shipping_total": "5.00",
        "shipping_tax": "0.00",
        "line_subtotal": "12.00",
        "line_subtotal_tax": "0.00",
        "line_total": "12.00",
        "line_tax": "0.00",
        "line_tax_data": {
            "subtotal": "0.00",
            "total": "0.00"
        },
        "order_total": "17.00",
        "order_tax": "0.00",
        "order_subtotal": "12.00",
        "fee": "0.00",
        "total": "17.00",
        "billing": {
            "first_name": "John",
            "last_name": "Doe",
            "company": "",
            "address_1": "1294 Timber Oak Drive",
            "address_2": "",
            "city": "San Luis Obispo",
            "state": "CA",
            "postcode": "93401",
            "country": "US",
            "email": "[email protected]",
            "phone": "805-980-8331"
        },
        "shipping": {
            "first_name": "Donna",
            "last_name": "Summer",
            "company": "",
            "address_1": "2108  Duck Creek Road",
            "address_2": "",
            "city": "San Francisco",
            "state": "california",
            "postcode": "94107",
            "country": "US"
        },
        "customer_order_note": "",
        "shipping_data": [
            []
        ],
        "paid_orders": [
            252
        ],
        "editable": true,
        "delivery_schedules": [
            {
                "id": "72",
                "status": "waiting",
                "entry_date": "2021-06-22 08:48:43",
                "scheduled_date": "2021-07-15 06:00:00",
                "sent_on": null
            },
            {
                "id": "83",
                "status": "waiting",
                "entry_date": "2021-06-22 08:48:43",
                "scheduled_date": "2022-06-15 06:00:00",
                "sent_on": null
            }
        ],
        "meta_data": [
            {
                "key": "order_ids",
                "value": [
                    [
                        252
                    ]
                ]
            }
        ],
        "_links": {
            "self": [
                {
                    "href": "https://example.com/wp-json/wc-yith-ywsbs/v1/subscriptions/253"
                }
            ],
            "collection": [
                {
                    "href": "https://example.com/wp-json/wc-yith-ywsbs/v1/subscriptions"
                }
            ],
            "up": [
                {
                    "href": "https://example.com/wp-json/wc/v3/orders/252"
                }
            ]
        }
    },
    {
        "id": 212,
        "status": "paused",
        "order_id": 210,
        "customer_id": 1,
        "currency": "EUR",
        "version": "2.3.2",
        "date_created": "2021-06-09T13:17:31",
        "date_created_gmt": "2021-06-09T11:17:31",
        "date_modified": "2021-06-14T12:54:50",
        "date_modified_gmt": "2021-06-14T10:54:50",
        "start_date": "2021-06-09T11:17:32",
        "next_payment_date": "2021-12-16T11:21:43",
        "expired_date": "",
        "cancelled_date": "",
        "end_date": "",
        "expired_pause_date": "",
        "product_id": 112,
        "variation_id": 0,
        "product_name": "Magazine Subscription",
        "subscription_interval": 6,
        "subscription_period": "months",
        "subscription_length": "",
        "trial_period": "1",
        "trial_interval": "weeks",
        "quantity": 1,
        "order_item_id": 116,
        "payment_method": "yith-stripe",
        "payment_method_title": "Credit Card",
        "created_via": "checkout",
        "prices_include_tax": true,
        "discount_total": "0.00",
        "discount_tax": "0.00",
        "shipping_total": "0.00",
        "shipping_tax": "0.00",
        "line_subtotal": "28.69",
        "line_subtotal_tax": "6.31",
        "line_total": "28.69",
        "line_tax": "6.31",
        "line_tax_data": {
            "subtotal": "1.00",
            "total": "1.00"
        },
        "order_total": "35.00",
        "order_tax": "6.31",
        "order_subtotal": "35.00",
        "fee": "0.00",
        "total": "35.00",
        "billing": {
            "first_name": "John",
            "last_name": "Doe",
            "company": "",
            "address_1": "1294 Timber Oak Drive",
            "address_2": "",
            "city": "San Luis Obispo",
            "state": "CA",
            "postcode": "93401",
            "country": "US",
            "email": "[email protected]",
            "phone": "805-980-8331"
        },
        "shipping": {
            "first_name": "Daniel",
            "last_name": "White",
            "company": "",
            "address_1": "via Black Bird",
            "address_2": "",
            "city": "San Luis Obispo",
            "state": "CA",
            "postcode": "93403",
            "country": "US"
        },
        "customer_order_note": "",
        "shipping_data": [],
        "paid_orders": [
            210,
            237
        ],
        "editable": true,
        "delivery_schedules": [],
        "meta_data": [
            {
                "key": "order_ids",
                "value": [
                    [
                        [
                            211,
                            237
                        ]
                    ]
                ]
            },
            {
                "key": "rates_payed",
                "value": [
                    [
                        "1"
                    ]
                ]
            },
            {
                "key": "yith_stripe_token",
                "value": [
                    "pm_1Ix4gVI2uO1SpHI6oR6RLRuW"
                ]
            },
            {
                "key": "stripe_customer_id",
                "value": [
                    "cus_JaFAeIc7YeMjyh"
                ]
            },
            {
                "key": "conversion_date",
                "value": [
                    "1623311833"
                ]
            },
            {
                "key": "previous_payment_due_date",
                "value": [
                    "1623842252"
                ]
            },
            {
                "key": "date_of_pauses",
                "value": [
                    {
                        "1": 1623667834,
                        "2": 1623668090
                    }
                ]
            },
            {
                "key": "num_of_pauses",
                "value": [
                    "2"
                ]
            },
            {
                "key": "sum_of_pauses",
                "value": [
                    "251"
                ]
            }
        ],
        "_links": {
            "self": [
                {
                    "href": "https://example.com/wp-json/wc-yith-ywsbs/v1/subscriptions/212"
                }
            ],
            "collection": [
                {
                    "href": "https://example.com/wp-json/wc-yith-ywsbs/v1/subscriptions"
                }
            ],
            "customer": [
                {
                    "href": "https://example.com/wp-json/wc/v3/customers/1"
                }
            ],
            "up": [
                {
                    "href": "https://example.com/wp-json/wc/v3/orders/210"
                }
            ]
        }
    }
]

Retrieve a Subscription

This API lets you retrieve and view a specific subscription.
GET /wc-yith-ywsbs/v1/subscriptions/<id>
 curl https://example.com/wp-json/wc-yith-ywsbs/v1/subscriptions/273 \
    -u consumer_key:consumer_secret
							
JSON response example:
{
    "id": 253,
    "status": "trial",
    "order_id": 252,
    "customer_id": 0,
    "currency": "USD",
    "version": "2.3.2",
    "date_created": "2021-06-22T10:48:43",
    "date_created_gmt": "2021-06-22T08:48:43",
    "date_modified": "2021-06-22T10:48:43",
    "date_modified_gmt": "2021-06-22T08:48:43",
    "start_date": "2021-06-22T08:48:43",
    "next_payment_date": "2022-01-01T02:00:00",
    "expired_date": "",
    "cancelled_date": "",
    "end_date": "",
    "expired_pause_date": "",
    "product_id": 222,
    "variation_id": 0,
    "product_name": "Summer box",
    "subscription_interval": 1,
    "subscription_period": "years",
    "subscription_length": "",
    "trial_period": "1",
    "trial_interval": "months",
    "quantity": 1,
    "order_item_id": 170,
    "payment_method": "bacs",
    "payment_method_title": "Direct bank transfer",
    "created_via": "checkout",
    "prices_include_tax": true,
    "discount_total": "0.00",
    "discount_tax": "0.00",
    "shipping_total": "5.00",
    "shipping_tax": "0.00",
    "line_subtotal": "12.00",
    "line_subtotal_tax": "0.00",
    "line_total": "12.00",
    "line_tax": "0.00",
    "line_tax_data": {
        "subtotal": "0.00",
        "total": "0.00"
    },
    "order_total": "17.00",
    "order_tax": "0.00",
    "order_subtotal": "12.00",
    "fee": "0.00",
    "total": "17.00",
    "billing": {
        "first_name": "John",
        "last_name": "Doe",
        "company": "",
        "address_1": "1294 Timber Oak Drive",
        "address_2": "",
        "city": "San Luis Obispo",
        "state": "CA",
        "postcode": "93401",
        "country": "US",
        "email": "[email protected]",
        "phone": "805-980-8331"
    },
    "shipping": {
        "first_name": "Donna",
        "last_name": "Summer",
        "company": "",
        "address_1": "2108  Duck Creek Road",
        "address_2": "",
        "city": "San Francisco",
        "state": "California",
        "postcode": "94107",
        "country": "US"
    },
    "customer_order_note": "",
    "shipping_data": [
        []
    ],
    "paid_orders": [
        252
    ],
    "editable": true,
    "delivery_schedules": [
        {
            "id": "72",
            "status": "waiting",
            "entry_date": "2021-06-22 08:48:43",
            "scheduled_date": "2021-07-15 06:00:00",
            "sent_on": null
        },
        {
            "id": "73",
            "status": "waiting",
            "entry_date": "2021-06-22 08:48:43",
            "scheduled_date": "2021-08-15 06:00:00",
            "sent_on": null
        },
        {
            "id": "74",
            "status": "waiting",
            "entry_date": "2021-06-22 08:48:43",
            "scheduled_date": "2021-09-15 06:00:00",
            "sent_on": null
        },
        {
            "id": "75",
            "status": "waiting",
            "entry_date": "2021-06-22 08:48:43",
            "scheduled_date": "2021-10-15 06:00:00",
            "sent_on": null
        },
        {
            "id": "76",
            "status": "waiting",
            "entry_date": "2021-06-22 08:48:43",
            "scheduled_date": "2021-11-15 06:00:00",
            "sent_on": null
        },
        {
            "id": "77",
            "status": "waiting",
            "entry_date": "2021-06-22 08:48:43",
            "scheduled_date": "2021-12-15 06:00:00",
            "sent_on": null
        },
        {
            "id": "78",
            "status": "waiting",
            "entry_date": "2021-06-22 08:48:43",
            "scheduled_date": "2022-01-15 06:00:00",
            "sent_on": null
        },
        {
            "id": "79",
            "status": "waiting",
            "entry_date": "2021-06-22 08:48:43",
            "scheduled_date": "2022-02-15 06:00:00",
            "sent_on": null
        },
        {
            "id": "80",
            "status": "waiting",
            "entry_date": "2021-06-22 08:48:43",
            "scheduled_date": "2022-03-15 06:00:00",
            "sent_on": null
        },
        {
            "id": "81",
            "status": "waiting",
            "entry_date": "2021-06-22 08:48:43",
            "scheduled_date": "2022-04-15 06:00:00",
            "sent_on": null
        },
        {
            "id": "82",
            "status": "waiting",
            "entry_date": "2021-06-22 08:48:43",
            "scheduled_date": "2022-05-15 06:00:00",
            "sent_on": null
        },
        {
            "id": "83",
            "status": "waiting",
            "entry_date": "2021-06-22 08:48:43",
            "scheduled_date": "2022-06-15 06:00:00",
            "sent_on": null
        }
    ],
    "meta_data": [
        {
            "key": "order_ids",
            "value": [
                [
                    252
                ]
            ]
        }
    ],
    "_links": {
        "self": [
            {
                "href": "https://example.com/wp-json/wc-yith-ywsbs/v1/subscriptions/253"
            }
        ],
        "collection": [
            {
                "href": "https://example.com/wp-json/wc-yith-ywsbs/v1/subscriptions"
            }
        ],
        "up": [
            {
                "href": "https://example.com/wp-json/wc/v3/orders/252"
            }
        ]
    }
}

Update a Subscription

This API lets you update and view a specific subscription.
PUT /wc-yith-ywsbs/v1/subscriptions/<id>
 curl -X PUT https://example.com/wp-json/wc-yith-ywsbs/v1/subscriptions/252 \
    -u consumer_key:consumer_secret \
    -H "Content-Type: application/json" \
    -d '{
  "status": "completed"
}'
							
JSON response example:
{
    "id": 253,
    "status": "completed",
    "order_id": 252,
    "customer_id": 0,
    "currency": "USD",
    "version": "2.3.2",
    "date_created": "2021-06-22T10:48:43",
    "date_created_gmt": "2021-06-22T08:48:43",
    "date_modified": "2021-06-22T10:48:43",
    "date_modified_gmt": "2021-06-22T08:48:43",
    "start_date": "2021-06-22T08:48:43",
    "next_payment_date": "2022-01-01T02:00:00",
    "expired_date": "",
    "cancelled_date": "",
    "end_date": "",
    "expired_pause_date": "",
    "product_id": 222,
    "variation_id": 0,
    "product_name": "Summer box",
    "subscription_interval": 1,
    "subscription_period": "years",
    "subscription_length": "",
    "trial_period": "1",
    "trial_interval": "months",
    "quantity": 1,
    "order_item_id": 170,
    "payment_method": "bacs",
    "payment_method_title": "Direct bank transfer",
    "created_via": "checkout",
    "prices_include_tax": true,
    "discount_total": "0.00",
    "discount_tax": "0.00",
    "shipping_total": "5.00",
    "shipping_tax": "0.00",
    "line_subtotal": "12.00",
    "line_subtotal_tax": "0.00",
    "line_total": "12.00",
    "line_tax": "0.00",
    "line_tax_data": {
        "subtotal": "0.00",
        "total": "0.00"
    },
    "order_total": "17.00",
    "order_tax": "0.00",
    "order_subtotal": "12.00",
    "fee": "0.00",
    "total": "17.00",
    "billing": {
        "first_name": "John",
        "last_name": "Doe",
        "company": "",
        "address_1": "1294 Timber Oak Drive",
        "address_2": "",
        "city": "San Luis Obispo",
        "state": "CA",
        "postcode": "93401",
        "country": "US",
        "email": "[email protected]",
        "phone": "805-980-8331"
    },
    "shipping": {
        "first_name": "Donna",
        "last_name": "Summer",
        "company": "",
        "address_1": "2108  Duck Creek Road",
        "address_2": "",
        "city": "San Francisco",
        "state": "California",
        "postcode": "94107",
        "country": "US"
    },
    "customer_order_note": "",
    "shipping_data": [
        []
    ],
    "paid_orders": [
        252
    ],
    "editable": true,
    "delivery_schedules": [
        {
            "id": "72",
            "status": "waiting",
            "entry_date": "2021-06-22 08:48:43",
            "scheduled_date": "2021-07-15 06:00:00",
            "sent_on": null
        },
        {
            "id": "73",
            "status": "waiting",
            "entry_date": "2021-06-22 08:48:43",
            "scheduled_date": "2021-08-15 06:00:00",
            "sent_on": null
        },
        {
            "id": "74",
            "status": "waiting",
            "entry_date": "2021-06-22 08:48:43",
            "scheduled_date": "2021-09-15 06:00:00",
            "sent_on": null
        },
        {
            "id": "75",
            "status": "waiting",
            "entry_date": "2021-06-22 08:48:43",
            "scheduled_date": "2021-10-15 06:00:00",
            "sent_on": null
        },
        {
            "id": "76",
            "status": "waiting",
            "entry_date": "2021-06-22 08:48:43",
            "scheduled_date": "2021-11-15 06:00:00",
            "sent_on": null
        },
        {
            "id": "77",
            "status": "waiting",
            "entry_date": "2021-06-22 08:48:43",
            "scheduled_date": "2021-12-15 06:00:00",
            "sent_on": null
        },
        {
            "id": "78",
            "status": "waiting",
            "entry_date": "2021-06-22 08:48:43",
            "scheduled_date": "2022-01-15 06:00:00",
            "sent_on": null
        },
        {
            "id": "79",
            "status": "waiting",
            "entry_date": "2021-06-22 08:48:43",
            "scheduled_date": "2022-02-15 06:00:00",
            "sent_on": null
        },
        {
            "id": "80",
            "status": "waiting",
            "entry_date": "2021-06-22 08:48:43",
            "scheduled_date": "2022-03-15 06:00:00",
            "sent_on": null
        },
        {
            "id": "81",
            "status": "waiting",
            "entry_date": "2021-06-22 08:48:43",
            "scheduled_date": "2022-04-15 06:00:00",
            "sent_on": null
        },
        {
            "id": "82",
            "status": "waiting",
            "entry_date": "2021-06-22 08:48:43",
            "scheduled_date": "2022-05-15 06:00:00",
            "sent_on": null
        },
        {
            "id": "83",
            "status": "waiting",
            "entry_date": "2021-06-22 08:48:43",
            "scheduled_date": "2022-06-15 06:00:00",
            "sent_on": null
        }
    ],
    "meta_data": [
        {
            "key": "order_ids",
            "value": [
                [
                    252
                ]
            ]
        }
    ],
    "_links": {
        "self": [
            {
                "href": "https://example.com/wp-json/wc-yith-ywsbs/v1/subscriptions/253"
            }
        ],
        "collection": [
            {
                "href": "https://example.com/wp-json/wc-yith-ywsbs/v1/subscriptions"
            }
        ],
        "up": [
            {
                "href": "https://example.com/wp-json/wc/v3/orders/252"
            }
        ]
    }
}

Delete a Subscription

This API helps you delete a subscription.

Available parameters

Parameter Type Description
force string Use true to permanently delete the order, Default is false.
DELETE /wc-yith-ywsbs/v1/subscriptions/<id>
 curl -X DELETE https://example.com/wp-json/wc-yith-ywsbs/v1/subscriptions/253?force=true \
    -u consumer_key:consumer_secret
							
JSON response example:
{
    "id": 253,
    "status": "cancelled",
    "order_id": 252,
    "customer_id": 0,
    "currency": "USD",
    "version": "2.3.2",
    "date_created": "2021-06-22T10:48:43",
    "date_created_gmt": "2021-06-22T08:48:43",
    "date_modified": "2021-06-22T10:48:43",
    "date_modified_gmt": "2021-06-22T08:48:43",
    "start_date": "2021-06-22T08:48:43",
    "next_payment_date": "2022-01-01T02:00:00",
    "expired_date": "",
    "cancelled_date": "",
    "end_date": "",
    "expired_pause_date": "",
    "product_id": 222,
    "variation_id": 0,
    "product_name": "Summer box",
    "subscription_interval": 1,
    "subscription_period": "years",
    "subscription_length": "",
    "trial_period": "1",
    "trial_interval": "months",
    "quantity": 1,
    "order_item_id": 170,
    "payment_method": "bacs",
    "payment_method_title": "Direct bank transfer",
    "created_via": "checkout",
    "prices_include_tax": true,
    "discount_total": "0.00",
    "discount_tax": "0.00",
    "shipping_total": "5.00",
    "shipping_tax": "0.00",
    "line_subtotal": "12.00",
    "line_subtotal_tax": "0.00",
    "line_total": "12.00",
    "line_tax": "0.00",
    "line_tax_data": {
        "subtotal": "0.00",
        "total": "0.00"
    },
    "order_total": "17.00",
    "order_tax": "0.00",
    "order_subtotal": "12.00",
    "fee": "0.00",
    "total": "17.00",
    "billing": {
        "first_name": "John",
        "last_name": "Doe",
        "company": "",
        "address_1": "1294 Timber Oak Drive",
        "address_2": "",
        "city": "San Luis Obispo",
        "state": "CA",
        "postcode": "93401",
        "country": "US",
        "email": "[email protected]",
        "phone": "805-980-8331"
    },
    "shipping": {
        "first_name": "Donna",
        "last_name": "Summer",
        "company": "",
        "address_1": "2108  Duck Creek Road",
        "address_2": "",
        "city": "San Francisco",
        "state": "California",
        "postcode": "94107",
        "country": "US"
    },
    "customer_order_note": "",
    "shipping_data": [
        []
    ],
    "paid_orders": [
        252
    ],
    "editable": true,
    "delivery_schedules": [
        {
            "id": "72",
            "status": "waiting",
            "entry_date": "2021-06-22 08:48:43",
            "scheduled_date": "2021-07-15 06:00:00",
            "sent_on": null
        },
        {
            "id": "73",
            "status": "waiting",
            "entry_date": "2021-06-22 08:48:43",
            "scheduled_date": "2021-08-15 06:00:00",
            "sent_on": null
        },
        {
            "id": "74",
            "status": "waiting",
            "entry_date": "2021-06-22 08:48:43",
            "scheduled_date": "2021-09-15 06:00:00",
            "sent_on": null
        },
        {
            "id": "75",
            "status": "waiting",
            "entry_date": "2021-06-22 08:48:43",
            "scheduled_date": "2021-10-15 06:00:00",
            "sent_on": null
        },
        {
            "id": "76",
            "status": "waiting",
            "entry_date": "2021-06-22 08:48:43",
            "scheduled_date": "2021-11-15 06:00:00",
            "sent_on": null
        },
        {
            "id": "77",
            "status": "waiting",
            "entry_date": "2021-06-22 08:48:43",
            "scheduled_date": "2021-12-15 06:00:00",
            "sent_on": null
        },
        {
            "id": "78",
            "status": "waiting",
            "entry_date": "2021-06-22 08:48:43",
            "scheduled_date": "2022-01-15 06:00:00",
            "sent_on": null
        },
        {
            "id": "79",
            "status": "waiting",
            "entry_date": "2021-06-22 08:48:43",
            "scheduled_date": "2022-02-15 06:00:00",
            "sent_on": null
        },
        {
            "id": "80",
            "status": "waiting",
            "entry_date": "2021-06-22 08:48:43",
            "scheduled_date": "2022-03-15 06:00:00",
            "sent_on": null
        },
        {
            "id": "81",
            "status": "waiting",
            "entry_date": "2021-06-22 08:48:43",
            "scheduled_date": "2022-04-15 06:00:00",
            "sent_on": null
        },
        {
            "id": "82",
            "status": "waiting",
            "entry_date": "2021-06-22 08:48:43",
            "scheduled_date": "2022-05-15 06:00:00",
            "sent_on": null
        },
        {
            "id": "83",
            "status": "waiting",
            "entry_date": "2021-06-22 08:48:43",
            "scheduled_date": "2022-06-15 06:00:00",
            "sent_on": null
        }
    ],
    "meta_data": [
        {
            "key": "order_ids",
            "value": [
                [
                    252
                ]
            ]
        }
    ],
    "_links": {
        "self": [
            {
                "href": "https://example.com/wp-json/wc-yith-ywsbs/v1/subscriptions/253"
            }
        ],
        "collection": [
            {
                "href": "https://example.com/wp-json/wc-yith-ywsbs/v1/subscriptions"
            }
        ],
        "up": [
            {
                "href": "https://example.com/wp-json/wc/v3/orders/252"
            }
        ]
    }
}