Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(AutoIt) Walmart V3 API - Get All Released OrdersRetrieves 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. For more information, see https://developer.walmart.com/#/apicenter/marketPlace/latest#getAllReleasedOrders
; This example requires the Chilkat API to have been previously unlocked. ; See Global Unlock Sample for sample code. $oHttp = ObjCreate("Chilkat.Http") $oHttp.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)) $oHttp.Login = "clientId" $oHttp.Password = "clientSecret" $oHttp.BasicAuth = True $oHttp.SetRequestHeader "Content-Type","application/json" $oHttp.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 $oHttp.SetRequestHeader "WM_SEC.ACCESS_TOKEN","eyJraWQiOiIzZjVhYTFmNS1hYWE5LTQzM....." $oHttp.SetRequestHeader "WM_SVC.NAME","Walmart Marketplace" $oHttp.SetUrlVar("createdStartDate","2020-01-16T10:30:15Z") $oHttp.SetUrlVar("limit","200") ; Can also be 3PLFulfilled $oHttp.SetUrlVar("shippingProgramType","SellerFulfilled") $oHttp.SetUrlVar("shipNodeType","TWO_DAY") Local $oResp = $oHttp.QuickRequest("GET","/v3/orders/released?createdStartDate={$createdStartDate}&limit={$limit}&shippingProgramType={$shippingProgramType}&shipNodeType={$shipNodeType}") If ($oHttp.LastMethodSuccess <> True) Then ConsoleWrite($oHttp.LastErrorText & @CRLF) Exit EndIf ConsoleWrite("Response Status Code: " & $oResp.StatusCode & @CRLF) $oJsonResponse = ObjCreate("Chilkat.JsonObject") $oJsonResponse.Load($oResp.BodyStr) $oJsonResponse.EmitCompact = False ConsoleWrite($oJsonResponse.Emit() & @CRLF) If ($oResp.StatusCode <> 200) Then ConsoleWrite("Failed." & @CRLF) Exit EndIf ; 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" ; } ; } ; ] ; } ; } ; } ; Local $sPurchaseOrderId Local $sCustomerOrderId Local $sCustomerEmailId Local $iOrderDate Local $shippingInfoPhone Local $iShippingInfoEstimatedDeliveryDate Local $iShippingInfoEstimatedShipDate Local $shippingInfoMethodCode Local $shippingInfoPostalAddressName Local $shippingInfoPostalAddressAddress1 Local $shippingInfoPostalAddressAddress2 Local $shippingInfoPostalAddressCity Local $shippingInfoPostalAddressState Local $shippingInfoPostalAddressPostalCode Local $shippingInfoPostalAddressCountry Local $shippingInfoPostalAddressAddressType Local $shipNodeType Local $iJ Local $iCount_j Local $sLineNumber Local $sItemProductName Local $sItemSku Local $sOrderLineQuantityUnitOfMeasurement Local $sOrderLineQuantityAmount Local $iStatusDate Local $sRefund Local $sFulfillmentFulfillmentOption Local $sFulfillmentShipMethod Local $sFulfillmentStoreId Local $iFulfillmentPickUpDateTime Local $sFulfillmentPickUpBy Local $sFulfillmentShippingProgramType Local $iK Local $iCount_k Local $sChargeType Local $sChargeName Local $sChargeAmountCurrency Local $iChargeAmountAmount Local $sTaxTaxName Local $sTaxTaxAmountCurrency Local $sTaxTaxAmountAmount Local $status Local $statusQuantityUnitOfMeasurement Local $statusQuantityAmount Local $sCancellationReason Local $sTrackingInfo Local $sReturnCenterAddress Local $iListMetaTotalCount = $oJsonResponse.IntOf("list.meta.totalCount") Local $iListMetaLimit = $oJsonResponse.IntOf("list.meta.limit") Local $sListMetaNextCursor = $oJsonResponse.StringOf("list.meta.nextCursor") Local $i = 0 Local $iCount_i = $oJsonResponse.SizeOfArray("list.elements.order") While $i < $iCount_i $oJsonResponse.I = $i $sPurchaseOrderId = $oJsonResponse.StringOf("list.elements.order[i].purchaseOrderId") $sCustomerOrderId = $oJsonResponse.StringOf("list.elements.order[i].customerOrderId") $sCustomerEmailId = $oJsonResponse.StringOf("list.elements.order[i].customerEmailId") $iOrderDate = $oJsonResponse.IntOf("list.elements.order[i].orderDate") $shippingInfoPhone = $oJsonResponse.StringOf("list.elements.order[i].shippingInfo.phone") $iShippingInfoEstimatedDeliveryDate = $oJsonResponse.IntOf("list.elements.order[i].shippingInfo.estimatedDeliveryDate") $iShippingInfoEstimatedShipDate = $oJsonResponse.IntOf("list.elements.order[i].shippingInfo.estimatedShipDate") $shippingInfoMethodCode = $oJsonResponse.StringOf("list.elements.order[i].shippingInfo.methodCode") $shippingInfoPostalAddressName = $oJsonResponse.StringOf("list.elements.order[i].shippingInfo.postalAddress.name") $shippingInfoPostalAddressAddress1 = $oJsonResponse.StringOf("list.elements.order[i].shippingInfo.postalAddress.address1") $shippingInfoPostalAddressAddress2 = $oJsonResponse.StringOf("list.elements.order[i].shippingInfo.postalAddress.address2") $shippingInfoPostalAddressCity = $oJsonResponse.StringOf("list.elements.order[i].shippingInfo.postalAddress.city") $shippingInfoPostalAddressState = $oJsonResponse.StringOf("list.elements.order[i].shippingInfo.postalAddress.state") $shippingInfoPostalAddressPostalCode = $oJsonResponse.StringOf("list.elements.order[i].shippingInfo.postalAddress.postalCode") $shippingInfoPostalAddressCountry = $oJsonResponse.StringOf("list.elements.order[i].shippingInfo.postalAddress.country") $shippingInfoPostalAddressAddressType = $oJsonResponse.StringOf("list.elements.order[i].shippingInfo.postalAddress.addressType") $shipNodeType = $oJsonResponse.StringOf("list.elements.order[i].shipNode.type") $iJ = 0 $iCount_j = $oJsonResponse.SizeOfArray("list.elements.order[i].orderLines.orderLine") While $iJ < $iCount_j $oJsonResponse.J = $iJ $sLineNumber = $oJsonResponse.StringOf("list.elements.order[i].orderLines.orderLine[j].lineNumber") $sItemProductName = $oJsonResponse.StringOf("list.elements.order[i].orderLines.orderLine[j].item.productName") $sItemSku = $oJsonResponse.StringOf("list.elements.order[i].orderLines.orderLine[j].item.sku") $sOrderLineQuantityUnitOfMeasurement = $oJsonResponse.StringOf("list.elements.order[i].orderLines.orderLine[j].orderLineQuantity.unitOfMeasurement") $sOrderLineQuantityAmount = $oJsonResponse.StringOf("list.elements.order[i].orderLines.orderLine[j].orderLineQuantity.amount") $iStatusDate = $oJsonResponse.IntOf("list.elements.order[i].orderLines.orderLine[j].statusDate") $sRefund = $oJsonResponse.StringOf("list.elements.order[i].orderLines.orderLine[j].refund") $sFulfillmentFulfillmentOption = $oJsonResponse.StringOf("list.elements.order[i].orderLines.orderLine[j].fulfillment.fulfillmentOption") $sFulfillmentShipMethod = $oJsonResponse.StringOf("list.elements.order[i].orderLines.orderLine[j].fulfillment.shipMethod") $sFulfillmentStoreId = $oJsonResponse.StringOf("list.elements.order[i].orderLines.orderLine[j].fulfillment.storeId") $iFulfillmentPickUpDateTime = $oJsonResponse.IntOf("list.elements.order[i].orderLines.orderLine[j].fulfillment.pickUpDateTime") $sFulfillmentPickUpBy = $oJsonResponse.StringOf("list.elements.order[i].orderLines.orderLine[j].fulfillment.pickUpBy") $sFulfillmentShippingProgramType = $oJsonResponse.StringOf("list.elements.order[i].orderLines.orderLine[j].fulfillment.shippingProgramType") $iK = 0 $iCount_k = $oJsonResponse.SizeOfArray("list.elements.order[i].orderLines.orderLine[j].charges.charge") While $iK < $iCount_k $oJsonResponse.K = $iK $sChargeType = $oJsonResponse.StringOf("list.elements.order[i].orderLines.orderLine[j].charges.charge[k].chargeType") $sChargeName = $oJsonResponse.StringOf("list.elements.order[i].orderLines.orderLine[j].charges.charge[k].chargeName") $sChargeAmountCurrency = $oJsonResponse.StringOf("list.elements.order[i].orderLines.orderLine[j].charges.charge[k].chargeAmount.currency") $iChargeAmountAmount = $oJsonResponse.IntOf("list.elements.order[i].orderLines.orderLine[j].charges.charge[k].chargeAmount.amount") $sTaxTaxName = $oJsonResponse.StringOf("list.elements.order[i].orderLines.orderLine[j].charges.charge[k].tax.taxName") $sTaxTaxAmountCurrency = $oJsonResponse.StringOf("list.elements.order[i].orderLines.orderLine[j].charges.charge[k].tax.taxAmount.currency") $sTaxTaxAmountAmount = $oJsonResponse.StringOf("list.elements.order[i].orderLines.orderLine[j].charges.charge[k].tax.taxAmount.amount") $iK = $iK + 1 Wend $iK = 0 $iCount_k = $oJsonResponse.SizeOfArray("list.elements.order[i].orderLines.orderLine[j].orderLineStatuses.orderLineStatus") While $iK < $iCount_k $oJsonResponse.K = $iK $status = $oJsonResponse.StringOf("list.elements.order[i].orderLines.orderLine[j].orderLineStatuses.orderLineStatus[k].status") $statusQuantityUnitOfMeasurement = $oJsonResponse.StringOf("list.elements.order[i].orderLines.orderLine[j].orderLineStatuses.orderLineStatus[k].statusQuantity.unitOfMeasurement") $statusQuantityAmount = $oJsonResponse.StringOf("list.elements.order[i].orderLines.orderLine[j].orderLineStatuses.orderLineStatus[k].statusQuantity.amount") $sCancellationReason = $oJsonResponse.StringOf("list.elements.order[i].orderLines.orderLine[j].orderLineStatuses.orderLineStatus[k].cancellationReason") $sTrackingInfo = $oJsonResponse.StringOf("list.elements.order[i].orderLines.orderLine[j].orderLineStatuses.orderLineStatus[k].trackingInfo") $sReturnCenterAddress = $oJsonResponse.StringOf("list.elements.order[i].orderLines.orderLine[j].orderLineStatuses.orderLineStatus[k].returnCenterAddress") $iK = $iK + 1 Wend $iJ = $iJ + 1 Wend $i = $i + 1 Wend |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.