> ## Documentation Index
> Fetch the complete documentation index at: https://api-doc.fidly.be/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Delivery Location

> Save a delivery address on a third party, to reuse it on the documents issued to it.

The country is required, as on any address, and `street_number` may only be given with a
`street`. `identifier` and `identifier_scheme` go together: a GLN means nothing without the
scheme that says how to read it.

In sandbox mode the body is validated exactly as in live mode but nothing is stored, so the
returned `id` is not resolvable.



## OpenAPI

````yaml /openapi.json post /delivery-locations
openapi: 3.1.0
info:
  title: Fidly API
  version: 1.0.0
servers:
  - url: https://api.fidly.be
    description: Production
security: []
paths:
  /delivery-locations:
    post:
      tags:
        - delivery locations
      summary: Create Delivery Location
      description: >-
        Save a delivery address on a third party, to reuse it on the documents
        issued to it.


        The country is required, as on any address, and `street_number` may only
        be given with a

        `street`. `identifier` and `identifier_scheme` go together: a GLN means
        nothing without the

        scheme that says how to read it.


        In sandbox mode the body is validated exactly as in live mode but
        nothing is stored, so the

        returned `id` is not resolvable.
      operationId: create_delivery_location_delivery_locations_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeliveryLocationCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeliveryLocationOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    DeliveryLocationCreate:
      properties:
        relation_id:
          type: string
          maxLength: 36
          title: Relation Id
          description: Opaque identifier of the third party this address belongs to.
        address:
          $ref: '#/components/schemas/AddressCreate'
          description: The address itself; the country is required.
        name:
          anyOf:
            - type: string
              maxLength: 100
            - type: 'null'
          title: Name
          description: >-
            Label of the location, to tell two addresses of the same third party
            apart.
        identifier:
          anyOf:
            - type: string
              maxLength: 30
            - type: 'null'
          title: Identifier
          description: >-
            Identifier of the location itself, typically a GLN. Requires
            `identifier_scheme`.
        identifier_scheme:
          anyOf:
            - type: string
            - type: 'null'
          title: Identifier Scheme
          description: >-
            4-digit Peppol scheme code, e.g. `0088` for a GLN. Requires
            `identifier`.
      additionalProperties: false
      type: object
      required:
        - relation_id
        - address
      title: DeliveryLocationCreate
      description: A delivery address to save on a third party.
    DeliveryLocationOut:
      properties:
        id:
          type: string
          title: Id
          description: Opaque unique identifier of the delivery location.
        relation_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Relation Id
          description: >-
            Opaque identifier of the third party this address belongs to
            (resolvable via `GET /relations/{id}`).
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Label of the location, e.g. `Warehouse Liège`.
        address:
          anyOf:
            - $ref: '#/components/schemas/AddressOut'
            - type: 'null'
          description: The address itself.
        identifier:
          anyOf:
            - type: string
            - type: 'null'
          title: Identifier
          description: Identifier of the location itself, typically a GLN.
        identifier_scheme:
          anyOf:
            - type: string
            - type: 'null'
          title: Identifier Scheme
          description: >-
            Scheme `identifier` belongs to — 4-digit Peppol scheme code, e.g.
            `0088` for a GLN.
      type: object
      required:
        - id
      title: DeliveryLocationOut
      description: A delivery address saved on a third party.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AddressCreate:
      properties:
        country_code:
          type: string
          title: Country Code
          description: >-
            Country of the relation (must be an ISO 3166-1 alpha-2 country code,
            e.g. 'BE').
        street:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Street
          description: Street name.
        street_number:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Street Number
          description: Street/house number. Requires `street`.
        street2:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Street2
          description: Additional address line.
        postal_code:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Postal Code
          description: Postal/ZIP code.
        city:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: City
          description: City.
        province:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Province
          description: 'Free text: province, state or region.'
      additionalProperties: false
      type: object
      required:
        - country_code
      title: AddressCreate
      description: >-
        The address of a relation being created. `country_code` is required — a
        relation is

        always located somewhere, and the country drives the VAT and Peppol
        handling downstream.


        `street_number` may only be given together with `street`: a house number
        on its own does

        not identify anything.
    AddressOut:
      properties:
        street:
          anyOf:
            - type: string
            - type: 'null'
          title: Street
          description: Street name.
        street_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Street Number
          description: Street/house number.
        street2:
          anyOf:
            - type: string
            - type: 'null'
          title: Street2
          description: Additional address line.
        postal_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Postal Code
          description: Postal/ZIP code.
        city:
          anyOf:
            - type: string
            - type: 'null'
          title: City
          description: City.
        province:
          anyOf:
            - type: string
            - type: 'null'
          title: Province
          description: Province, state or region.
        country_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Country Code
          description: ISO 3166-1 alpha-2 country code (e.g. `BE`).
      type: object
      title: AddressOut
      description: >-
        Postal address of a relation. The object itself is `null` when none is
        stored.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````