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

Subscription

Search subscriptions

get
Query parameters
CustomerEmailstringOptional

Customer's email

Example: customer@2checkout.com
DeliveredCodestringOptional

Customer's delivered code

Example: FJD89SR
AvangateCustomerReferencestringOptional

Customer's reference

Example: FDOIEJF
ExternalCustomerReferencestringOptional

Customer's external reference

Example: 4584358
AggregatebooleanOptional

Aggregated data, the only valid value is 'true'

Example: true
SubscriptionEnabledbooleanOptional

Checks status

Example: false
RecurringEnabledbooleanOptional

Filter by recurring status

Example: true
ProductCodesstring[]Optional

Array of product codes

Example: ["FJGHRE","GFDFOI"]
CountryCodesstring[]Optional

Array of countries codes

Example: ["UK","BG","RO","FR"]
PurchasedAfterstringOptional

Purchase date

Example: 2018-09-03
PurchasedBeforestringOptional

Purchase date

Example: 2018-09-03
ExpireAfterstringOptional

Expire date

Example: 2018-09-03
ExpireBeforestringOptional

Expire date

Example: 2018-09-03
RenewedAfterstringOptional

Renew date

Example: 2018-09-03
RenewedBeforestringOptional

Renew date

Example: 2018-09-03
NotificationAfterstringOptional

Notification date

Example: 2018-09-03
NotificationBeforestringOptional

Notification date

Example: 2018-09-03
ModifiedAfterstringOptional

Change date

Example: 2018-09-03
ModifiedBeforestringOptional

Change date

Example: 2018-09-03
NextBillingDateAfterstringOptional

Start date of Next billing date filter

Example: 2018-09-03
NextBillingDateBeforestringOptional

End date of Next billing date filter

Example: 2018-09-03
LifetimeSubscriptionbooleanOptional

Filter by lifetime subscriptions

Example: false
TypestringOptional

Subscription types

Example: REGULAR
PageintegerOptional

Requested page

Example: 2
LimitintegerOptional

Limit number

Example: 20
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

List subscriptions

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

List subscriptions

{
  "Items": [
    {
      "MerchantCode": "merchant_code",
      "SubscriptionReference": "28C2248CE1",
      "StartDate": "2019-10-09T16:05:20+03:00",
      "ExpirationDate": "2019-11-09T16:05:20+02:00",
      "RecurringEnabled": true,
      "SubscriptionEnabled": true,
      "ReasonText": "Imported",
      "Product": {
        "ProductCode": "224258F2",
        "ProductId": "9697491",
        "ProductName": "Product name",
        "ProductVersion": "",
        "ProductQuantity": "1",
        "PriceOptionCodes": [],
        "Dynamic": false,
        "Physical": false
      },
      "EndUser": {
        "FirstName": "John",
        "LastName": "Doe",
        "Email": "test@test.com",
        "Company": "",
        "FiscalCode": "",
        "Phone": "",
        "Fax": "",
        "Address1": "address 1",
        "Address2": "address 2",
        "Zip": "0000",
        "City": "Bucharest",
        "State": "Bucuresti - Sector 6",
        "CountryCode": "ro",
        "Language": "en"
      },
      "SKU": "",
      "ReceiveNotifications": false,
      "Lifetime": false,
      "IdAffiliate": "0",
      "TestSubscription": false,
      "IsTrial": false,
      "Status": "EXPIRED",
      "LatestSubscriptionOrder": {
        "RefNo": "11723445",
        "Status": "AUTHRECEIVED",
        "FailedRecurringChargesCount": 0
      }
    },
    {
      "MerchantCode": "merchant_code",
      "SubscriptionReference": "28C2248CE1",
      "StartDate": "2019-10-09T16:05:20+03:00",
      "ExpirationDate": "2019-11-09T16:05:20+02:00",
      "RecurringEnabled": true,
      "SubscriptionEnabled": true,
      "Product": {
        "ProductCode": "224258F2",
        "ProductId": "9697491",
        "ProductName": "Product name",
        "ProductVersion": "",
        "ProductQuantity": "1",
        "PriceOptionCodes": [],
        "Dynamic": false,
        "Physical": false
      },
      "EndUser": {
        "FirstName": "John",
        "LastName": "Doe",
        "Email": "test@test.com",
        "Company": "",
        "FiscalCode": "",
        "Phone": "",
        "Fax": "",
        "Address1": "address 1",
        "Address2": "address 2",
        "Zip": "0000",
        "City": "Bucharest",
        "State": "Bucuresti - Sector 6",
        "CountryCode": "ro",
        "Language": "en"
      },
      "SKU": "",
      "ReceiveNotifications": false,
      "Lifetime": false,
      "IdAffiliate": "0",
      "TestSubscription": false,
      "IsTrial": false,
      "Status": "EXPIRED",
      "LatestSubscriptionOrder": {
        "RefNo": "11723445",
        "Status": "AUTHRECEIVED",
        "FailedRecurringChargesCount": 0
      }
    }
  ],
  "Pagination": {
    "Page": 1,
    "Limit": 10,
    "Count": 2
  }
}

Import test subscriptions with card information

post
Header parameters
X-Avangate-AuthenticationstringRequired

Authentication header

Example: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Acceptstring · enumRequiredExample: application/jsonPossible values:
Body
AdditionalInfoany · nullableOptional
CustomPriceBillingCyclesLeftnumberOptional
ExpirationDatestringOptional
ExternalCustomerReferenceany · nullableOptional
ExternalSubscriptionReferencestringOptional
NextRenewalPricenumberOptional
NextRenewalPriceCurrencystringOptional
PartnerCodestringOptional
StartDatestringOptional
ActivationDatestring · nullableOptional
SubscriptionValuenumberOptional
SubscriptionValueCurrencystringOptional
TestnumberOptional
Responses
201

Overview

Import test subscription and data from your or a third-party system with payment information assigned, and test advanced renewal and upgrade scenarios in the 2Checkout platform. Contact 2Checkout directly for additional details.


