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

# Set the caller's default address

> Points the client's `defaultAddressId` at an address they have already saved; it does not create one, so add the address first or this is a 404. Returns the whole updated profile.

Worth doing deliberately rather than leaving to chance, because the default is not just a delivery preference: it is the fallback the pricing engine uses to pick a region when an order names no reservation, location or address of its own. Moving the default across a country or subdivision border therefore changes what that client is quoted for the same offering. It does not touch orders already placed, which snapshot their region at creation, so repointing it fixes future orders only.



## OpenAPI

````yaml /api-reference/openapi.json put /v1/projects/{projectId}/clients/me/addresses/{addressId}/default
openapi: 3.0.0
info:
  title: MarketBox 2.0 Open API
  version: 1.0.0
  description: >-
    The MarketBox public API for building booking experiences. Core model:
    create an order, then draw its order items down into bookings. Single
    bookings reference an order item per service line; package bookings draw one
    PACKAGE item down across N sessions. To schedule a package, build a slate
    (POST /availability/package-slate) and book it by slateId (POST
    /orders/{orderId}/package-bookings). See the guides for end-to-end
    walkthroughs.
  contact:
    name: MarketBox support
servers:
  - url: https://apiv2.gomarketbox.com
    description: MarketBox Open API
security:
  - ApiKeyAuth: []
paths:
  /v1/projects/{projectId}/clients/me/addresses/{addressId}/default:
    put:
      tags:
        - Clients
      summary: Set the caller's default address
      description: >-
        Points the client's `defaultAddressId` at an address they have already
        saved; it does not create one, so add the address first or this is a
        404. Returns the whole updated profile.


        Worth doing deliberately rather than leaving to chance, because the
        default is not just a delivery preference: it is the fallback the
        pricing engine uses to pick a region when an order names no reservation,
        location or address of its own. Moving the default across a country or
        subdivision border therefore changes what that client is quoted for the
        same offering. It does not touch orders already placed, which snapshot
        their region at creation, so repointing it fixes future orders only.
      parameters:
        - schema:
            type: string
            minLength: 1
            description: >-
              The project (tenant) that owns the resource. Every resource in
              this API is scoped to a project, and your API key is restricted to
              the projects it was issued for — a project outside that scope
              returns 403.
            example: prj_01kv60qgnef2kt3pvqgwmkbzfr
          required: true
          description: >-
            The project (tenant) that owns the resource. Every resource in this
            API is scoped to a project, and your API key is restricted to the
            projects it was issued for — a project outside that scope returns
            403.
          name: projectId
          in: path
        - schema:
            type: string
            minLength: 1
            description: >-
              One of the client's saved addresses. The id is a fingerprint of
              the address fields, so the same physical address always yields the
              same id.
            example: addr_9f2c1ab77d0e4b3c85a16e2f
          required: true
          description: >-
            One of the client's saved addresses. The id is a fingerprint of the
            address fields, so the same physical address always yields the same
            id.
          name: addressId
          in: path
      responses:
        '200':
          description: Default set
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/ClientProfile'
                required:
                  - data
        '401':
          description: Missing/invalid user token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '403':
          description: >-
            No access to project or unregistered user, or the signed-in user is
            not an ACTIVE member of it holding the route’s permission
            (FORBIDDEN), or X-MB-Acting-Role names a role they do not hold
            (ACTING_ROLE_NOT_HELD)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: Client or address not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - ApiKeyAuth: []
          EndUserBearer: []
