addPickPackCart
Creates a new PickPack cart or updates an existing one. When creating a cart, you must provide a name, and optionally a color. When updating a cart, you must provide the cart_id and can optionally update the name and/or color. If no color is provided during creation, the system will automatically generate a random color. The cart will be assigned to the current user and positioned at the end of their cart list (for new carts).
Input parameters
Output data:
A sample request in PHP:
| cart_id | int | Cart identifier for updating existing cart. If not provided, a new cart will be created |
| name | varchar(5) | Cart name (maximum 5 characters). Required for creation, optional for updates |
| color | varchar(7) | Cart color in hex format (e.g., #FF0000). If not provided during creation, a random color will be generated automatically |
Output data
The method returns the data in JSON format.
| status | varchar(30) | SUCCESS - request executed correctly ERROR - an error occurred during an API request. Error details will be described in 2 additional returned fields: error_message and error_code |
| cart_id | int | The ID number of the added/updated cart |
Sample
Input data:Output data:
A sample request in PHP: