> ## Documentation Index
> Fetch the complete documentation index at: https://docs.snappy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Autocomplete order address

> Use this endpoint to retrieve address suggestions based on a partial input string. Use this when you're building an address input field in your platform UI - autocomplete reduces typos and helps end users land on complete, deliverable addresses before order placement.

###### Required parameters:
- `filter[address]` query parameter - partial address text from the user. 4-128 characters.
- `filter[country]` query parameter - two-letter country code to scope the suggestions to.

###### Please note:
- Returns an array of suggestions in the `data` field. Each entry follows the standard address shape (`address1`, `address2`, `city`, `provinceCode`, `postalCode`, `countryCode`).
- The address parameter is free text and the endpoint may be called frequently as the user types. Debounce input by 200-300ms before issuing the request to avoid excessive calls and stay within rate limits.
- Returns `400` when address or country are missing or malformed (e.g. address shorter than 4 characters).
- Returns `422` when the input cannot be processed by the autocomplete service.
- This endpoint is a UI helper - it suggests addresses but does not validate deliverability. Pair it with `POST /v3/orders/addresses/validate` before placing an order if you need verified-deliverable addresses.

#### Permissions
- Requires: `orders:read:masked` or `orders:read:unmasked`



## OpenAPI

````yaml get /v3/orders/addresses/autocomplete
openapi: 3.0.3
info:
  title: Snappy Public API v3
  version: 3.0.0
  contact:
    name: Snappy Support
    email: info@snappy.com
  description: >-
    Welcome to the Snappy API reference documentation!

    You can use this API to integrate with Snappy and spread smiles to your
    employees/clients/customers and much more.

    So let's get started!
servers:
  - url: https://api.snappy.com/public-api
    description: Base API URL
  - url: https://mtls-api.snappy.com/public-api
    description: >-
      ## mTLS URL

      You can also use mTLS to enhance your API security. To get your specific
      certificates please contact our support.

      Once you configure the certificated correctly, you need to also update
      endpoints to use the following secure api base URL:
security: []
tags:
  - name: Products
    description: >-
      Use these endpoints to retrieve products and tags for building catalog and
      browse experiences in your UI.
  - name: Collections
    description: >-
      Use these endpoints to retrieve products within curated collections for
      marketplace and browse experiences.
  - name: Variants
    description: >-
      Use these endpoints to retrieve variants, variant pricing, and country
      availability for orderable product SKUs.
  - name: Billing Methods
    description: >-
      A **Billing Method** is the funding source attached to an **Account** -
      for example, a Purchase Order (PO), Invoice, Prepay deposit, or Credit
      Card. Use these endpoints to retrieve billing method details such as
      remaining balance, status, and expiration.
  - name: Accounts
    description: >-
      An **Account** is a sub-entity within a **Company**, used to organize
      campaigns and gift sends. Use these endpoints to list, retrieve, and
      create accounts.
  - name: API Keys
    description: >-
      Use these endpoints to manage API keys for programmatic access. Key
      management requires company owner privileges.
  - name: Orders
    description: >-
      Use these endpoints to place, retrieve, cancel, and validate orders and
      shipping addresses.
