Create shopping cart

This function creates a shopping cart with which the system sends an order to the cPanel Store. Typically, the system will send shopping cart orders for SSL certificates to UAPI’s Market::request_ssl_certificates function.

SecurityBasicAuth
Request
query Parameters
access_token
required
string <uuid>

The access token to connect to the provider.

Example: access_token=1a676e6f-99fc-11e6-9ab6-e60a769b73bc
item
required
Array of strings <json>

The items to add to the shopping cart.

Note:

The value is a JSON string.

This object has one required key, product_id, which is a string.

The other keys/values in this object vary depending on the provider.

Example: item={"product_id":123456,"provider-specfic-key":"provider-specfic-value","another-provider-specfic-key":"another-provider-specfic-value"}&item={"product_id":123457,"provider-specfic-key":"provider-specfic-value","another-provider-specfic-key":"another-provider-specfic-value"}
provider
required
string

The cPanel Market provider’s name.

Example: provider=cPStore
url_after_checkout
required
string <url>

The location to which the provider directs the user after the checkout process is complete.

Example: url_after_checkout=http://www.example.com/thenextplace
Responses
200

HTTP Request was successful.

Response Schema: application/json
apiversion
integer

The version of the API.

func
string

The name of the method called.

module
string

The name of the module called.

object
get/Market/create_shopping_cart
Request samples
uapi --output=jsonpretty \
  --user=username \
  Market \
  create_shopping_cart \
  provider='cPStore' \
  access_token='1a676e6f-99fc-11e6-9ab6-e60a769b73bc' \
  url_after_checkout='http://www.example.com/thenextplace' \
  item='{"product_id":123456,"provider-specfic-key":"provider-specfic-value","another-provider-specfic-key":"another-provider-specfic-value"}' item='{"product_id":123457,"provider-specfic-key":"provider-specfic-value","another-provider-specfic-key":"another-provider-specfic-value"}'
Response samples
application/json
{
  • "apiversion": 3,
  • "func": "create_shopping_cart",
  • "module": "Market",
  • "result": {
    • "data": {},
    • "errors": null,
    • "messages": null,
    • "metadata": { },
    • "status": 1,
    • "warnings": null
    }
}