Requirements

Test subscriptions can be imported only for eStore orders. Only dummy credit card data can be assigned to subscriptions. Check here the list of credit cards that can be used for import.

Cardholder name is composed as FirstName + " " + LastName.

application/json
stringOptionalExample: "68E6387652"
post/subscriptions/
POST /rest/6.0/subscriptions/ HTTP/1.1
Host: api.2checkout.com
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Accept: application/json
Content-Type: application/json
Content-Length: 915

{
  "CustomPriceBillingCyclesLeft": 2,
  "DeliveryInfo": {
    "Codes": [
      {
        "Code": "___TEST___CODE____"
      }
    ]
  },
  "EndUser": {
    "Address1": "Test Address",
    "Address2": "",
    "City": "LA",
    "Company": "",
    "CountryCode": "us",
    "Email": "customer@2Checkout.com",
    "Fax": "",
    "FirstName": "Customer",
    "Language": "en",
    "LastName": "2Checkout",
    "Phone": "",
    "State": "CA",
    "Zip": "12345"
  },
  "ExpirationDate": "2015-12-16",
  "ExternalSubscriptionReference": "ThisIsYourUniqueIdentifier123",
  "NextRenewalPrice": 49.99,
  "NextRenewalPriceCurrency": "usd",
  "PartnerCode": "",
  "Payment": {
    "CCID": "123",
    "CardNumber": "4111111111111111",
    "CardType": "VISA",
    "ExpirationMonth": "12",
    "ExpirationYear": "2018",
    "HolderName": "John Doe"
  },
  "Product": {
    "PriceOptionCodes": [
      "oneuser1"
    ],
    "ProductCode": "my_subscription_1",
    "ProductId": "4639321",
    "ProductName": "2Checkout Subscription",
    "ProductQuantity": 1,
    "ProductVersion": ""
  },
  "StartDate": "2015-02-16",
  "SubscriptionValue": 199,
  "SubscriptionValueCurrency": "usd",
  "Test": 1
}
201

Overview

Import test subscription and data from your or a third-party system with payment information assigned, and test advanced renewal and upgrade scenarios in the 2Checkout platform. Contact 2Checkout directly for additional details.


Requirements

Test subscriptions can be imported only for eStore orders. Only dummy credit card data can be assigned to subscriptions. Check here the list of credit cards that can be used for import.

Cardholder name is composed as FirstName + " " + LastName.

"68E6387652"

Retrieve a subscription

get
Path parameters
SubscriptionReferencestringRequired

Unique code which represents a subscription

Example: D183B94D0E
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

Get subscription

application/json
SubscriptionReferencestringOptionalExample: 3501E8CADA
StartDatestringOptionalExample: 2018-09-03 16:28:32
ActivationDatestringOptionalExample: 2018-09-03 16:28:32
ExpirationDatestringOptionalExample: 2018-09-03 17:28:32
RecurringEnabledbooleanOptionalExample: true
NextBillingDatestring · max: 25RequiredDefault: nullExample: 2020-11-09T12:19:31+02:00
SubscriptionEnabledbooleanOptionalExample: true
SKUstringOptional
ReceiveNotificationsbooleanOptionalExample: true
LifetimebooleanOptionalExample: false
PartnerCodestringOptionalExample: ADE86
ReasonTextstringOptionalExample: Imported
IdAffiliateintegerOptionalExample: 0
CustomerReferencestringOptionalExample: 918495269
ExternalCustomerReferencestringOptionalExample: 123980DUSI46
TestSubscriptionbooleanOptionalExample: false
IsTrialbooleanOptionalExample: false
StatusstringOptionalExample: EXPIRED
IsAssistedSalebooleanOptionalExample: false
get/subscriptions/{SubscriptionReference}/
GET /rest/6.0/subscriptions/{SubscriptionReference}/ HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
200

Get subscription

{
  "SubscriptionReference": "3501E8CADA",
  "StartDate": "2018-09-03 16:28:32",
  "ActivationDate": "2018-09-03 16:28:32",
  "ExpirationDate": "2018-09-03 17:28:32",
  "RecurringEnabled": true,
  "NextBillingDate": "2020-11-09T12:19:31+02:00",
  "SubscriptionEnabled": true,
  "ReasonText": "Imported",
  "Product": {
    "ProductCode": "71B3784B53",
    "ProductId": 7623654,
    "ProductName": "Product 9",
    "ProductVersion": 1,
    "ProductQuantity": 5,
    "PriceOptionCodes": [
      []
    ],
    "Dynamic": false,
    "Physical": true
  },
  "EndUser": {
    "FirstName": "John",
    "LastName": "Doe",
    "Email": "dynamicproduct@products.com",
    "Company": "",
    "FiscalCode": "A54FR",
    "Phone": "",
    "Fax": "",
    "Address1": "Address example",
    "Address2": "",
    "Zip": "90210",
    "City": "LA",
    "State": "California",
    "CountryCode": "us",
    "Language": "en"
  },
  "SKU": "",
  "DeliveryInfo": {
    "Description": "Company office",
    "Codes": [
      {
        "Code": "FDS89UY",
        "File": "",
        "Description": "",
        "ExtraInfo": "Sample info"
      }
    ]
  },
  "ReceiveNotifications": true,
  "Lifetime": false,
  "PartnerCode": "ADE86",
  "IdAffiliate": 0,
  "CustomerReference": "918495269",
  "ExternalCustomerReference": "123980DUSI46",
  "IsTrial": false,
  "Status": "EXPIRED",
  "LatestSubscriptionOrder": {
    "RefNo": 11791662,
    "Status": "COMPLETE",
    "FailedRecurringChargesCount": 0
  },
  "IsAssistedSale": false,
  "Billing": {
    "Quantity": 1,
    "Currency": "USD",
    "UnitBillingPriceNet": 2242.25,
    "UnitBillingPriceGross": 2399,
    "BillingPriceNet": 2242.25,
    "BillingPriceGross": 2399,
    "NoOfBillingCycles": -1,
    "CurrentBillingCycle": 1,
    "PayedBillingCycles": 0,
    "RemainingBillingCycles": 0,
    "CurrentBillingCycleEndDate": "2024-03-20T13:53:59+02:00",
    "TaxAmount": 156.94,
    "TaxPercent": 7,
    "BillingCyclesFrequency": 1,
    "BillingCycleFrequencyUnit": "MONTHS",
    "ContractLength": 12,
    "ContractLengthUnit": "MONTHS",
    "PriceOption": [
      {
        "Code": "LIST_USERS_YEARS",
        "Options": [
          {
            "Value": "h-3u-1y"
          }
        ]
      }
    ],
    "ActivationKey": "7686-8768"
  },
  "ScheduledActions": {
    "ProductUpdate": {
      "ProductCode": "AIJT2PY5IG",
      "ProductId": 12345,
      "ProductName": "Updated Product",
      "PriceOptionCodes": [
        "adb_checkbox_1",
        "adb_radio_2"
      ],
      "ProductQuantity": 2,
      "ScheduledOn": "2025-12-29T10:00:00+00:00"
    }
  }
}

