Skip to content

Latest commit

 

History

History
961 lines (654 loc) · 36.7 KB

CheckoutApi.md

File metadata and controls

961 lines (654 loc) · 36.7 KB

ultracart\v2\CheckoutApi

All URIs are relative to https://secure.ultracart.com/rest/v2

Method HTTP request Description
cityState POST /checkout/city_state City/State for Zip
finalizeOrder POST /checkout/cart/finalizeOrder Finalize Order
getAffirmCheckout GET /checkout/cart/{cart_id}/affirmCheckout Get affirm checkout (by cart id)
getAllowedCountries POST /checkout/allowedCountries Allowed countries
getCart GET /checkout/cart Get cart
getCartByCartId GET /checkout/cart/{cart_id} Get cart (by cart id)
getCartByReturnCode GET /checkout/return/{return_code} Get cart (by return code)
getCartByReturnToken GET /checkout/return_token Get cart (by return token)
getStateProvincesForCountry POST /checkout/stateProvincesForCountry/{country_code} Get state/province list for a country code
handoffCart POST /checkout/cart/handoff Handoff cart
login POST /checkout/cart/profile/login Profile login
logout POST /checkout/cart/profile/logout Profile logout
register POST /checkout/cart/profile/register Profile registration
registerAffiliateClick POST /checkout/affiliateClick/register Register affiliate click
relatedItemsForCart POST /checkout/related_items Related items
relatedItemsForItem POST /checkout/relatedItems/{item_id} Related items (specific item)
setupBrowserKey PUT /checkout/browser_key Setup Browser Application
updateCart PUT /checkout/cart Update cart
validateCart POST /checkout/cart/validate Validate

cityState

\ultracart\v2\models\CityStateZip cityState($cart)

City/State for Zip

Look up the city and state for the shipping zip code. Useful for building an auto complete for parts of the shipping address

Example

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

// Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
$simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00';
$api_instance = ultracart\v2\api\CheckoutApi::usingApiKey($simple_key);

$cart = new \ultracart\v2\models\Cart(); // \ultracart\v2\models\Cart | Cart

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

Parameters

Name Type Description Notes
cart \ultracart\v2\models\Cart Cart

Return type

\ultracart\v2\models\CityStateZip

Authorization

ultraCartBrowserApiKey, ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

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

finalizeOrder

\ultracart\v2\models\CartFinalizeOrderResponse finalizeOrder($finalize_request)

Finalize Order

Finalize the cart into an order. This method can not be called with browser key authentication. It is ONLY meant for server side code to call.

Example

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

// Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
$simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00';
$api_instance = ultracart\v2\api\CheckoutApi::usingApiKey($simple_key);

$finalize_request = new \ultracart\v2\models\CartFinalizeOrderRequest(); // \ultracart\v2\models\CartFinalizeOrderRequest | Finalize request

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

Parameters

Name Type Description Notes
finalize_request \ultracart\v2\models\CartFinalizeOrderRequest Finalize request

Return type

\ultracart\v2\models\CartFinalizeOrderResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

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

getAffirmCheckout

\ultracart\v2\models\CartAffirmCheckoutResponse getAffirmCheckout($cart_id)

Get affirm checkout (by cart id)

Get a Affirm checkout object for the specified cart_id parameter.

Example

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

// Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
$simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00';
$api_instance = ultracart\v2\api\CheckoutApi::usingApiKey($simple_key);

$cart_id = "cart_id_example"; // string | Cart ID to retrieve

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

Parameters

Name Type Description Notes
cart_id string Cart ID to retrieve

Return type

\ultracart\v2\models\CartAffirmCheckoutResponse

Authorization

ultraCartBrowserApiKey, ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

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

getAllowedCountries

\ultracart\v2\models\CheckoutAllowedCountriesResponse getAllowedCountries()

Allowed countries

Lookup the allowed countries for this merchant id

Example

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

// Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
$simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00';
$api_instance = ultracart\v2\api\CheckoutApi::usingApiKey($simple_key);


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

Parameters

This endpoint does not need any parameter.

Return type

\ultracart\v2\models\CheckoutAllowedCountriesResponse

Authorization

ultraCartBrowserApiKey, ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

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

getCart

\ultracart\v2\models\CartResponse getCart($_expand)

Get cart

If the cookie is set on the browser making the request then it will return their active cart. Otherwise it will create a new cart.

Example

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

// Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
$simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00';
$api_instance = ultracart\v2\api\CheckoutApi::usingApiKey($simple_key);

