Subscription
Customer's email
customer@2checkout.comCustomer's delivered code
FJD89SRCustomer's reference
FDOIEJFCustomer's external reference
4584358Aggregated data, the only valid value is 'true'
trueChecks status
falseFilter by recurring status
trueArray of product codes
["FJGHRE","GFDFOI"]Array of countries codes
["UK","BG","RO","FR"]Purchase date
2018-09-03Purchase date
2018-09-03Expire date
2018-09-03Expire date
2018-09-03Renew date
2018-09-03Renew date
2018-09-03Notification date
2018-09-03Notification date
2018-09-03Change date
2018-09-03Change date
2018-09-03Start date of Next billing date filter
2018-09-03End date of Next billing date filter
2018-09-03Filter by lifetime subscriptions
falseSubscription types
REGULARRequested page
2Limit number
20application/jsonExample: application/jsonPossible values: Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"List 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}"
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
}
}Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"application/jsonPossible values: 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"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
}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"Unique code which represents a subscription
D183B94D0Eapplication/jsonExample: application/jsonPossible values: Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"Get subscription
3501E8CADA2018-09-03 16:28:322018-09-03 16:28:322018-09-03 17:28:32truenullExample: 2020-11-09T12:19:31+02:00truetruefalseADE86Imported0918495269123980DUSI46falsefalseEXPIREDfalseGET /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}"
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"
}
}
}Unique, system-generated subscription identifier.
D183B94D0EAuthentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"application/jsonPossible values: OK
Invalid data
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
trueUnique, system-generated subscription identifier.
AF168DD240Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"application/jsonPossible values: OK
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"
}OK
trueUnique, system-generated subscription identifier.
D183B94D0EAuthentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"OK
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: */*
OK
trueReverts 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.
Unique, system-generated subscription identifier.
13E4ED768Dapplication/jsonExample: application/jsonPossible values: Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"The reference number (RefNo) of the order whose changes should be reverted. Must be the last order on the subscription.
1200815Mandatory free-text reason for the revert. Recorded in subscription history.
Customer requested revert after accidental renewalSubscription reverted successfully
Invalid data
Internal server error
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"
}trueAttach multiple additional information key/value pairs to an existing subscription in a single call
Unique, system-generated subscription identifier.
5A235DDE94Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"application/jsonPossible values: OK
Invalid data
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 additional information of specified subscription
Unique, system-generated subscription identifier.
5A235DDE94application/jsonExample: application/jsonPossible values: Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"OK
Invalid data
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 an existing subscription by key/value pair
Unique, system-generated subscription identifier.
5A235DDE94Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"application/jsonPossible values: OK
Invalid data
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"
}Get additional information for a subscription by field key
Unique, system-generated subscription identifier.
5A235DDE94Unique name you assign as the identifier of an additional information field.
TestField1application/jsonExample: application/jsonPossible values: Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"OK
Invalid data
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 of a subscription by field/key
Unique, system-generated subscription identifier.
5A235DDE94Unique name you assign as the identifier of an additional information field.
TestField1Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"application/jsonOK
Invalid data
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"
}Remove additional information attached to a subscription by name/key
Unique, system-generated subscription identifier.
5A235DDE94Unique name you assign as the identifier of an additional information field.
TestField1Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"OK
Invalid data
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: */*
trueBuild the PayPal URL that can be used to attach a subscription to a PayPal account.
Unique, system-generated subscription identifier. Represents the subscription code that will be attached to the PayPal account.
5A235DDE94Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"application/jsonExample: application/jsonPossible values: The PayPal email associated with the subscription.
The URL the user will be redirected to if the subscription is successfully attached to PayPal.
The URL the user will be redirected to if the subscription fails to attach to PayPal.
OK
Can be "success" if no errors occurred or "error" otherwise.
successThe PayPal redirect URL if no errors occurred or empty otherwise.
https://api.2checkout.com/6.0/scripts/paypal/request?avng8apitoken=a211b606e9a62202Empty if no errors occurred or the error message otherwise.
Invalid data
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": []
}Extract information on the customer associated with a specific subscription.
Unique, system-generated subscription identifier.
5A235DDE94application/jsonExample: application/jsonPossible values: Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"OK
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}"
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"
}Move a subscription from under a customer to another customer entity.
Unique, system-generated subscription identifier.
AF168DD240Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"application/jsonPossible values: OK
truePOST /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
}OK
trueOverview
Extract information about the end user of a specific subscription.
Unique, system-generated subscription identifier.
13E4ED768Dapplication/jsonExample: application/jsonPossible values: Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"OK
JohnDoedynamicproduct@products.comA54FRAddress example90210LACaliforniausenGET /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}"
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 the end user details for a specific subscription.
Unique, system-generated subscription identifier.
13E4ED768DAuthentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"application/jsonPossible values: JohnDoedynamicproduct@products.comA54FRAddress example90210LACaliforniausenOK
truePUT /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"
}OK
trueRetrieve the payment information associated with a subscription and that the 2Checkout system uses for the auto-renewal process (recurring billing).
Unique, system-generated subscription identifier.
13E4ED768Dapplication/jsonExample: application/jsonPossible values: Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"OK
TESTUSDInvalid data
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 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.
The 2Checkout Subscription Reference of the imported target subscription, to which 2Checkout copies the payment on file data associated with the source
9366C227E7The 2Checkout Subscription Reference of the source subscription whose attached payment on file data 2Checkout copies to the target subscription.
AD45C256Q1Boolean 'true' in case of successful copy
No content
Copy payment failed
POST /rest/6.0/subscriptions/{SubscriptionReference}/payment/?SubscriptionCode=text HTTP/1.1
Host: api.2checkout.com
Accept: */*
No content
Update the payment information associated with a subscription, the 2Checkout system uses for the auto-renewal process (recurring billing).
Unique, system-generated subscription identifier.
13E4ED768Dapplication/jsonExample: application/jsonPossible values: Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"Return object
41111111visa022023truehttp://secure.avangate.local/order/3ds.php?refno=11656222&CHANGE_CARD=1Invalid data
Operations forbidden
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 the manual renewal link and the recurring billing status for a subscription.
Unique, system-generated subscription identifier.
13E4ED768Dapplication/jsonExample: application/jsonPossible values: Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"OK
Invalid data
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 (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.
Unique, system-generated subscription identifier.
13E4ED768DAuthentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"application/jsonPossible values: OK
Invalid data
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
trueRenew a specific subscription controlling the price and number of days.
Unique, system-generated subscription identifier.
13E4ED768DAuthentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"application/jsonPossible values: OK
Invalid data
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
}trueDisable recurring billing (the auto-renewal system) for a subscription.
Unique, system-generated subscription identifier.
13E4ED768DAuthentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"OK
Invalid data
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: */*
trueSet 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.
SubscriptionReference
Required (string)
Unique, system-generated subscription identifier.
Query parameters
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.
Unique, system-generated subscription identifier.
48F5AC7011The number of days of the grace period.
7Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"application/jsonPossible values: OK
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
OK
trueSubscribe shoppers to subscription renewal notifications.
Unique, system-generated subscription identifier.
13E4ED768DAuthentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"application/jsonPossible values: OK
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
OK
trueDisable subscription renewal notifications for a specific subscription.
Unique, system-generated subscription identifier.
13E4ED768DArray of churn reason codes
["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"]Churn reason free text. Valid only if churn reason codes are CHURN_REASON_EXTRAORDINARY or CHURN_REASON_OTHER
An example reason in freetextAuthentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"OK
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: */*
OK
trueA merchant can change the merchantdealautorenewal to true on a client existing subscription
Unique, system-generated subscription identifier.
13E4ED768DAuthentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"application/jsonPossible values: OK
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
OK
{
"Merchantdealautorenewal": true
}A merchant can change the merchantdealautorenewal to false on a client existing subscription
Unique, system-generated subscription identifier.
13E4ED768DAuthentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"OK
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: */*
OK
{
"Merchantdealautorenewal": false
}If merchant deal autorenewal is false then will set client deal autorenewal value to true
Unique, system-generated subscription identifier.
13E4ED768DAuthentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"application/jsonPossible values: OK
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
OK
{
"ClientDealAutoRenewal": true
}If merchant deal autorenewal is false then will set client deal autorenewal value to false
Unique, system-generated subscription identifier.
13E4ED768DAuthentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"OK
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: */*
OK
{
"ClientDealAutoRenewal": false
}Retrieve pricing details for the next charge necessary to renew a specific subscription.
Unique, system-generated subscription identifier.
48F5AC7011The currency ISO code used for the payment - ISO 4217.
usdOptional array of addon subscription reference codes to include in the aggregated price. When omitted, all active addon subscriptions with auto-renewal enabled are included.
["TLWHMXTZ5B"]application/jsonExample: application/jsonPossible values: Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"OK
1EUR1.2EURInvalid data
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 custom renewal prices for subscriptions and control the number of recurring billing cycles the price impact subscribers.
Unique, system-generated subscription identifier.
48F5AC7011The currency ISO code used for the payment - ISO 4217.
usdAuthentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"application/jsonPossible values: OK
Invalid data
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"
}trueConvert 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.
Unique, system-generated subscription identifier belonging to a trial for which 2Checkout collected payment information (card).
C941E05AF3The currency associated to the renewal price - ISO 4217 code.
usdThe number of days the 2Checkout system extends the lifetime of the subscription.
30true - Subscription start date is the moment of the conversion. false - Subscription start date is the trial/subscription expiration date.
falsetrue - The price that 2Checkout charges the customer for the renewal. This is the Netprice. Ignored for trial conversions.
45.99Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"application/jsonPossible values: OK
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
OK
trueRetrieve a subscription's pause information
Unique, system-generated subscription identifier.
13E4ED768Dapplication/jsonExample: application/jsonPossible values: Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"OK
Invalid data
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 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.
Unique, system-generated subscription identifier.
13E4ED768DResume date
2020-02-30 18:00:00Pause reason
vacation leaveAuthentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"application/jsonPossible values: OK
Invalid data
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
trueUnpause a subscription
Unique, system-generated subscription identifier.
13E4ED768DAuthentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"OK
Invalid data
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: */*
trueThis method will schedule the subscription to auto-renew as soon as possible.
Unique code which represents a subscription
No content
No content
Immediate usage billing client error
Immediate usage billing server error
PUT /rest/6.0/subscriptions/{SubscriptionReference}/renewal/usage/ HTTP/1.1
Host: api.2checkout.com
Accept: */*
No content
Retrieve the upgrade options available for a specific subscription.
Unique, system-generated subscription identifier.
13E4ED768Dapplication/jsonExample: application/jsonPossible values: Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"OK
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}"
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 specific subscription.
Unique, system-generated subscription identifier.
13E4ED768DAuthentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"application/jsonPossible values: OK
Upgrade validation error
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
}trueRetrieve the upgrade price available for a specific subscription. The response will contain the upgrade price for quantity = 1.
Unique, system-generated subscription identifier.
13E4ED768DUnique, system-generated product identifier.
76G4FE769LCurrency code.
EURPrice options delimited by comma.
abc,defQuantity.
4Decides if the price should be prorated.
falseapplication/jsonExample: application/jsonPossible values: Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"OK
Upgrade price validation error
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 a product update for a subscription. The update will be applied at the next renewal.
Unique, system-generated subscription identifier.
13E4ED768Dapplication/jsonExample: application/jsonPossible values: Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"The product code to update to
AIJT2PY5IGSemicolon-separated list of pricing options
adb_checkbox_1;adb_radio_2Optional quantity for the product
2Product update scheduled successfully
Invalid data
Internal server error
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
}trueRemove a previously scheduled product update for a subscription.
Unique, system-generated subscription identifier.
13E4ED768Dapplication/jsonExample: application/jsonPossible values: Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"Scheduled product update removed successfully
Invalid data
Internal server error
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}"
trueLast updated
Was this helpful?