DashForDevsDocs
DocsNewsAPI v1
dashfordevs.comSign in

© 2026 DashForDevs

DocsNewsdashfordevs.comLegalStatus
DocsShippingShipping Locations
Introduction
Getting Started
Authentication
Products
Categories
Cart
Checkout
Blog
Reviews
Webhooks
Customers
Orders
Inventory
Shipping
Shipping RatesGenerate LabelsTrackingShipping Locations
Discounts
Affiliates
Email
Media & Files
Analytics & Tracking
Locations
Tax
Global Data
SEO
Error Handling
Geography
Finance
Automations
Page Types
Surveys
Billing & Subscriptions
Storefront Payments
SDK Reference
REST API
Storefront Architecture
Notifications
Security
Team & Permissions
Migrations & Import
Calendar & Appointments
Contact Forms
AI Bots
Dashboard API
Deployment
Changelog
Troubleshooting
Recipes
CLI & Deployment
Image Pipeline
White-label Platforms
Records Engine
Platform Modules
Platform Security
Site Keys & Client Sites
Use Cases
Operations

Shipping Locations

Manage warehouse and fulfillment locations.

Updated March 29, 2026

On this page
  • Overview
  • SDK Usage
  • Address Form Dropdowns
  • REST API
  • Next Steps

Overview

Get the list of countries and states your store ships to. Use this to populate address dropdowns in checkout forms.

SDK Usage

typescript
import dash from "@/lib/dash"

const { countries } = await dash.checkout.getShippingLocations()

// countries = [
//   {
//     id: "loc_us",
//     name: "United States",
//     code: "US",
//     states: [
//       { id: "st_tx", name: "Texas", code: "TX" },
//       { id: "st_ca", name: "California", code: "CA" },
//       // ...
//     ]
//   }
// ]

Address Form Dropdowns

typescript
"use client"
import { useState, useEffect } from "react"
import dash from "@/lib/dash"

export function AddressForm() {
  const [locations, setLocations] = useState([])
  const [selectedCountry, setSelectedCountry] = useState("")
  const [states, setStates] = useState([])

  useEffect(() => {
    dash.checkout.getShippingLocations().then(({ countries }) => {
      setLocations(countries)
      if (countries.length === 1) {
        setSelectedCountry(countries[0].code)
        setStates(countries[0].states)
      }
    })
  }, [])

  function handleCountryChange(code) {
    setSelectedCountry(code)
    const country = locations.find(c => c.code === code)
    setStates(country?.states || [])
  }

  return (
    <div>
      <select value={selectedCountry} onChange={e => handleCountryChange(e.target.value)}>
        <option value="">Select country</option>
        {locations.map(c => <option key={c.code} value={c.code}>{c.name}</option>)}
      </select>

      <select>
        <option value="">Select state</option>
        {states.map(s => <option key={s.code} value={s.code}>{s.name}</option>)}
      </select>
    </div>
  )
}

REST API

shell
GET /storefront/shipping-locations
X-API-Key: pk_live_your_key

Next Steps

  • Shipping Rates — Getting rate quotes
  • Create Order — Using locations in checkout
PreviousTrackingNextDiscount Codes

On this page

  • Overview
  • SDK Usage
  • Address Form Dropdowns
  • REST API
  • Next Steps