API Recipes

Ship With Walmart Label Purchase Workflow

This recipe was an interactive walkthrough in the previous portal. Each step below names the API call it makes; open it in the API Reference to try it.

Overview

Step 1: Get Shipping Rates

Request shipping rate quotes for a package based on its dimensions, weight, and destination address.

API call: getRates

Example arguments:

{
            body: {
              shipTo: {
                name: "Jordan Rivera",
                addressLine1: "500 Market St",
                city: "San Francisco",
                stateOrRegion: "CA",
                postalCode: "94105",
                countryCode: "US",
              },
              shipFrom: {
                name: "Acme Fulfillment",
                addressLine1: "1 Warehouse Way",
                city: "Bentonville",
                stateOrRegion: "AR",
                postalCode: "72712",
                countryCode: "US",
              },
              packages: [
                {
                  dimensions: { length: 10, width: 8, height: 4, unit: "inches" },
                  weight: { value: 2, unit: "lb" },
                  packageClientReferenceId: "PKG-1",
                },
              ],
              channelDetails: {
                channelType: "WALMART_MARKETPLACE",
              },
            },
          }

Step 2: Purchase Shipment

Purchase the shipping label for the rate selected from Step 2. The response's shipmentId and

API call: purchaseShipment

Example arguments:

{
            body: {
              requestToken,
              rateId,
              requestedDocumentSpecification: {
                format: "PDF",
                size: { width: 4, length: 6, unit: "inches" },
                dpi: 203,
              },
            },
          }

Step 3: Get Shipment Documents

Download the printable label and any other documents for the shipment you just purchased.\n\n

API call: getShipmentDocuments

Example arguments:

{
            path: { shipmentId },
          }

Step 4: Get Tracking

Check the current tracking status for the shipment using the tracking ID from Step 3 and the

API call: getTracking

Example arguments:

{
            query: { trackingId, carrierId },
          }

Step 5: Cancel Shipment

Cancel the shipment purchased in Step 3 and return the pre-paid label. Cancellation eligibility is

API call: cancelShipment

Example arguments:

{
            path: { shipmentId },
          }

On this page