Building a RESTful Web Service :: Learn how to create a RESTful web service with Spring. :: spring-boot http://spring.io/guides/gs/rest-service/

API Reference.htm 64KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737
  1. <!DOCTYPE html>
  2. <html><head>
  3. <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  4. <meta charset="utf-8">
  5. <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
  6. <meta name="google-site-verification" content="ZxKSonHR9fGKxGY0pK48MMg1-0Zm4bMEyZAmhbmQys0">
  7. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  8. <title>API Reference</title>
  9. <link href="API%20Reference_fichiers/screen.css" rel="stylesheet" type="text/css" media="screen">
  10. <link href="API%20Reference_fichiers/print.css" rel="stylesheet" type="text/css" media="print">
  11. <script async="" src="API%20Reference_fichiers/analytics.js"></script><script src="API%20Reference_fichiers/jquery.js"></script>
  12. <script>
  13. (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  14. (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  15. m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  16. })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
  17. ga('create', 'UA-88890615-1', 'auto');
  18. ga('send', 'pageview');
  19. </script>
  20. <script src="API%20Reference_fichiers/all.js" type="text/javascript"></script>
  21. <script>
  22. $(function() {
  23. setupLanguages(["shell"]);
  24. });
  25. </script>
  26. </head>
  27. <body class="index">
  28. <a href="#" id="nav-button">
  29. <span>
  30. NAV
  31. <img src="API%20Reference_fichiers/navbar.png">
  32. </span>
  33. </a>
  34. <div class="tocify-wrapper">
  35. <img src="API%20Reference_fichiers/zinc-light.png">
  36. <div class="lang-selector">
  37. <a href="#" data-language-name="shell" class="active">shell</a>
  38. </div>
  39. <div class="search">
  40. <input class="search" id="input-search" placeholder="Search" type="text">
  41. </div>
  42. <ul class="search-results"></ul>
  43. <div id="toc" class="tocify">
  44. <ul id="tocify-header0" class="tocify-header"><li class="tocify-item" data-unique="introduction"><a>Introduction</a></li></ul><ul id="tocify-header1" class="tocify-header"><li class="tocify-item" data-unique="supported-retailers"><a>Supported retailers</a></li></ul><ul id="tocify-header2" class="tocify-header"><li class="tocify-item" data-unique="authentication" style="cursor: pointer;"><a>Authentication</a></li></ul><ul id="tocify-header3" class="tocify-header"><li class="tocify-item tocify-focus" data-unique="idempotency-keys" style="cursor: pointer;"><a>Idempotency Keys</a></li></ul><ul id="tocify-header4" class="tocify-header"><li class="tocify-item" data-unique="place-an-order" style="cursor: pointer;"><a>Place an order</a></li><ul class="tocify-subheader" data-tag="2" style="display: none;"><li class="tocify-item" data-unique="create-an-order"><a>Create an order</a></li><li class="tocify-item" data-unique="retrieving-an-order"><a>Retrieving an order</a></li><li class="tocify-item" data-unique="selecting-shipping"><a>Selecting shipping</a></li><li class="tocify-item" data-unique="order-bundling"><a>Order bundling</a></li></ul></ul><ul id="tocify-header5" class="tocify-header"><li class="tocify-item" data-unique="get-product-details" style="cursor: pointer;"><a>Get product details</a></li></ul><ul id="tocify-header6" class="tocify-header"><li class="tocify-item" data-unique="get-product-prices" style="cursor: pointer;"><a>Get product prices</a></li></ul><ul id="tocify-header7" class="tocify-header"><li class="tocify-item" data-unique="object-reference" style="cursor: pointer;"><a>Object reference</a></li><ul class="tocify-subheader" data-tag="2" style="display: none;"><li class="tocify-item" data-unique="product-object"><a>Product object</a></li><li class="tocify-item" data-unique="seller-selection-criteria-object"><a>Seller selection criteria object</a></li><li class="tocify-item" data-unique="shipping-object"><a>Shipping object</a></li><li class="tocify-item" data-unique="address-object"><a>Address object</a></li><li class="tocify-item" data-unique="payment-method-object"><a>Payment method object</a></li><li class="tocify-item" data-unique="webhooks-object"><a>Webhooks object</a></li><li class="tocify-item" data-unique="retailer-credentials-object"><a>Retailer credentials object</a></li><li class="tocify-item" data-unique="price-components-object"><a>Price components object</a></li><li class="tocify-item" data-unique="merchant-order-ids-object"><a>Merchant order ids object</a></li><li class="tocify-item" data-unique="product-offer-object"><a>Product offer object</a></li><li class="tocify-item" data-unique="tracking-object"><a>Tracking object</a></li></ul></ul><ul id="tocify-header8" class="tocify-header"><li class="tocify-item" data-unique="errors" style="cursor: pointer;"><a>Errors</a></li></ul></div>
  45. <ul class="toc-footer">
  46. <li><a href="http://dash.zinc.io/">Sign Up for a Zinc account</a></li>
  47. </ul>
  48. </div>
  49. <div class="page-wrapper">
  50. <div class="dark-box"></div>
  51. <div class="content">
  52. <div name="introduction" data-unique="introduction"></div><h1 id="introduction">Introduction</h1>
  53. <p>Zinc lets you buy things from popular online retailers, including
  54. Amazon.com, with a single POST request. Zinc also lets you get prices
  55. and descriptive information about products from supported retailers.</p>
  56. <h3 id="quick-start">Quick start</h3>
  57. <ol>
  58. <li>Make an account at <a href="https://dash.zinc.io/">dash.zinc.io</a>.</li>
  59. <li>Follow the instructions in the <a href="#create-an-order">create an order</a> section from the documentation below to place your first order.</li>
  60. </ol>
  61. <div name="supported-retailers" data-unique="supported-retailers"></div><h1 id="supported-retailers">Supported retailers</h1>
  62. <p>The table below shows the endpoints available for each retailer. We
  63. can add additional retailers upon request – fill out the form at the <a href="https://zinc.io/#bottom">bottom of our home page</a> for a quote for a particular retailer.</p>
  64. <table><thead>
  65. <tr>
  66. <th>Name</th>
  67. <th>Retailer Code</th>
  68. <th>Orders</th>
  69. <th>Product Details</th>
  70. <th>Product Prices</th>
  71. </tr>
  72. </thead><tbody>
  73. <tr>
  74. <td>AliExpress</td>
  75. <td>aliexpress</td>
  76. <td>Y</td>
  77. <td>Y</td>
  78. <td>Y</td>
  79. </tr>
  80. <tr>
  81. <td>Amazon</td>
  82. <td>amazon</td>
  83. <td>Y</td>
  84. <td>Y</td>
  85. <td>Y</td>
  86. </tr>
  87. <tr>
  88. <td>Amazon United Kingdom</td>
  89. <td>amazon_uk</td>
  90. <td>Y</td>
  91. <td>Y</td>
  92. <td>Y</td>
  93. </tr>
  94. <tr>
  95. <td>Amazon Canada</td>
  96. <td>amazon_ca</td>
  97. <td>Y</td>
  98. <td>Y</td>
  99. <td>Y</td>
  100. </tr>
  101. <tr>
  102. <td>Amazon Mexico</td>
  103. <td>amazon_mx</td>
  104. <td>Y</td>
  105. <td>Y</td>
  106. <td>Y</td>
  107. </tr>
  108. <tr>
  109. <td>Costco</td>
  110. <td>costco</td>
  111. <td>Y</td>
  112. <td>Y</td>
  113. <td>Y</td>
  114. </tr>
  115. <tr>
  116. <td>East Dane</td>
  117. <td>eastdane</td>
  118. <td>Y</td>
  119. <td></td>
  120. <td></td>
  121. </tr>
  122. <tr>
  123. <td>Google Shopping</td>
  124. <td>google_shopping</td>
  125. <td></td>
  126. <td>Y</td>
  127. <td>Y</td>
  128. </tr>
  129. <tr>
  130. <td>Newegg</td>
  131. <td>newegg</td>
  132. <td>Y</td>
  133. <td></td>
  134. <td></td>
  135. </tr>
  136. <tr>
  137. <td>Nordstrom</td>
  138. <td>nordstrom</td>
  139. <td>Y</td>
  140. <td></td>
  141. <td></td>
  142. </tr>
  143. <tr>
  144. <td>Overstock</td>
  145. <td>overstock</td>
  146. <td></td>
  147. <td>Y</td>
  148. <td>Y</td>
  149. </tr>
  150. <tr>
  151. <td>Shopbop</td>
  152. <td>shopbop</td>
  153. <td>Y</td>
  154. <td></td>
  155. <td></td>
  156. </tr>
  157. <tr>
  158. <td>Walmart</td>
  159. <td>walmart</td>
  160. <td>Y</td>
  161. <td>Y</td>
  162. <td>Y</td>
  163. </tr>
  164. </tbody></table>
  165. <div name="authentication" data-unique="authentication"></div><h1 id="authentication">Authentication</h1>
  166. <blockquote>
  167. <p>Example authentication request</p>
  168. </blockquote>
  169. <pre class="highlight shell" style="display: block;"><code>curl https://api.zinc.io/v1/orders <span class="se">\</span>
  170. -u &lt;client_token&gt;:
  171. </code></pre>
  172. <p>You can authenticate your account by including your client token in
  173. your request. Authentication is performed through HTTP Basic Auth, where
  174. the client token is the basic auth username value. You do not need to
  175. provide a password.</p>
  176. <p>Make sure that you don’t share your client token and that you keep it
  177. away from publicly accessible areas such as Github, client-side code,
  178. etc. Client tokens are tied to your account, so you will be charged for
  179. any orders or requests made with your client token. If you believe your
  180. client token has been compromised, please contact support@zinc.io immediately.</p>
  181. <div name="idempotency-keys" data-unique="idempotency-keys"></div><h1 id="idempotency-keys">Idempotency Keys</h1>
  182. <blockquote>
  183. <p>Example idempontency key request</p>
  184. </blockquote>
  185. <pre class="highlight shell" style="display: block;"><code>curl <span class="s2">"https://api.zinc.io/v1/orders"</span> <span class="se">\</span>
  186. -u &lt;client_token&gt;: <span class="se">\</span>
  187. -d <span class="s1">'{
  188. "idempotency_key": &lt;idempotency_key&gt;,
  189. "retailer": "amazon",
  190. "max_price": 2300,
  191. ...
  192. }'</span>
  193. </code></pre>
  194. <p>The Zinc API does not provide out of the box deduplication of orders.
  195. Each time you send a new order request, the Zinc API will attempt to
  196. place a new order. However, the API supports idempotency for safely
  197. retrying requests without accidentally performing the same operation
  198. twice. For example, if an order request fails due to a network
  199. connection error, you can retry the request with the same idempotency
  200. key to guarantee that only a single order is created.</p>
  201. <p>To perform an idempotent request, attach a unique key to request body of any POST request with the parameter <code class="prettyprint">"idempotency_key": &lt;idempotency_key&gt;</code>.
  202. How you create unique keys is completely up to you. We suggest using
  203. random strings or UUIDs. We’ll always send back the same response for
  204. requests made with the same key. If you receive an error on a request,
  205. you can retry by sending another request with a different idempotency
  206. key. Once you receive an error or success response, the order will no
  207. longer change.</p>
  208. <p>Idempotency keys are STRONGLY recommended. In the unlikely event that
  209. an API request returns a 5XX status code, duplicate requests could
  210. occur if you reattempt the request. We can’t be sure of the state of the
  211. request when we return a 5XX status code, so it’s best to attempt
  212. requests with an idempotency key. If you aren’t using an idempotency key
  213. and you retry orders with a 5XX error code, Zinc will not refund you
  214. for duplicate orders.</p>
  215. <div name="place-an-order" data-unique="place-an-order"></div><h1 id="place-an-order">Place an order</h1>
  216. <div name="create-an-order" data-unique="create-an-order"></div><h2 id="create-an-order">Create an order</h2>
  217. <p>Zinc offers the underlying API for apps that need real-time order
  218. placing capabilities. With a single POST request, you can order an item
  219. from one of our supported retailers. Making an order request will start
  220. an order. You’ll receive a <code class="prettyprint">request_id</code> in the POST body’s response which you’ll then use for <a href="#retrieving-an-order">retrieving the status of the order</a>.</p>
  221. <blockquote>
  222. <p>Example create an order request</p>
  223. </blockquote>
  224. <pre class="highlight shell" style="display: block;"><code>curl <span class="s2">"https://api.zinc.io/v1/orders"</span> <span class="se">\</span>
  225. -u &lt;client_token&gt;: <span class="se">\</span>
  226. -d <span class="s1">'{
  227. "retailer": "amazon",
  228. "products": [
  229. {
  230. "product_id": "0923568964",
  231. "quantity": 1,
  232. "variants": [
  233. {
  234. "dimension": "color",
  235. "value": "Red",
  236. }
  237. ]
  238. }
  239. ],
  240. "max_price": 2300,
  241. "shipping_address": {
  242. "first_name": "Tim",
  243. "last_name": "Beaver",
  244. "address_line1": "77 Massachusetts Avenue",
  245. "address_line2": "",
  246. "zip_code": "02139",
  247. "city": "Cambridge",
  248. "state": "MA",
  249. "country": "US",
  250. "phone_number": "5551230101"
  251. },
  252. "is_gift": true,
  253. "gift_message": "Here is your package, Tim! Enjoy!",
  254. "shipping": {
  255. "order_by": "price",
  256. "max_days": 5,
  257. "max_price": 1000
  258. },
  259. "payment_method": {
  260. "name_on_card": "Ben Bitdiddle",
  261. "number": "5555555555554444",
  262. "security_code": "123",
  263. "expiration_month": 1,
  264. "expiration_year": 2020,
  265. "use_gift": false
  266. },
  267. "billing_address": {
  268. "first_name": "William",
  269. "last_name": "Rogers",
  270. "address_line1": "84 Massachusetts Ave",
  271. "address_line2": "",
  272. "zip_code": "02139",
  273. "city": "Cambridge",
  274. "state": "MA",
  275. "country": "US",
  276. "phone_number": "5551234567"
  277. },
  278. "retailer_credentials": {
  279. "email": "timbeaver@gmail.com",
  280. "password": "myRetailerPassword"
  281. },
  282. "webhooks": {
  283. "order_placed": "http://mywebsite.com/zinc/order_placed",
  284. "order_failed": "http://mywebsite.com/zinc/order_failed",
  285. "tracking_obtained": "http://mywebsite.com/zinc/tracking_obtained"
  286. },
  287. "client_notes": {
  288. "our_internal_order_id": "abc123",
  289. "any_other_field": ["any value"]
  290. }
  291. }'</span>
  292. </code></pre>
  293. <blockquote>
  294. <p>Example create an order response</p>
  295. </blockquote>
  296. <pre class="highlight shell" style="display: block;"><code><span class="o">{</span>
  297. <span class="s2">"request_id"</span>: <span class="s2">"3f1c939065cf58e7b9f0aea70640dffc"</span>
  298. <span class="o">}</span>
  299. </code></pre>
  300. <h3 id="required-attributes">Required attributes</h3>
  301. <table><thead>
  302. <tr>
  303. <th>Attribute</th>
  304. <th>Type</th>
  305. <th>Description</th>
  306. </tr>
  307. </thead><tbody>
  308. <tr>
  309. <td>retailer</td>
  310. <td>String</td>
  311. <td>The retailer code of the supported retailer</td>
  312. </tr>
  313. <tr>
  314. <td>products</td>
  315. <td>List</td>
  316. <td>A list of <a href="#product-object">product objects</a> that should be ordered</td>
  317. </tr>
  318. <tr>
  319. <td>shipping_address</td>
  320. <td>Object</td>
  321. <td>An <a href="#address-object">address object</a> to which the order will be delivered</td>
  322. </tr>
  323. <tr>
  324. <td>shipping_method</td>
  325. <td>String</td>
  326. <td>The desired shipping method for the object. Available methods are <code class="prettyprint">cheapest</code> (always select the cheapest method available), <code class="prettyprint">fastest</code> (always select the fastest method available), or <code class="prettyprint">free</code> (which will fail for items without some sort of free shipping). You must provide either this or the <code class="prettyprint">shipping</code> attribute, but not both.</td>
  327. </tr>
  328. <tr>
  329. <td>shipping</td>
  330. <td>Object</td>
  331. <td>A <a href="#shipping-object">shipping object</a> with information as to which shipping method to use. You must provide either this or the <code class="prettyprint">shipping_method</code> attribute, but not both.</td>
  332. </tr>
  333. <tr>
  334. <td>billing_address</td>
  335. <td>Object</td>
  336. <td>An <a href="#address-object">address object</a> for the person associated with the credit card</td>
  337. </tr>
  338. <tr>
  339. <td>payment_method</td>
  340. <td>Object</td>
  341. <td>A <a href="#payment-method-object">payment method</a> object containing payment information for the order</td>
  342. </tr>
  343. <tr>
  344. <td>retailer_credentials</td>
  345. <td>Object</td>
  346. <td>A <a href="#retailer-credentials-object">retailer credentials</a> object for logging into the retailer with a preexisting account</td>
  347. </tr>
  348. </tbody></table>
  349. <h3 id="optional-attributes">Optional attributes</h3>
  350. <table><thead>
  351. <tr>
  352. <th>Attribute</th>
  353. <th>Type</th>
  354. <th>Description</th>
  355. </tr>
  356. </thead><tbody>
  357. <tr>
  358. <td>gift_message</td>
  359. <td>String</td>
  360. <td>A message to include on the packing slip for the recipient. Must be no more than 240 characters, or 9 lines.</td>
  361. </tr>
  362. <tr>
  363. <td>is_gift</td>
  364. <td>Boolean</td>
  365. <td>Whether or not this order should be placed as a gift. Typically,
  366. retailers will exclude the price of the items on the receipt if this is
  367. set.</td>
  368. </tr>
  369. <tr>
  370. <td>max_price</td>
  371. <td>Number</td>
  372. <td>The maximum price in cents for the order. If the final price exceeds
  373. this number, the order will not go through and will return a <code class="prettyprint">max_price_exceeded</code> error.</td>
  374. </tr>
  375. <tr>
  376. <td>webhooks</td>
  377. <td>Object</td>
  378. <td>A <a href="#webhooks-object">webhooks object</a> including URLs that will receive POST requests after particular events have finished</td>
  379. </tr>
  380. <tr>
  381. <td>client_notes</td>
  382. <td>Object</td>
  383. <td>Any metadata to store on the request for future use. This object will be passed back in the response.</td>
  384. </tr>
  385. <tr>
  386. <td>promo_codes</td>
  387. <td>Array</td>
  388. <td>A list of promotion codes to use at checkout.</td>
  389. </tr>
  390. <tr>
  391. <td>ignore_invalid_promo_code</td>
  392. <td>Boolean</td>
  393. <td>Continue with checkout even if promotion codes are invalid. Default is <code class="prettyprint">false</code>.</td>
  394. </tr>
  395. <tr>
  396. <td>po_number</td>
  397. <td>Number</td>
  398. <td>(Amazon business accounts only). Adds a purchase order number to the order.</td>
  399. </tr>
  400. <tr>
  401. <td>bundled</td>
  402. <td>Boolean</td>
  403. <td>(Amazon only). If enabled, orders will be grouped together into batches and placed together. See the <a href="#order-bundling">order bundling</a> section for more details.</td>
  404. </tr>
  405. </tbody></table>
  406. <div name="retrieving-an-order" data-unique="retrieving-an-order"></div><h2 id="retrieving-an-order">Retrieving an order</h2>
  407. <blockquote>
  408. <p>Example retrieve an order request</p>
  409. </blockquote>
  410. <pre class="highlight shell" style="display: block;"><code>curl <span class="s2">"https://api.zinc.io/v1/orders/3f1c939065cf58e7b9f0aea70640dffc"</span> <span class="se">\</span>
  411. -u &lt;client_token&gt;:
  412. </code></pre>
  413. <p>To see the status of an order, you can retrieve it using the request
  414. id you obtained from your order request, and placing it in a GET request
  415. URL. Orders usually take a while to process. While your order is
  416. processing, the response will return an error with code type <code class="prettyprint">request_processing</code>.</p>
  417. <blockquote>
  418. <p>Example retrieve an order response (request processing)</p>
  419. </blockquote>
  420. <pre class="highlight shell" style="display: block;"><code><span class="o">{</span>
  421. <span class="s2">"_type"</span>: <span class="s2">"error"</span>,
  422. <span class="s2">"code"</span>: <span class="s2">"request_processing"</span>,
  423. <span class="s2">"message"</span>: <span class="s2">"Request is currently processing and will complete soon."</span>,
  424. <span class="s2">"data"</span>: <span class="o">{}</span>
  425. <span class="o">}</span>
  426. </code></pre>
  427. <blockquote>
  428. <p>Example retrieve an order response (order response)</p>
  429. </blockquote>
  430. <pre class="highlight shell" style="display: block;"><code><span class="o">{</span>
  431. <span class="s2">"_type"</span> : <span class="s2">"order_response"</span>,
  432. <span class="s2">"price_components"</span> : <span class="o">{</span>
  433. <span class="s2">"shipping"</span> : 0,
  434. <span class="s2">"subtotal"</span> : 1999,
  435. <span class="s2">"tax"</span> : 0,
  436. <span class="s2">"total"</span> : 1999
  437. <span class="o">}</span>,
  438. <span class="s2">"merchant_order_ids"</span> : <span class="o">[</span>
  439. <span class="o">{</span>
  440. <span class="s2">"merchant_order_id"</span> : <span class="s2">"112-1234567-7272727"</span>,
  441. <span class="s2">"merchant"</span> : <span class="s2">"amazon"</span>,
  442. <span class="s2">"account"</span> : <span class="s2">"timbeaver@gmail.com"</span>,
  443. <span class="s2">"placed_at"</span> : <span class="s2">"2014-07-02T23:51:08.366Z"</span>
  444. <span class="o">}</span>
  445. <span class="o">]</span>,
  446. <span class="s2">"tracking"</span> : <span class="o">[</span>
  447. <span class="o">{</span>
  448. <span class="s2">"product_id"</span> : <span class="s2">"0923568964"</span>,
  449. <span class="s2">"merchant_order_id"</span> : <span class="s2">"112-1234567-7272727"</span>,
  450. <span class="s2">"carrier"</span> : <span class="s2">"Fedex"</span>,
  451. <span class="s2">"tracking_number"</span> : <span class="s2">"9261290100129790891234"</span>,
  452. <span class="s2">"obtained_at"</span> : <span class="s2">"2014-07-03T23:22:48.165Z"</span>
  453. <span class="o">}</span>
  454. <span class="o">]</span>,
  455. <span class="s2">"request"</span> : <span class="o">{</span>
  456. ...
  457. <span class="o">}</span>
  458. <span class="o">}</span>
  459. </code></pre>
  460. <p>Once the request completes, the retrieve an order response should either return a response of type <code class="prettyprint">order_response</code> or <code class="prettyprint">error</code>. An error response body will contain a <code class="prettyprint">code</code> and a <code class="prettyprint">message</code>.
  461. The code indicates the error that occurred, while the message provides a
  462. more detailed description of the error. Any extra details about the
  463. error will be provided in the <code class="prettyprint">data</code> object. For a full list of errors, see the <a href="#errors">Errors section</a>.</p>
  464. <h3 id="order-response-attributes">Order response attributes</h3>
  465. <table><thead>
  466. <tr>
  467. <th>Attribute</th>
  468. <th>Type</th>
  469. <th>Description</th>
  470. </tr>
  471. </thead><tbody>
  472. <tr>
  473. <td>price_components</td>
  474. <td>Object</td>
  475. <td>A <a href="#price-components-object">price components object</a> which contains details about the price of the final order</td>
  476. </tr>
  477. <tr>
  478. <td>merchant_order_ids</td>
  479. <td>Array</td>
  480. <td>A <a href="#merchant-order-ids-object">merchant order ids object</a> which contains details about the retailer’s order identifiers</td>
  481. </tr>
  482. <tr>
  483. <td>tracking</td>
  484. <td>Array</td>
  485. <td>An array of <a href="#tracking-object">tracking objects</a> that
  486. contain the order’s tracking information. In most cases, this field will
  487. not be populated immediately after the order is placed and will only be
  488. available later after tracking is updated by the retailer. Once
  489. tracking has been obtained, a POST request will be sent to the <code class="prettyprint">tracking_obtained</code> field of the <a href="#webhooks-object">webhooks object</a> from the request if set.</td>
  490. </tr>
  491. <tr>
  492. <td>request</td>
  493. <td>Object</td>
  494. <td>The original request that was sent to the Zinc API</td>
  495. </tr>
  496. </tbody></table>
  497. <div name="selecting-shipping" data-unique="selecting-shipping"></div><h2 id="selecting-shipping">Selecting shipping</h2>
  498. <p>Ordering on the Zinc API can be complicated due to all the potential
  499. shipping options available. Generally, faster shipping will cost more
  500. money, so you must decide how fast you’d like your items or how much
  501. money to pay for shipping. Zinc provides a number of options to
  502. customize your shipping speed and cost formulas.</p>
  503. <p>Since different items will have different shipping options, you can use a product’s <a href="#seller-selection-criteria">seller selection criteria</a> to specify <code class="prettyprint">handling_days_max</code>.
  504. This will filter the list of potential offers down to those that will
  505. arrive within a certain number of days. The Zinc API will then select
  506. the cheapest offer that matched all of your seller selection criteria to
  507. make a purchase. For example, if you specified <code class="prettyprint">"handling_days_max": 6</code>,
  508. then any offer whose latest delivery date is greater than 6 days from
  509. now would be excluded from your buying selection. Thus, if two sellers
  510. are offering the same product, but one has a guaranteed delivery date 10
  511. days away and the other seller has a guaranteed delivery date 5 days
  512. away, the second seller’s offer would be selected.</p>
  513. <p>You may also use the <a href="#shipping-object">shipping parameter</a>
  514. on an order to select a shipping option once a product has been
  515. selected. Instead of filtering by the different offers, like the seller
  516. selection criteria, the <code class="prettyprint">shipping</code> parameter will choose the shipping speed on the selected offer. For example, if you set <code class="prettyprint">"max_days": 5</code> on the <code class="prettyprint">shipping</code>
  517. parameter, the Zinc API would attempt to select the cheapest shipping
  518. method that took less than 5 days. Thus, if there was a shipping method
  519. that took 3 days and cost $10 and another shipping method that took 7
  520. days but cost $2, the first shipping option would be selected.</p>
  521. <div name="order-bundling" data-unique="order-bundling"></div><h2 id="order-bundling">Order bundling</h2>
  522. <p>The bundling feature groups orders together before placing them. This
  523. is often advantageous on retailers where larger orders are given free
  524. shipping. To use bundling, you only need to specify <code class="prettyprint">bundled: true</code> when placing an order request. Bundling currently only works on the following retailers: <code class="prettyprint">amazon</code>, <code class="prettyprint">amazon_uk</code>.</p>
  525. <p>The bundling feature allows you to take advantage of free shipping
  526. over $50 (on Amazon) without having to change your Zinc integration.
  527. Bundling will take the shipping addresses, products, and quantities from
  528. separate orders and will group them together into a single order,
  529. making sure that each product is routed correctly. The order requests
  530. and responses remain exactly the same. The only difference is when the
  531. order is placed. The order bundling feature will wait for enough orders
  532. in the queue before launching a bundled order. The exact dynamics are as
  533. follows:</p>
  534. <ol>
  535. <li>The order bundler will wait until $55 in products have been
  536. purchased. As soon as more than $55 of products have been queued with <code class="prettyprint">bundled: true</code>, the bundler will launch a new order.</li>
  537. <li>If the order bundler has waited for longer than 6 hours and has not
  538. yet obtained $55 in products, it will launch an order with whatever
  539. products are currently in the queue.</li>
  540. </ol>
  541. <p>Note that the order bundler will not group together two orders which have the same product ids.</p>
  542. <div name="get-product-details" data-unique="get-product-details"></div><h1 id="get-product-details">Get product details</h1>
  543. <p>Get up to date information on the title, description, manufacturer
  544. details, item specifics, and more for any product on our supported
  545. retailers.</p>
  546. <blockquote>
  547. <p>Example product details request</p>
  548. </blockquote>
  549. <pre class="highlight shell" style="display: block;"><code>curl https://api.zinc.io/v1/products/0923568964?retailer<span class="o">=</span>amazon <span class="se">\</span>
  550. -u &lt;client_token&gt;:
  551. </code></pre>
  552. <p>To retrieve product details, make a GET request to the following URL, replacing <code class="prettyprint">:product_id</code>
  553. with the retailer’s unique identifier for a particular product and
  554. specifying the request attributes as query parameters in the URL.</p>
  555. <p><code class="prettyprint">https://api.zinc.io/v1/products/:product_id</code></p>
  556. <h3 id="required-request-attributes">Required request attributes</h3>
  557. <table><thead>
  558. <tr>
  559. <th>Attribute</th>
  560. <th>Type</th>
  561. <th>Description</th>
  562. </tr>
  563. </thead><tbody>
  564. <tr>
  565. <td>retailer</td>
  566. <td>String</td>
  567. <td>The retailer for the product</td>
  568. </tr>
  569. </tbody></table>
  570. <h4 id="optional-request-attributes">Optional request attributes</h4>
  571. <table><thead>
  572. <tr>
  573. <th>Attribute</th>
  574. <th>Type</th>
  575. <th>Description</th>
  576. </tr>
  577. </thead><tbody>
  578. <tr>
  579. <td>max_age</td>
  580. <td>Number</td>
  581. <td>A number in seconds setting the maximum age of the response. The
  582. data returned in the response will be at most this many seconds old.
  583. Cannot specify with <code class="prettyprint">newer_than</code>.</td>
  584. </tr>
  585. <tr>
  586. <td>newer_than</td>
  587. <td>Number</td>
  588. <td>A timestamp setting the minimum time the response should be
  589. retrieved from. The data returned in the response will be newer this
  590. timestamp. Cannot specify with <code class="prettyprint">max_age</code>.</td>
  591. </tr>
  592. <tr>
  593. <td>async</td>
  594. <td>Boolean</td>
  595. <td>Determines whether the resulting response will be asynchronous. If set to <code class="prettyprint">true</code>, then the API will not block waiting for a result. Instead, it will immediately return <code class="prettyprint">status: "processing"</code> and you will be responsible for resending the request until the response is no longer <code class="prettyprint">status: "processing"</code>. Defaults to <code class="prettyprint">false</code>.</td>
  596. </tr>
  597. </tbody></table>
  598. <blockquote>
  599. <p>Example product details response</p>
  600. </blockquote>
  601. <pre class="highlight shell" style="display: block;"><code><span class="o">{</span>
  602. <span class="s2">"status"</span>: <span class="s2">"completed"</span>,
  603. <span class="s2">"product_description"</span>: <span class="s2">"This is a great book!"</span>,
  604. <span class="s2">"retailer"</span>: <span class="s2">"amazon"</span>,
  605. <span class="s2">"epids"</span>:[
  606. <span class="o">{</span>
  607. <span class="s2">"type"</span>: <span class="s2">"EAN"</span>,
  608. <span class="s2">"value"</span>: <span class="s2">"9780923568962"</span>
  609. <span class="o">}</span>,
  610. <span class="o">{</span>
  611. <span class="s2">"type"</span>: <span class="s2">"ISBN"</span>,
  612. <span class="s2">"value"</span>: <span class="s2">"0923568964"</span>
  613. <span class="o">}</span>
  614. <span class="o">]</span>,
  615. <span class="s2">"product_details"</span>: <span class="o">[</span>
  616. <span class="s2">"Series: The Easy Way!"</span>,
  617. <span class="s2">"Paperback: 60 pages"</span>,
  618. <span class="s2">"Publisher: XanEdu Publishing Inc; 2nd Edition edition (September 28, 2009)"</span>,
  619. <span class="s2">"Language: English"</span>,
  620. <span class="s2">"ISBN-10: 0923568964"</span>,
  621. <span class="s2">"ISBN-13: 978-0923568962"</span>,
  622. <span class="s2">"Product Dimensions: 8.3 x 5.3 x 0.2 inches"</span>,
  623. <span class="s2">"Shipping Weight: 3.5 ounces"</span>
  624. <span class="o">]</span>,
  625. <span class="s2">"title"</span>: <span class="s2">"APA: The Easy Way! [Updated for APA 6th Edition]"</span>,
  626. <span class="s2">"variant_specifics"</span>: <span class="o">[</span>
  627. <span class="o">{</span>
  628. <span class="s2">"dimension"</span>: <span class="s2">"Color"</span>,
  629. <span class="s2">"value"</span>: <span class="s2">"Gray"</span>
  630. <span class="o">}</span>,
  631. <span class="o">{</span>
  632. <span class="s2">"dimension"</span>: <span class="s2">"Size"</span>,
  633. <span class="s2">"value"</span>: <span class="s2">"Small/Medium"</span>
  634. <span class="o">}</span>
  635. <span class="o">]</span>,
  636. <span class="s2">"product_id"</span>: <span class="s2">"0923568964"</span>
  637. <span class="o">}</span>
  638. </code></pre>
  639. <h3 id="response-attributes">Response attributes</h3>
  640. <table><thead>
  641. <tr>
  642. <th>Attribute</th>
  643. <th>Type</th>
  644. <th>Description</th>
  645. </tr>
  646. </thead><tbody>
  647. <tr>
  648. <td>status</td>
  649. <td>String</td>
  650. <td>Possible values are <code class="prettyprint">processing</code>, <code class="prettyprint">failed</code>, or <code class="prettyprint">completed</code>. You will only see <code class="prettyprint">processing</code> if <code class="prettyprint">async: true</code> was set on the request</td>
  651. </tr>
  652. <tr>
  653. <td>retailer</td>
  654. <td>String</td>
  655. <td>The retailer for the product</td>
  656. </tr>
  657. <tr>
  658. <td>product_id</td>
  659. <td>String</td>
  660. <td>The retailer’s unique identifier for the product</td>
  661. </tr>
  662. <tr>
  663. <td>timestamp</td>
  664. <td>String</td>
  665. <td>The timestamp that the resource was accessed</td>
  666. </tr>
  667. <tr>
  668. <td>title</td>
  669. <td>String</td>
  670. <td>Title of the product</td>
  671. </tr>
  672. <tr>
  673. <td>product_details</td>
  674. <td>Array</td>
  675. <td>An array of strings providing details about the product</td>
  676. </tr>
  677. <tr>
  678. <td>main_image</td>
  679. <td>String</td>
  680. <td>The URL of the primary image associated with the product</td>
  681. </tr>
  682. <tr>
  683. <td>images</td>
  684. <td>Array</td>
  685. <td>An array of image URLs associated with the product</td>
  686. </tr>
  687. <tr>
  688. <td>variant_specifics</td>
  689. <td>Array</td>
  690. <td>Array of objects containing information about the types and values
  691. of product variants available. A variant specifics object contains a <code class="prettyprint">dimension</code> field describing the type of the variant (e.g. “Color”) and a <code class="prettyprint">value</code> field describing the specific value available</td>
  692. </tr>
  693. <tr>
  694. <td>categories</td>
  695. <td>Array</td>
  696. <td>Array of different categories that the product belongs in</td>
  697. </tr>
  698. <tr>
  699. <td>authors</td>
  700. <td>Array</td>
  701. <td>Array of author names (only available for products that are books)</td>
  702. </tr>
  703. <tr>
  704. <td>product_description</td>
  705. <td>String</td>
  706. <td>The description of the product</td>
  707. </tr>
  708. <tr>
  709. <td>epids</td>
  710. <td>Array</td>
  711. <td>Array of objects containing external product identifier (epid) objects. An epid object contains a <code class="prettyprint">type</code> field describing the name of the external product identifier and a <code class="prettyprint">value</code> field for the identifier’s value</td>
  712. </tr>
  713. </tbody></table>
  714. <div name="get-product-prices" data-unique="get-product-prices"></div><h1 id="get-product-prices">Get product prices</h1>
  715. <p>Get information about all the offers for a particular product,
  716. including seller name, item price, shipping price, condition, seller
  717. reputation, and more.</p>
  718. <blockquote>
  719. <p>Example product offers request</p>
  720. </blockquote>
  721. <pre class="highlight shell" style="display: block;"><code>curl https://api.zinc.io/v1/products/0923568964/offers?retailer<span class="o">=</span>amazon <span class="se">\</span>
  722. -u &lt;client_token&gt;:
  723. </code></pre>
  724. <p>To retrieve product offers and prices, make a GET request to the following URL, replacing <code class="prettyprint">:product_id</code>
  725. with the retailer’s unique identifier for a particular product and
  726. specifying the request attributes as query parameters in the URL.</p>
  727. <p><code class="prettyprint">https://api.zinc.io/v1/products/:product_id/offers</code></p>
  728. <h3 id="required-request-attributes">Required request attributes</h3>
  729. <table><thead>
  730. <tr>
  731. <th>Attribute</th>
  732. <th>Type</th>
  733. <th>Description</th>
  734. </tr>
  735. </thead><tbody>
  736. <tr>
  737. <td>retailer</td>
  738. <td>String</td>
  739. <td>The retailer for the product</td>
  740. </tr>
  741. </tbody></table>
  742. <h3 id="optional-request-attributes">Optional request attributes</h3>
  743. <table><thead>
  744. <tr>
  745. <th>Attribute</th>
  746. <th>Type</th>
  747. <th>Description</th>
  748. </tr>
  749. </thead><tbody>
  750. <tr>
  751. <td>max_age</td>
  752. <td>Number</td>
  753. <td>A number in seconds setting the maximum age of the response. The
  754. data returned in the response will be at most this many seconds old.
  755. Cannot specify with <code class="prettyprint">newer_than</code>.</td>
  756. </tr>
  757. <tr>
  758. <td>newer_than</td>
  759. <td>Number</td>
  760. <td>A timestamp setting the minimum time the response should be
  761. retrieved from. The data returned in the response will be newer this
  762. timestamp. Cannot specify with <code class="prettyprint">max_age</code>.</td>
  763. </tr>
  764. <tr>
  765. <td>async</td>
  766. <td>Boolean</td>
  767. <td>Determines whether the resulting response will be asynchronous. If set to <code class="prettyprint">true</code>, then the API will not block waiting for a result. Instead, it will immediately return <code class="prettyprint">status: "processing"</code> and you will be responsible for resending the request until the response is no longer <code class="prettyprint">status: "processing"</code>. Defaults to <code class="prettyprint">false</code>.</td>
  768. </tr>
  769. </tbody></table>
  770. <blockquote>
  771. <p>Example product offers response</p>
  772. </blockquote>
  773. <pre class="highlight shell" style="display: block;"><code><span class="o">{</span>
  774. <span class="s2">"retailer"</span>: <span class="s2">"amazon"</span>,
  775. <span class="s2">"status"</span>: <span class="s2">"completed"</span>,
  776. <span class="s2">"offers"</span>:[
  777. <span class="o">{</span>
  778. <span class="s2">"addon"</span>: <span class="nb">false</span>,
  779. <span class="s2">"condition"</span>: <span class="s2">"New"</span>,
  780. <span class="s2">"handling_days_max"</span>: 0,
  781. <span class="s2">"handling_days_min"</span>: 0,
  782. <span class="s2">"international"</span>: <span class="nb">false</span>,
  783. <span class="s2">"merchant_id"</span>: <span class="s2">"ATVPDKIKX0DER"</span>,
  784. <span class="s2">"offerlisting_id"</span>: <span class="s2">"lUai8vEbhC%2F2vYZDwaePlc4baWiHzAy9XJncUR%2FpQ9l4VOrs%2FfpYt4ZtreQaB%2BPL1xJwz5OpIc%2BJjyymHg3iv4YkZvWy5z7flil7n7lUDWNPY76YUhMNdw%3D%3D"</span>,
  785. <span class="s2">"price"</span>: 9.79,
  786. <span class="s2">"ship_price"</span>: 0
  787. <span class="s2">"prime"</span>: <span class="nb">true</span>,
  788. <span class="s2">"prime_only"</span>: <span class="nb">false</span>,
  789. <span class="s2">"seller_name"</span>: <span class="s2">"Amazon.com"</span>,
  790. <span class="s2">"seller_num_ratings"</span>: 1000000,
  791. <span class="s2">"seller_percent_positive"</span>: 100
  792. <span class="o">}</span>
  793. <span class="o">]</span>
  794. <span class="o">}</span>
  795. </code></pre>
  796. <h3 id="response-attributes">Response attributes</h3>
  797. <table><thead>
  798. <tr>
  799. <th>Attribute</th>
  800. <th>Type</th>
  801. <th>Description</th>
  802. </tr>
  803. </thead><tbody>
  804. <tr>
  805. <td>status</td>
  806. <td>String</td>
  807. <td>Possible values are <code class="prettyprint">processing</code>, <code class="prettyprint">failed</code>, or <code class="prettyprint">completed</code>. You will only see <code class="prettyprint">processing</code> if <code class="prettyprint">async: true</code> was set on the request.</td>
  808. </tr>
  809. <tr>
  810. <td>retailer</td>
  811. <td>String</td>
  812. <td>The retailer for the product offers</td>
  813. </tr>
  814. <tr>
  815. <td>offers</td>
  816. <td>Array</td>
  817. <td>An array of <a href="#product-offer-object">product offer objects</a> for a particular product on a retailer</td>
  818. </tr>
  819. </tbody></table>
  820. <div name="object-reference" data-unique="object-reference"></div><h1 id="object-reference">Object reference</h1>
  821. <div name="product-object" data-unique="product-object"></div><h2 id="product-object">Product object</h2>
  822. <blockquote>
  823. <p>Example product object</p>
  824. </blockquote>
  825. <pre class="highlight shell" style="display: block;"><code><span class="o">{</span>
  826. <span class="s2">"product_id"</span>: <span class="s2">"0923568964"</span>,
  827. <span class="s2">"quantity"</span>: 1,
  828. <span class="s2">"seller_selection_criteria"</span>: <span class="o">{</span>
  829. <span class="s2">"prime"</span>: <span class="nb">true</span>,
  830. <span class="s2">"handling_days_max"</span>: 6,
  831. <span class="s2">"condition_in"</span>: <span class="o">[</span><span class="s2">"New"</span><span class="o">]</span>,
  832. <span class="o">}</span>
  833. <span class="o">}</span>
  834. </code></pre>
  835. <table><thead>
  836. <tr>
  837. <th>Attribute</th>
  838. <th>Type</th>
  839. <th>Description</th>
  840. </tr>
  841. </thead><tbody>
  842. <tr>
  843. <td>product_id</td>
  844. <td>String</td>
  845. <td>The retailer’s unique identifier for the product. Note that Zinc
  846. does not support digital purchases or Amazon prime pantry items.</td>
  847. </tr>
  848. <tr>
  849. <td>quantity</td>
  850. <td>Number</td>
  851. <td>The number of products to purchase.</td>
  852. </tr>
  853. <tr>
  854. <td>seller_selection_criteria</td>
  855. <td>Object</td>
  856. <td>A <a href="#seller-selection-criteria-object">seller selection criteria</a>
  857. object containing information about which offers to choose when there
  858. are multiple offers available. If the seller selection criteria object
  859. is not included for a product, the seller selection criteria will
  860. default to <code class="prettyprint">"prime": true</code>, <code class="prettyprint">"handling_days_max": 6</code>, and <code class="prettyprint">"condition_in": ["New"]</code>.</td>
  861. </tr>
  862. </tbody></table>
  863. <div name="seller-selection-criteria-object" data-unique="seller-selection-criteria-object"></div><h2 id="seller-selection-criteria-object">Seller selection criteria object</h2>
  864. <blockquote>
  865. <p>Example seller selection criteria object</p>
  866. </blockquote>
  867. <pre class="highlight shell" style="display: block;"><code><span class="o">{</span>
  868. <span class="s2">"addon"</span>: <span class="nb">false</span>,
  869. <span class="s2">"condition_in"</span>: <span class="o">[</span><span class="s2">"New"</span><span class="o">]</span>,
  870. <span class="s2">"handling_days_max"</span>: 6,
  871. <span class="s2">"max_item_price"</span>: 5350
  872. <span class="s2">"min_seller_num_ratings"</span>: 100,
  873. <span class="s2">"prime"</span>: <span class="nb">true</span>,
  874. <span class="o">}</span>
  875. </code></pre>
  876. <p>Seller selection criteria allow you to filter multiple offers for a
  877. product from a retailer. They give you fine grained control when a
  878. retailer has multiple offers for a single product. This happens
  879. frequently when third party or affiliated merchants are selling on a
  880. platform, such as o Amazon.</p>
  881. <p>The seller selection criteria serve as a series of optional filters
  882. to narrow down the potential set of offers to something reasonable.
  883. After all the filters have been applied, Zinc will select the cheapest
  884. offer that is still available. For example, if <code class="prettyprint">"handling_days_max": 6</code> is applied, then the Zinc API will order the cheapest offer where the shipping will arrive in 6 days or less.</p>
  885. <table><thead>
  886. <tr>
  887. <th>Attribute</th>
  888. <th>Type</th>
  889. <th>Description</th>
  890. </tr>
  891. </thead><tbody>
  892. <tr>
  893. <td>addon</td>
  894. <td>Boolean</td>
  895. <td>(Amazon only) Specifies whether the selected offer should be an addon item</td>
  896. </tr>
  897. <tr>
  898. <td>buy_box</td>
  899. <td>Boolean</td>
  900. <td>(Amazon only) Specifies whether the selected offer should be Amazon’s default buy box offer</td>
  901. </tr>
  902. <tr>
  903. <td>condition_in</td>
  904. <td>Array</td>
  905. <td>An array of item conditions that the Zinc API must order from</td>
  906. </tr>
  907. <tr>
  908. <td>condition_not_in</td>
  909. <td>Array</td>
  910. <td>An array of item conditions that the Zinc API must not order from</td>
  911. </tr>
  912. <tr>
  913. <td>first_party_seller</td>
  914. <td>Boolean</td>
  915. <td>Is the seller first-party? e.g. sold by Walmart.com on walmart</td>
  916. </tr>
  917. <tr>
  918. <td>handling_days_max</td>
  919. <td>Number</td>
  920. <td>The maximum number of allowable days for shipping and handling</td>
  921. </tr>
  922. <tr>
  923. <td>international</td>
  924. <td>Boolean</td>
  925. <td>Specifies whether the item should come from an international supplier</td>
  926. </tr>
  927. <tr>
  928. <td>max_item_price</td>
  929. <td>Number</td>
  930. <td>The maximum allowable price in cents for an item</td>
  931. </tr>
  932. <tr>
  933. <td>merchant_id_in</td>
  934. <td>Array</td>
  935. <td>An array of merchant ids that the Zinc API must order from</td>
  936. </tr>
  937. <tr>
  938. <td>merchant_id_not_in</td>
  939. <td>Array</td>
  940. <td>An array of merchant ids that the Zinc API must not order from</td>
  941. </tr>
  942. <tr>
  943. <td>min_seller_num_ratings</td>
  944. <td>Number</td>
  945. <td>(Amazon only) The minimum number of ratings required for an Amazon seller’s offer to be selected</td>
  946. </tr>
  947. <tr>
  948. <td>min_seller_percent_positive_feedback</td>
  949. <td>Number</td>
  950. <td>(Amazon only) The minimum percentage of positive ratings of an Amazon seller for their offer to be selected</td>
  951. </tr>
  952. <tr>
  953. <td>prime</td>
  954. <td>Boolean</td>
  955. <td>(Amazon only) Specifies whether the selected offer should be an Amazon Prime offer</td>
  956. </tr>
  957. </tbody></table>
  958. <div name="shipping-object" data-unique="shipping-object"></div><h2 id="shipping-object">Shipping object</h2>
  959. <blockquote>
  960. <p>Example shipping object</p>
  961. </blockquote>
  962. <pre class="highlight shell" style="display: block;"><code><span class="o">{</span>
  963. <span class="s2">"order_by"</span>: <span class="s2">"price"</span>,
  964. <span class="s2">"max_days"</span>: 5,
  965. <span class="s2">"max_price"</span>: 1000
  966. <span class="o">}</span>
  967. </code></pre>
  968. <p>The shipping object gives you fine grained control over shipping
  969. speeds on your orders. Typically, there is a tradeoff between how fast
  970. your order arrives and the cost of shipping. The shipping object gives
  971. you a way to make sure that you don’t go over budget and that your order
  972. still arrives on time.</p>
  973. <table><thead>
  974. <tr>
  975. <th>Attribute</th>
  976. <th>Type</th>
  977. <th>Description</th>
  978. </tr>
  979. </thead><tbody>
  980. <tr>
  981. <td>order_by</td>
  982. <td>String</td>
  983. <td>The ordering of available shipping methods that meet the desired criteria. Available values are <code class="prettyprint">price</code> or <code class="prettyprint">speed</code>. If ordering by price, then the Zinc API will choose the cheapest shipping method that meets the desired criteria, while <code class="prettyprint">speed</code> will choose the fastest shipping method meeting the criteria.</td>
  984. </tr>
  985. <tr>
  986. <td>max_days</td>
  987. <td>Number</td>
  988. <td>The maximum number of days allowed for shipping on the order.</td>
  989. </tr>
  990. <tr>
  991. <td>max_price</td>
  992. <td>Number</td>
  993. <td>The maximum price in cents allowed for the shipping cost of the order.</td>
  994. </tr>
  995. </tbody></table>
  996. <div name="address-object" data-unique="address-object"></div><h2 id="address-object">Address object</h2>
  997. <blockquote>
  998. <p>Example address object</p>
  999. </blockquote>
  1000. <pre class="highlight shell" style="display: block;"><code><span class="o">{</span>
  1001. <span class="s2">"first_name"</span>: <span class="s2">"Tim"</span>,
  1002. <span class="s2">"last_name"</span>: <span class="s2">"Beaver"</span>,
  1003. <span class="s2">"address_line1"</span>: <span class="s2">"77 Massachusetts Avenue"</span>,
  1004. <span class="s2">"address_line2"</span>: <span class="s2">""</span>,
  1005. <span class="s2">"zip_code"</span>: <span class="s2">"02139"</span>,
  1006. <span class="s2">"city"</span>: <span class="s2">"Cambridge"</span>,
  1007. <span class="s2">"state"</span>: <span class="s2">"MA"</span>,
  1008. <span class="s2">"country"</span>: <span class="s2">"US"</span>,
  1009. <span class="s2">"phone_number"</span>: <span class="s2">"5551230101"</span>
  1010. <span class="o">}</span>
  1011. </code></pre>
  1012. <table><thead>
  1013. <tr>
  1014. <th>Attribute</th>
  1015. <th>Type</th>
  1016. <th>Description</th>
  1017. </tr>
  1018. </thead><tbody>
  1019. <tr>
  1020. <td>first_name</td>
  1021. <td>String</td>
  1022. <td>The first name of the addressee</td>
  1023. </tr>
  1024. <tr>
  1025. <td>last_name</td>
  1026. <td>String</td>
  1027. <td>The last name of the addressee</td>
  1028. </tr>
  1029. <tr>
  1030. <td>address_line1</td>
  1031. <td>String</td>
  1032. <td>The house number and street name</td>
  1033. </tr>
  1034. <tr>
  1035. <td>address_line2</td>
  1036. <td>String</td>
  1037. <td>The suite, post office box, or apartment number (optional)</td>
  1038. </tr>
  1039. <tr>
  1040. <td>zip_code</td>
  1041. <td>String</td>
  1042. <td>The zip code of the address</td>
  1043. </tr>
  1044. <tr>
  1045. <td>city</td>
  1046. <td>String</td>
  1047. <td>The city of the address</td>
  1048. </tr>
  1049. <tr>
  1050. <td>state</td>
  1051. <td>String</td>
  1052. <td>The USPS abbreviation for the state of the address (e.g. AK)</td>
  1053. </tr>
  1054. <tr>
  1055. <td>country</td>
  1056. <td>String</td>
  1057. <td>The ISO abbreviation for the country of the address (e.g. US). A list of all available two-letter country codes can be found <a href="http://www.theodora.com/country_digraphs.html">here</a>.</td>
  1058. </tr>
  1059. <tr>
  1060. <td>phone_number</td>
  1061. <td>String</td>
  1062. <td>The phone number associated with the address</td>
  1063. </tr>
  1064. </tbody></table>
  1065. <div name="payment-method-object" data-unique="payment-method-object"></div><h2 id="payment-method-object">Payment method object</h2>
  1066. <blockquote>
  1067. <p>Example payment object</p>
  1068. </blockquote>
  1069. <pre class="highlight shell" style="display: block;"><code><span class="o">{</span>
  1070. <span class="s2">"name_on_card"</span>: <span class="s2">"Ben Bitdiddle"</span>,
  1071. <span class="s2">"number"</span>: <span class="s2">"5555555555554444"</span>,
  1072. <span class="s2">"security_code"</span>: <span class="s2">"123"</span>,
  1073. <span class="s2">"expiration_month"</span>: 1,
  1074. <span class="s2">"expiration_year"</span>: 2015,
  1075. <span class="s2">"use_gift"</span>: <span class="nb">false</span>
  1076. <span class="o">}</span>
  1077. </code></pre>
  1078. <p>The recommended way to pay for purchases on a retailer is by using
  1079. gift card balance already applied to an account. Gift cards are
  1080. supported on <code class="prettyprint">amazon</code>, <code class="prettyprint">amazon_uk</code>, <code class="prettyprint">amazon_ca</code>, and <code class="prettyprint">walmart</code>. To use the existing gift balance on the account, simply pass <code class="prettyprint">{"use_gift": true}</code> as the payment method object.</p>
  1081. <p>To use a credit card, you must include the <code class="prettyprint">name_on_card</code>, <code class="prettyprint">number</code>, <code class="prettyprint">security_code</code>, <code class="prettyprint">expiration_month</code>, and <code class="prettyprint">expiration_year</code>
  1082. fields. For Amazon, you should only have a single credit card
  1083. associated with an account which should be the same as the card passed
  1084. in the payment method object. This allows the system to correctly answer
  1085. any payment-related security questions.</p>
  1086. <table><thead>
  1087. <tr>
  1088. <th>Attribute</th>
  1089. <th>Type</th>
  1090. <th>Description</th>
  1091. </tr>
  1092. </thead><tbody>
  1093. <tr>
  1094. <td>name_on_card</td>
  1095. <td>String</td>
  1096. <td>The full name on the credit/debit card</td>
  1097. </tr>
  1098. <tr>
  1099. <td>number</td>
  1100. <td>String</td>
  1101. <td>The credit/debit card number</td>
  1102. </tr>
  1103. <tr>
  1104. <td>security_code</td>
  1105. <td>String</td>
  1106. <td>The card verification value on the back of the credit/debit card</td>
  1107. </tr>
  1108. <tr>
  1109. <td>expiration_month</td>
  1110. <td>Number</td>
  1111. <td>The month of the expiration of the card (e.g. January is 1, February is 2)</td>
  1112. </tr>
  1113. <tr>
  1114. <td>expiration_year</td>
  1115. <td>Number</td>
  1116. <td>The year of the expiration of the card (e.g. 2016)</td>
  1117. </tr>
  1118. <tr>
  1119. <td>use_gift</td>
  1120. <td>Boolean</td>
  1121. <td>Whether or not to use the gift balance on the retailer account. If
  1122. true, then the gift balance will be used for payment. Only works for
  1123. retailers which support gift balance (Amazon and Walmart).</td>
  1124. </tr>
  1125. </tbody></table>
  1126. <div name="webhooks-object" data-unique="webhooks-object"></div><h2 id="webhooks-object">Webhooks object</h2>
  1127. <p>Webhooks let you register a URL that the Zinc API notifies whenever
  1128. an event happens pertaining to your account. When an event occurs, we
  1129. will send a <code class="prettyprint">POST</code> request to the URL specified in the webhooks object. If no URL was specified, then a webhook will not be sent. The body of the <code class="prettyprint">POST</code> request is the standard raw JSON response for that object.</p>
  1130. <p>As an example, let’s say you have just created an order via the Zinc API. Every time the order status changes, a <code class="prettyprint">POST</code> request will be sent to the URL that you passed in the <code class="prettyprint">status_updated</code> parameter of the webhooks object. The body will mimic the response received from the standard <code class="prettyprint">GET https://api.zinc.io/v1/orders/&lt;request_id&gt;</code> request. A webhook will also be sent if order fails, gets placed, or if tracking gets updated.</p>
  1131. <blockquote>
  1132. <p>Example webhooks object</p>
  1133. </blockquote>
  1134. <pre class="highlight shell" style="display: block;"><code><span class="o">{</span>
  1135. <span class="s2">"request_succeeded"</span>: <span class="s2">"http://mywebsite.com/zinc/request_placed"</span>,
  1136. <span class="s2">"request_failed"</span>: <span class="s2">"http://mywebsite.com/zinc/request_failed"</span>,
  1137. <span class="s2">"tracking_obtained"</span>: <span class="s2">"http://mywebsite.com/zinc/tracking_obtained"</span>,
  1138. <span class="s2">"status_updated"</span>: <span class="s2">"http://mywebsite.com/zinc/status_updated"</span>
  1139. <span class="o">}</span>
  1140. </code></pre>
  1141. <table><thead>
  1142. <tr>
  1143. <th>Attribute</th>
  1144. <th>Type</th>
  1145. <th>Description</th>
  1146. </tr>
  1147. </thead><tbody>
  1148. <tr>
  1149. <td>request_succeeded</td>
  1150. <td>String</td>
  1151. <td>The webhook URL to send data to when a request succeeds</td>
  1152. </tr>
  1153. <tr>
  1154. <td>request_failed</td>
  1155. <td>String</td>
  1156. <td>The webhook URL to send data to when a request fails</td>
  1157. </tr>
  1158. <tr>
  1159. <td>tracking_obtained</td>
  1160. <td>String</td>
  1161. <td>The webhook URL to send data to when tracking for an order is retrieved</td>
  1162. </tr>
  1163. <tr>
  1164. <td>status_updated</td>
  1165. <td>String</td>
  1166. <td>The webhook URL to send data to when the status of a request is updated</td>
  1167. </tr>
  1168. </tbody></table>
  1169. <div name="retailer-credentials-object" data-unique="retailer-credentials-object"></div><h2 id="retailer-credentials-object">Retailer credentials object</h2>
  1170. <blockquote>
  1171. <p>Example retailer credentials object</p>
  1172. </blockquote>
  1173. <pre class="highlight shell" style="display: block;"><code><span class="o">{</span>
  1174. <span class="s2">"email"</span>: <span class="s2">"timbeaver@gmail.com"</span>,
  1175. <span class="s2">"password"</span>: <span class="s2">"myRetailerPassword"</span>
  1176. <span class="o">}</span>
  1177. </code></pre>
  1178. <table><thead>
  1179. <tr>
  1180. <th>Attribute</th>
  1181. <th>Type</th>
  1182. <th>Description</th>
  1183. </tr>
  1184. </thead><tbody>
  1185. <tr>
  1186. <td>email</td>
  1187. <td>String</td>
  1188. <td>The email for the retailer account</td>
  1189. </tr>
  1190. <tr>
  1191. <td>password</td>
  1192. <td>String</td>
  1193. <td>The password for the retailer account</td>
  1194. </tr>
  1195. </tbody></table>
  1196. <div name="price-components-object" data-unique="price-components-object"></div><h2 id="price-components-object">Price components object</h2>
  1197. <blockquote>
  1198. <p>Example price components object</p>
  1199. </blockquote>
  1200. <pre class="highlight shell" style="display: block;"><code><span class="o">{</span>
  1201. <span class="s2">"shipping"</span> : 0,
  1202. <span class="s2">"subtotal"</span> : 1999,
  1203. <span class="s2">"tax"</span> : 0,
  1204. <span class="s2">"total"</span> : 1999
  1205. <span class="o">}</span>
  1206. </code></pre>
  1207. <table><thead>
  1208. <tr>
  1209. <th>Attribute</th>
  1210. <th>Type</th>
  1211. <th>Description</th>
  1212. </tr>
  1213. </thead><tbody>
  1214. <tr>
  1215. <td>shipping</td>
  1216. <td>Number</td>
  1217. <td>The price for shipping</td>
  1218. </tr>
  1219. <tr>
  1220. <td>subtotal</td>
  1221. <td>Number</td>
  1222. <td>The total price of the order before tax and other price adjustments</td>
  1223. </tr>
  1224. <tr>
  1225. <td>tax</td>
  1226. <td>Number</td>
  1227. <td>The tax collected on the order</td>
  1228. </tr>
  1229. <tr>
  1230. <td>total</td>
  1231. <td>Number</td>
  1232. <td>The total price paid for the order</td>
  1233. </tr>
  1234. <tr>
  1235. <td>gift_certificate</td>
  1236. <td>Number</td>
  1237. <td>(Optional) The amount of value used on a gift certificate placed on the account</td>
  1238. </tr>
  1239. </tbody></table>
  1240. <div name="merchant-order-ids-object" data-unique="merchant-order-ids-object"></div><h2 id="merchant-order-ids-object">Merchant order ids object</h2>
  1241. <blockquote>
  1242. <p>Example merchant order ids object</p>
  1243. </blockquote>
  1244. <pre class="highlight shell" style="display: block;"><code><span class="o">{</span>
  1245. <span class="s2">"merchant_order_id"</span> : <span class="s2">"112-1234567-7272727"</span>,
  1246. <span class="s2">"merchant"</span> : <span class="s2">"amazon"</span>,
  1247. <span class="s2">"account"</span> : <span class="s2">"timbeaver@gmail.com"</span>,
  1248. <span class="s2">"placed_at"</span> : <span class="s2">"2014-07-02T23:51:08.366Z"</span>
  1249. <span class="o">}</span>
  1250. </code></pre>
  1251. <table><thead>
  1252. <tr>
  1253. <th>Attribute</th>
  1254. <th>Type</th>
  1255. <th>Description</th>
  1256. </tr>
  1257. </thead><tbody>
  1258. <tr>
  1259. <td>merchant_order_id</td>
  1260. <td>String</td>
  1261. <td>The identifier provided by the retailer for the order that was placed</td>
  1262. </tr>
  1263. <tr>
  1264. <td>merchant</td>
  1265. <td>String</td>
  1266. <td>The retailer on which the order was placed</td>
  1267. </tr>
  1268. <tr>
  1269. <td>account</td>
  1270. <td>String</td>
  1271. <td>The account on which the order was placed</td>
  1272. </tr>
  1273. <tr>
  1274. <td>placed_at</td>
  1275. <td>Date</td>
  1276. <td>The date and time at which the order was placed</td>
  1277. </tr>
  1278. </tbody></table>
  1279. <div name="product-offer-object" data-unique="product-offer-object"></div><h2 id="product-offer-object">Product offer object</h2>
  1280. <blockquote>
  1281. <p>Example product offer object</p>
  1282. </blockquote>
  1283. <pre class="highlight shell" style="display: block;"><code><span class="o">{</span>
  1284. <span class="s2">"addon"</span>: <span class="nb">false</span>,
  1285. <span class="s2">"condition"</span>: <span class="s2">"New"</span>,
  1286. <span class="s2">"handling_days_max"</span>: 0,
  1287. <span class="s2">"handling_days_min"</span>: 0,
  1288. <span class="s2">"international"</span>: <span class="nb">false</span>,
  1289. <span class="s2">"merchant_id"</span>: <span class="s2">"ATVPDKIKX0DER"</span>,
  1290. <span class="s2">"offerlisting_id"</span>: <span class="s2">"lUai8vEbhC%2F2vYZDwaePlc4baWiHzAy9XJncUR%2FpQ9l4VOrs%2FfpYt4ZtreQaB%2BPL1xJwz5OpIc%2BJjyymHg3iv4YkZvWy5z7flil7n7lUDWNPY76YUhMNdw%3D%3D"</span>,
  1291. <span class="s2">"price"</span>: 9.79,
  1292. <span class="s2">"ship_price"</span>: 0
  1293. <span class="s2">"prime"</span>: <span class="nb">true</span>,
  1294. <span class="s2">"prime_only"</span>: <span class="nb">false</span>,
  1295. <span class="s2">"seller_name"</span>: <span class="s2">"Amazon.com"</span>,
  1296. <span class="s2">"seller_num_ratings"</span>: 1000000,
  1297. <span class="s2">"seller_percent_positive"</span>: 100
  1298. <span class="o">}</span>
  1299. </code></pre>
  1300. <table><thead>
  1301. <tr>
  1302. <th>Attribute</th>
  1303. <th>Type</th>
  1304. <th>Description</th>
  1305. </tr>
  1306. </thead><tbody>
  1307. <tr>
  1308. <td>addon</td>
  1309. <td>Boolean</td>
  1310. <td>Whether or not the product is an addon item that can only be purchased in a bundle</td>
  1311. </tr>
  1312. <tr>
  1313. <td>condition</td>
  1314. <td>String</td>
  1315. <td>The condition of the product. Possible values are <code class="prettyprint">New</code>, <code class="prettyprint">Refurbished</code>, <code class="prettyprint">Used - Like New</code>, <code class="prettyprint">Used - Very Good</code>, <code class="prettyprint">Used - Good</code>, <code class="prettyprint">Used - Acceptable</code>, <code class="prettyprint">Unacceptable</code>.</td>
  1316. </tr>
  1317. <tr>
  1318. <td>handling_days_max</td>
  1319. <td>Number</td>
  1320. <td>The maximum number of days required for shipping and handling</td>
  1321. </tr>
  1322. <tr>
  1323. <td>handling_days_min</td>
  1324. <td>Number</td>
  1325. <td>The minimum number of days required for shipping and handling</td>
  1326. </tr>
  1327. <tr>
  1328. <td>international</td>
  1329. <td>Boolean</td>
  1330. <td>Whether or not the product ships from outside of the United States</td>
  1331. </tr>
  1332. <tr>
  1333. <td>merchant_id</td>
  1334. <td>String</td>
  1335. <td>The merchant’s unique identifier for the product</td>
  1336. </tr>
  1337. <tr>
  1338. <td>offerlisting_id</td>
  1339. <td>String</td>
  1340. <td>(<code class="prettyprint">amazon</code> and <code class="prettyprint">amazon_uk</code> only). The unique identifier that identifies an item sold by any merchant on Amazon</td>
  1341. </tr>
  1342. <tr>
  1343. <td>price</td>
  1344. <td>Number</td>
  1345. <td>The price of the item, not including shipping</td>
  1346. </tr>
  1347. <tr>
  1348. <td>ship_price</td>
  1349. <td>Number</td>
  1350. <td>The price of the shipping for the item</td>
  1351. </tr>
  1352. <tr>
  1353. <td>prime</td>
  1354. <td>Boolean</td>
  1355. <td>(<code class="prettyprint">amazon</code> and <code class="prettyprint">amazon_uk</code> only). Whether or not the product ships using Amazon Prime</td>
  1356. </tr>
  1357. <tr>
  1358. <td>prime_only</td>
  1359. <td>Boolean</td>
  1360. <td>(<code class="prettyprint">amazon</code> and <code class="prettyprint">amazon_uk</code> only). Whether or not the product only ships using Amazon Prime</td>
  1361. </tr>
  1362. <tr>
  1363. <td>seller_name</td>
  1364. <td>String</td>
  1365. <td>The name of the seller of the current offer</td>
  1366. </tr>
  1367. <tr>
  1368. <td>seller_num_ratings</td>
  1369. <td>Number</td>
  1370. <td>The number of ratings that the seller has accumulated</td>
  1371. </tr>
  1372. <tr>
  1373. <td>seller_percent_positive</td>
  1374. <td>Number</td>
  1375. <td>Number between 0 and 100 denoting the percentage of positive ratings the seller has received</td>
  1376. </tr>
  1377. </tbody></table>
  1378. <div name="tracking-object" data-unique="tracking-object"></div><h2 id="tracking-object">Tracking object</h2>
  1379. <blockquote>
  1380. <p>Example tracking object</p>
  1381. </blockquote>
  1382. <pre class="highlight shell" style="display: block;"><code><span class="o">{</span>
  1383. <span class="s2">"merchant_order_id"</span>: <span class="s2">"112-1234567-7272727"</span>,
  1384. <span class="s2">"carrier"</span>: <span class="s2">"UPS"</span>,
  1385. <span class="s2">"tracking_number"</span>: <span class="s2">"1Z9999999999999999"</span>,
  1386. <span class="s2">"tracking_url"</span>: <span class="s2">"https://some-url.com/tracking-number/1Z9999999999999999"</span>,
  1387. <span class="s2">"product_id"</span>: <span class="s2">"0923568964"</span>
  1388. <span class="o">}</span>
  1389. </code></pre>
  1390. <table><thead>
  1391. <tr>
  1392. <th>Attribute</th>
  1393. <th>Type</th>
  1394. <th>Description</th>
  1395. </tr>
  1396. </thead><tbody>
  1397. <tr>
  1398. <td>merchant_order_id</td>
  1399. <td>String</td>
  1400. <td>The corresponding order identifier for which tracking was obtained.</td>
  1401. </tr>
  1402. <tr>
  1403. <td>carrier</td>
  1404. <td>String</td>
  1405. <td>(Optional) The logistics carrier that was used to ship the package.</td>
  1406. </tr>
  1407. <tr>
  1408. <td>tracking_number</td>
  1409. <td>String</td>
  1410. <td>(Optional) The tracking number from the logistics carrier.</td>
  1411. </tr>
  1412. <tr>
  1413. <td>tracking_url</td>
  1414. <td>String</td>
  1415. <td>(Optional) The tracking url that can be used to find the carrier and tracking number for a package.</td>
  1416. </tr>
  1417. <tr>
  1418. <td>product_id</td>
  1419. <td>String</td>
  1420. <td>(Optional) The corresponding product for which tracking was obtained.</td>
  1421. </tr>
  1422. </tbody></table>
  1423. <div name="errors" data-unique="errors"></div><h1 id="errors">Errors</h1>
  1424. <blockquote>
  1425. <p>Example error response</p>
  1426. </blockquote>
  1427. <pre class="highlight shell" style="display: block;"><code><span class="o">{</span>
  1428. <span class="s2">"_type"</span>: <span class="s2">"error"</span>,
  1429. <span class="s2">"code"</span>: <span class="s2">"product_unavailable"</span>,
  1430. <span class="s2">"message"</span>: <span class="s2">"One of the products you selected is unavailable."</span>,
  1431. <span class="s2">"data"</span>: <span class="o">{</span><span class="s1">'product_id'</span>: <span class="s1">'018293801'</span><span class="o">}</span>
  1432. <span class="o">}</span>
  1433. </code></pre>
  1434. <p>If there is an error processing a request, the result endpoint will return an error object containing three fields: <code class="prettyprint">code</code>, <code class="prettyprint">message</code>, and <code class="prettyprint">data</code>.</p>
  1435. <p>The <code class="prettyprint">code</code> field provides a short, unique error code describing the error situation. The <code class="prettyprint">message</code> field provides a human readable message describing the error and is intended for the developer and not the end user. The <code class="prettyprint">data</code>
  1436. field contains specific information related to the error (for example,
  1437. the maximum quantity allowed and the desired quantity would be shown for
  1438. a <code class="prettyprint">max_quantity_exceeded</code> error).</p>
  1439. <p>The Zinc API uses the following errors:</p>
  1440. <table><thead>
  1441. <tr>
  1442. <th>Error Code</th>
  1443. <th>Meaning</th>
  1444. </tr>
  1445. </thead><tbody>
  1446. <tr>
  1447. <td>account_login_failed</td>
  1448. <td>We were unable to log in to the retailer with the username and password you provided.</td>
  1449. </tr>
  1450. <tr>
  1451. <td>add_on_item</td>
  1452. <td>Add-on items cannot be ordered individually.</td>
  1453. </tr>
  1454. <tr>
  1455. <td>additional_information_required</td>
  1456. <td>The retailer asked for additional account verification questions. If
  1457. using the API, please add a field ‘phone_number’ in the billing address
  1458. that matches your billing telephone number.</td>
  1459. </tr>
  1460. <tr>
  1461. <td>billing_address_refused</td>
  1462. <td>The billing address you provided was refused by the retailer.</td>
  1463. </tr>
  1464. <tr>
  1465. <td>brand_not_accepted</td>
  1466. <td>Your credit card brand is not accepted with this merchant.</td>
  1467. </tr>
  1468. <tr>
  1469. <td>credit_card_declined</td>
  1470. <td>The credit card you entered was declined.</td>
  1471. </tr>
  1472. <tr>
  1473. <td>duplicate_order</td>
  1474. <td>This order is a duplicate.</td>
  1475. </tr>
  1476. <tr>
  1477. <td>expired_product_id</td>
  1478. <td>The product_id you used is no longer supported by the retailer.</td>
  1479. </tr>
  1480. <tr>
  1481. <td>incomplete_account_setup</td>
  1482. <td>You attempted to place an order with an account that has not been fully set up.</td>
  1483. </tr>
  1484. <tr>
  1485. <td>insufficient_variants</td>
  1486. <td>You did not select all required variants for a product.</td>
  1487. </tr>
  1488. <tr>
  1489. <td>internal_error</td>
  1490. <td>Zinc or the retailer you requested is experiencing outages. Please try again or contact support@zinc.io if this error persists.</td>
  1491. </tr>
  1492. <tr>
  1493. <td>invalid_card_number</td>
  1494. <td>The credit card number you entered is not valid.</td>
  1495. </tr>
  1496. <tr>
  1497. <td>invalid_client_token</td>
  1498. <td>Your client token is invalid.</td>
  1499. </tr>
  1500. <tr>
  1501. <td>invalid_expiration_date</td>
  1502. <td>The expiration date on your credit card is not valid.</td>
  1503. </tr>
  1504. <tr>
  1505. <td>invalid_gift_options</td>
  1506. <td>The gift options you provided were rejected by the retailer.</td>
  1507. </tr>
  1508. <tr>
  1509. <td>invalid_json</td>
  1510. <td>The JSON in your request could not be parsed.</td>
  1511. </tr>
  1512. <tr>
  1513. <td>invalid_login_credentials</td>
  1514. <td>The email and password you entered were incorrect.</td>
  1515. </tr>
  1516. <tr>
  1517. <td>invalid_payment_method</td>
  1518. <td>The payment method provided is not available on the retailer.</td>
  1519. </tr>
  1520. <tr>
  1521. <td>invalid_promo_code</td>
  1522. <td>One of the promotion code you entered was not valid.</td>
  1523. </tr>
  1524. <tr>
  1525. <td>invalid_quantity</td>
  1526. <td>The quantity for one of the products does not match the one available on the retailer.</td>
  1527. </tr>
  1528. <tr>
  1529. <td>invalid_request</td>
  1530. <td>Validation failed on the request.</td>
  1531. </tr>
  1532. <tr>
  1533. <td>invalid_request_id</td>
  1534. <td>The provided request_id is invalid.</td>
  1535. </tr>
  1536. <tr>
  1537. <td>invalid_security_code</td>
  1538. <td>The security code you entered was declined.</td>
  1539. </tr>
  1540. <tr>
  1541. <td>invalid_shipping_method</td>
  1542. <td>The shipping method you selected was not valid.</td>
  1543. </tr>
  1544. <tr>
  1545. <td>invalid_variant</td>
  1546. <td>One of the product variants you provided was not valid.</td>
  1547. </tr>
  1548. <tr>
  1549. <td>manual_review_required</td>
  1550. <td>This order is under manual review by Zinc – please check back later for the status of this order.</td>
  1551. </tr>
  1552. <tr>
  1553. <td>max_price_exceeded</td>
  1554. <td>The retailers final price exceeds the maximum price.</td>
  1555. </tr>
  1556. <tr>
  1557. <td>max_quantity_exceeded</td>
  1558. <td>You have exceeded the maximum quantity available for a specific product.</td>
  1559. </tr>
  1560. <tr>
  1561. <td>no_free_shipping</td>
  1562. <td>Free shipping is not available for the item(s) you selected.</td>
  1563. </tr>
  1564. <tr>
  1565. <td>no_gift_shipping</td>
  1566. <td>No gift shipping was available on this order.</td>
  1567. </tr>
  1568. <tr>
  1569. <td>no_two_day_shipping</td>
  1570. <td>Two day shipping (or faster) is not available for the item(s) you selected.</td>
  1571. </tr>
  1572. <tr>
  1573. <td>order_probably_placed</td>
  1574. <td>This order was probably placed, but we were not able to retrieve the merchant order ids.</td>
  1575. </tr>
  1576. <tr>
  1577. <td>payment_info_problem</td>
  1578. <td>There was a problem with your payment information (likely not enough gift balance).</td>
  1579. </tr>
  1580. <tr>
  1581. <td>prime_pantry_not_supported</td>
  1582. <td>Purchasing Prime Pantry items is not supported by the Zinc API.</td>
  1583. </tr>
  1584. <tr>
  1585. <td>product_unavailable</td>
  1586. <td>One of the products you selected is not available on the retailer.
  1587. Either the seller selection criteria did not match any available offers
  1588. or the product is out of stock and not available for purchase.</td>
  1589. </tr>
  1590. <tr>
  1591. <td>request_processing</td>
  1592. <td>Request is currently processing and will complete soon.</td>
  1593. </tr>
  1594. <tr>
  1595. <td>shipping_address_refused</td>
  1596. <td>The shipping address you provided was refused by the retailer.</td>
  1597. </tr>
  1598. <tr>
  1599. <td>shipping_address_unavailable</td>
  1600. <td>The item(s) cannot be shipped to the selected shipping address.</td>
  1601. </tr>
  1602. <tr>
  1603. <td>shipping_method_unavailable</td>
  1604. <td>The selected shipping_method is not available for the selected shipping_address.</td>
  1605. </tr>
  1606. <tr>
  1607. <td>unauthorized_access</td>
  1608. <td>You are not authorized to make this API call. Please contact support@zinc.io.</td>
  1609. </tr>
  1610. </tbody></table>
  1611. </div>
  1612. <div class="dark-box">
  1613. <div class="lang-selector">
  1614. <a href="#" data-language-name="shell" class="active">shell</a>
  1615. </div>
  1616. </div>
  1617. </div>
  1618. </body></html>