Receipts

DATA = JSON.parse('{
 "receipt_id":"meow0101021",
 "items":[
   {
     "id":"100",
     "name":"Classic t-shirt wit Kitten",
     "currency":"USD",
     "price":"15.00",
     "thumb_url":"http://www.comedyvsnerds.com/assets/cvn_transparent-022819895eb48d3a76ee6627b1a6cda2.png",
     "item_url":"http://www.comedyvsnerds.com/?item_id=100",      
     "quantity":"2",
     "metadata":{
       "brand":"Awesome Comedy Show",
       "size":"L",
       "color":"White",
       "fun": "A lot!"
     }
   }
 ],
 "timestamp":"1423076008",
 "account_holder_name":"Matt Berman",
 "recipient_name":"Matt Berman",
 "structured_address":{
   "street_1":"25 Taylor str",
   "city":"San Francisco",
   "state":"CA",
   "postal_code":"94133",
   "country":"US"
 },
 "shipping_method":"USPS",
 "payment_method":"Visa 1234",
 "subtotal":"30.00",
 "shipping_cost":"5.00",
 "total_tax":"3.00",
 "total_cost":"38.00",
 "currency":"USD",
 "order_url":"http://www.comedyvsnerds.com?orderID=order123456789",
 "cancellation_url":"http://www.comedyvsnerds.com?cancelID=order123456789"
}')

TYPE = 'retail_receipts'
NameDescriptionTypeRequired
receipt_idunique order numberstringY
itemsarray of items being orderedarrayY
timestamporder placed timetimestampY
account_holder_namename of the person who placed the orderstringY
receipt_namename of the person receiving the shipment itemstringY
structured_addressstructured shipping addressshippingY
shipping_methodshipping carrier (UPS/Fedex etc)stringN
payment_methodshould be card name and last 4 digits (Visa & 1234)stringY
subtotalorder subtotal amountfloatY
shipping_costtotal shipping amountfloatY
total_taxtax amountfloatY
total_costtotal order amountfloatY
currencypricing currency (ex: USD)enumY
order_urlURL of order details pageURLN

📘

status values: PREPARED_SHIP, PARTIALLY_SHIPPED, SHIPPED, DELIVERED, EMPTY_STRING, CANCELED

items Object:

NameDescriptionTypeRequired
idunique product numberstringY
nameitem namestringY
currencyitem pricing currency e.g. USDstringY
priceitem pricestringY
thumb_urlitem image to be displayedURLN
item_urlURL for itemURLY
quantityitem quantitystringN
metadataitem metadata that will display in receipts (see details below)metadataN

metadata Object:

NameDescriptionTypeRequired
branditem brand namestringN
sizeitem size (please add "Size " before numeric sizes, e.g. 4, 2T, etc.)stringN
coloritem color descriptionstringN
gendergender for itemenum (M/F or "" for gender neutral)N

structured_address Object:

NameDescriptionTypeRequired
street_1street address 1stringY
street_2street address 2stringN
citycity namestringY
state2 character state namestate nameY
postal_code5 digit postal codestringY
country2 character country name. ISO3166 alpha-2stringY

Shipment Notifications

DATA = JSON.parse('{
  "receipt_id":"meow0101021",
  "carrier":"UPS",
  "tracking_number":"1ZW098R40361231305",
  "carrier_tracking_url":"http://www.ups.com/WebTracking/processInputRequest?tracknum=1ZW098R40361231305",
  "items":[
    {
      "id":"100",
      "quantity":"2"
    }
  ],
  "ship_date":"1427824997",
  "origin":{
    "street_1":"",
    "street_2":"",
    "city":"Cleveland",
    "state":"OH",
    "postal_code":"44101",
    "country":"US"
  },
  "destination":{
    "street_1":"1 Hacker Way",
    "street_2":"",
    "city":"Menlo Park",
    "state":"CA",
    "postal_code":"94025",
    "country":"US"
  },
  "weight":"4.5",
  "weight_unit":"LBS"
}')

