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

# Create Location

> Create a new location with name and address details



## OpenAPI

````yaml post /v1/locations
openapi: 3.1.1
info:
  title: HitPay API
  description: >-
    Accept PayNow, FPX, QRIS, GrabPay, cards, and 40+ payment methods with a
    single API. Production base URL: https://api.hit-pay.com, Sandbox:
    https://api.sandbox.hit-pay.com
  version: '1.0'
servers:
  - url: https://api.hit-pay.com
    description: Production
  - url: https://api.sandbox.hit-pay.com
    description: Sandbox
security: []
paths:
  /v1/locations:
    post:
      tags:
        - Location
      summary: Create location
      description: >
        Create a new location for the authenticated business. The business is
        resolved from the API key

        or OAuth bearer token. Newly created locations are active by default.
      operationId: PublicCreateLocation
      parameters:
        - name: X-BUSINESS-API-KEY
          in: header
          required: true
          style: simple
          explode: false
          schema:
            type: string
            example: b286daabf9921b5a01a4621f026c111e046f8911feba212996c92159b98427d
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - street
                - city
                - state
                - country
                - postal_code
              properties:
                name:
                  type: string
                  description: Location name
                  maxLength: 255
                  example: Main Store
                street:
                  type: string
                  description: Street address
                  maxLength: 255
                  example: 123 Main St
                city:
                  type: string
                  description: City
                  maxLength: 255
                  example: Singapore
                state:
                  type: string
                  description: State or region
                  maxLength: 255
                  example: Singapore
                country:
                  type: string
                  description: Country code or name
                  maxLength: 255
                  example: SG
                postal_code:
                  type: string
                  description: Postal code
                  maxLength: 16
                  example: '123456'
            example:
              name: Main Store
              street: 123 Main St
              city: Singapore
              state: Singapore
              country: SG
              postal_code: '123456'
      responses:
        '200':
          description: Location created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    description: Location ID
                    example: 9c484458-b2a3-4f49-87ed-ad9ea71b0df3
                  business_id:
                    type: string
                    format: uuid
                    description: Business that owns this location
                    example: 8a1f2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d
                  name:
                    type: string
                    description: Name of the location
                    example: Main Store
                  street:
                    type: string
                    description: Street address
                    example: 123 Main St
                  city:
                    type: string
                    description: City
                    example: Singapore
                  state:
                    type: string
                    description: State or region
                    example: Singapore
                  country:
                    type: string
                    description: Country code or name
                    example: SG
                  postal_code:
                    type: string
                    description: Postal code
                    example: '123456'
                  active:
                    type: boolean
                    description: Whether the location is active
                    example: true
                  pickups:
                    type: array
                    description: >-
                      Pickup configurations linked to this location (empty when
                      not loaded)
                    items:
                      type: object
                  created_at:
                    type: string
                    format: date-time
                  updated_at:
                    type: string
                    format: date-time
                required:
                  - id
                  - business_id
                  - name
                  - street
                  - city
                  - state
                  - country
                  - postal_code
                  - active
        '401':
          description: Missing or invalid API key / OAuth token
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                  errors:
                    type: array
        '403':
          description: Authenticated user cannot manage locations
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                  errors:
                    type: array
        '422':
          description: Validation error — required fields are missing or invalid
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                  errors:
                    type: array

````