Chilkat Examples

ChilkatHOME.NET Core C#Android™AutoItCC#C++Chilkat2-PythonCkPythonClassic ASPDataFlexDelphi ActiveXDelphi DLLGoJavaLianjaMono C#Node.jsObjective-CPHP ActiveXPHP ExtensionPerlPowerBuilderPowerShellPureBasicRubySQL ServerSwift 2Swift 3,4,5...TclUnicode CUnicode C++VB.NETVBScriptVisual Basic 6.0Visual FoxProXojo Plugin

DataFlex Web API Examples

Primary Categories

ABN AMRO
AWS Secrets Manager
AWS Security Token Service
AWS Translate
Activix CRM
Adyen
Alibaba Cloud OSS
Amazon Cognito
Amazon DynamoDB
Amazon MWS
Amazon Pay
Amazon Rekognition
Amazon SP-API
Amazon Voice ID
Aruba Fatturazione
Azure Maps
Azure Monitor
Azure OAuth2
Azure Storage Accounts
Backblaze S3
Banco Inter
Belgian eHealth Platform
Bitfinex v2 REST
Bluzone
BrickLink
Bunny CDN
CallRail
CardConnect
Cerved
ClickBank
Clickatell
Cloudfare
Constant Contact
DocuSign
Duo Auth MFA
ETrade
Ecwid
Egypt ITIDA
Egypt eReceipt
Etsy
Facebook
Faire
Frame.io
GeoOp
GetHarvest
Global Payments
Google People
Google Search Console
Google Translate
Google Vision
Hungary NAV Invoicing
IBM Text to Speech
Ibanity
IntakeQ
Jira
Lightspeed
MYOB
Magento
Mailgun

Mastercard
MedTunnel
MercadoLibre
MessageMedia
Microsoft Calendar
Microsoft Group
Microsoft Tasks and Plans
Microsoft Teams
Moody's
Okta OAuth/OIDC
OneLogin OIDC
OneNote
OpenAI ChatGPT
PRODA
PayPal
Paynow.pl
Peoplevox
Populi
QuickBooks
Rabobank
Refinitiv
Royal Mail OBA
SCiS Schools Catalogue
SII Chile
SMSAPI
SOAP finkok.com
SendGrid
Shippo
Shopify
Shopware
Shopware 6
SimpleTexting
Square
Stripe
SugarCRM
TicketBAI
Trello
Twilio
Twitter API v2
Twitter v1
UPS
UniPin
VoiceBase
Vonage
WaTrend
Walmart v3
Wasabi
WhatsApp
WiX
WooCommerce
WordPress
Xero
Yahoo Mail
Yapily
Yousign
ZATCA
Zendesk
Zoom
_Miscellaneous_
eBay
effectconnect
hacienda.go.cr

 

 

 

(DataFlex) Walmart v3 Acknowledge Orders

Allows a DSV to acknowledge an order, including all order lines, preferably within four hours of receipt of the order.

The response to a successful call contains the acknowledged order. As a good practice, acknowledge your orders to avoid underselling.

Note: This example requires Chilkat v9.5.0.85 or greater.

For more information, see https://developer.walmart.com/api/us/dsv/orders#operation/acknowledgeOrders

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

Use ChilkatAx-9.5.0-win32.pkg