TYPE = 'retail_shipments'
NameDescriptionTypeRequired
receipt_idunique existing order numberstringY
carriershipping carrier enumerated values e.g. UPSenum (see below)Y
tracking_numbercarrier unique/valid tracking number (required for UPS and USPS)stringY
carrier_tracking_urlURL of shipment tracking sitestringN
itemsarray of items being shippeditems[] (see below)Y
ship_datedate/time of shipmenttimestampY
originstructured address of shipment originorigin (see below)Y
destinationstructured address of shipment destinationdestination (see below)Y
weightshipment numeric weight (default value = 1)floatN
weight_unitshipping weight unit (default value = LBS)enum (see below)N

📘

carrier Values:

UPS
FedEx
USPS
[all other carriers (DHL, OnTrac, etc.) should be returned in a human-readbable form, as this is what will be passed through to the buyer.]

items Object:

NameDescriptionTypeRequired
idunique product numberstringY
quantityitem quantitystringY

origin Object:

NameDescriptionTypeRequired
street_1street address 1stringN
street_2street address 2stringN
citycity namestringY
state2 character state namestate nameY
postal_code5 digit postal codestringY
country2 character country name. ISO3166 alpha-2stringY

destination Object

NameDescriptionTypeRequired
street_1street address 1stringY
street_2street address 2stringN
citycity namestringY
state2 character state namestate nameY
postal_code5 digit postal codestringY
country2 character country name. ISO3166 alpha-2stringY

📘

weight_unit Values (case sensitive):

LBS
KGS

Order Update

DATA = JSON.parse('{
 "receipt_id":"meow0101021",
 "update_id":"update2",
 "update_type":"update_quantity",
 "items":[
   {
     "id":"100",
   }
 ],
 "timestamp":"1428444852",
 "updated_sub_total":"20.00",
 "updated_shipping_cost":"5.00",
 "updated_total_tax":"2.00",
 "updated_total":"27.00",
 "currency":"USD"
}')
                  
TYPE = 'retail_updatereceipts'

📘

If updated_sub_total, updated_shipping_cost, updated_total_tax, or updated_total is omitted, the modified receipt will contain the corresponding value as previously POSTed to retail_receipts and/or /retail_updatereceipts

Fields:

NameDescriptionTypeRequired
receipt_idunique existing order numberstringY
update_idoptional unique identifier of this updatestringN
update_typecancel_item or update_quantityenumY
itemsarray of items being updateditems[] (see below)Y
timestamporder update timetimestampY
updated_sub_totalupdated order subtotal amountfloatN
updated_shipping_costupdated total shipping amountfloatN
updated_total_taxupdated tax amountfloatN
updated_totalupdated total order amountfloatN
currencypricing currency e.g. USDstringN

📘

update_type values:

cancel_item, update_quantity

items Object:

NameDescriptionTypeRequired
idunique product numberstringY
quantityupdated item quantitystringN

General Notifications

If you have customers interested in one or more items that are out of stock, they can get notified when an item is available. You can add this as a link in your site labeled Notify Me and make a call the API when an item is in stock.

964

When you add this plugin, you can configure the URL that the customer goes to after they click Notify Me. You can take someone to the page for the item, or a shopping cart with that item already loaded, and so on.

DATA = JSON.parse('{
 "name":"New Comedy VS Nerds Show",
 "notification_id":"product123456789",
 "url":"http://www.google.com",
 "thumb_url":"http://www.google.com/share5.png",
 "category":"retail_item",
 "currency":"USD",
 "price":"35.00",
 "desc":"Awesome Comedy VS Nerds comedy show, starring Loui CK and Bruce Williams",
 "metadata":{
   "brand":"ComedyVSNerds",
   "kitten":"true",
   "funny":"veery"
 }}')
                  
TYPE = 'notifyme'

Fields

NameDescriptionTypeReq
notification_idunique product numberstringY
namename of the productstringY
urllink of the product on your websiteURLY
thumb_urlproduct image to be displayedURLY
categoryProduct categoryenumY
currencyPricing currency e.g. USDenumN
pricePrice of the product in the above currencystringN
descDescription of the productstringN
metadataOther details about the productmetadataN

Metadata Object:

NameDescriptionTypeRequired
branditem brand namestringN
sizeitem size (please add "Size " before numeric sizes, e.g. 4, 2T, etc.)stringN
coloritem color descriptionstringN
Language
Authorization