UltraCart REST API PHP Client
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs
lib
test
.gitignore
.php_cs
.travis.yml
LICENSE
README.md
autoload.php
composer.json
phpunit.xml.dist

README.md

SwaggerClient-php

UltraCart REST API Version 2

This PHP package is automatically generated by the Swagger Codegen project:

  • API version: 2.0.0
  • Build package: io.swagger.codegen.languages.PhpClientCodegen For more information, please visit http://www.ultracart.com

Requirements

PHP 5.5 and later

Installation & Usage

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/UltraCart/rest_api_v2_sdk_php.git"
    }
  ],
  "require": {
    "UltraCart/rest_api_v2_sdk_php": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

    require_once('/path/to/vendor/whatever_you_named_your_ultracart_sdk_directory/autoload.php');

Tests

To run the unit tests:

composer install
./vendor/bin/phpunit

Getting Started

Please follow the installation procedure and then run the following:

<?php /* docs.ultracart.com sample */ ?>

<?php
// for testing and development only
set_time_limit(3000);
ini_set('max_execution_time', 3000);
ini_set('display_errors', 1);
error_reporting(E_ALL);
?>

<?php
// initialization code
require_once './vendor/autoload.php';
$simple_key = '4256aaf6dfedfa01582fe9a961ab0100216d737b874a4801582fe9a961ab0100';
ultracart\v2\Configuration::getDefaultConfiguration()->setApiKey('x-ultracart-simple-key', $simple_key);

$client = new GuzzleHttp\Client(['verify' => true, 'debug' => false]);
$config = ultracart\v2\Configuration::getDefaultConfiguration();
$headerSelector = new \ultracart\v2\HeaderSelector(/* leave null for version tied to this sdk version */);

$auto_order_api = new ultracart\v2\Api\AutoorderApi($client, $config, $headerSelector);
?>

<html>
<body>
<?php

try {
    $auto_order_oid = 2078718;  // this is found either by looping through auto orders, or from the back end.
    $auto_order_response = $auto_order_api->getAutoOrder($auto_order_oid, "items");
    $auto_order = $auto_order_response->getAutoOrder();
    $auto_order->getItems()[0]->setArbitraryQuantity(4);
    $auto_order_response = $auto_order_api->updateAutoOrder($auto_order, $auto_order_oid);

} catch (\ultracart\v2\ApiException $e) {
    error_log($e->getResponseBody());
}

?>
<pre>
<?php echo print_r($auto_order); ?>
<?php echo print_r($auto_order_response); ?>
</pre>
<?php echo 'Finished.'; ?>
</body>
</html>

Documentation for API Endpoints

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

Class Method HTTP request Description
AffiliateApi getClicksByQuery POST /affiliate/clicks/query Retrieve clicks
AffiliateApi getLedgersByQuery POST /affiliate/ledgers/query Retrieve ledger entries
AutoOrderApi getAutoOrder GET /auto_order/auto_orders/{auto_order_oid} Retrieve an auto order
AutoOrderApi getAutoOrderByCode GET /auto_order/auto_orders/code/{auto_order_code} Retrieve an auto order
AutoOrderApi getAutoOrderByReferenceOrderId GET /auto_order/auto_orders/reference_order_id/{reference_order_id} Retrieve an auto order
AutoOrderApi getAutoOrders GET /auto_order/auto_orders Retrieve auto orders
AutoOrderApi updateAutoOrder PUT /auto_order/auto_orders/{auto_order_oid} Update an auto order
ChargebackApi deleteChargeback DELETE /chargeback/chargebacks/{chargeback_dispute_oid} Delete a chargeback
ChargebackApi getChargebackDispute GET /chargeback/chargebacks/{chargeback_dispute_oid} Retrieve a chargeback
ChargebackApi getChargebackDisputes GET /chargeback/chargebacks Retrieve chargebacks
ChargebackApi insertChargeback POST /chargeback/chargebacks Insert a chargeback
ChargebackApi updateChargeback PUT /chargeback/chargebacks/{chargeback_dispute_oid} Update a chargeback
CheckoutApi cityState POST /checkout/city_state City/State for Zip
CheckoutApi finalizeOrder POST /checkout/cart/finalizeOrder Finalize Order
CheckoutApi getAffirmCheckout GET /checkout/cart/{cart_id}/affirmCheckout Get affirm checkout (by cart id)
CheckoutApi getAllowedCountries POST /checkout/allowedCountries Allowed countries
CheckoutApi getCart GET /checkout/cart Get cart
CheckoutApi getCartByCartId GET /checkout/cart/{cart_id} Get cart (by cart id)
CheckoutApi getCartByReturnCode GET /checkout/return/{return_code} Get cart (by return code)
CheckoutApi getStateProvincesForCountry POST /checkout/stateProvincesForCountry/{country_code} Get state/province list for a country code
CheckoutApi handoffCart POST /checkout/cart/handoff Handoff cart
CheckoutApi login POST /checkout/cart/profile/login Profile login
CheckoutApi logout POST /checkout/cart/profile/logout Profile logout
CheckoutApi register POST /checkout/cart/profile/register Profile registration
CheckoutApi relatedItemsForCart POST /checkout/related_items Related items
CheckoutApi relatedItemsForItem POST /checkout/relatedItems/{item_id} Related items (specific item)
CheckoutApi setupBrowserKey PUT /checkout/browser_key Setup Browser Application
CheckoutApi updateCart PUT /checkout/cart Update cart
CheckoutApi validateCart POST /checkout/cart/validate Validate
CouponApi deleteCoupon DELETE /coupon/coupons/{coupon_oid} Delete a coupon
CouponApi generateCouponCodes POST /coupon/coupons/{coupon_oid}/generate_codes Generates one time codes for a coupon
CouponApi generateOneTimeCodesByMerchantCode POST /coupon/coupons/merchant_code/{merchant_code}/generate_codes Generates one time codes by merchant code
CouponApi getCoupon GET /coupon/coupons/{coupon_oid} Retrieve a coupon
CouponApi getCouponByMerchantCode GET /coupon/coupons/merchant_code/{merchant_code} Retrieve a coupon by merchant code
CouponApi getCoupons GET /coupon/coupons Retrieve coupons
CouponApi getCouponsByQuery GET /coupon/coupons/query Retrieve coupons by query
CouponApi getEditorValues GET /coupon/editor_values Retrieve values needed for a coupon editor
CouponApi insertCoupon POST /coupon/coupons Insert a coupon
CouponApi updateCoupon PUT /coupon/coupons/{coupon_oid} Update a coupon
CustomerApi deleteCustomer DELETE /customer/customers/{customer_profile_oid} Delete a customer
CustomerApi getCustomer GET /customer/customers/{customer_profile_oid} Retrieve a customer
CustomerApi getCustomers GET /customer/customers Retrieve customers
CustomerApi getCustomersByQuery GET /customer/customers/query Retrieve customers by query
CustomerApi getCustomersForDataTables POST /customer/customers/dataTables Retrieve customers for DataTables plugin
CustomerApi getEditorValues GET /customer/editor_values Retrieve values needed for a customer profile editor
CustomerApi insertCustomer POST /customer/customers Insert a customer
CustomerApi updateCustomer PUT /customer/customers/{customer_profile_oid} Update a customer
FulfillmentApi acknowledgeOrders PUT /fulfillment/distribution_centers/{distribution_center_code}/acknowledgements Acknowledge receipt of orders.
FulfillmentApi getDistributionCenterOrders GET /fulfillment/distribution_centers/{distribution_center_code}/orders Retrieve orders queued up for this distribution center.
FulfillmentApi getDistributionCenters GET /fulfillment/distribution_centers Retrieve distribution centers
FulfillmentApi shipOrders POST /fulfillment/distribution_centers/{distribution_center_code}/shipments Mark orders as shipped
FulfillmentApi updateInventory POST /fulfillment/distribution_centers/{distribution_center_code}/inventory Update inventory
ItemApi deleteItem DELETE /item/items/{merchant_item_oid} Delete an item
ItemApi getItem GET /item/items/{merchant_item_oid} Retrieve an item
ItemApi getItemByMerchantItemId GET /item/items/merchant_item_id/{merchant_item_id} Retrieve an item by item id
ItemApi getItems GET /item/items Retrieve items
ItemApi getPricingTiers GET /item/pricing_tiers Retrieve pricing tiers
ItemApi insertItem POST /item/items Create an item
ItemApi updateItem PUT /item/items/{merchant_item_oid} Update an item
ItemApi updateItems PUT /item/items/batch Update multiple items
ItemApi uploadTemporaryMultimedia POST /item/temp_multimedia Upload an image to the temporary multimedia.
OauthApi oauthAccessToken POST /oauth/token Exchange authorization code for access token.
OauthApi oauthRevoke POST /oauth/revoke Revoke this OAuth application.
OrderApi cancelOrder POST /order/orders/{order_id}/cancel Cancel an order
OrderApi deleteOrder DELETE /order/orders/{order_id} Delete an order
OrderApi format POST /order/orders/{order_id}/format Format order
OrderApi getOrder GET /order/orders/{order_id} Retrieve an order
OrderApi getOrders GET /order/orders Retrieve orders
OrderApi getOrdersByQuery POST /order/orders/query Retrieve orders
OrderApi refundOrder PUT /order/orders/{order_id}/refund Refund an order
OrderApi resendReceipt POST /order/orders/{order_id}/resend_receipt Resend receipt
OrderApi resendShipmentConfirmation POST /order/orders/{order_id}/resend_shipment_confirmation Resend shipment confirmation
OrderApi updateOrder PUT /order/orders/{order_id} Update an order
TaxApi deleteTaxProviderSelfCity DELETE /tax/providers/self/city/{city} Deletes a Self tax provider city
TaxApi deleteTaxProviderSelfCountry DELETE /tax/providers/self/country/{countryCode} Deletes a Self tax provider country
TaxApi deleteTaxProviderSelfCounty DELETE /tax/providers/self/county/{county} Deletes a Self tax provider county
TaxApi deleteTaxProviderSelfPostalCode DELETE /tax/providers/self/postalCode/{postal_code} Deletes a Self tax provider postalCode
TaxApi deleteTaxProviderSelfState DELETE /tax/providers/self/state/{stateCode} Deletes a Self tax provider state
TaxApi getTaxProviderAvalara GET /tax/providers/avalara Retrieve the Avalara tax provider
TaxApi getTaxProviderAvalaraCompanies POST /tax/providers/avalara/companies Returns Avalara Tax companies configured by the merchant
TaxApi getTaxProviderAvalaraTest GET /tax/providers/avalara/test Attempts to connect to Avalara and returns back the response
TaxApi getTaxProviderSelf GET /tax/providers/self Retrieve the Self tax provider
TaxApi getTaxProviderSelfCountries GET /tax/providers/self/countries Retrieve the Self tax provider countries
TaxApi getTaxProviderSelfRegionsByCountryCode GET /tax/providers/self/regions/{countryCode} Retrieve the Self tax provider regions for a given country code
TaxApi getTaxProviderTaxJar GET /tax/providers/taxjar Retrieve the TaxJar tax provider
TaxApi getTaxProviderTaxJarTest GET /tax/providers/taxjar/test Attempts to connect to TaxJar and returns back the response
TaxApi getTaxProviderUltraCart GET /tax/providers/ultracart Retrieve the UltraCart tax provider
TaxApi getTaxProviders GET /tax/providers Retrieve tax methods
TaxApi setActiveTaxProvider POST /tax/providers/setActive/{providerName} Toggle a tax provider to active
TaxApi updateTaxProviderAvalara POST /tax/providers/avalara Update the Avalara tax provider
TaxApi updateTaxProviderSelf POST /tax/providers/self Update the Self tax provider
TaxApi updateTaxProviderSelfCity POST /tax/providers/self/city/{city} Updates a Self tax provider city
TaxApi updateTaxProviderSelfCountry POST /tax/providers/self/country/{countryCode} Updates a Self tax provider country
TaxApi updateTaxProviderSelfCounty POST /tax/providers/self/county/{county} Updates a Self tax provider county
TaxApi updateTaxProviderSelfPostalCode POST /tax/providers/self/postalCode/{postal_code} Updates a Self tax provider postalCode
TaxApi updateTaxProviderSelfState POST /tax/providers/self/state/{stateCode} Updates a Self tax provider state
TaxApi updateTaxProviderTaxJar POST /tax/providers/taxjar Update the TaxJar tax provider
TaxApi updateTaxProviderUltraCart POST /tax/providers/ultracart Update the UltraCart tax provider
WebhookApi deleteWebhook DELETE /webhook/webhooks/{webhookOid} Delete a webhook
WebhookApi getWebhookLog GET /webhook/webhooks/{webhookOid}/logs/{requestId} Retrieve an individual log
WebhookApi getWebhookLogSummaries GET /webhook/webhooks/{webhookOid}/logs Retrieve the log summaries
WebhookApi getWebhooks GET /webhook/webhooks Retrieve webhooks
WebhookApi insertWebhook POST /webhook/webhooks Add a webhook
WebhookApi resendEvent POST /webhook/webhooks/{webhookOid}/reflow/{eventName} Resend events to the webhook endpoint.
WebhookApi updateWebhook PUT /webhook/webhooks/{webhookOid} Update a webhook

Documentation For Models

Documentation For Authorization

ultraCartBrowserApiKey

  • Type: API key
  • API key parameter name: x-ultracart-browser-key
  • Location: HTTP header

ultraCartOauth

  • Type: OAuth
  • Flow: accessCode
  • Authorization URL: https://secure.ultracart.com/rest/v2/oauth/authorize
  • Scopes:
  • affiliate_read: Allows you to read affiliate information.
  • affiliate_write: Allows you to write affiliate information.
  • auto_order_read: Allows you to read auto order information.
  • auto_order_write: Allows you to write auto order information.
  • chargeback_read: Allows you to read chargeback information.
  • chargeback_write: Allows you to write chargeback information.
  • checkout_read: Allows you to read checkout information.
  • checkout_write: Allows you to write checkout information.
  • coupon_read: Allows you to read coupon information.
  • coupon_write: Allows you to write coupon information.
  • customer_read: Allows you to read customer information.
  • customer_write: Allows you to write customer information.
  • fulfillment_read: Allows you to read fulfillment information.
  • fulfillment_write: Allows you to write fulfillment information.
  • order_read: Allows you to read order information.
  • order_write: Allows you to write order information.
  • item_read: Allows you to read item information.
  • item_write: Allows you to write item information.
  • tax_read: Allows you to read tax configuration information.
  • tax_write: Allows you to write tax configuration information.
  • webhook_read: Allows you to read webhook information.
  • webhook_write: Allows you to write webhook information.
  • ultrabooks_read: 1 of 2 required to use UltraBooks
  • ultrabooks_write: 2 of 2 required to use UltraBooks

ultraCartSimpleApiKey

  • Type: API key
  • API key parameter name: x-ultracart-simple-key
  • Location: HTTP header

Author

support@ultracart.com