Skip to content

Latest commit

 

History

History
360 lines (241 loc) · 12.9 KB

File metadata and controls

360 lines (241 loc) · 12.9 KB

OpenAPI\Client\ResourcesDiscoverCartApi

All URIs are relative to https://api.builtbybit.com, except if the operation defines another base path.

Method HTTP request Description
getV2ResourcesDiscoverCartView() GET /v2/resources/discover/cart/view View the user's cart items
postV2ResourcesDiscoverCartAdd() POST /v2/resources/discover/cart/add Add items to a user's cart
postV2ResourcesDiscoverCartCheckout() POST /v2/resources/discover/cart/checkout Initiate a checkout of a user's cart
postV2ResourcesDiscoverCartCouponAdd() POST /v2/resources/discover/cart/coupon/add Add a coupon to the user's cart
postV2ResourcesDiscoverCartCouponRemove() POST /v2/resources/discover/cart/coupon/remove Remove a coupon from the user's cart
postV2ResourcesDiscoverCartRemove() POST /v2/resources/discover/cart/remove Remove an item from the user's cart

getV2ResourcesDiscoverCartView()

getV2ResourcesDiscoverCartView(): \OpenAPI\Client\Model\GetV2ResourcesDiscoverCartView200Response

View the user's cart items

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure OAuth2 access token for authorization: oauth2
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\ResourcesDiscoverCartApi(
    // 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
);

try {
    $result = $apiInstance->getV2ResourcesDiscoverCartView();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ResourcesDiscoverCartApi->getV2ResourcesDiscoverCartView: ', $e->getMessage(), PHP_EOL;
}

Parameters

This endpoint does not need any parameter.

Return type

\OpenAPI\Client\Model\GetV2ResourcesDiscoverCartView200Response

Authorization

oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

postV2ResourcesDiscoverCartAdd()

postV2ResourcesDiscoverCartAdd($post_v2_resources_discover_cart_add_request): \OpenAPI\Client\Model\PostV2ResourcesDiscoverCartAdd2XXResponse

Add items to a user's cart

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure OAuth2 access token for authorization: oauth2
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\ResourcesDiscoverCartApi(
    // 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
);
$post_v2_resources_discover_cart_add_request = new \OpenAPI\Client\Model\PostV2ResourcesDiscoverCartAddRequest(); // \OpenAPI\Client\Model\PostV2ResourcesDiscoverCartAddRequest | A list of content to add to the user's cart. The outer list is keyed by the content type and the inner list are the content IDs.    For instance, if adding a resource with the ID 555, the body becomes:  ```json  {\"add\": {\"resource\": [555]}}  ```

try {
    $result = $apiInstance->postV2ResourcesDiscoverCartAdd($post_v2_resources_discover_cart_add_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ResourcesDiscoverCartApi->postV2ResourcesDiscoverCartAdd: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
post_v2_resources_discover_cart_add_request \OpenAPI\Client\Model\PostV2ResourcesDiscoverCartAddRequest A list of content to add to the user's cart. The outer list is keyed by the content type and the inner list are the content IDs. For instance, if adding a resource with the ID 555, the body becomes: ```json {&quot;add&quot;: {&quot;resource&quot;: [555]}} ``` [optional]

Return type

\OpenAPI\Client\Model\PostV2ResourcesDiscoverCartAdd2XXResponse

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

postV2ResourcesDiscoverCartCheckout()

postV2ResourcesDiscoverCartCheckout($body): \OpenAPI\Client\Model\PostV2ResourcesDiscoverCartCheckout200Response

Initiate a checkout of a user's cart

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure OAuth2 access token for authorization: oauth2
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\ResourcesDiscoverCartApi(
    // 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
);
$body = array('key' => new \stdClass); // object

try {
    $result = $apiInstance->postV2ResourcesDiscoverCartCheckout($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ResourcesDiscoverCartApi->postV2ResourcesDiscoverCartCheckout: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
body object [optional]

Return type

\OpenAPI\Client\Model\PostV2ResourcesDiscoverCartCheckout200Response

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

postV2ResourcesDiscoverCartCouponAdd()

postV2ResourcesDiscoverCartCouponAdd($post_v2_resources_discover_cart_coupon_add_request): \OpenAPI\Client\Model\PostV2ResourcesDiscoverCartCouponAdd200Response

Add a coupon to the user's cart

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure OAuth2 access token for authorization: oauth2
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\ResourcesDiscoverCartApi(
    // 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
);
$post_v2_resources_discover_cart_coupon_add_request = new \OpenAPI\Client\Model\PostV2ResourcesDiscoverCartCouponAddRequest(); // \OpenAPI\Client\Model\PostV2ResourcesDiscoverCartCouponAddRequest

try {
    $result = $apiInstance->postV2ResourcesDiscoverCartCouponAdd($post_v2_resources_discover_cart_coupon_add_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ResourcesDiscoverCartApi->postV2ResourcesDiscoverCartCouponAdd: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
post_v2_resources_discover_cart_coupon_add_request \OpenAPI\Client\Model\PostV2ResourcesDiscoverCartCouponAddRequest [optional]

Return type

\OpenAPI\Client\Model\PostV2ResourcesDiscoverCartCouponAdd200Response

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

postV2ResourcesDiscoverCartCouponRemove()

postV2ResourcesDiscoverCartCouponRemove($post_v2_resources_discover_cart_coupon_remove_request): \OpenAPI\Client\Model\PostV2ResourcesDiscoverCartCouponRemove200Response

Remove a coupon from the user's cart

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure OAuth2 access token for authorization: oauth2
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\ResourcesDiscoverCartApi(
    // 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
);
$post_v2_resources_discover_cart_coupon_remove_request = new \OpenAPI\Client\Model\PostV2ResourcesDiscoverCartCouponRemoveRequest(); // \OpenAPI\Client\Model\PostV2ResourcesDiscoverCartCouponRemoveRequest

try {
    $result = $apiInstance->postV2ResourcesDiscoverCartCouponRemove($post_v2_resources_discover_cart_coupon_remove_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ResourcesDiscoverCartApi->postV2ResourcesDiscoverCartCouponRemove: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
post_v2_resources_discover_cart_coupon_remove_request \OpenAPI\Client\Model\PostV2ResourcesDiscoverCartCouponRemoveRequest [optional]

Return type

\OpenAPI\Client\Model\PostV2ResourcesDiscoverCartCouponRemove200Response

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

postV2ResourcesDiscoverCartRemove()

postV2ResourcesDiscoverCartRemove($post_v2_resources_discover_cart_remove_request): \OpenAPI\Client\Model\PostV2ResourcesDiscoverCartRemove200Response

Remove an item from the user's cart

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure OAuth2 access token for authorization: oauth2
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\ResourcesDiscoverCartApi(
    // 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
);
$post_v2_resources_discover_cart_remove_request = new \OpenAPI\Client\Model\PostV2ResourcesDiscoverCartRemoveRequest(); // \OpenAPI\Client\Model\PostV2ResourcesDiscoverCartRemoveRequest

try {
    $result = $apiInstance->postV2ResourcesDiscoverCartRemove($post_v2_resources_discover_cart_remove_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ResourcesDiscoverCartApi->postV2ResourcesDiscoverCartRemove: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
post_v2_resources_discover_cart_remove_request \OpenAPI\Client\Model\PostV2ResourcesDiscoverCartRemoveRequest [optional]

Return type

\OpenAPI\Client\Model\PostV2ResourcesDiscoverCartRemove200Response

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]