Skip to main content
knowledgecenter.2checkout.com

ConvertPlus Buy Links Signature

Generate custom links

You can generate links for dynamic products outside the cPanel, using the ConvertPlus parameters explained in this article. Some of the ConvertPlus buy link parameters require a signature, to prevent any interference in the ordering process.

ConvertPlus parameters that require a signature:

Parameter Description
return-url URL to which customers are redirected after their finalized purchase. Learn more about Redirect URL on this article.

return-type

The return method used for redirecting your customers after a successful sale. Possible values:

  • Link in the Thank You page
  • Header Redirect
expiration

Buy link expiry date. The link becomes invalid after the date from this parameter. Send as a UTC timestamp.

Example: 

1537549421 

order-ext-ref Use this parameter to set an external reference to the order.
currency Preselected billing currency 2Checkout uses to charge your customers.
product

The name of the dynamic product. For multiple products, send them separated by a semicolon.

Example: name1;name2;name3.

price

For dynamic products, enter the product price.

For multiple dynamic items, send the values separated by a semicolon.

Example: price1;price2;price3.

qty

The number of units (quantity) for each product in checkout, separated by a semicolon ;. Do not use spaces or blanks. Example: qty=2;1.

qty works in conjunction with prod, based on their respective order. The first value of the qty parameter controls the number of units for the products whose identifier is in the first position of the prod parameter. 

Example: https://secure.2checkout.com/checkou...rchant=2COLNC&prod=6FD08E61B5;E2932D0DE2&qty=4;3

tangible

Boolean.

Send TRUE or 1 for products that require physical delivery.

type

The type of the dynamic product. Possible values:

  • PRODUCT
  • SHIPPING
  • TAX

For multiple dynamic items, send the values separated by a semicolon.

Build ConvertPlus signature

To sign a ConvertPlus buy link, you need to follow these steps:

  1. Sort the parameters that require a signature alphabetically.
  2. Serialize the parameters append to them the length of their values.
  3. Concatenate the resulting values.
  4. The serialized value is then encrypted with your Buy Link Secret Word using the HMAC method (algorithm sha256).
  5. The resulting value is added to the buy link under the signature parameter

Example

Let's consider the following parameters:

  •     merchant = 'MCODE'
  •     dynamic = '1'
  •     prod = 'Software'
  •     price = 10
  •     currency = 'USD'
  •     qty = 1
  •     tangible = 0
  •     type = 'product'
  •     expiration = 123123123

The regular buy link will have the following structure:

https://www.2checkout.com/checkout/buy?merchant=2COLRNC&dynamic=1&prod=Software&price=10currency=USD&qty=1&tangible=0&type=product&expiration=123123123

This link is missing one last parameter, a signature.

We take a look at the list of parameters that require a signature:

  •     merchant = '2COLRNC'
  •     dynamic = '1'
  •     prod = 'Software' <-- SIGNATURE REQUIRED
  •     price = 10        <-- SIGNATURE REQUIRED
  •     currency = 'USD'        <-- SIGNATURE REQUIRED
  •     qty = 1             <-- SIGNATURE REQUIRED
  •     tangible = 0         <-- SIGNATURE REQUIRED
  •     type = 'product'         <-- SIGNATURE REQUIRED
  •     expiration = 123123123     <-- SIGNATURE REQUIRED

We extract only those parameters:

  •     prod = 'Software'
  •     price = 10
  •     currency = 'USD'
  •     qty = 1
  •     tangible = 0
  •     type = 'product'
  •     expiration = 123123123

Sort the parameters alphabetically

  •     currency = 'USD'
  •     expiration = 123123123    
  •     price = 10
  •     prod = 'Software'
  •     qty = 1
  •     tangible = 0
  •     type = 'product'

Serialize the values

  •     currency = '3USD'
  •     expiration = 9123123123  
  •     price = 210
  •     prod = '8Software'
  •     qty = 11
  •     tangible = 10
  •     type = '7product'

Concatenate the values

    '3USD91231231232108Software11107product'

Encrypt using your Secret Word

The serialized value is then encrypted using the HMAC method.
    - the algorithm used is sha256
    - the key used when encrypting is the merchant secred word (in this example, the secret word is 'secret_word')

This outputs a 65 character string:
    
    833f1f971b3648da5b24638b9ded15be542518769a525a960c43195c2c61b35f

Add the string in the buy link

https://secure.2checkout.com/checkout/buy?merchant=2COLRNC&dynamic=1&prod=Software&price=10currency=USD&qty=1&tangible=0&type=product&expiration=123123123&signature=2a2ef960a6244c66bf12cfc5d412f8c8cc5907ebebf1003a50ada14f6859df7f