Introduction

Additional Topics and Tutorials

The UltraCart API is organized around REST and JSON. Our API uses cutting edge REST API functionality to deliver resource-oriented URLs that are efficient at exposing the maximum amount of functionality in an easy to use interface. Our APIs are all defined using the OpenAPI (Swagger) specification which allows us to provide generated client libraries and documentation that are always accurate and efficient to program against. Whenever possible, JSON is the format for the request and the response of our APIs and our client libraries convert the information into language specific objects.

The Swagger client SDK simplifies your client side code.

require_once(__DIR__ . '/SwaggerClient-php/autoload.php');

$simple_key = '4256aaf6dfedfa01582fe9a961ab0100216d737b874a4801582fe9a961ab0100';
ultracart\v2\Configuration::getDefaultConfiguration()->setApiKey('x-ultracart-simple-key', $simple_key);
ultracart\v2\Configuration::getDefaultConfiguration()->addDefaultHeader("X-UltraCart-Api-Version", "2017-03-01");

try {
    $order_api = new ultracart\v2\Api\CheckoutApi();

    $order_id = "DEMO-0009103586";
    $order_expansion = "shipping,billing,summary,item";
    $order_api = new \ultracart\v2\api\OrderApi();
    $order_response = $order_api->orderOrdersOrderIdGet($order_id, $order_expansion);
    if ($order_response->getSuccess()) {
        $order = $order_response->getOrder();
    }
} catch (\ultracart\v2\ApiException $e) {
    echo 'Exception when calling CustomerApi->customerCustomersCustomerProfileOidGet: ', $e->getMessage(), PHP_EOL;
    // THE FOLLOWING LINE PROVIDES DETAILED ERROR INFORMATION
    print_r($e->getResponseObject());
}