components:
  schemas:
    ClientProfile:
      type: object
      properties:
        entityType:
          type: string
          enum:
            - CLIENT_PROFILE
        clientId:
          type: string
        projectId:
          type: string
        firstName:
          type: string
        lastName:
          type: string
        fullName:
          type: string
        firstNameNormalized:
          type: string
        lastNameNormalized:
          type: string
        fullNameNormalized:
          type: string
        email:
          type: string
        emailNormalized:
          type: string
        phone:
          type: string
        defaultAddressId:
          type: string
        externalId:
          type: string
        externalData:
          type: object
          additionalProperties:
            nullable: true
        userId:
          type: string
        invitationStatus:
          type: string
          enum:
            - NONE
            - INVITED
            - LINKED
        stripeCustomerId:
          type: string
          nullable: true
        stripeAccountId:
          type: string
          nullable: true
        notes:
          type: string
        lifetimeSpend:
          type: number
        orderCount:
          type: number
        lastPurchaseAt:
          type: string
        lastPaymentMethodId:
          type: string
        lastPayment:
          type: object
          properties:
            type:
              type: string
              enum:
                - CARD
            brand:
              type: string
            last4:
              type: string
              minLength: 4
              maxLength: 4
            expMonth:
              type: integer
              nullable: true
              minimum: 1
              maximum: 12
            expYear:
              type: integer
              nullable: true
            paidAt:
              type: string
          required:
            - type
            - brand
            - last4
            - paidAt
        defaultLocale:
          type: string
        active:
          type: boolean
        deleted:
          type: boolean
        createdAt:
          type: string
        updatedAt:
          type: string
        createdBy:
          type: string
        updatedBy:
          type: string
        addresses:
          type: array
          items:
            type: object
            properties:
              addressOneLine:
                type: string
                minLength: 1
                description: The whole address on one line, as a person would write it.
                example: 10 Main St, Toronto, ON M5V 1A1, Canada
              streetNumber:
                type: string
                minLength: 1
                description: The street number.
                example: '10'
              streetName:
                type: string
                minLength: 1
                description: The street name.
                example: Main St
              city:
                type: string
                minLength: 1
                description: The city or town.
                example: Toronto
              state:
                type: string
                minLength: 1
                description: >-
                  The state, province or region; an ISO 3166-2 code when one
                  matches.
                example: 'ON'
              country:
                type: string
                minLength: 1
                description: The country; ISO 3166-1 alpha-2, alpha-3 or the English name.
                example: CA
              zipCode:
                type: string
                minLength: 1
                description: The postal or ZIP code, in any national format.
                example: M5V 1A1
              unitNumber:
                type: string
                nullable: true
                description: The unit, suite or apartment, if any.
                example: 4B
              id:
                type: string
                minLength: 1
              source:
                type: string
                enum:
                  - BOOKING
                  - MANUAL
              latitude:
                type: number
                nullable: true
              longitude:
                type: number
                nullable: true
            required:
              - addressOneLine
              - streetNumber
              - streetName
              - city
              - state
              - country
              - zipCode
              - id
      required:
        - entityType
        - clientId
        - projectId
        - firstName
        - lastName
        - fullName
        - firstNameNormalized
        - lastNameNormalized
        - fullNameNormalized
        - email
        - emailNormalized
        - invitationStatus
        - stripeCustomerId
        - stripeAccountId
        - active
        - deleted
        - createdAt
        - updatedAt
        - createdBy
        - updatedBy
        - addresses
    ErrorMessage:
      type: object
      properties:
        code:
          type: string
          description: Stable machine-readable error code, e.g. NOT_FOUND.
        message:
          type: string
          description: Human-readable description of what went wrong.
        statusCode:
          type: integer
          description: The HTTP status code of this response.
        requestId:
          type: string
          description: >-
            The id of this request, also returned as the X-Request-Id header.
            Quote it in a support ticket.
      required:
        - code
        - message
        - statusCode
        - requestId
      example:
        code: NOT_FOUND
        message: Booking not found
        statusCode: 404
        requestId: a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key minted in the MarketBox dashboard. Scope is restricted to the
        projects you select at creation time. Every route needs the key's
        standard API access (`*`) except `POST /v1/projects/{projectId}/events`,
        which needs `events:write`; a key without `*` is refused with 403
        `CAPABILITY_NOT_GRANTED`.
    EndUserBearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        The signed-in person's Cognito access token, issued to this
        application's app client. Sent with the API key on the /clients/me and
        /suppliers/me routes.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.