Enable a subscription

post
Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: D183B94D0E
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
stringOptional
post/subscriptions/{SubscriptionReference}/
POST /rest/6.0/subscriptions/{SubscriptionReference}/ HTTP/1.1
Host: api.2checkout.com
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Accept: application/json
true

Update a subscription

put
Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: AF168DD240
Header parameters
X-Avangate-AuthenticationstringRequired

Authentication header

Example: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Acceptstring · enumRequiredExample: application/jsonPossible values:
Body
StartDatestringOptional
ExpirationDatestringOptional
ExternalCustomerReferenceany · nullableOptional
RecurringEnabledbooleanOptional
SubscriptionEnabledbooleanOptional
ChurnReasonsstring[]Optional
ChurnReasonOtherstringOptional
Responses
200

OK

application/json
stringOptional
put/subscriptions/{SubscriptionReference}/
PUT /rest/6.0/subscriptions/{SubscriptionReference}/ HTTP/1.1
Host: api.2checkout.com
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Accept: application/json
Content-Type: application/json
Content-Length: 620

{
  "EndUser": {
    "Address1": "Test Address",
    "Address2": "",
    "City": "LA",
    "Company": "",
    "CountryCode": "us",
    "Email": "customer@2Checkout.com",
    "Fax": "",
    "FirstName": "Customer",
    "Language": "en",
    "LastName": "2Checkout",
    "Phone": "",
    "State": "CA",
    "Zip": "12345"
  },
  "StartDate": "2024-12-16 01:01:00",
  "ExpirationDate": "2015-12-16",
  "Product": {
    "PriceOptionCodes": [
      "oneuser1"
    ],
    "ProductId": "4639321",
    "ProductName": "2Checkout Subscription",
    "ProductQuantity": 1
  },
  "ActivationKey": null,
  "RecurringEnabled": true,
  "SubscriptionEnabled": true,
  "ChurnReasons": [
    "CHURN_REASON_COVID",
    "CHURN_REASON_OTHER"
  ],
  "ChurnReasonOther": "sample reason freetext",
  "Currency": "RON"
}
200

OK

true

Disable a subscription

delete
Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: D183B94D0E
Header parameters
X-Avangate-AuthenticationstringRequired

Authentication header

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

OK

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

OK

true

Revert subscription to pre-order state

post

Reverts a subscription to its state before the specified order. The order must be the most recent one on the subscription and the subscription must not have been modified outside of an order since.

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

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

Authentication header

Example: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Body
OrderReferencestringRequired

The reference number (RefNo) of the order whose changes should be reverted. Must be the last order on the subscription.

Example: 1200815
ReasonstringRequired

Mandatory free-text reason for the revert. Recorded in subscription history.

Example: Customer requested revert after accidental renewal
Responses
200

Subscription reverted successfully

application/json
post/subscriptions/{SubscriptionReference}/revert/
POST /rest/6.0/subscriptions/{SubscriptionReference}/revert/ HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Content-Type: application/json
Content-Length: 90

{
  "OrderReference": "1200815",
  "Reason": "Customer requested revert after accidental renewal"
}
true

Attach multiple additional information fields to a subscription

post

Attach multiple additional information key/value pairs to an existing subscription in a single call

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: 5A235DDE94
Header parameters
X-Avangate-AuthenticationstringRequired

Authentication header

Example: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Acceptstring · enumRequiredExample: application/jsonPossible values:
Bodyobject · body_18[]
NamestringOptional
ValuestringOptional
Responses
200

OK

application/json
post/subscriptions/{SubscriptionReference}/additionalInformations/
POST /rest/6.0/subscriptions/{SubscriptionReference}/additionalInformations/ HTTP/1.1
Host: api.2checkout.com
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Accept: application/json
Content-Type: application/json
Content-Length: 85

[
  {
    "Name": "TestName1",
    "Value": "TestValue1"
  },
  {
    "Name": "TestName2",
    "Value": "TestValue2"
  }
]
[
  {
    "Name": "TestName1",
    "Value": "TestValue1"
  },
  {
    "Name": "TestName2",
    "Value": "TestValue2"
  }
]

Retrieve information attached to a subscription

get

Retrieve additional information of specified subscription

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: 5A235DDE94
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}/additionalinformation/
GET /rest/6.0/subscriptions/{SubscriptionReference}/additionalinformation/ HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
[
  {
    "Name": "TestName1",
    "Value": "TestValue1"
  },
  {
    "Name": "TestName2",
    "Value": "TestValue2"
  },
  {
    "Name": "TestName3",
    "Value": "TestValue3"
  }
]

Attach additional information to a subscription

post

Attach additional information to an existing subscription by key/value pair

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: 5A235DDE94
Header parameters
X-Avangate-AuthenticationstringRequired

Authentication header

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

OK

