All URIs are relative to https://api.api2cart.com/v1.1, except if the operation defines another base path.
Method | HTTP request | Description |
---|---|---|
basketInfo() | GET /basket.info.json | basket.info |
basketItemAdd() | POST /basket.item.add.json | basket.item.add |
basketLiveShippingServiceCreate() | POST /basket.live_shipping_service.create.json | basket.live_shipping_service.create |
basketLiveShippingServiceDelete() | DELETE /basket.live_shipping_service.delete.json | basket.live_shipping_service.delete |
basketLiveShippingServiceList() | GET /basket.live_shipping_service.list.json | basket.live_shipping_service.list |
basketInfo($id, $store_id, $params, $exclude, $response_fields): \OpenAPI\Client\Model\BasketInfo200Response
basket.info
Retrieve basket information.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: StoreKeyAuth
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('x-store-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-store-key', 'Bearer');
// Configure API key authorization: ApiKeyAuth
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');
$apiInstance = new OpenAPI\Client\Api\BasketApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$id = 10; // string | Entity id
$store_id = 1; // string | Store Id
$params = id,model,price,images; // string | Set this parameter in order to choose which entity fields you want to retrieve
$exclude = false; // string | Set this parameter in order to choose which entity fields you want to ignore. Works only if parameter `params` equal force_all
$response_fields = {result}; // string | Set this parameter in order to choose which entity fields you want to retrieve
try {
$result = $apiInstance->basketInfo($id, $store_id, $params, $exclude, $response_fields);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling BasketApi->basketInfo: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
id | string | Entity id | |
store_id | string | Store Id | [optional] |
params | string | Set this parameter in order to choose which entity fields you want to retrieve | [optional] [default to 'force_all'] |
exclude | string | Set this parameter in order to choose which entity fields you want to ignore. Works only if parameter `params` equal force_all | [optional] |
response_fields | string | Set this parameter in order to choose which entity fields you want to retrieve | [optional] |
\OpenAPI\Client\Model\BasketInfo200Response
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
basketItemAdd($customer_id, $product_id, $variant_id, $quantity, $store_id): \OpenAPI\Client\Model\BasketItemAdd200Response
basket.item.add
Add item to basket
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: StoreKeyAuth
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('x-store-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-store-key', 'Bearer');
// Configure API key authorization: ApiKeyAuth
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');
$apiInstance = new OpenAPI\Client\Api\BasketApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$customer_id = 5; // string | Retrieves orders specified by customer id
$product_id = 10; // string | Defines id of the product which should be added to the basket
$variant_id = 45; // string | Defines product's variants specified by variant id
$quantity = 6; // float | Defines new items quantity
$store_id = 1; // string | Store Id
try {
$result = $apiInstance->basketItemAdd($customer_id, $product_id, $variant_id, $quantity, $store_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling BasketApi->basketItemAdd: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
customer_id | string | Retrieves orders specified by customer id | |
product_id | string | Defines id of the product which should be added to the basket | |
variant_id | string | Defines product's variants specified by variant id | [optional] |
quantity | float | Defines new items quantity | [optional] [default to 0] |
store_id | string | Store Id | [optional] |
\OpenAPI\Client\Model\BasketItemAdd200Response
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
basketLiveShippingServiceCreate($name, $callback, $store_id): \OpenAPI\Client\Model\BasketLiveShippingServiceCreate200Response
basket.live_shipping_service.create
Create live shipping rate service.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: StoreKeyAuth
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('x-store-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-store-key', 'Bearer');
// Configure API key authorization: ApiKeyAuth
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');
$apiInstance = new OpenAPI\Client\Api\BasketApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$name = BestDelivery; // string | Shipping Service Name
$callback = https://example.com/callback; // string | Callback url that returns shipping rates. It should be able to accept POST requests with json data.
$store_id = 1; // string | Store Id
try {
$result = $apiInstance->basketLiveShippingServiceCreate($name, $callback, $store_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling BasketApi->basketLiveShippingServiceCreate: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
name | string | Shipping Service Name | |
callback | string | Callback url that returns shipping rates. It should be able to accept POST requests with json data. | |
store_id | string | Store Id | [optional] |
\OpenAPI\Client\Model\BasketLiveShippingServiceCreate200Response
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
basketLiveShippingServiceDelete($id): \OpenAPI\Client\Model\BasketLiveShippingServiceDelete200Response
basket.live_shipping_service.delete
Delete live shipping rate service.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: StoreKeyAuth
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('x-store-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-store-key', 'Bearer');
// Configure API key authorization: ApiKeyAuth
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');
$apiInstance = new OpenAPI\Client\Api\BasketApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$id = 5; // int | Entity id
try {
$result = $apiInstance->basketLiveShippingServiceDelete($id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling BasketApi->basketLiveShippingServiceDelete: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
id | int | Entity id |
\OpenAPI\Client\Model\BasketLiveShippingServiceDelete200Response
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
basketLiveShippingServiceList($store_id, $start, $count): \OpenAPI\Client\Model\BasketLiveShippingServiceList200Response
basket.live_shipping_service.list
Retrieve a list of live shipping rate services.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: StoreKeyAuth
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('x-store-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-store-key', 'Bearer');
// Configure API key authorization: ApiKeyAuth
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');
$apiInstance = new OpenAPI\Client\Api\BasketApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$store_id = 1; // string | Store Id
$start = 0; // int | This parameter sets the number from which you want to get entities
$count = 20; // int | This parameter sets the entity amount that has to be retrieved. Max allowed count=250
try {
$result = $apiInstance->basketLiveShippingServiceList($store_id, $start, $count);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling BasketApi->basketLiveShippingServiceList: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
store_id | string | Store Id | [optional] |
start | int | This parameter sets the number from which you want to get entities | [optional] [default to 0] |
count | int | This parameter sets the entity amount that has to be retrieved. Max allowed count=250 | [optional] [default to 10] |
\OpenAPI\Client\Model\BasketLiveShippingServiceList200Response
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]