Child pages
  • WHM API 1 Functions - purchase_a_license
Skip to end of metadata
Go to start of metadata

 

Description

This function returns the checkout URL to use for a cPanel Store or cPanel Market provider purchase.

Examples  


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/purchase_a_license?api.version=1&url_after_checkout=http%3A%2F%2Fhostname.example.com&provider=cPStore&login_token=1a676e6f-99fc-11e6-9ab6-e60a769b73bc&upgrade=1
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/purchase_a_license?api.version=1&url_after_checkout=http%3A%2F%2Fhostname.example.com&provider=cPStore&login_token=1a676e6f-99fc-11e6-9ab6-e60a769b73bc&upgrade=1
 Command Line
whmapi1 purchase_a_license url_after_checkout=http:\/\/hostname.example.com provider=cPStore login_token=1a676e6f-99fc-11e6-9ab6-e60a769b73bc upgrade=1


Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command. 

 Output (JSON)
{  
   "data":{  
      "payload":[  
         "https://store.cpanel.net/checkout/ssl/1234567"
      ]
   },
   "metadata":{  
      "command":"purchase_a_license",
      "version":1,
      "reason":"OK",
      "result":1
   }
}
 Output (XML)
<result>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <data>
            <payload>https://store.cpanel.net/checkout/ssl/1234567</payload>
        </data>
        <command>purchase_a_license</command>
    </metadata>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

   

Parameters

ParameterTypeDescriptionPossible valuesExample
providerstring

Required

The cPanel Store or cPanel Market provider's name.

  • cPStore
  • A valid provider name.
cPStore
url_after_checkoutstring

Required

The location to which the cPanel Store or cPanel Market provider directs the user after the checkout process finishes.

A valid URL.http://hostname.example.com
login_tokenstring

Required

The login token to access the cPanel Store.

A valid login token.1a676e6f-99fc-11e6-9ab6-e60a769b73bc
upgradeBoolean

Whether the cPanel Store or cPanel Market provider should treat this request as an upgrade.

This parameter defaults to 0.

Note:

We added this parameter is cPanel & WHM version 68.

1An upgrade.

0Not an upgrade.

1

 

Return

ReturnTypeDescriptionPossible valuesExample
payloadarray

An array of checkout URLs.

A valid checkout URL.
https://store.cpanel.net/checkout/ssl/1234567