application/json
post/subscriptions/{SubscriptionReference}/additionalinformation/
POST /rest/6.0/subscriptions/{SubscriptionReference}/additionalinformation/ HTTP/1.1
Host: api.2checkout.com
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Accept: application/json
Content-Type: application/json
Content-Length: 41

{
  "Name": "TestName1",
  "Value": "TestValue1"
}
{
  "Name": "TestName1",
  "Value": "TestValue1"
}

Retrieve information attached to a subscription by key

get

Get additional information for a subscription by field key

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: 5A235DDE94
NamestringRequired

Unique name you assign as the identifier of an additional information field.

Example: TestField1
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}/additionalinformation/{Name}/
GET /rest/6.0/subscriptions/{SubscriptionReference}/additionalinformation/{Name}/ HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
{
  "Name": "TestName1",
  "Value": "TestValue1"
}

Update additional information attached to a subscription by key

put

Update additional information of a subscription by field/key

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: 5A235DDE94
NamestringRequired

Unique name you assign as the identifier of an additional information field.

Example: TestField1
Header parameters
X-Avangate-AuthenticationstringRequired

Authentication header

Example: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
AcceptstringRequiredExample: application/json
Body
NamestringOptional
ValuestringOptional
Responses
200

OK

application/json
put/subscriptions/{SubscriptionReference}/additionalinformation/{Name}/
PUT /rest/6.0/subscriptions/{SubscriptionReference}/additionalinformation/{Name}/ HTTP/1.1
Host: api.2checkout.com
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Accept: application/json
Content-Type: application/json
Content-Length: 47

{
  "Name": "TestName1",
  "Value": "UpdatedTestValue"
}
{
  "Name": "TestName1",
  "Value": "UpdatedTestValue"
}

Delete additional information of a subscription

delete

Remove additional information attached to a subscription by name/key

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: 5A235DDE94
NamestringRequired

Unique name you assign as the identifier of an additional information field.

Example: TestField1
Header parameters
X-Avangate-AuthenticationstringRequired

Authentication header

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

OK

application/json
delete/subscriptions/{SubscriptionReference}/additionalinformation/{Name}/
DELETE /rest/6.0/subscriptions/{SubscriptionReference}/additionalinformation/{Name}/ HTTP/1.1
Host: api.2checkout.com
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Accept: */*
true

Attach PayPal to a subscription

post

Build the PayPal URL that can be used to attach a subscription to a PayPal account.

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier. Represents the subscription code that will be attached to the PayPal account.

Example: 5A235DDE94
Header parameters
X-Avangate-AuthenticationstringRequired

Authentication header

Example: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Acceptstring · enumRequiredDefault: application/jsonExample: application/jsonPossible values:
Body
paypalEmailstringRequired

The PayPal email associated with the subscription.

returnURLstringRequired

The URL the user will be redirected to if the subscription is successfully attached to PayPal.

cancelURLstringRequired

The URL the user will be redirected to if the subscription fails to attach to PayPal.

Responses
200

OK

application/json
statusstringOptional

Can be "success" if no errors occurred or "error" otherwise.

Example: success
urlstringOptional

The PayPal redirect URL if no errors occurred or empty otherwise.

Example: https://api.2checkout.com/6.0/scripts/paypal/request?avng8apitoken=a211b606e9a62202
errorstring[]Optional

Empty if no errors occurred or the error message otherwise.

post/subscriptions/paypal/attach/
POST /rest/6.0/subscriptions/paypal/attach/ HTTP/1.1
Host: api.2checkout.com
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Accept: application/json
Content-Type: application/json
Content-Length: 133

{
  "paypalEmail": "customer@2checkout.com",
  "returnURL": "https://www.yoursite.com/success",
  "cancelURL": "https://www.yoursite.com/cancel"
}
{
  "status": "success",
  "url": "https://api.2checkout.com/6.0/scripts/paypal/request?avng8apitoken=a211b606e9a62202",
  "error": []
}

Retrieve a subscription’s customer

get

Extract information on the customer associated with a specific subscription.

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: 5A235DDE94
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}/customer/
GET /rest/6.0/subscriptions/{SubscriptionReference}/customer/ HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
200

OK

{
  "Address1": "Address details",
  "Address2": "55",
  "CustomerReference": "423577932",
  "City": "London",
  "Company": "",
  "CountryCode": "gb",
  "Email": "john.doe@example.com",
  "Enabled": false,
  "ExistingCards": [],
  "ExternalCustomerReference": "TestCustomerID1234",
  "Fax": "",
  "FirstName": "John",
  "FiscalCode": "",
  "Language": "",
  "LastName": "Doe",
  "Phone": "",
  "State": "London",
  "Trial": false,
  "Zip": "WC1A1AH"
}

Assign a subscription to another customer

post

Move a subscription from under a customer to another customer entity.

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: AF168DD240
Header parameters
X-Avangate-AuthenticationstringRequired

Authentication header

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

OK

application/json
stringOptionalExample: true
post/subscriptions/{SubscriptionReference}/customer/
POST /rest/6.0/subscriptions/{SubscriptionReference}/customer/ HTTP/1.1
Host: api.2checkout.com
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Accept: application/json
Content-Type: application/json
Content-Length: 94

{
  "ExternalCustomerReference": "ThisIsTheCustomerID123",
  "AvangateCustomerReference": 23423543543
}
200

OK

true

Retrieve a subscription's end user

get

Overview

Extract information about the end user of a specific subscription.

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: 13E4ED768D
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
FirstNamestringOptionalExample: John
LastNamestringOptionalExample: Doe
EmailstringOptionalExample: dynamicproduct@products.com
CompanystringOptional
FiscalCodestringOptionalExample: A54FR
PhonestringOptional
FaxstringOptional
Address1stringOptionalExample: Address example
Address2stringOptional
ZipstringOptionalExample: 90210
CitystringOptionalExample: LA
StatestringOptionalExample: California
CountryCodestringOptionalExample: us
LanguagestringOptionalExample: en
get/subscriptions/{SubscriptionReference}/enduser/
GET /rest/6.0/subscriptions/{SubscriptionReference}/enduser/ HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
200

OK

{
  "FirstName": "2Checkout",
  "LastName": "Customer",
  "Email": "iwanttestnow1981@yahoo.com",
  "Company": "Test company",
  "FiscalCode": "MRTMTT25D09F205Z",
  "Phone": 123123123,
  "Fax": 125342424,
  "Address1": "Test Address",
  "Address2": "No 12",
  "Zip": 12345,
  "City": "Test city",
  "CountryCode": "gb",
  "State": "Test state",
  "Language": "en"
}

Update end user info

put

Update the end user details for a specific subscription.

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: 13E4ED768D
Header parameters
X-Avangate-AuthenticationstringRequired

Authentication header

Example: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Acceptstring · enumRequiredExample: application/jsonPossible values:
Body
FirstNamestringOptionalExample: John
LastNamestringOptionalExample: Doe
EmailstringOptionalExample: dynamicproduct@products.com
CompanystringOptional
FiscalCodestringOptionalExample: A54FR
PhonestringOptional
FaxstringOptional
Address1stringOptionalExample: Address example
Address2stringOptional
ZipstringOptionalExample: 90210
CitystringOptionalExample: LA
StatestringOptionalExample: California
CountryCodestringOptionalExample: us
LanguagestringOptionalExample: en
Responses
200

OK

application/json
stringOptionalExample: true
put/subscriptions/{SubscriptionReference}/enduser/
PUT /rest/6.0/subscriptions/{SubscriptionReference}/enduser/ HTTP/1.1
Host: api.2checkout.com
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Accept: application/json
Content-Type: application/json
Content-Length: 307

{
  "FirstName": "2Checkout",
  "LastName": "Customer",
  "Email": "iwanttestnow1981@yahoo.com",
  "Company": "Test company",
  "FiscalCode": "MRTMTT25D09F205Z",
  "Phone": 123123123,
  "Fax": 125342424,
  "Address1": "Test Address",
  "Address2": "No 12",
  "Zip": 12345,
  "City": "Test city",
  "CountryCode": "gb",
  "State": "Test state",
  "Language": "en"
}
200

OK

true

Retrieve the payment info for a subscription

get

Retrieve the payment information associated with a subscription and that the 2Checkout system uses for the auto-renewal process (recurring billing).

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: 13E4ED768D
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
TypestringOptionalExample: TEST
CurrencystringOptionalExample: USD
get/subscriptions/{SubscriptionReference}/payment/
GET /rest/6.0/subscriptions/{SubscriptionReference}/payment/ HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
{
  "Type": "TEST",
  "Currency": "USD",
  "PaymentMethod": {
    "FirstDigits": "4111",
    "LastDigits": "1111",
    "CardType": "visa",
    "ExpirationMonth": "02",
    "ExpirationYear": "2023",
    "CardUpdated": true,
    "Authorize3DSUrl": "http://secure.avangate.local/order/3ds.php?refno=11656222&CHANGE_CARD=1"
  }
}

Copy payment info

post

Copy card-on-file data available in the 2Checkout system from a source subscription to an imported target subscription. 2Checkout uses the existing payment information to charge customers as a part of the recurring billing (renewal) process.

Path parameters
SubscriptionReferencestringRequired

The 2Checkout Subscription Reference of the imported target subscription, to which 2Checkout copies the payment on file data associated with the source

Example: 9366C227E7
Query parameters
SubscriptionCodestringRequired

The 2Checkout Subscription Reference of the source subscription whose attached payment on file data 2Checkout copies to the target subscription.

Example: AD45C256Q1
Responses
200

Boolean 'true' in case of successful copy

No content

post/subscriptions/{SubscriptionReference}/payment/
POST /rest/6.0/subscriptions/{SubscriptionReference}/payment/?SubscriptionCode=text HTTP/1.1
Host: api.2checkout.com
Accept: */*