$_expand = "_expand_example"; // string | The object expansion to perform on the result.  See documentation for examples

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

Parameters

Name Type Description Notes
_expand string The object expansion to perform on the result. See documentation for examples [optional]

Return type

\ultracart\v2\models\CartResponse

Authorization

ultraCartBrowserApiKey, ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

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

getCartByCartId

\ultracart\v2\models\CartResponse getCartByCartId($cart_id, $_expand)

Get cart (by cart id)

Get a cart specified by the cart_id parameter.

Example

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

// Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
$simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00';
$api_instance = ultracart\v2\api\CheckoutApi::usingApiKey($simple_key);

$cart_id = "cart_id_example"; // string | Cart ID to retrieve
$_expand = "_expand_example"; // string | The object expansion to perform on the result.  See documentation for examples

try {
    $result = $apiInstance->getCartByCartId($cart_id, $_expand);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CheckoutApi->getCartByCartId: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
cart_id string Cart ID to retrieve
_expand string The object expansion to perform on the result. See documentation for examples [optional]

Return type

\ultracart\v2\models\CartResponse

Authorization

ultraCartBrowserApiKey, ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

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

getCartByReturnCode

\ultracart\v2\models\CartResponse getCartByReturnCode($return_code, $_expand)

Get cart (by return code)

Get a cart specified by the return code parameter.

Example

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

// Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
$simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00';
$api_instance = ultracart\v2\api\CheckoutApi::usingApiKey($simple_key);

$return_code = "return_code_example"; // string | Return code to lookup cart ID by
$_expand = "_expand_example"; // string | The object expansion to perform on the result.  See documentation for examples

try {
    $result = $apiInstance->getCartByReturnCode($return_code, $_expand);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CheckoutApi->getCartByReturnCode: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
return_code string Return code to lookup cart ID by
_expand string The object expansion to perform on the result. See documentation for examples [optional]

Return type

\ultracart\v2\models\CartResponse

Authorization

ultraCartBrowserApiKey, ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

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

getCartByReturnToken

\ultracart\v2\models\CartResponse getCartByReturnToken($return_token, $_expand)

Get cart (by return token)

Get a cart specified by the encrypted return token parameter.

Example

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

// Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
$simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00';
$api_instance = ultracart\v2\api\CheckoutApi::usingApiKey($simple_key);

$return_token = "return_token_example"; // string | Return token provided by StoreFront Communications
$_expand = "_expand_example"; // string | The object expansion to perform on the result.  See documentation for examples

try {
    $result = $apiInstance->getCartByReturnToken($return_token, $_expand);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CheckoutApi->getCartByReturnToken: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
return_token string Return token provided by StoreFront Communications [optional]
_expand string The object expansion to perform on the result. See documentation for examples [optional]

Return type

\ultracart\v2\models\CartResponse

Authorization

ultraCartBrowserApiKey, ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

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

getStateProvincesForCountry

\ultracart\v2\models\CheckoutStateProvinceResponse getStateProvincesForCountry($country_code)

Get state/province list for a country code

Lookup a state/province list for a given country code

Example

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

// Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
$simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00';
$api_instance = ultracart\v2\api\CheckoutApi::usingApiKey($simple_key);

$country_code = "country_code_example"; // string | Two letter ISO country code

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

Parameters

Name Type Description Notes
country_code string Two letter ISO country code

Return type

\ultracart\v2\models\CheckoutStateProvinceResponse

Authorization

ultraCartBrowserApiKey, ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

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

handoffCart

\ultracart\v2\models\CheckoutHandoffResponse handoffCart($handoff_request, $_expand)

Handoff cart

Handoff the browser to UltraCart for view cart on StoreFront, transfer to PayPal, transfer to Affirm, transfer to Sezzle or finalization of the order (including upsell processing).

Example

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

// Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
$simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00';
$api_instance = ultracart\v2\api\CheckoutApi::usingApiKey($simple_key);

$handoff_request = new \ultracart\v2\models\CheckoutHandoffRequest(); // \ultracart\v2\models\CheckoutHandoffRequest | Handoff request
$_expand = "_expand_example"; // string | The object expansion to perform on the result.  See documentation for examples

try {
    $result = $apiInstance->handoffCart($handoff_request, $_expand);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CheckoutApi->handoffCart: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
handoff_request \ultracart\v2\models\CheckoutHandoffRequest Handoff request
_expand string The object expansion to perform on the result. See documentation for examples [optional]

Return type

\ultracart\v2\models\CheckoutHandoffResponse

Authorization

ultraCartBrowserApiKey, ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

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

login

\ultracart\v2\models\CartProfileLoginResponse login($login_request, $_expand)

Profile login

Login in to the customer profile specified by cart.billing.email and password

Example

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

// Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
$simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00';
$api_instance = ultracart\v2\api\CheckoutApi::usingApiKey($simple_key);

$login_request = new \ultracart\v2\models\CartProfileLoginRequest(); // \ultracart\v2\models\CartProfileLoginRequest | Login request
$_expand = "_expand_example"; // string | The object expansion to perform on the result.  See documentation for examples

try {
    $result = $apiInstance->login($login_request, $_expand);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CheckoutApi->login: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
login_request \ultracart\v2\models\CartProfileLoginRequest Login request
_expand string The object expansion to perform on the result. See documentation for examples [optional]

Return type

\ultracart\v2\models\CartProfileLoginResponse

Authorization

ultraCartBrowserApiKey, ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

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

logout

\ultracart\v2\models\CartResponse logout($cart, $_expand)

Profile logout

Log the cart out of the current profile. No error will occur if they are not logged in.

Example

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

// Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
$simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00';
$api_instance = ultracart\v2\api\CheckoutApi::usingApiKey($simple_key);

$cart = new \ultracart\v2\models\Cart(); // \ultracart\v2\models\Cart | Cart
$_expand = "_expand_example"; // string | The object expansion to perform on the result.  See documentation for examples

try {
    $result = $apiInstance->logout($cart, $_expand);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CheckoutApi->logout: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
cart \ultracart\v2\models\Cart Cart
_expand string The object expansion to perform on the result. See documentation for examples [optional]

Return type

\ultracart\v2\models\CartResponse

Authorization

ultraCartBrowserApiKey, ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

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

register

\ultracart\v2\models\CartProfileRegisterResponse register($register_request, $_expand)

Profile registration

Register a new customer profile. Requires the cart.billing object to be populated along with the password.

Example

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

// Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
$simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00';
$api_instance = ultracart\v2\api\CheckoutApi::usingApiKey($simple_key);

$register_request = new \ultracart\v2\models\CartProfileRegisterRequest(); // \ultracart\v2\models\CartProfileRegisterRequest | Register request
$_expand = "_expand_example"; // string | The object expansion to perform on the result.  See documentation for examples

try {
    $result = $apiInstance->register($register_request, $_expand);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CheckoutApi->register: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
register_request \ultracart\v2\models\CartProfileRegisterRequest Register request
_expand string The object expansion to perform on the result. See documentation for examples [optional]

Return type

\ultracart\v2\models\CartProfileRegisterResponse

Authorization

ultraCartBrowserApiKey, ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

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

registerAffiliateClick

\ultracart\v2\models\RegisterAffiliateClickResponse registerAffiliateClick($register_affiliate_click_request, $_expand)

Register affiliate click

Register an affiliate click. Used by custom checkouts that are completely API based and do not perform checkout handoff.

Example

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

// Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
$simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00';
$api_instance = ultracart\v2\api\CheckoutApi::usingApiKey($simple_key);

$register_affiliate_click_request = new \ultracart\v2\models\RegisterAffiliateClickRequest(); // \ultracart\v2\models\RegisterAffiliateClickRequest | Register affiliate click request
$_expand = "_expand_example"; // string | The object expansion to perform on the result.  See documentation for examples

try {
    $result = $apiInstance->registerAffiliateClick($register_affiliate_click_request, $_expand);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CheckoutApi->registerAffiliateClick: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
register_affiliate_click_request \ultracart\v2\models\RegisterAffiliateClickRequest Register affiliate click request
_expand string The object expansion to perform on the result. See documentation for examples [optional]

Return type

\ultracart\v2\models\RegisterAffiliateClickResponse

Authorization

ultraCartBrowserApiKey, ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

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

relatedItemsForCart

\ultracart\v2\models\ItemsResponse relatedItemsForCart($cart, $_expand)

Related items

Retrieve all the related items for the cart contents. Expansion is limited to content, content.assignments, content.attributes, content.multimedia, content.multimedia.thumbnails, options, pricing, and pricing.tiers.

Example

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

// Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
$simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00';
$api_instance = ultracart\v2\api\CheckoutApi::usingApiKey($simple_key);

$cart = new \ultracart\v2\models\Cart(); // \ultracart\v2\models\Cart | Cart
$_expand = "_expand_example"; // string | The object expansion to perform on the result.  See item resource documentation for examples

try {
    $result = $apiInstance->relatedItemsForCart($cart, $_expand);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CheckoutApi->relatedItemsForCart: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
cart \ultracart\v2\models\Cart Cart
_expand string The object expansion to perform on the result. See item resource documentation for examples [optional]

Return type

\ultracart\v2\models\ItemsResponse

Authorization

ultraCartBrowserApiKey, ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

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

relatedItemsForItem

\ultracart\v2\models\ItemsResponse relatedItemsForItem($item_id, $cart, $_expand)

Related items (specific item)

Retrieve all the related items for the cart contents. Expansion is limited to content, content.assignments, content.attributes, content.multimedia, content.multimedia.thumbnails, options, pricing, and pricing.tiers.

Example

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

// Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
$simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00';
$api_instance = ultracart\v2\api\CheckoutApi::usingApiKey($simple_key);

$item_id = "item_id_example"; // string | Item ID to retrieve related items for
$cart = new \ultracart\v2\models\Cart(); // \ultracart\v2\models\Cart | Cart
$_expand = "_expand_example"; // string | The object expansion to perform on the result.  See item resource documentation for examples

try {
    $result = $apiInstance->relatedItemsForItem($item_id, $cart, $_expand);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CheckoutApi->relatedItemsForItem: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
item_id string Item ID to retrieve related items for
cart \ultracart\v2\models\Cart Cart
_expand string The object expansion to perform on the result. See item resource documentation for examples [optional]

Return type

\ultracart\v2\models\ItemsResponse

Authorization

ultraCartBrowserApiKey, ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

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

setupBrowserKey

\ultracart\v2\models\CheckoutSetupBrowserKeyResponse setupBrowserKey($browser_key_request)

Setup Browser Application

Setup a browser key authenticated application with checkout permissions. This REST call must be made with an authentication scheme that is not browser key. The new application will be linked to the application that makes this call. If this application is disabled / deleted, then so will the application setup by this call. The purpose of this call is to allow an OAuth application, such as the Wordpress plugin, to setup the proper browser based authentication for the REST checkout API to use.

Example

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

// Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
$simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00';
$api_instance = ultracart\v2\api\CheckoutApi::usingApiKey($simple_key);

$browser_key_request = new \ultracart\v2\models\CheckoutSetupBrowserKeyRequest(); // \ultracart\v2\models\CheckoutSetupBrowserKeyRequest | Setup browser key request

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

Parameters

Name Type Description Notes
browser_key_request \ultracart\v2\models\CheckoutSetupBrowserKeyRequest Setup browser key request

Return type

\ultracart\v2\models\CheckoutSetupBrowserKeyResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

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

updateCart

\ultracart\v2\models\CartResponse updateCart($cart, $_expand)

Update cart

Update the cart.

Example

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

// Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
$simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00';
$api_instance = ultracart\v2\api\CheckoutApi::usingApiKey($simple_key);

$cart = new \ultracart\v2\models\Cart(); // \ultracart\v2\models\Cart | Cart
$_expand = "_expand_example"; // string | The object expansion to perform on the result.  See documentation for examples

try {
    $result = $apiInstance->updateCart($cart, $_expand);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CheckoutApi->updateCart: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
cart \ultracart\v2\models\Cart Cart
_expand string The object expansion to perform on the result. See documentation for examples [optional]

Return type

\ultracart\v2\models\CartResponse

Authorization

ultraCartBrowserApiKey, ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

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

validateCart

\ultracart\v2\models\CartValidationResponse validateCart($validation_request, $_expand)

Validate

Validate the cart for errors. Specific checks can be passed and multiple validations can occur throughout your checkout flow.

Example

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

// Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
$simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00';
$api_instance = ultracart\v2\api\CheckoutApi::usingApiKey($simple_key);

$validation_request = new \ultracart\v2\models\CartValidationRequest(); // \ultracart\v2\models\CartValidationRequest | Validation request
$_expand = "_expand_example"; // string | The object expansion to perform on the result.  See documentation for examples

try {
    $result = $apiInstance->validateCart($validation_request, $_expand);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CheckoutApi->validateCart: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
validation_request \ultracart\v2\models\CartValidationRequest Validation request
_expand string The object expansion to perform on the result. See documentation for examples [optional]

Return type

\ultracart\v2\models\CartValidationResponse

Authorization

ultraCartBrowserApiKey, ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

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