paths:
  /v3/orders/addresses/autocomplete:
    get:
      tags:
        - Orders
      summary: Autocomplete order address
      description: >-
        Use this endpoint to retrieve address suggestions based on a partial
        input string. Use this when you're building an address input field in
        your platform UI - autocomplete reduces typos and helps end users land
        on complete, deliverable addresses before order placement.


        ###### Required parameters:

        - `filter[address]` query parameter - partial address text from the
        user. 4-128 characters.

        - `filter[country]` query parameter - two-letter country code to scope
        the suggestions to.


        ###### Please note:

        - Returns an array of suggestions in the `data` field. Each entry
        follows the standard address shape (`address1`, `address2`, `city`,
        `provinceCode`, `postalCode`, `countryCode`).

        - The address parameter is free text and the endpoint may be called
        frequently as the user types. Debounce input by 200-300ms before issuing
        the request to avoid excessive calls and stay within rate limits.

        - Returns `400` when address or country are missing or malformed (e.g.
        address shorter than 4 characters).

        - Returns `422` when the input cannot be processed by the autocomplete
        service.

        - This endpoint is a UI helper - it suggests addresses but does not
        validate deliverability. Pair it with `POST
        /v3/orders/addresses/validate` before placing an order if you need
        verified-deliverable addresses.


        #### Permissions

        - Requires: `orders:read:masked` or `orders:read:unmasked`
      parameters:
        - schema:
            type: string
            minLength: 4
            maxLength: 128
            description: Partial address string to autocomplete (minimum 4 characters).
            example: 123 Main St
          required: true
          description: Partial address string to autocomplete (minimum 4 characters).
          name: filter[address]
          in: query
        - schema:
            type: string
            pattern: ^[A-Za-z]{2}$
            description: Two-letter country code for the address lookup (case-insensitive).
            example: US
          required: true
          description: Two-letter country code for the address lookup (case-insensitive).
          name: filter[country]
          in: query
        - schema:
            type: string
            description: Optional account identifier for swag validation/filtering.
            example: acc123456
          required: false
          description: Optional account identifier for swag validation/filtering.
          name: snappy-account-id
          in: header
        - schema:
            type: string
            description: Optional company identifier for swag validation/filtering.
            example: cmp123456
          required: false
          description: Optional company identifier for swag validation/filtering.
          name: snappy-company-id
          in: header
      responses:
        '200':
          description: Autocomplete address suggestions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AutocompleteOrderAddressV3Response'
        '400':
          description: Bad Request - Invalid query parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseV3'
      security:
        - ApiKeyAuthentication: []
components:
  schemas:
    AutocompleteOrderAddressV3Response:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/PlaceOrderV3ShippingAddress'
          description: Autocomplete address suggestions.
      required:
        - data
      description: Autocomplete order address response.
    ErrorResponseV3:
      type: object
      properties:
        message:
          type: string
          description: Human-readable error message.
          example: Product not found.
        errorCode:
          type: string
          description: Structured error code.
          example: 404_PROD_001
        errors:
          type: array
          items:
            type: object
            properties:
              message:
                type: string
                example: Product with id 'q1w2e3r4t5' was not found
              path:
                type: string
                description: Dot-separated path to the field that caused the error.
                example: pathParameters.productId
              errorCode:
                type: string
                example: 404_PROD_001
            required:
              - message
              - path
          description: Optional field-level error details.
      required:
        - message
        - errorCode
      description: Standard v3 error envelope.
    PlaceOrderV3ShippingAddress:
      type: object
      properties:
        address1:
          type: string
          minLength: 1
          maxLength: 35
          description: >-
            Street address, including house or building number. Maximum 35
            characters.
          example: 123 Main St
        address2:
          type: string
          maxLength: 35
          description: >-
            Apartment, suite, floor, or other secondary address details. Maximum
            35 characters.
          example: Apt 4B
        city:
          type: string
          minLength: 1
          description: City name.
          example: New York
        provinceCode:
          type: string
          pattern: ^[A-Z0-9]{1,3}$
          description: >-
            State or province code. Must be 1-3 uppercase alphanumeric
            characters (e.g., US state codes like NY, CA, or Australian
            territories like NSW).
          example: NY
        postalCode:
          type: string
          pattern: ^[a-zA-Z0-9 -]{3,10}$
          description: Postal code or ZIP code. Alphanumeric, 3-10 characters.
          example: '10001'
        countryCode:
          type: string
          pattern: ^[A-Z]{2}$
          description: Two-letter ISO 3166-1 alpha-2 country code. Must be uppercase.
          example: US
      required:
        - address1
        - city
        - provinceCode
        - postalCode
        - countryCode
      additionalProperties: false
      description: Physical shipping address for order delivery.
      example:
        address1: 123 Main St
        address2: Apt 4B
        city: New York
        provinceCode: NY
        postalCode: '10001'
        countryCode: US
  securitySchemes:
    ApiKeyAuthentication:
      type: apiKey
      in: header
      name: X-Api-Key
      description: |-
        ## Company Level Authentication

        Include your API key in the `X-Api-Key` header for every request:
        ```
        X-Api-Key: YOUR_API_KEY
        ```

````