No content

Update the payment info for a subscription

put

Update the payment information associated with a subscription, the 2Checkout system uses for the auto-renewal process (recurring billing).

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

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

Authentication header

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

Return object

application/json
FirstDigitsstringOptionalExample: 4111
LastDigitsstringOptionalExample: 1111
CardTypestringOptionalExample: visa
ExpirationMonthstringOptionalExample: 02
ExpirationYearintegerOptionalExample: 2023
CardUpdatedbooleanOptionalExample: true
Authorize3DSUrlstringOptionalExample: http://secure.avangate.local/order/3ds.php?refno=11656222&CHANGE_CARD=1
put/subscriptions/{SubscriptionReference}/payment/
PUT /rest/6.0/subscriptions/{SubscriptionReference}/payment/ HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Content-Type: application/json
Content-Length: 115

{
  "PaymentDetails": {
    "Type": "EES_TOKEN_PAYMENT",
    "PaymentMethod": {
      "EesToken": "fa922523-26d0-4cb4-983c-a4c5195baff7"
    }
  }
}
{
  "FirstDigits": "4111",
  "LastDigits": "1111",
  "CardType": "visa",
  "ExpirationMonth": "02",
  "ExpirationYear": "2023",
  "CardUpdated": true,
  "Authorize3DSUrl": "http://secure.avangate.local/order/3ds.php?refno=11656222&CHANGE_CARD=1"
}

Retrieve renewal links and recurring billing status

get

Retrieve the manual renewal link and the recurring billing status for a subscription.

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: 13E4ED768D
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}/renewal/
GET /rest/6.0/subscriptions/{SubscriptionReference}/renewal/ HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
{
  "ManualRenewalLink": "https://store.avancart.com/s.php?c=12d1b2e4aba2d3631403&v=60539333bb",
  "RecurringEnabled": true
}

Enable recurring billing for a subscription

post

Enable recurring billing (the auto-renewal system) for a subscription. For an add-on subscription, auto-renewal can only be enabled while its main subscription is active and has auto-renewal on; otherwise the request is rejected with error_code ADDON_AUTORENEWAL_MAIN_NOT_ELIGIBLE.

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: 13E4ED768D
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
post/subscriptions/{SubscriptionReference}/renewal/
POST /rest/6.0/subscriptions/{SubscriptionReference}/renewal/ HTTP/1.1
Host: api.2checkout.com
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Accept: application/json
true

