Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Tip

The best way to see the SOAP API is to download the reference implementation and run it.
Requirements: It requires PHP5 and there's a function for determing page url that relies on Apache (not IIS).
Installation:

  1. Unzip it into any php directory and browse to cart.php.
  2. There are instructions on the page for adding items to the cart.
  3. Once items are in the cart, it will behave like the standard UltraCart single page checkout.

Here's the working example: ucsoap_13.10.zip

Example

Version

Changes

ucsoap.zip

1.0

Initial Version

ucsoap_1.1.zip

1.1

Added registerCustomer(), loginCustomer(), establishCustomerProfile(), and customer_profile.php demo page

ucsoap_3.0.zip

3.0

Updated to run against v3.0 of Checkout. This version has call logging. Login to secure.ultracart.com and visit the Developer Tools section. Click on Call History.

WSDL

Here's the WSDL. It has all the gory details.https://secure.ultracart.com/axis/services/CheckoutAPIV2CheckoutAPIV3?wsdl
Version 3 rolled out on May 10, 2012.

Usage

Here's an example php script for using the SOAP Checkout:

Code Block
languagephp
themeDJango
linenumberstrue
<?php
$url = 'https://secure.ultracart.com/axis/services/CheckoutAPIV1CheckoutAPIV3?wsdl';
$client = new SoapClient($url);
$merchantId = 'DEMO';

/*** Check if there's already a cart ***/
if(!isset($_COOKIE["cartId"])){
	$cart$cartChangeResult = $client->createCart($merchantId);
        $cart = $cartChangeResult->cart;

}else{
	$cartId=$_COOKIE["cartId"];
	$cart$cartChangeResult = $client->getCart($merchantId,$cartId);
        $cart = $cartChangeResult->cart;
}
?>

Anchor
samples
samples

Sample Files

Version 3

File

Comments

list_functions_3.0.php

List all SOAP functions

add_item_3.0.php

Add an item to a cart

add_items_3.0.php

Add several items to a cart

get_items_3.0.php

Get items and display them

update_items_3.0.php

Add/Update/Delete Items, also Clear Cart and estimateShipping. You'll need jquery.1.4.2+ to execute estimateShipping()

estimate_shipping.php

queries available shipping methods and returns them in json format. called via ajax by update_items.php

Version 1

File

Comments

list_functions.php

List all SOAP functions

add_item.php

Add an item to a cart

add_items.php

Add several items to a cart

get_items.php

Get items and display them

update_items.php

Add/Update/Delete Items, also Clear Cart and estimateShipping. You'll need jquery.1.4.2+ to execute estimateShipping()

estimate_shipping.php

queries available shipping methods and returns them in json format. called via ajax by update_items.php

...