React Native Requires Chilkat v11.0.0+
React Native
Walmart V3 API - Get All Released Orders
See more Walmart v3 Examples
Retrieves all the orders with line items that are in the "created" status, that is, these orders have been released from the Walmart Order Management System to the seller for processing. The released orders are the orders that are ready for a seller to fulfill.Chilkat React Native Downloads
import { Http, HttpResponse, JsonObject } from '@chilkat/react-native'
async function chilkatExample() {
// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
const http = new Http();
http.accept = 'application/json';
// Setting the Login and Password properties to the clientId and clientSecret
// will cause the Basic Auth header to be added (i.e. BaseEncode64(clientId:clientSecret))
http.login = 'clientId';
http.password = 'clientSecret';
http.basicAuth = true;
http.setRequestHeader('Content-Type', 'application/json');
http.setRequestHeader('WM_QOS.CORRELATION_ID', 'b3261d2d-028a-4ef7-8602-633c23200af6');
// Use the access token obtained from this example: Walmart v3 API Get OAuth2 Access Token using Client Credentials
http.setRequestHeader('WM_SEC.ACCESS_TOKEN', 'eyJraWQiOiIzZjVhYTFmNS1hYWE5LTQzM.....');
http.setRequestHeader('WM_SVC.NAME', 'Walmart Marketplace');
http.setUrlVar('createdStartDate', '2020-01-16T10:30:15Z');
http.setUrlVar('limit', '200');
// Can also be 3PLFulfilled
http.setUrlVar('shippingProgramType', 'SellerFulfilled');
http.setUrlVar('shipNodeType', 'TWO_DAY');
const resp = new HttpResponse();
try {
await http.httpNoBodyAsync('GET', '/v3/orders/released?createdStartDate={$createdStartDate}&limit={$limit}&shippingProgramType={$shippingProgramType}&shipNodeType={$shipNodeType}', resp);
} catch {
console.log(http.lastErrorText);
return;
}
console.log(`Response Status Code: ${resp.statusCode}`);
const jsonResponse = new JsonObject();
jsonResponse.load(resp.bodyStr);
jsonResponse.emitCompact = false;
console.log(jsonResponse.emit());
if (resp.statusCode !== 200) {
console.log('Failed.');
return;
}
// Sample output...
// (See the parsing code below..)
//
// Use the this online tool to generate parsing code from sample JSON:
// Generate Parsing Code from JSON
// {
// "list": {
// "meta": {
// "totalCount": 25228,
// "limit": 10,
// "nextCursor": "?limit=10&hasMoreElements=true&soIndex=25228&poIndex=10&sellerId=152&createdStartDate=2019-04-02T00:00:00.000Z&createdEndDate=2019-09-26T16:05:49.648Z"
// },
// "elements": {
// "order": [
// {
// "purchaseOrderId": "4792701510371",
// "customerOrderId": "5401973367419",
// "customerEmailId": "47B81ACD2C62434DBE64F47B9E1F7630@relay.walmart.com",
// "orderDate": 1569513584000,
// "shippingInfo": {
// "phone": "2134488377",
// "estimatedDeliveryDate": 1569870000000,
// "estimatedShipDate": 1569553200000,
// "methodCode": "Express",
// "postalAddress": {
// "name": "Julio Hernandez",
// "address1": "9713 pleasant view dr",
// "address2": null,
// "city": "Rancho Cucamonga",
// "state": "CA",
// "postalCode": "91701",
// "country": "USA",
// "addressType": "RESIDENTIAL"
// }
// },
// "orderLines": {
// "orderLine": [
// {
// "lineNumber": "1",
// "item": {
// "productName": "Refurbished Lenovo YB1-X90F Grey Yoga Book with WiFi 10.1\" Touchscreen Tablet Android 6.0.1",
// "sku": "VO190403007727R"
// },
// "charges": {
// "charge": [
// {
// "chargeType": "PRODUCT",
// "chargeName": "ItemPrice",
// "chargeAmount": {
// "currency": "USD",
// "amount": 259
// },
// "tax": {
// "taxName": "Tax1",
// "taxAmount": {
// "currency": "USD",
// "amount": 20.07
// }
// }
// },
// {
// "chargeType": "FEE",
// "chargeName": "Fee",
// "chargeAmount": {
// "currency": "USD",
// "amount": 0
// },
// "tax": {
// "taxName": "Electronic Waste Recycling Fee",
// "taxAmount": {
// "currency": "USD",
// "amount": 5
// }
// }
// }
// ]
// },
// "orderLineQuantity": {
// "unitOfMeasurement": "EACH",
// "amount": "1"
// },
// "statusDate": 1569513724000,
// "orderLineStatuses": {
// "orderLineStatus": [
// {
// "status": "Acknowledged",
// "statusQuantity": {
// "unitOfMeasurement": "EACH",
// "amount": "1"
// },
// "cancellationReason": null,
// "trackingInfo": null,
// "returnCenterAddress": null
// }
// ]
// },
// "refund": null,
// "fulfillment": {
// "fulfillmentOption": "S2H",
// "shipMethod": "EXPEDITED",
// "storeId": null,
// "pickUpDateTime": 1569870000000,
// "pickUpBy": null,
// "shippingProgramType": "TWO_DAY"
// }
// }
// ]
// },
// "shipNode": {
// "type": "3PLFulfilled"
// }
// }
// ]
// }
// }
// }
//
let purchaseOrderId = '';
let customerOrderId = '';
let customerEmailId = '';
let orderDate = 0;
let shippingInfoPhone = '';
let shippingInfoEstimatedDeliveryDate = 0;
let shippingInfoEstimatedShipDate = 0;
let shippingInfoMethodCode = '';
let shippingInfoPostalAddressName = '';
let shippingInfoPostalAddressAddress1 = '';
let shippingInfoPostalAddressAddress2 = '';
let shippingInfoPostalAddressCity = '';
let shippingInfoPostalAddressState = '';
let shippingInfoPostalAddressPostalCode = '';
let shippingInfoPostalAddressCountry = '';
let shippingInfoPostalAddressAddressType = '';
let shipNodeType = '';
let j = 0;
let countJ = 0;
let lineNumber = '';
let itemProductName = '';
let itemSku = '';
let orderLineQuantityUnitOfMeasurement = '';
let orderLineQuantityAmount = '';
let statusDate = 0;
let refund = '';
let fulfillmentFulfillmentOption = '';
let fulfillmentShipMethod = '';
let fulfillmentStoreId = '';
let fulfillmentPickUpDateTime = 0;
let fulfillmentPickUpBy = '';
let fulfillmentShippingProgramType = '';
let k = 0;
let countK = 0;
let chargeType = '';
let chargeName = '';
let chargeAmountCurrency = '';
let chargeAmountAmount = 0;
let taxTaxName = '';
let taxTaxAmountCurrency = '';
let taxTaxAmountAmount = '';
let status = '';
let statusQuantityUnitOfMeasurement = '';
let statusQuantityAmount = '';
let cancellationReason = '';
let trackingInfo = '';
let returnCenterAddress = '';
const listMetaTotalCount = jsonResponse.intOf('list.meta.totalCount');
const listMetaLimit = jsonResponse.intOf('list.meta.limit');
const listMetaNextCursor = jsonResponse.stringOf('list.meta.nextCursor');
let i = 0;
const countI = jsonResponse.sizeOfArray('list.elements.order');
while (i < countI) {
jsonResponse.i = i;
purchaseOrderId = jsonResponse.stringOf('list.elements.order[i].purchaseOrderId');
customerOrderId = jsonResponse.stringOf('list.elements.order[i].customerOrderId');
customerEmailId = jsonResponse.stringOf('list.elements.order[i].customerEmailId');
orderDate = jsonResponse.intOf('list.elements.order[i].orderDate');
shippingInfoPhone = jsonResponse.stringOf('list.elements.order[i].shippingInfo.phone');
shippingInfoEstimatedDeliveryDate = jsonResponse.intOf('list.elements.order[i].shippingInfo.estimatedDeliveryDate');
shippingInfoEstimatedShipDate = jsonResponse.intOf('list.elements.order[i].shippingInfo.estimatedShipDate');
shippingInfoMethodCode = jsonResponse.stringOf('list.elements.order[i].shippingInfo.methodCode');
shippingInfoPostalAddressName = jsonResponse.stringOf('list.elements.order[i].shippingInfo.postalAddress.name');
shippingInfoPostalAddressAddress1 = jsonResponse.stringOf('list.elements.order[i].shippingInfo.postalAddress.address1');
shippingInfoPostalAddressAddress2 = jsonResponse.stringOf('list.elements.order[i].shippingInfo.postalAddress.address2');
shippingInfoPostalAddressCity = jsonResponse.stringOf('list.elements.order[i].shippingInfo.postalAddress.city');
shippingInfoPostalAddressState = jsonResponse.stringOf('list.elements.order[i].shippingInfo.postalAddress.state');
shippingInfoPostalAddressPostalCode = jsonResponse.stringOf('list.elements.order[i].shippingInfo.postalAddress.postalCode');
shippingInfoPostalAddressCountry = jsonResponse.stringOf('list.elements.order[i].shippingInfo.postalAddress.country');
shippingInfoPostalAddressAddressType = jsonResponse.stringOf('list.elements.order[i].shippingInfo.postalAddress.addressType');
shipNodeType = jsonResponse.stringOf('list.elements.order[i].shipNode.type');
j = 0;
countJ = jsonResponse.sizeOfArray('list.elements.order[i].orderLines.orderLine');
while (j < countJ) {
jsonResponse.j = j;
lineNumber = jsonResponse.stringOf('list.elements.order[i].orderLines.orderLine[j].lineNumber');
itemProductName = jsonResponse.stringOf('list.elements.order[i].orderLines.orderLine[j].item.productName');
itemSku = jsonResponse.stringOf('list.elements.order[i].orderLines.orderLine[j].item.sku');
orderLineQuantityUnitOfMeasurement = jsonResponse.stringOf('list.elements.order[i].orderLines.orderLine[j].orderLineQuantity.unitOfMeasurement');
orderLineQuantityAmount = jsonResponse.stringOf('list.elements.order[i].orderLines.orderLine[j].orderLineQuantity.amount');
statusDate = jsonResponse.intOf('list.elements.order[i].orderLines.orderLine[j].statusDate');
refund = jsonResponse.stringOf('list.elements.order[i].orderLines.orderLine[j].refund');
fulfillmentFulfillmentOption = jsonResponse.stringOf('list.elements.order[i].orderLines.orderLine[j].fulfillment.fulfillmentOption');
fulfillmentShipMethod = jsonResponse.stringOf('list.elements.order[i].orderLines.orderLine[j].fulfillment.shipMethod');
fulfillmentStoreId = jsonResponse.stringOf('list.elements.order[i].orderLines.orderLine[j].fulfillment.storeId');
fulfillmentPickUpDateTime = jsonResponse.intOf('list.elements.order[i].orderLines.orderLine[j].fulfillment.pickUpDateTime');
fulfillmentPickUpBy = jsonResponse.stringOf('list.elements.order[i].orderLines.orderLine[j].fulfillment.pickUpBy');
fulfillmentShippingProgramType = jsonResponse.stringOf('list.elements.order[i].orderLines.orderLine[j].fulfillment.shippingProgramType');
k = 0;
countK = jsonResponse.sizeOfArray('list.elements.order[i].orderLines.orderLine[j].charges.charge');
while (k < countK) {
jsonResponse.k = k;
chargeType = jsonResponse.stringOf('list.elements.order[i].orderLines.orderLine[j].charges.charge[k].chargeType');
chargeName = jsonResponse.stringOf('list.elements.order[i].orderLines.orderLine[j].charges.charge[k].chargeName');
chargeAmountCurrency = jsonResponse.stringOf('list.elements.order[i].orderLines.orderLine[j].charges.charge[k].chargeAmount.currency');
chargeAmountAmount = jsonResponse.intOf('list.elements.order[i].orderLines.orderLine[j].charges.charge[k].chargeAmount.amount');
taxTaxName = jsonResponse.stringOf('list.elements.order[i].orderLines.orderLine[j].charges.charge[k].tax.taxName');
taxTaxAmountCurrency = jsonResponse.stringOf('list.elements.order[i].orderLines.orderLine[j].charges.charge[k].tax.taxAmount.currency');
taxTaxAmountAmount = jsonResponse.stringOf('list.elements.order[i].orderLines.orderLine[j].charges.charge[k].tax.taxAmount.amount');
k++;
}
k = 0;
countK = jsonResponse.sizeOfArray('list.elements.order[i].orderLines.orderLine[j].orderLineStatuses.orderLineStatus');
while (k < countK) {
jsonResponse.k = k;
status = jsonResponse.stringOf('list.elements.order[i].orderLines.orderLine[j].orderLineStatuses.orderLineStatus[k].status');
statusQuantityUnitOfMeasurement = jsonResponse.stringOf('list.elements.order[i].orderLines.orderLine[j].orderLineStatuses.orderLineStatus[k].statusQuantity.unitOfMeasurement');
statusQuantityAmount = jsonResponse.stringOf('list.elements.order[i].orderLines.orderLine[j].orderLineStatuses.orderLineStatus[k].statusQuantity.amount');
cancellationReason = jsonResponse.stringOf('list.elements.order[i].orderLines.orderLine[j].orderLineStatuses.orderLineStatus[k].cancellationReason');
trackingInfo = jsonResponse.stringOf('list.elements.order[i].orderLines.orderLine[j].orderLineStatuses.orderLineStatus[k].trackingInfo');
returnCenterAddress = jsonResponse.stringOf('list.elements.order[i].orderLines.orderLine[j].orderLineStatuses.orderLineStatus[k].returnCenterAddress');
k++;
}
j++;
}
i++;
}
}