Renew a subscription

put

Renew a specific subscription controlling the price and number of days.

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: 13E4ED768D
Header parameters
X-Avangate-AuthenticationstringRequired

Authentication header

Example: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Acceptstring · enumRequiredExample: application/jsonPossible values:
Body
CurrencystringOptional
DaysnumberOptional
ExtendSubscriptionany · nullableOptional
PricenumberOptional
Responses
200

OK

application/json
put/subscriptions/{SubscriptionReference}/renewal/
PUT /rest/6.0/subscriptions/{SubscriptionReference}/renewal/ HTTP/1.1
Host: api.2checkout.com
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Accept: application/json
Content-Type: application/json
Content-Length: 42

{
  "Currency": "usd",
  "Days": 15,
  "Price": 22.11
}
true

Disable recurring billing for a subscription

delete

Disable recurring billing (the auto-renewal system) for a subscription.

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: 13E4ED768D
Header parameters
X-Avangate-AuthenticationstringRequired

Authentication header

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

OK

application/json
delete/subscriptions/{SubscriptionReference}/renewal/
DELETE /rest/6.0/subscriptions/{SubscriptionReference}/renewal/ HTTP/1.1
Host: api.2checkout.com
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Accept: */*
true

Set a custom grace period

put

Set a custom grace period for an Active or Past Due subscription.

Use null to set the grace period for a subscription to the default value you defined in the per-product or per-account settings.


Attributes
Type/Description

SubscriptionReference

Required (string)

Unique, system-generated subscription identifier.

Query parameters

Attributes
Type/Description

Days

Required (string)

The number of days of the grace period. Use null to set the grace period for a subscription to the default value you defined in the per-product or per-account settings.


Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: 48F5AC7011
Query parameters
DaysintegerRequired

The number of days of the grace period.

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}/renewal/graceperiod/
PUT /rest/6.0/subscriptions/{SubscriptionReference}/renewal/graceperiod/?Days=1 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

Enable renewal notification

post

Subscribe shoppers to subscription renewal notifications.

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: 13E4ED768D
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
post/subscriptions/{SubscriptionReference}/renewal/notification/
POST /rest/6.0/subscriptions/{SubscriptionReference}/renewal/notification/ 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

Disable renewal notification

delete

Disable subscription renewal notifications for a specific subscription.

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: 13E4ED768D
Query parameters
ChurnReasonsstring[]Optional

Array of churn reason codes

Example: ["CHURN_REASON_NOT_SATISFIED_PRODUCT","CHURN_REASON_ENABLED_BY_MISTAKE","CHURN_REASON_PREFER_MANUAL","CHURN_REASON_ALREADY_RENEWED","CHURN_REASON_DONT_NEED","CHURN_REASON_WANT_PAUSE","CHURN_REASON_COVID","CHURN_REASON_HIGH_PRICE","CHURN_REASON_NOT_SATISFIED_SUPPORT","CHURN_REASON_EXTRAORDINARY","CHURN_REASON_OTHER"]
ChurnReasonOtherstringOptional

Churn reason free text. Valid only if churn reason codes are CHURN_REASON_EXTRAORDINARY or CHURN_REASON_OTHER

Example: An example reason in freetext
Header parameters
X-Avangate-AuthenticationstringRequired

Authentication header

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

OK

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

OK

true

Set merchant deal autorenewal value to true

post

A merchant can change the merchantdealautorenewal to true on a client existing subscription

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: 13E4ED768D
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
MerchantDealAutoRenewalbooleanOptional
post/subscriptions/{SubscriptionReference}/renewal/merchantdealautorenewal/
POST /rest/6.0/subscriptions/{SubscriptionReference}/renewal/merchantdealautorenewal/ HTTP/1.1
Host: api.2checkout.com
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Accept: application/json
200

OK

{
  "Merchantdealautorenewal": true
}

Set merchant deal autorenewal value to false

delete

A merchant can change the merchantdealautorenewal to false on a client existing subscription

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: 13E4ED768D
Header parameters
X-Avangate-AuthenticationstringRequired

Authentication header

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

OK

application/json
MerchantDealAutoRenewalbooleanOptional
delete/subscriptions/{SubscriptionReference}/renewal/merchantdealautorenewal/
DELETE /rest/6.0/subscriptions/{SubscriptionReference}/renewal/merchantdealautorenewal/ HTTP/1.1
Host: api.2checkout.com
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Accept: */*
200

OK

{
  "Merchantdealautorenewal": false
}

Set client deal autorenewal value to true

post

If merchant deal autorenewal is false then will set client deal autorenewal value to true

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: 13E4ED768D
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
ClientDealAutoRenewalbooleanOptional
post/subscriptions/{SubscriptionReference}/renewal/clientdealautorenewal/
POST /rest/6.0/subscriptions/{SubscriptionReference}/renewal/clientdealautorenewal/ HTTP/1.1
Host: api.2checkout.com
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Accept: application/json
200

OK

{
  "ClientDealAutoRenewal": true
}

Set client deal autorenewal value to false

delete

If merchant deal autorenewal is false then will set client deal autorenewal value to false

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: 13E4ED768D
Header parameters
X-Avangate-AuthenticationstringRequired

Authentication header

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

OK

