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

# Create shipping address

> Store a new shipping address for the authenticated shopper and optionally set it as default.

## Request

```http theme={null}
POST /shipping-address
Authorization: Bearer {{token}}
x-shop-id: {{shopId}}
Content-Type: application/json

{
  "name": "Jane Smith",
  "email": "jane@example.com",
  "phone": "+2348099887766",
  "address": "12 Computation Way, Lagos",
  "city": "Lagos",
  "state": "Lagos",
  "zipCode": "100001",
  "country": "NG",
  "latitude": 6.4541,
  "longitude": 3.3947,
  "isDefault": true
}
```

## Headers

| Header          | Type   | Description                                  |
| --------------- | ------ | -------------------------------------------- |
| `Authorization` | string | Include the shopper token as `Bearer <jwt>`. |
| `x-shop-id`     | string | Scope the request to a specific shop.        |
| `Content-Type`  | string | Always set to `application/json`.            |

## Body parameters

| Field       | Type    | Required | Description                                              |
| ----------- | ------- | -------- | -------------------------------------------------------- |
| `name`      | string  | Yes      | Recipient name for the delivery.                         |
| `email`     | string  | No       | Contact email for the recipient.                         |
| `phone`     | string  | No       | Contact phone number for the recipient.                  |
| `address`   | string  | Yes      | Full street address (geocoded on save).                  |
| `city`      | string  | Yes      | City where the delivery should be made.                  |
| `state`     | string  | Yes      | State or province component of the address.              |
| `zipCode`   | string  | Yes      | Postal or ZIP code.                                      |
| `country`   | string  | Yes      | ISO 3166-1 alpha-2 country code (e.g. `NG`, `US`, `GB`). |
| `latitude`  | number  | No       | Latitude coordinate for geocoding.                       |
| `longitude` | number  | No       | Longitude coordinate for geocoding.                      |
| `isDefault` | boolean | No       | Set to `true` to make this the default shipping address. |

## Successful response

```json theme={null}
{
    "status": 200,
    "success": true,
    "message": "Shipping address saved",
    "data": {
        "shippingAddress": {
            "_id": "6a27d707289b87893fcbde52",
            "user": "69360693a7a8f7dc8ae32d6d",
            "name": "Jane Smith",
            "email": "jane@example.com",
            "phone": "+2348099887766",
            "address": "12 Computation Way, Lagos",
            "city": "Lagos",
            "state": "Lagos",
            "zipCode": "100001",
            "country": "NG",
            "latitude": 6.4541,
            "longitude": 3.3947,
            "validated": {
                "address_code": 536035068,
                "address": "12 Computation Way, Lagos Island, Lagos, Nigeria",
                "name": "Jane Smith",
                "email": "jane@example.com",
                "street_no": "12",
                "street": "Computation Way",
                "phone": "+2348099887766",
                "formatted_address": "12 Computation Way, Lagos Island, Lagos, Nigeria",
                "country": "Nigeria",
                "country_code": "NG",
                "city": "Lagos Island",
                "city_code": "Lagos Island",
                "state": "Lagos",
                "state_code": "LA",
                "postal_code": "100001",
                "latitude": 6.4541,
                "longitude": 3.3947
            },
            "isDefault": false,
            "deleted": false,
            "createdAt": "2026-06-09T09:04:07.485Z",
            "updatedAt": "2026-06-09T09:04:07.485Z",
            "__v": 0
        }
    }
}
```

## Error response

```json theme={null}
{
    "status": 400,
    "success": false,
    "message": "\"name\" is required",
    "data": {}
}
```


## OpenAPI

````yaml POST /shipping-address
openapi: 3.1.0
info:
  title: Salesive Store API
  description: >-
    REST interface for querying products, categories, and merchandising banners
    exposed by Salesive storefronts.
  version: 1.0.0
servers:
  - description: Production
    url: https://store.salesive.com/api/v1
security:
  - BearerAuth: []
    ShopIdHeader: []
paths:
  /shipping-address:
    post:
      summary: Create shipping address
      description: >-
        Create a shipping address for the shopper and optionally mark it as
        default.
      parameters:
        - $ref: '#/components/parameters/XShopIdHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateShippingAddressRequest'
      responses:
        '200':
          description: Shipping address saved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateShippingAddressResponse'
        '400':
          description: Invalid payload.
        '401':
          description: Unauthorized.
components:
  parameters:
    XShopIdHeader:
      name: x-shop-id
      in: header
      description: >-
        Optional identifier that scopes responses to a specific storefront when
        the referer cannot be inferred.
      required: false
      schema:
        type: string
  schemas:
    CreateShippingAddressRequest:
      type: object
      required:
        - fullName
        - street
        - city
        - state
        - zipCode
        - country
      properties:
        fullName:
          type: string
          description: Recipient name for the delivery.
        phone:
          type: string
          description: Optional phone number for delivery coordination.
        street:
          type: string
          description: Primary street address.
        street2:
          type: string
          description: Additional address details such as apartment or suite.
        city:
          type: string
          description: City component of the address.
        state:
          type: string
          description: State or province component of the address.
        zipCode:
          type: string
          description: Postal or ZIP code.
        country:
          type: string
          description: Country for the address.
        latitude:
          type: number
          description: Latitude coordinate for mapping purposes.
        longitude:
          type: number
          description: Longitude coordinate for mapping purposes.
        landmark:
          type: string
          description: Helpful nearby landmark or delivery instruction.
        isDefault:
          type: boolean
          description: Set to true to make this the default shipping address.
    CreateShippingAddressResponse:
      type: object
      required:
        - status
        - success
        - message
        - data
      properties:
        status:
          type: integer
        success:
          type: boolean
        message:
          type: string
        data:
          type: object
          required:
            - shippingAddress
          properties:
            shippingAddress:
              $ref: '#/components/schemas/ShippingAddress'
    ShippingAddress:
      type: object
      required:
        - _id
        - fullName
        - street
        - city
        - state
        - zipCode
        - country
        - isDefault
        - createdAt
        - updatedAt
      properties:
        _id:
          type: string
          description: Unique identifier for the shipping address.
        fullName:
          type: string
          description: Recipient name for the delivery.
        phone:
          type: string
          description: Optional phone number for delivery coordination.
        street:
          type: string
          description: Primary street address.
        street2:
          type: string
          description: Additional address details such as apartment or suite.
        city:
          type: string
          description: City component of the address.
        state:
          type: string
          description: State or province component of the address.
        zipCode:
          type: string
          description: Postal or ZIP code.
        country:
          type: string
          description: Country for the address.
        latitude:
          type: number
          description: Latitude coordinate for mapping purposes.
        longitude:
          type: number
          description: Longitude coordinate for mapping purposes.
        landmark:
          type: string
          description: Helpful nearby landmark or delivery instruction.
        isDefault:
          type: boolean
          description: Indicates whether this address is the default for the shopper.
        createdAt:
          type: string
          format: date-time
          description: Timestamp of when the address was created.
        updatedAt:
          type: string
          format: date-time
          description: Timestamp of when the address was last updated.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT issued by the Salesive Store API for authenticated shoppers.
    ShopIdHeader:
      type: apiKey
      in: header
      name: x-shop-id
      description: >-
        Optional storefront identifier sent as a header to scope responses to a
        specific shop. Try It requests remember this value once provided.

````