Schedule Next Term Instructions

You can use this endpoint to set instructions for the next term renewal.

All of the properties are optional.

Request

Request Syntax:

Method

Request URI

POST

https://api.crayon.com/api/v1/subscriptions/{id}/next-term-instructions

Request Parameters:

Name

Type

Description

id

int

Id of the subscription

Request Body:

{
  "billingCycle": 1,
  "partNumber": "CFQ7TTC0HD33:0003",
  "quantity": 1,
  "termDuration": "P1M",
  "customTermEndDate": "2022-09-30T23:59:59Z"
}

Properties:

Name

Type

Required

Description

BillingCycle

BillingCycleType

No

Billing cycle. Unknown = 0, Monthly = 1, Annual = 2, None = 3, OneTime = 4, Triennial = 5

PartNumber

string

No

Quantity

int

No

TermDuration

string

No

An ISO 8601 representation of the term’s duration. Supported values are: “P1M” for (1 month), “P1Y” for (1 year) and “P3Y” for (3 years).

CustomTermEndDate

DateTime

No

Applicable for coterminosity scenarios. Supported values are returned by the get coterminosity dates endpoint

Response

If successful, the following json is returned in the response body..

{
  "IsSuccessful": true,
  "ErrorReasonCode": "Error_Code_String",
  "ErrorDescription": "Error description."
}

Response success and error codes:

Each response comes with an HTTP status code that indicates success or failure and additional debugging information. Use a network trace tool to read this code, error type, and additional parameters.

Error Codes

Description

200 Ok

The request has succeeded.

400 Bad Request

The request could not be understood by the server due to malformed syntax, missing required properties, properties that couldn’t be parsed according to their type (and length). It is a non-retryable error condition. The client should not repeat the request without modifications.

401 Unauthorized

The request requires user authentication. If the request already included Authorization credentials, then the 401 (Unauthorized) status code means that authorization has been refused for those credentials. It is a non-retryable error condition.

404 Not Found

The server has not found anything matching the request.