application/json
ClientDealAutoRenewalbooleanOptional
delete/subscriptions/{SubscriptionReference}/renewal/clientdealautorenewal/
DELETE /rest/6.0/subscriptions/{SubscriptionReference}/renewal/clientdealautorenewal/ HTTP/1.1
Host: api.2checkout.com
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Accept: */*
200

OK

{
  "ClientDealAutoRenewal": false
}

Retrieve a subscription's next renewal price

get

Retrieve pricing details for the next charge necessary to renew a specific subscription.

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: 48F5AC7011
CurrencystringRequired

The currency ISO code used for the payment - ISO 4217.

Example: usd
Query parameters
AddonReferencesstring[]Optional

Optional array of addon subscription reference codes to include in the aggregated price. When omitted, all active addon subscriptions with auto-renewal enabled are included.

Example: ["TLWHMXTZ5B"]
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
NetPricenumber · doubleOptionalExample: 1
NetCurrencystringOptionalExample: EUR
FinalPricenumber · doubleOptionalExample: 1.2
FinalCurrencystringOptionalExample: EUR
ReasonTextstring · nullableOptional
get/subscriptions/{SubscriptionReference}/renewal/price/{Currency}/
GET /rest/6.0/subscriptions/{SubscriptionReference}/renewal/price/{Currency}/ HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
{
  "FinalCurrency": "EUR",
  "FinalPrice": 1.2,
  "NetCurrency": "EUR",
  "NetPrice": 1,
  "ReasonText": null
}

Set a custom subscription renewal price

put

Set custom renewal prices for subscriptions and control the number of recurring billing cycles the price impact subscribers.

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: 48F5AC7011
CurrencystringRequired

The currency ISO code used for the payment - ISO 4217.

Example: usd
Header parameters
X-Avangate-AuthenticationstringRequired

Authentication header

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

OK

application/json
put/subscriptions/{SubscriptionReference}/renewal/price/{Currency}/
PUT /rest/6.0/subscriptions/{SubscriptionReference}/renewal/price/{Currency}/ HTTP/1.1
Host: api.2checkout.com
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Accept: application/json
Content-Type: application/json
Content-Length: 69

{
  "Cycles": 2,
  "Currency": "EUR",
  "Price": 100,
  "Text": "Additional details"
}
true

Convert a trial

put

Convert a trial to a paid subscription. In the eventuality of a conversion failure, you can attempt the same trial subscription conversion only after you let 24 hours pass since the initial attempt. The 2Checkout system also attempts to automatically convert trials before they expire to full subscriptions, unless you made an attempt that failed less than 24 hours before the scheduled expiration deadline. In case the trial conversion fails due to a transaction issue, the 2Checkout system sends unfinished payment follow-up emails to customers, provided that you set up lead management for your account.

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier belonging to a trial for which 2Checkout collected payment information (card).

Example: C941E05AF3
Query parameters
CurrencystringOptional

The currency associated to the renewal price - ISO 4217 code.

Example: usd
DaysintegerOptional

The number of days the 2Checkout system extends the lifetime of the subscription.

Example: 30
ExtendSubscriptionbooleanOptional

true - Subscription start date is the moment of the conversion. false - Subscription start date is the trial/subscription expiration date.

Example: false
PricenumberOptional

true - The price that 2Checkout charges the customer for the renewal. This is the Netprice. Ignored for trial conversions.

Example: 45.99
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}/renewal/trial/
PUT /rest/6.0/subscriptions/{SubscriptionReference}/renewal/trial/ 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 pause information

get

Retrieve a subscription's pause information

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: 13E4ED768D
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}/renewal/pause/
GET /rest/6.0/subscriptions/{SubscriptionReference}/renewal/pause/ HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
{
  "StartDate": "2020-09-09 13:36:44",
  "ResumeDate": "2020-10-20 08:08:08",
  "PauseReason": "vacation"
}

Pause subscription

post

Pause a subscription. A subscription that has active addon subscriptions (with auto-renewal enabled) cannot be paused, and an addon subscription itself cannot be paused. Both cases are rejected with error_code INVALID_LICENCE.

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: 13E4ED768D
Query parameters
ResumeDatestringRequired

Resume date

Example: 2020-02-30 18:00:00
PauseReasonstringOptional

Pause reason

Example: vacation leave
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
post/subscriptions/{SubscriptionReference}/renewal/pause/
POST /rest/6.0/subscriptions/{SubscriptionReference}/renewal/pause/?ResumeDate=text HTTP/1.1
Host: api.2checkout.com
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Accept: application/json
true

Unpause subscription

delete

Unpause a subscription

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: 13E4ED768D
Header parameters
X-Avangate-AuthenticationstringRequired

Authentication header

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

OK

application/json
delete/subscriptions/{SubscriptionReference}/renewal/pause/
DELETE /rest/6.0/subscriptions/{SubscriptionReference}/renewal/pause/ HTTP/1.1
Host: api.2checkout.com
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Accept: */*
true

Trigger immediate billing for a pay per usage subscription

put

This method will schedule the subscription to auto-renew as soon as possible.

Path parameters
SubscriptionReferencestringRequired

Unique code which represents a subscription

Responses
200

No content

No content

