Documentation

V2ApiClient extends BaseApiClient

Class for accessing BigCommerce V2 Endpoints

Currently only the Create Order endpoint is implement as it has no V3 equivalent.

The class is used similarly to the V3 client.

$api = new BigCommerce\ApiV2\V2ApiClient($_ENV['hash'], $_ENV['CLIENT_ID'], $_ENV['ACCESS_TOKEN']);

$order = new BigCommerce\ApiV2\ResourceModels\Order\Order();
// set order details...

try {
    $api->orders->create($order);
} catch (\Psr\Http\Client\ClientExceptionInterface $exception) {
    echo "Unable to update product: {$exception->getMessage()}";
}

Table of Contents

DEFAULT_BASE_URI  = 'base_uri'
DEFAULT_HANDLER  = 'handler'
DEFAULT_HEADERS  = 'headers'
__construct()  : mixed
getBaseUri()  : string
getRestClient()  : Client
order()  : OrdersApi
orders()  : OrdersApi
printDebug()  : mixed
printDebugLastRequest()  : mixed
setBaseUri()  : mixed
setRestClient()  : void
storeInformation()  : StoreInformationApi

Constants

Methods

__construct()

public __construct(string $storeHash, string $clientId, string $accessToken[, Client|null $client = null ]) : mixed
Parameters
$storeHash : string
$clientId : string
$accessToken : string
$client : Client|null = null
Return values
mixed

getBaseUri()

public getBaseUri() : string
Return values
string

getRestClient()

public getRestClient() : Client
Return values
Client

printDebug()

public printDebug() : mixed
Return values
mixed

printDebugLastRequest()

public printDebugLastRequest() : mixed
Return values
mixed

setBaseUri()

public setBaseUri(string $baseUri) : mixed
Parameters
$baseUri : string
Return values
mixed

setRestClient()

public setRestClient(Client $client) : void
Parameters
$client : Client
Return values
void

Search results