Autoship

edit.json

method: GET

secured: true

url: /v1/autoship/edit/[Cart ID].json

If the Cart ID belongs to the authenticated user and it's status is BUILDING you will see a response like this (this example started as a copied Autoship):

{
	"Id": 615,
	"Url": "/autoship/edit/615.json",
	"ShipDay": 8,
	"FormattedShipDay": "8th",
	"ShipToName": "Test User",
	"TotalPrice": "$42.35",
	"TransactionDesc": null,
	"ShipTo": {
		"Email": "test@us.gnld.com",
		"AddressPrimary": "3500 Gateway Blvd.",
		"AddressSecondary": "",
		"AddressTertiary": "",
		"City": "FREMONT",
		"Province": "CA",
		"PostalCode": "94538",
		"Country": "USA"
	},
	"Items": [{
		"SKU": "3010",
		"Title": "Tre' Nutritional Essence",
		"SubTitle": "32 fluid oz. (950 mL)",
		"Image": "http://s3.amazonaws.com/static.gnld.com/us/product/3010/landingpage_m.png",
		"Quantity": 1,
		"Pv": 36,
		"Bv": 45.7500,
		"Price": "$42.35",
		"Adjustable": true
	}],
	"success": true,
	"error": null,
	"errorAction": "NONE"
}

method: POST

secured: true

url: /v1/autoship/edit/[Cart ID].json

Field Notes
shipDay A day of the month to receive the autoship (between and including the 5th and the 25th)
Type: Int(Optional)
action Tells the endpoint how to treat the items being passed:
append takes all passed in SKUs and adds them to the the item list (increasing the quantity of any items already in the cart)
adjust takes all passed in SKUs and sets thier quantities to the passed in value, any other item in the cart is untouched.
replace replaces the tiems in acart with the items passed in.
remove removes the items passed in, any other item in the cart is untouched.

Type: String (append|adjust|replace|remove) (Optional, assumes append if not passed)
items A JSON encoded array with the following structure:
{
    "SKU": "[Product SKU]",
    "Quantity": [Quantity of singles]
}

Type: JSON array (Optional)
pack A JSON encoded object with the following structure:
{
    "Guid": "[Pack GUID]",
    "Quantity": [Quantity of this configuration],
    "Berry": [Quantity of Vanilla],
    "Chocolate": [Quantity of Chocolate],
    "Vanilla": [Quantity of Berry],
}
This will take the quantites of each flavor, find the SKU that matches, and add the Quantity of this SKU to your Cart. This is a convenience method to make implementing a UI easier. It only works with Packs that have a Selector of FLAVOR_QUANTITIES_MAX_2 or FLAVOR_QUANTITIES_MAX_4.
Type: JSON Object (only evaluated if you do not pass an items field) (Optional)

If sucessfull you will see a response like this:

{
    "Items": 1,
    "success": true,
    "error": null
}

method: OPTIONS

secured: true

url: /v1/autoship/edit/[Cart ID].json

Returns fully formed URLs for the various endpoints related to managing this autoship (this cna be easier than contructing these URLs by hand, this will also reference the correct server and API version if you are using a test server):

{
    "Verify": {
        "Address": "http://api.gnld.com/v1/autoship/edit/77/checkout/verify/address.json",
        "Payment": "http://api.gnld.com/v1/autoship/edit/77/checkout/verify/payment.json"
    },
    "success": true,
    "error": null
}