Advertisement
Guest User

Untitled

a guest
Oct 6th, 2015
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.26 KB | None | 0 0
  1. {
  2. "orders": [
  3. {
  4. "id": 645,
  5. "order_number": 645,
  6. "created_at": "2015-01-26T20:00:21Z",
  7. "updated_at": "2015-01-26T20:00:21Z",
  8. "completed_at": "2015-01-26T20:00:21Z",
  9. "status": "processing",
  10. "currency": "USD",
  11. "total": "79.87",
  12. "subtotal": "63.97",
  13. "total_line_items_quantity": 3,
  14. "total_tax": "5.90",
  15. "total_shipping": "10.00",
  16. "cart_tax": "5.40",
  17. "shipping_tax": "0.50",
  18. "total_discount": "0.00",
  19. "shipping_methods": "Flat Rate",
  20. "payment_details": {
  21. "method_id": "bacs",
  22. "method_title": "Direct Bank Transfer",
  23. "paid": true
  24. },
  25. "billing_address": {
  26. "first_name": "John",
  27. "last_name": "Doe",
  28. "company": "",
  29. "address_1": "969 Market",
  30. "address_2": "",
  31. "city": "San Francisco",
  32. "state": "CA",
  33. "postcode": "94103",
  34. "country": "US",
  35. "email": "john.doe@example.com",
  36. "phone": "(555) 555-5555"
  37. },
  38. "shipping_address": {
  39. "first_name": "John",
  40. "last_name": "Doe",
  41. "company": "",
  42. "address_1": "969 Market",
  43. "address_2": "",
  44. "city": "San Francisco",
  45. "state": "CA",
  46. "postcode": "94103",
  47. "country": "US"
  48. },
  49. "note": "",
  50. "customer_ip": "127.0.0.1",
  51. "customer_user_agent": "WordPress/4.1; http://example.com",
  52. "customer_id": 2,
  53. "view_order_url": "https://example.com/my-account/view-order/645",
  54. "line_items": [
  55. {
  56. "id": 504,
  57. "subtotal": "43.98",
  58. "subtotal_tax": "4.40",
  59. "total": "43.98",
  60. "total_tax": "4.40",
  61. "price": "21.99",
  62. "quantity": 2,
  63. "tax_class": "reduced-rate",
  64. "name": "Premium Quality",
  65. "product_id": 546,
  66. "sku": "",
  67. "meta": []
  68. },
  69. {
  70. "id": 505,
  71. "subtotal": "19.99",
  72. "subtotal_tax": "1.00",
  73. "total": "19.99",
  74. "total_tax": "1.00",
  75. "price": "19.99",
  76. "quantity": 1,
  77. "tax_class": null,
  78. "name": "Ship Your Idea",
  79. "product_id": 613,
  80. "sku": "",
  81. "meta": [
  82. {
  83. "key": "pa_color",
  84. "label": "Color",
  85. "value": "Black"
  86. }
  87. ]
  88. }
  89. ],
  90. "shipping_lines": [
  91. {
  92. "id": 506,
  93. "method_id": "flat_rate",
  94. "method_title": "Flat Rate",
  95. "total": "10.00"
  96. }
  97. ],
  98. "tax_lines": [
  99. {
  100. "id": 507,
  101. "rate_id": "5",
  102. "code": "US-CA-TAX-1",
  103. "title": "Tax",
  104. "total": "4.40",
  105. "compound": false
  106. },
  107. {
  108. "id": 508,
  109. "rate_id": "4",
  110. "code": "US-STANDARD-1",
  111. "title": "Standard",
  112. "total": "1.50",
  113. "compound": false
  114. }
  115. ],
  116. "fee_lines": [],
  117. "coupon_lines": [],
  118. "customer": {
  119. "id": 2,
  120. "created_at": "2014-11-19T18:34:19Z",
  121. "email": "john.doe@example.com",
  122. "first_name": "",
  123. "last_name": "",
  124. "username": "john.doe",
  125. "last_order_id": "645",
  126. "last_order_date": "2015-01-26T20:00:21Z",
  127. "orders_count": 2,
  128. "total_spent": "19.00",
  129. "avatar_url": "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
  130. "billing_address": {
  131. "first_name": "John",
  132. "last_name": "Doe",
  133. "company": "",
  134. "address_1": "969 Market",
  135. "address_2": "",
  136. "city": "San Francisco",
  137. "state": "CA",
  138. "postcode": "94103",
  139. "country": "US",
  140. "email": "john.doe@example.com",
  141. "phone": "(555) 555-5555"
  142. },
  143. "shipping_address": {
  144. "first_name": "John",
  145. "last_name": "Doe",
  146. "company": "",
  147. "address_1": "969 Market",
  148. "address_2": "",
  149. "city": "San Francisco",
  150. "state": "CA",
  151. "postcode": "94103",
  152. "country": "US"
  153. }
  154. }
  155. },
  156. {
  157. "id": 644,
  158. "order_number": 644,
  159. "created_at": "2015-01-26T19:33:42Z",
  160. "updated_at": "2015-01-26T19:33:42Z",
  161. "completed_at": "2015-01-26T19:33:42Z",
  162. "status": "on-hold",
  163. "currency": "USD",
  164. "total": "44.14",
  165. "subtotal": "30.99",
  166. "total_line_items_quantity": 2,
  167. "total_tax": "3.15",
  168. "total_shipping": "10.00",
  169. "cart_tax": "2.65",
  170. "shipping_tax": "0.50",
  171. "total_discount": "0.00",
  172. "shipping_methods": "Flat Rate",
  173. "payment_details": {
  174. "method_id": "bacs",
  175. "method_title": "Direct Bank Transfer",
  176. "paid": false
  177. },
  178. "billing_address": {
  179. "first_name": "John",
  180. "last_name": "Doe",
  181. "company": "",
  182. "address_1": "969 Market",
  183. "address_2": "",
  184. "city": "San Francisco",
  185. "state": "CA",
  186. "postcode": "94103",
  187. "country": "US",
  188. "email": "john.doe@example.com",
  189. "phone": "(555) 555-5555"
  190. },
  191. "shipping_address": {
  192. "first_name": "John",
  193. "last_name": "Doe",
  194. "company": "",
  195. "address_1": "969 Market",
  196. "address_2": "",
  197. "city": "San Francisco",
  198. "state": "CA",
  199. "postcode": "94103",
  200. "country": "US"
  201. },
  202. "note": "",
  203. "customer_ip": "127.0.0.1",
  204. "customer_user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.91 Safari/537.36",
  205. "customer_id": 2,
  206. "view_order_url": "https://example.com/my-account/view-order/644",
  207. "line_items": [
  208. {
  209. "id": 499,
  210. "subtotal": "21.99",
  211. "subtotal_tax": "2.20",
  212. "total": "21.99",
  213. "total_tax": "2.20",
  214. "price": "21.99",
  215. "quantity": 1,
  216. "tax_class": "reduced-rate",
  217. "name": "Premium Quality",
  218. "product_id": 546,
  219. "sku": "",
  220. "meta": []
  221. },
  222. {
  223. "id": 500,
  224. "subtotal": "9.00",
  225. "subtotal_tax": "0.45",
  226. "total": "9.00",
  227. "total_tax": "0.45",
  228. "price": "9.00",
  229. "quantity": 1,
  230. "tax_class": null,
  231. "name": "Woo Album #4",
  232. "product_id": 96,
  233. "sku": "",
  234. "meta": []
  235. }
  236. ],
  237. "shipping_lines": [
  238. {
  239. "id": 501,
  240. "method_id": "flat_rate",
  241. "method_title": "Flat Rate",
  242. "total": "10.00"
  243. }
  244. ],
  245. "tax_lines": [
  246. {
  247. "id": 502,
  248. "rate_id": "5",
  249. "code": "US-CA-TAX-1",
  250. "title": "Tax",
  251. "total": "4.40",
  252. "compound": false
  253. },
  254. {
  255. "id": 503,
  256. "rate_id": "4",
  257. "code": "US-STANDARD-1",
  258. "title": "Standard",
  259. "total": "1.50",
  260. "compound": false
  261. }
  262. ],
  263. "fee_lines": [],
  264. "coupon_lines": [],
  265. "customer": {
  266. "id": 2,
  267. "created_at": "2014-11-19T18:34:19Z",
  268. "email": "john.doe@example.com",
  269. "first_name": "",
  270. "last_name": "",
  271. "username": "john.doe",
  272. "last_order_id": "645",
  273. "last_order_date": "2015-01-26T20:00:21Z",
  274. "orders_count": 2,
  275. "total_spent": "19.00",
  276. "avatar_url": "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
  277. "billing_address": {
  278. "first_name": "John",
  279. "last_name": "Doe",
  280. "company": "",
  281. "address_1": "969 Market",
  282. "address_2": "",
  283. "city": "San Francisco",
  284. "state": "CA",
  285. "postcode": "94103",
  286. "country": "US",
  287. "email": "john.doe@example.com",
  288. "phone": "(555) 555-5555"
  289. },
  290. "shipping_address": {
  291. "first_name": "John",
  292. "last_name": "Doe",
  293. "company": "",
  294. "address_1": "969 Market",
  295. "address_2": "",
  296. "city": "San Francisco",
  297. "state": "CA",
  298. "postcode": "94103",
  299. "country": "US"
  300. }
  301. }
  302. }
  303. ]
  304. }
  305. Available Filters
  306.  
  307. Filter Type Description
  308. status string Orders by status. eg: processing or cancelled
  309. Update An Order
  310. This API lets you make changes to an order.
  311.  
  312. HTTP Request
  313.  
  314. PUT /wc-api/v3/orders/<id>
  315. data = {
  316. "order": {
  317. "status": "completed"
  318. }
  319. }
  320.  
  321. print(wcapi.put("orders/645", data).json())
  322. JSON response example:
  323. {
  324. "order": {
  325. "id": 645,
  326. "order_number": 645,
  327. "created_at": "2015-01-26T20:00:21Z",
  328. "updated_at": "2015-01-26T20:00:21Z",
  329. "completed_at": "2015-01-26T20:00:21Z",
  330. "status": "completed",
  331. "currency": "USD",
  332. "total": "79.87",
  333. "subtotal": "63.97",
  334. "total_line_items_quantity": 3,
  335. "total_tax": "5.90",
  336. "total_shipping": "10.00",
  337. "cart_tax": "5.40",
  338. "shipping_tax": "0.50",
  339. "total_discount": "0.00",
  340. "shipping_methods": "Flat Rate",
  341. "payment_details": {
  342. "method_id": "bacs",
  343. "method_title": "Direct Bank Transfer",
  344. "paid": true
  345. },
  346. "billing_address": {
  347. "first_name": "John",
  348. "last_name": "Doe",
  349. "company": "",
  350. "address_1": "969 Market",
  351. "address_2": "",
  352. "city": "San Francisco",
  353. "state": "CA",
  354. "postcode": "94103",
  355. "country": "US",
  356. "email": "john.doe@example.com",
  357. "phone": "(555) 555-5555"
  358. },
  359. "shipping_address": {
  360. "first_name": "John",
  361. "last_name": "Doe",
  362. "company": "",
  363. "address_1": "969 Market",
  364. "address_2": "",
  365. "city": "San Francisco",
  366. "state": "CA",
  367. "postcode": "94103",
  368. "country": "US"
  369. },
  370. "note": "",
  371. "customer_ip": "127.0.0.1",
  372. "customer_user_agent": "WordPress/4.1; http://example.com",
  373. "customer_id": 2,
  374. "view_order_url": "https://example.com/my-account/view-order/645",
  375. "line_items": [
  376. {
  377. "id": 504,
  378. "subtotal": "43.98",
  379. "subtotal_tax": "4.40",
  380. "total": "43.98",
  381. "total_tax": "4.40",
  382. "price": "21.99",
  383. "quantity": 2,
  384. "tax_class": "reduced-rate",
  385. "name": "Premium Quality",
  386. "product_id": 546,
  387. "sku": "",
  388. "meta": []
  389. },
  390. {
  391. "id": 505,
  392. "subtotal": "19.99",
  393. "subtotal_tax": "1.00",
  394. "total": "19.99",
  395. "total_tax": "1.00",
  396. "price": "19.99",
  397. "quantity": 1,
  398. "tax_class": null,
  399. "name": "Ship Your Idea",
  400. "product_id": 613,
  401. "sku": "",
  402. "meta": [
  403. {
  404. "key": "pa_color",
  405. "label": "Color",
  406. "value": "Black"
  407. }
  408. ]
  409. }
  410. ],
  411. "shipping_lines": [
  412. {
  413. "id": 506,
  414. "method_id": "flat_rate",
  415. "method_title": "Flat Rate",
  416. "total": "10.00"
  417. }
  418. ],
  419. "tax_lines": [
  420. {
  421. "id": 507,
  422. "rate_id": "5",
  423. "code": "US-CA-TAX-1",
  424. "title": "Tax",
  425. "total": "4.40",
  426. "compound": false
  427. },
  428. {
  429. "id": 508,
  430. "rate_id": "4",
  431. "code": "US-STANDARD-1",
  432. "title": "Standard",
  433. "total": "1.50",
  434. "compound": false
  435. }
  436. ],
  437. "fee_lines": [],
  438. "coupon_lines": [],
  439. "customer": {
  440. "id": 2,
  441. "created_at": "2014-11-19T18:34:19Z",
  442. "email": "john.doe@example.com",
  443. "first_name": "",
  444. "last_name": "",
  445. "username": "john.doe",
  446. "last_order_id": "645",
  447. "last_order_date": "2015-01-26T20:00:21Z",
  448. "orders_count": 2,
  449. "total_spent": "19.00",
  450. "avatar_url": "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
  451. "billing_address": {
  452. "first_name": "John",
  453. "last_name": "Doe",
  454. "company": "",
  455. "address_1": "969 Market",
  456. "address_2": "",
  457. "city": "San Francisco",
  458. "state": "CA",
  459. "postcode": "94103",
  460. "country": "US",
  461. "email": "john.doe@example.com",
  462. "phone": "(555) 555-5555"
  463. },
  464. "shipping_address": {
  465. "first_name": "John",
  466. "last_name": "Doe",
  467. "company": "",
  468. "address_1": "969 Market",
  469. "address_2": "",
  470. "city": "San Francisco",
  471. "state": "CA",
  472. "postcode": "94103",
  473. "country": "US"
  474. }
  475. }
  476. }
  477. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement