List orders
The store's orders in one format for every platform, with what an invoice needs: line items with unit prices, discounts and tax per line, shipping and fee lines, billing details, payment status and refunds. Newest order first; with updatedAfter, oldest change first, so a sync can page forward from its last seen updatedAt. Start each sync a few minutes before the last updatedAt you saw and drop duplicates by id, since an order edited while you page can shift the list. Shopify returns at most 25 orders per page and, unless the store was granted access to all orders, only the last 60 days. Buyer fields (customer and addresses) are null when the store's approval does not cover buyer data. Needs orders.read.
Authorization
bearerAuth API key authentication: send your Zernio API key in the Authorization header, prefixed with Bearer.
In: header
Query Parameters
Connected store SocialAccount id.
1 <= value <= 10020date-timedate-timeOnly orders changed after this time, oldest change first.
date-timeResponse Body
application/json
application/json
application/json
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.commerce.listCommerceOrders({ query: { accountId: 'account_abc123', },});console.log(data);{ "orders": [ { "id": "string", "accountId": "string", "platform": "shopify", "number": "string", "status": "pending_payment", "platformStatus": "string", "paymentStatus": "pending", "platformPaymentStatus": "string", "currency": "string", "taxesIncluded": true, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "paidAt": "2019-08-24T14:15:22Z", "cancelledAt": "2019-08-24T14:15:22Z", "cancelReason": "string", "subtotal": { "amount": "string", "currency": "string" }, "discountTotal": { "amount": "string", "currency": "string" }, "shippingTotal": { "amount": "string", "currency": "string" }, "taxTotal": { "amount": "string", "currency": "string" }, "total": { "amount": "string", "currency": "string" }, "refundedTotal": { "amount": "string", "currency": "string" }, "discountCodes": [ "string" ], "paymentMethods": [ "string" ], "customer": { "id": "string", "email": "string", "phone": "string", "firstName": "string", "lastName": "string" }, "billingAddress": { "firstName": "string", "lastName": "string", "company": "string", "phone": "string", "line1": "string", "line2": "string", "city": "string", "region": "string", "postalCode": "string", "countryCode": "string" }, "shippingAddress": { "firstName": "string", "lastName": "string", "company": "string", "phone": "string", "line1": "string", "line2": "string", "city": "string", "region": "string", "postalCode": "string", "countryCode": "string" }, "buyerNote": "string", "lineItems": [ { "id": "string", "productId": "string", "variantId": "string", "sku": "string", "title": "string", "variantTitle": "string", "quantity": 0, "unitPrice": { "amount": "string", "currency": "string" }, "subtotal": { "amount": "string", "currency": "string" }, "discountTotal": { "amount": "string", "currency": "string" }, "total": { "amount": "string", "currency": "string" }, "taxLines": [ { "title": "string", "ratePercent": 0, "amount": { "amount": "string", "currency": "string" } } ] } ], "shippingLines": [ { "id": "string", "title": "string", "amount": { "amount": "string", "currency": "string" }, "discountTotal": { "amount": "string", "currency": "string" }, "taxLines": [ { "title": "string", "ratePercent": 0, "amount": { "amount": "string", "currency": "string" } } ] } ], "feeLines": [ { "id": "string", "title": "string", "amount": { "amount": "string", "currency": "string" }, "discountTotal": { "amount": "string", "currency": "string" }, "taxLines": [ { "title": "string", "ratePercent": 0, "amount": { "amount": "string", "currency": "string" } } ] } ], "taxLines": [ { "title": "string", "ratePercent": 0, "amount": { "amount": "string", "currency": "string" } } ], "refunds": [ { "id": "string", "createdAt": "2019-08-24T14:15:22Z", "note": "string", "amount": { "amount": "string", "currency": "string" }, "lineItems": [ { "lineItemId": "string", "quantity": 0, "amount": { "amount": "string", "currency": "string" } } ] } ], "fulfillments": [ { "carrierName": "string", "trackingNumber": "string", "trackingUrl": "string" } ], "platformData": {} } ], "nextCursor": "string"}List collection metafields
The collection's metafields as namespace, key, type and value. Needs collections.metafields: WooCommerce keeps custom fields on products only and answers 400 platform_not_supported.
List product metafields
The product's custom fields (metafields on Shopify, public meta on WooCommerce) as namespace, key, type and value. Needs metafields.read.