put/subscriptions/{SubscriptionReference}/renewal/usage/
PUT /rest/6.0/subscriptions/{SubscriptionReference}/renewal/usage/ HTTP/1.1
Host: api.2checkout.com
Accept: */*

No content

Retrieve upgrade options for a subscription

get

Retrieve the upgrade options available for a specific subscription.

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: 13E4ED768D
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}/upgrade/
GET /rest/6.0/subscriptions/{SubscriptionReference}/upgrade/ HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
200

OK

[
  {
    "ProductInfo": {
      "ProductId": 1245432423,
      "ProductCode": "product_code_custom1",
      "ProductName": "One Size Fits All Local Security",
      "ProductVersion": 2,
      "ProductEnabled": 0,
      "PriceType": "NET",
      "Currency": "USD",
      "DefaultCurrency": "USD",
      "Price": "99",
      "NetPrice": "99",
      "GrossPrice": "119.46",
      "GiftOption": null,
      "IdGroup": 0,
      "GroupName": "",
      "ShortDescription": "\r\n\t- \r\n\t\tOnline is a channel.\r\n\t- \r\n\t\tOne-time sale.\r\n\t- \r\n\t\tInternational over time.\r\n\t- \r\n\t\tProduct separated from commerce.\r\n\t- \r\n\t\tAcquisition only.\r\n\t- \r\n\t\tSingle pricing model, static.\r\n",
      "ProductImage": "blank-box-blue.jpg",
      "Languages": [],
      "ProductType": "NET",
      "PriceSchema": null
    },
    "Quantity": "1",
    "PriceOptions": {
      "Id": null,
      "Name": "Users",
      "Description": "",
      "Required": true,
      "Type": "RADIO",
      "Options": [
        {
          "Id": null,
          "Name": "1-100",
          "Value": "oneuser1",
          "Default": true,
          "Description": "",
          "MinValue": 1,
          "MaxValue": 100
        },
        {
          "Id": null,
          "Name": "101-1000",
          "Value": "oneuser1",
          "Default": true,
          "Description": "",
          "MinValue": 101,
          "MaxValue": 1000
        }
      ]
    }
  },
  {
    "ProductInfo": {
      "ProductId": 45432423,
      "ProductCode": "product_code_custom2",
      "ProductName": "One Size Fits All Local Security",
      "ProductVersion": 2,
      "ProductEnabled": 0,
      "PriceType": "NET",
      "Currency": "USD",
      "DefaultCurrency": "USD",
      "Price": "99",
      "GiftOption": null,
      "IdGroup": 0,
      "GroupName": "",
      "ShortDescription": "\r\n\t- \r\n\t\tOnline is a channel.\r\n\t- \r\n\t\tOne-time sale.\r\n\t- \r\n\t\tInternational over time.\r\n\t- \r\n\t\tProduct separated from commerce.\r\n\t- \r\n\t\tAcquisition only.\r\n\t- \r\n\t\tSingle pricing model, static.\r\n",
      "ProductImage": "blank-box-blue.jpg",
      "Languages": [],
      "ProductType": "NET",
      "PriceSchema": null
    },
    "Quantity": "1",
    "PriceOptions": {
      "Id": null,
      "Name": "Users",
      "Description": "",
      "Required": true,
      "Type": "RADIO",
      "Options": [
        {
          "Id": null,
          "Name": "1-100",
          "Value": "oneuser1",
          "Default": true,
          "Description": "",
          "MinValue": 1,
          "MaxValue": 100
        },
        {
          "Id": null,
          "Name": "101-1000",
          "Value": "oneuser1",
          "Default": true,
          "Description": "",
          "MinValue": 101,
          "MaxValue": 1000
        }
      ]
    }
  }
]

Upgrade a subscription

put

Upgrade a specific subscription.

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: 13E4ED768D
Header parameters
X-Avangate-AuthenticationstringRequired

Authentication header

Example: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Acceptstring · enumRequiredExample: application/jsonPossible values:
Body
CustomPricenumberOptional
ExternalRefany · nullableOptional
PriceOptionsstringOptional
ProductCodestringOptional
QuantitynumberOptional
Responses
200

OK

application/json
put/subscriptions/{SubscriptionReference}/upgrade/
PUT /rest/6.0/subscriptions/{SubscriptionReference}/upgrade/ HTTP/1.1
Host: api.2checkout.com
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Accept: application/json
Content-Type: application/json
Content-Length: 106

{
  "CustomPrice": 50,
  "PriceOptions": "emailsupport;oneuser1",
  "ProductCode": "my_subscription_123",
  "Quantity": 3
}
true

Retrieve product upgrade price for a subscription

get

Retrieve the upgrade price available for a specific subscription. The response will contain the upgrade price for quantity = 1.

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: 13E4ED768D
ProductReferencestringRequired

Unique, system-generated product identifier.

Example: 76G4FE769L
CurrencyCodestringRequired

Currency code.

Example: EUR
Query parameters
OptionsstringOptional

Price options delimited by comma.

Example: abc,def
QuantityintegerOptional

Quantity.

Example: 4
CalculateProratedPricebooleanOptional

Decides if the price should be prorated.

Example: false
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}/upgrade/price/{ProductReference}/{CurrencyCode}/
GET /rest/6.0/subscriptions/{SubscriptionReference}/upgrade/price/{ProductReference}/{CurrencyCode}/ HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
{
  "Discount": 0.3,
  "ProratedPrice": 3,
  "ProratedGrossPrice": 3,
  "DiscountedProratedPrice": 2.7,
  "DiscountedProratedGrossPrice": 2.7,
  "BillingPrice": 3,
  "BillingGrossPrice": 3,
  "DiscountedBillingPrice": 2.7,
  "DiscountedBillingGrossPrice": 2.7,
  "BillingCurrency": "EUR",
  "Quantity": "1",
  "DisplayDiscount": 0.3,
  "DisplayPrice": 3,
  "DisplayGrossPrice": 3,
  "DiscountedDisplayPrice": 2.7,
  "DiscountedDisplayGrossPrice": 2.7,
  "DisplayCurrency": "EUR"
}

Schedule product update

post

Schedule a product update for a subscription. The update will be applied at the next renewal.

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

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

Authentication header

Example: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Body
ProductCodestringRequired

The product code to update to

Example: AIJT2PY5IG
PricingOptionsstringRequired

Semicolon-separated list of pricing options

Example: adb_checkbox_1;adb_radio_2
QuantityintegerOptional

Optional quantity for the product

Example: 2
Responses
200

Product update scheduled successfully

application/json
post/subscriptions/{SubscriptionReference}/schedule-product-update
POST /rest/6.0/subscriptions/{SubscriptionReference}/schedule-product-update HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Content-Type: application/json
Content-Length: 87

{
  "ProductCode": "AIJT2PY5IG",
  "PricingOptions": "adb_checkbox_1;adb_radio_2",
  "Quantity": 2
}
true

Remove scheduled product update

delete

Remove a previously scheduled product update for a subscription.

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: 13E4ED768D
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

Scheduled product update removed successfully

application/json
delete/subscriptions/{SubscriptionReference}/remove-scheduled-product-update
DELETE /rest/6.0/subscriptions/{SubscriptionReference}/remove-scheduled-product-update HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
true

Last updated

Was this helpful?