For the complete documentation index, see llms.txt. This page is also available as Markdown.

Subscription History

Retrieve the history of a subscription

get

Overview

Retrieve information on the evolution of a subscription in the 2Checkout system, including details of the initial acquisition and the subsequent renewals and upgrades.

Subscriptions can be retrieved starting with 5 minutes after their orders are generated in the 2Checkout system.

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: 48F5AC7011
Header parameters
Acceptstring · enumRequiredDefault: application/jsonExample: application/jsonPossible values:
X-Avangate-AuthenticationstringRequired

Authentication header

Example: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Responses
200

OK

application/json
get/subscriptions/{SubscriptionReference}/history/
GET /rest/6.0/subscriptions/{SubscriptionReference}/history/ HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
200

OK

[
  {
    "DeliveryInfo": {
      "Codes": [
        {
          "Codes": "___TEST___CODE____"
        }
      ]
    },
    "ExpirationDate": "2015-03-12",
    "Lifetime": false,
    "PartnerCode": "",
    "ReferenceNo": "1234567",
    "SKU": "NewSubscriptionPurchase",
    "StartDate": "2015-02-12",
    "SubscriptionReference": "48F5AC7011",
    "Type": "SALE"
  },
  {
    "DeliveryInfo": {
      "Codes": [
        {
          "Code": "___TEST___CODE____"
        }
      ]
    },
    "ExpirationDate": "2015-04-11",
    "Lifetime": false,
    "PartnerCode": "",
    "ReferenceNo": "112233445",
    "SKU": "SubscriptionRenewal",
    "StartDate": "2015-02-12",
    "SubscriptionReference": "48F5AC7011",
    "Type": "RENEWAL"
  }
]

Extend a subscription

put

Extends an existing subscription.

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: 13E4ED768D
Query parameters
DaysstringRequired

The number of days of delay.

Example: 7
Header parameters
X-Avangate-AuthenticationstringRequired

Authentication header

Example: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Acceptstring · enumRequiredExample: application/jsonPossible values:
Responses
200

OK

application/json
put/subscriptions/{SubscriptionReference}/history/
PUT /rest/6.0/subscriptions/{SubscriptionReference}/history/?Days=text HTTP/1.1
Host: api.2checkout.com
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Accept: application/json
200

OK

true

Retrieve a subscription's purchase, renewal or upgrade details

get

Retrieve a snapshot of a subscription’s evolution corresponding to a specific purchase for which you provide the order reference number.

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: 48F5AC7011
OrderReferencestringRequired

Reference number for approved/paid orders.

Example: 1234567
Header parameters
Acceptstring · enumRequiredDefault: application/jsonExample: application/jsonPossible values:
X-Avangate-AuthenticationstringRequired

Authentication header

Example: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Responses
200

OK

application/json
get/subscriptions/{SubscriptionReference}/history/{OrderReference}/
GET /rest/6.0/subscriptions/{SubscriptionReference}/history/{OrderReference}/ HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
200

OK

{
  "DeliveryInfo": {
    "Codes": [
      {
        "Code": "___TEST___CODE____"
      }
    ]
  },
  "ExpirationDate": "2015-03-12",
  "Lifetime": false,
  "PartnerCode": "",
  "ReferenceNo": "1234567",
  "SKU": "NewSubscriptionPurchase",
  "StartDate": "2015-02-12",
  "SubscriptionReference": "48F5AC7011",
  "Type": "SALE"
}

Last updated

Was this helpful?