Subscription import

Add/import subscriptions in the 2Checkout system. Include card data with your subscription import only if you contacted 2Checkout to enable this functionality for your account. Otherwise, the import process results in a failure. Contact 2Checkout or your account manager directly for more details.

Request parameters

Parameter
Type / Description

ExternalSubscriptionReference

Required (string) Unique identifier for your subscription. Mandatory when importing subscription data.

StartDate

Required (string) Subscription start date(YYYY-MM-DD) - StartDate is mandatory when importing subscription data. If you changed the time zone for the 2Checkout API by editing system settings under Account settings, then the StartDate you provide must be in accordance with your custom configuration.

ExpirationDate

Required (string) Subscription expiration date(YYYY-MM-DD) - ExpirationDate is mandatory when importing subscription data. If you changed the time zone for the 2Checkout API by editing system settings under Account settings, then the ExpirationDate you provide must be in accordance with your custom configuration.

Product

Required (object) The product for which 2Checkout generated the subscription. Details below.

Product.ProductCode

String Unique product identifier that you control.

Product.ProductId

Int Unique, system-generated product identifier.

Product.ProductName

String Product name.

Product.ProductQuantity

Int Ordered number of units.

Product.ProductVersion

String Product version.

Product.PriceOptionCodes

Array The product options codes the customer selected when acquiring the subscription. Pricing options codes are case sensitive.

EndUser

Required (object) The end user of the subscription. Details below.

EndUser.Person

Object Details below.

EndUser.Person.FirstName

String End user's first name

EndUser.Person.LastName

String End user's last name

EndUser.Person.CountryCode

String End user country code [ISO3166-1 Alpha 2].

EndUser.Person.State

String End user state.

EndUser.Person.City

String End user city.

EndUser.Person.Address1

String End user first address line.

EndUser.Person.Address2

String End user second address line.

EndUser.Person.Zip

String End user zip code.

EndUser.Person.Email

String End user email address.

EndUser.Person.Phone

String End user phone number.

EndUser.Person.Company

String Company name.

EndUser.Fax

String End user fax.

EndUser.Language

String Language [ISO639-2] the 2Checkout system uses for communications.

DeliveryInfo

Optional (object) The object contains information about the delivery/fulfillment made to the customer.

DeliveryInfo.Description

String Delivery description.

DeliveryInfo.Codes

Array of objects Details below.

DeliveryInfo.Codes.Code

String Delivered activation key/code.

DeliveryInfo.Codes.Description

String Code description for dynamic lists from your key generator.

DeliveryInfo.Codes.ExtraInfo

Object Info set by your key generator for dynamic lists only.

DeliveryInfo.Codes.ExtraInfo.CodeExtraInfo

Object

DeliveryInfo.Codes.ExtraInfo.Type

String

DeliveryInfo.Codes.ExtraInfo.Label

String

DeliveryInfo.Codes.ExtraInfo.Value

String

DeliveryInfo.Codes.File

Array of objects Details below.

DeliveryInfo.Codes.File.Content

String Content of the file (base64 encoded).

DeliveryInfo.Codes.File.ContentLenght

Int File size.

DeliveryInfo.Codes.File.Filename

String The name of the delivered file.

DeliveryInfo.Codes.File.FileType

String The type of the delivered file.

PartnerCode

Optional (string)

  • Empty: for ecommerce orders

  • Partner Code (mandatory)

ExternalCustomerReference

Optional (string) Customer identifier you control.

SubscriptionValue

Optional (double) Subscription value. The total costs incurred by the customer through the lifecycle of the subscription before you imported the item into the 2Checkout system.

When you send this parameter you must accompany it by ValueCurrency.

SubscriptionValueCurrency

Optional (string) Mandatory when you also send the Value parameter. The currency associated to the subscription value.

AdditionalInfo

Optional (string) Extra information that you can attach to a subscription, such as the source of the initial purchase.

NextRenewalPrice

Optional (double) The future costs that subscribers would incur when their subscriptions are renewed. When provided, you must accompany it by NextRenewalPriceCurrency and CustomPriceBillingCyclesLeft.

NextRenewalPriceCurrency

Optional (string) Mandatory when you send CustomPriceBillingCyclesLeft. The currency associated with the subscription next renewal price value.

CustomPriceBillingCyclesLeft

Optional (string) Mandatory when you send NextRenewalPrice. 2Checkout applies the next renewal price to the number of billing cycles you define.

Test

Optional (integer) Available only for eStore subscriptions. Use 1 to import a test subscription. Exclude the parameter or set the value to 0 to import regular subscriptions. Test subscriptions enable you to try out flows like manual and auto renewal, and upgrade.

CardPayment

Optional (object) Include payment (credit/debit card) information that 2Checkout uses for recurring billing to renew imported subscriptions. Importing subscriptions with payment data is available only to eligible 2Checkout accounts. Contact 2Checkout directly for additional details.

Card payment

Add credit/debit card details when importing subscriptions. 2Checkout uses payment information in the recurring billing process.

For imports of test subscriptions, use the credit card information from this article.

Parameter
Type / Description

CardPayment

Object

CardNumber

Required (string) The credit/debit card number.

CardType

Required (string) VISA, VISAELECTRON, MASTERCARD, MAESTRO, AMEX, DISCOVER, DANKORT, CARTEBLEUE, JCB.

ExpirationYear

Required (string) The year in which the card expires.

ExpirationMonth

Required (string) The month in which the card expires.

HolderName

Required (string) Card holder name.

CCID

Required (string) Credit Card Identification - an extra ID printed on the card, usually a 3-4 digit number, the CVC2/CVV2.

HolderNameTime

Required (int) The interval of time in seconds in which shoppers enter their name in the HolderName field. An abnormally short interval is usually a red flag for fraud attempts.

AutoRenewal

Optional (bool) True or false, depending on whether the customer or you enabled or disabled subscription auto-renewals.

CardNumberTime

Optional (int) The interval of time in seconds in which shopper enter their card number in the CardNumber field. An abnormally short interval is usually a red flag for fraud attempts.

Can be NULL, but not a negative number.

Last updated

Was this helpful?