Procedure Test
    Handle hoHttp
    Boolean iSuccess
    Variant vResp
    Handle hoResp
    Variant vSbResponseBody
    Handle hoSbResponseBody
    String sTemp1
    Integer iTemp1
    Boolean bTemp1

    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    Get Create (RefClass(cComChilkatHttp)) To hoHttp
    If (Not(IsComObjectCreated(hoHttp))) Begin
        Send CreateComObject of hoHttp
    End

    Send ComSetRequestHeader To hoHttp "WM_QOS.CORRELATION_ID" "b3261d2d-028a-4ef7-8602-633c23200af6"
    Send ComSetRequestHeader To hoHttp "WM_SEC.ACCESS_TOKEN" "eyJraWQiOiIzZjVhYTFmNS1hYWE5LTQzM....."
    Send ComSetRequestHeader To hoHttp "Accept" "application/json"
    Send ComSetRequestHeader To hoHttp "WM_SVC.NAME" "Walmart Marketplace"

    // Note: A problem is was fixed after the Chilkat v9.5.0.84 release.  The "Content-Length: 0" header is required for the POST.
    // Chilkat v9.5.0.84 did not automatically include it for QuickRequest called with the POST verb.
    Get ComQuickRequest Of hoHttp "POST" "https://api-gateway.walmart.com/v3/orders/{purchaseOrderId}/acknowledge" To vResp
    If (IsComObject(vResp)) Begin
        Get Create (RefClass(cComChilkatHttpResponse)) To hoResp
        Set pvComObject Of hoResp To vResp
    End
    Get ComLastMethodSuccess Of hoHttp To bTemp1
    If (bTemp1 = False) Begin
        Get ComLastErrorText Of hoHttp To sTemp1
        Showln sTemp1
        Procedure_Return
    End

    Get ComStatusCode Of hoResp To iTemp1
    Showln "Response status code: " iTemp1

    Get Create (RefClass(cComChilkatStringBuilder)) To hoSbResponseBody
    If (Not(IsComObjectCreated(hoSbResponseBody))) Begin
        Send CreateComObject of hoSbResponseBody
    End
    Get pvComObject of hoSbResponseBody to vSbResponseBody
    Get ComGetBodySb Of hoResp vSbResponseBody To iSuccess
    Send Destroy of hoResp

    // A sample JSON response:

    // {
    //   "order": {
    //     "purchaseOrderId": "1581564396843",
    //     "customerOrderId": "3001859598500",
    //     "customerEmailId": "D5AFD31C627A45F3A93041FD557F94C4@relay.walmart.com",
    //     "orderDate": 1517252660000,
    //     "buyerId": "43538435-de77-44c7-b606-ad9a8ff1d8f8",
    //     "mart": "Walmart.com",
    //     "isGuest": false,
    //     "shippingInfo": {
    //       "phone": "2566519197",
    //       "estimatedDeliveryDate": 1518454800000,
    //       "estimatedShipDate": 1518109200000,
    //       "methodCode": "Standard",
    //       "postalAddress": {
    //         "name": "whitney feathers",
    //         "address1": "4100 Cloverdale Dr NW",
    //         "address2": null,
    //         "city": "Huntsville",
    //         "state": "AL",
    //         "postalCode": "35805",
    //         "country": "USA",
    //         "addressType": "RESIDENTIAL"
    //       }
    //     },
    //     "orderLines": {
    //       "orderLine": [
    //         {
    //           "lineNumber": "1",
    //           "item": {
    //             "productName": "High-Quality 8 x 10 Prints",
    //             "sku": "8x10{IS",
    //             "imageUrl": "https://i5.walmartimages.com/asr/7924b94b-49fa-4050-8e62-2364d07d0068_1.6ef0f115abba4f27b7c5e785c2bac517.jpeg",
    //             "weight": {
    //               "value": "0.438",
    //               "unit": "Pounds"
    //             }
    //           },
    //           "charges": {
    //             "charge": [
    //               {
    //                 "chargeType": "PRODUCT",
    //                 "chargeName": "ItemPrice",
    //                 "chargeAmount": {
    //                   "currency": "USD",
    //                   "amount": 1.79
    //                 },
    //                 "tax": {
    //                   "taxName": "Tax1",
    //                   "taxAmount": {
    //                     "currency": "USD",
    //                     "amount": 0.15
    //                   }
    //                 }
    //               },
    //               {
    //                 "chargeType": "SHIPPING",
    //                 "chargeName": "Shipping",
    //                 "chargeAmount": {
    //                   "currency": "USD",
    //                   "amount": 1.75
    //                 },
    //                 "tax": null
    //               }
    //             ]
    //           },
    //           "orderLineQuantity": {
    //             "unitOfMeasurement": "EACH",
    //             "amount": "1"
    //           },
    //           "statusDate": 1542069814000,
    //           "orderLineStatuses": {
    //             "orderLineStatus": [
    //               {
    //                 "status": "Shipped",
    //                 "statusQuantity": {
    //                   "unitOfMeasurement": "EACH",
    //                   "amount": "1"
    //                 },
    //                 "cancellationReason": null,
    //                 "trackingInfo": {
    //                   "shipDateTime": 1540845015000,
    //                   "carrierName": {
    //                     "otherCarrier": null,
    //                     "carrier": "UPS"
    //                   },
    //                   "methodCode": "Standard",
    //                   "carrierMethodCode": null,
    //                   "trackingNumber": "3445435443441221",
    //                   "trackingURL": "http://www.fedex.com"
    //                 }
    //               }
    //             ]
    //           },
    //           "refund": {
    //             "refundId": null,
    //             "refundComments": null,
    //             "refundCharges": {
    //               "refundCharge": [
    //                 {
    //                   "refundReason": "Quality -> Missing Parts / Instructions",
    //                   "charge": {
    //                     "chargeType": "PRODUCT",
    //                     "chargeName": "Quality -> Missing Parts / Instructions",
    //                     "chargeAmount": {
    //                       "currency": "USD",
    //                       "amount": -0.01
    //                     },
    //                     "tax": null
    //                   }
    //                 }
    //               ]
    //             }
    //           },
    //           "originalCarrierMethod": "22",
    //           "referenceLineId": "123456",
    //           "fulfillment": {
    //             "fulfillmentOption": "S2H",
    //             "shipMethod": "STANDARD",
    //             "storeId": null,
    //             "pickUpDateTime": 1518120000000,
    //             "pickUpBy": null
    //           }
    //         }
    //       ]
    //     }
    //   }
    // 


End_Procedure

 

© 2000-2024 Chilkat Software, Inc. All Rights Reserved.