Wishlist

Accessed via /api/wishlist.

Properties

Each wishlist has the following properties Complete details in OrderProperties and OrderItemProperties.

id

The unique id for this wishlist. It will never change.

wing_object_type

wishlist

name

A label to identify an wishlist. This is useful if you're going to allow multiple wishlists open at the same time, or if you want to name wishlists.

user_id

If specified, the unique id of the user that controls this wishlist. Once a user has been attached to an wishlist, it cannot be viewed or manipulated except by passing a working session id for that user. See Wishlist Options below for details. Defaults to Wishlist.

shipping_address_id

The unique id of an address. See Wishlist Options below for details.

shipping_address

A hash of address properties associated with the shipping_address_id. See Wishlist Related Objects below for details.

shipping_method

The shipping mechanism that will be used to transport the wishlist to the purchaser. Defaults to USPS Priority. See Wishlist Options below for details.

shipping_cost

The amount added to the wishlist to account for the cost of shipping. This will be added to the wishlist once both a shipping address and a shipping method are known.

subtotal

The cost of all the items attached to the wishlist before taxes, shop credit, and shipping are applied.

taxes

The amount of taxes to be paid to purchase this wishlist. Will always be zero until a shipping address has been specified.

total

The total cost of the wishlist including taxes and shipping. If this is a Receipt it will also include the discount as a result of shop credit used.

payment_method

The method used to pay for the wishlist. Defaults to Credit Card. See Wishlist Options below for details.

payment_transaction_id

If an attempt has been made to pay for this wishlist then the id returned from the payment gateway will be logged here. This is a holdover in case the wishlist was once a cart.

payment_status

If an attempt has been made to pay for this wishlist then the status code returned from the payment gateway will be logged here. This is a holdover in case the wishlist was once a cart.

payment_message

If an attempt has been made to pay for this wishlist then the message returned from the payment gateway will be logged here. This is a holdover in case the wishlist was once a cart.

ip_address

The IP address of the user at the time of wishlist creation.

date_created

A date when the wishlist was created.

date_updated

A date when the wishlist's account was last updated.

Related Objects

See "Related Objects" in Intro for details.

user

The user attached to this wishlist, if any. Will return:

 {
    "shop_credit" : "0.00",
    "username" : "andy",
    "id" : "xxx",
    ...
 }
shipping_address

The address attached to the wishlist that the wishlist should be shipped to. Will return:

 {
    "id" : "xxx",
    "name" : "Andy Dufresne",
    "company" : "Shawshank Prison",
    "address1" : "123 Prison Lane",
    "address2" : "Shawshank Prison Library",
    "city" : "Portland",
    "state" : "Maine",
    "postal_code" : "04101",
    "country" : "US",
    "phone_number" : "207-874-8300"
 }
 
 =back

Methods

The methods used to fetch and manipulate wishlists.

Options

Provides a list of the options that can be used to fill out various fields when creating or updating a wishlist.

 GET /api/wishlist/_options

Returns:

 {
    "identity" : [...],
    "shipping_method" : [...],
    "_shipping_method" : {...},
    "shipping_address" : [...],
    "_shipping_address" : {...},
 }

NOTE: You can also get this data by adding _include_options=1 to the parameter list when fetching a wishlist.

Create

 POST /api/wishlist
api_key_id

See APIKey. Required.

name

Optional.

identity

Optional.

Returns:

 {
   "id" : "xxx",
   "wishlistname" : "andy",
   ...
 }

Update

 PUT /api/wishlist/xxx

See Create Wishlist for details. Can only be done by an admin or the wishlist itself.

Delete

 DELETE /api/wishlist/xxx
session_id

Required. The unique session id provided by a Session method.

Can only be done by an admin or the wishlist owner itself.

Returns:

 {
   "success" : 1
 }

Fetch

 GET /api/wishlist/xxx
session_id

Optional. The unique session id provided by a Session method.

Can by done by anybody.

Returns:

 {
   "id" : "xxx",
   "wishlistname" : "andy",
   ...
 }

Add Items To Wishlist

 POST /api/wishlist/xxx/sku/xxx

Allows you to add a Sku to the wishlist.

quantity

Optional. Defaults to 1. Add or subtract items to or from the wishlist depending on whether this number is positive or negative.

Adjust Items In Wishlist

 PUT /api/wishlist/xxx/sku/xxx

Allows you to adjust the quantity of this Sku in the wishlist.

quantity

Optional. Defaults to 1. Sets the number of this item contained in the wishlist. Setting to 0 will remove it from the wishlist. If you set a quantity and the item isn't already in the wishlist it will be added.

Attach A User

 POST /api/wishlist/xxx/user

Before checkout you need to attach a user to the wishlist. This can either be done by attaching an authenticated session, or by simply specifying an email address.

 {
    "order" : { ... },
    "session_id" : "xxx"
 }

NOTE: The session_id returned here needs (or any session_id attached to the user_id attached to this wishlist) to be used on all subsequent interactions with the wishlist.

session_id

A session id as created by Session.

email

An email address of the user checking out. This only works if the user is not already in the system.

Convert To A Cart

 POST /api/wishlist/xxx/cart

Converts this cart to a Cart.

POD ERRORS

Hey! The above document had some coding errors, which are explained below:

Around line 123:

You forgot a '=back' before '=head1'

^ Back to Top ^