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

# Create a delivery note

> Creates one delivery note from an existing organization-scoped sale or from explicit standalone data. Sale origin derives customer, point of sale, items, quantities, product identity, and warehouses. Creation is independent from invoicing and preserves the current one-delivery-note-per-sale rule.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/delivery-notes
openapi: 3.1.0
info:
  title: La Pyme API
  description: >-
    Resources and workflows for purchases, sales, inventory, contacts, products,
    reports, and settings.
  version: 1.0.0
  contact:
    name: La Pyme Support
    email: hola@lapyme.com.ar
  license:
    name: Proprietary
    url: https://lapyme.com.ar/terminos
servers:
  - url: https://api.lapyme.com.ar
    description: Servidor de producción
security:
  - bearerAuth: []
tags:
  - name: API
    description: Public API operations for La Pyme integrations.
paths:
  /api/v1/delivery-notes:
    post:
      tags:
        - API
      summary: Create a delivery note
      description: >-
        Creates one delivery note from an existing organization-scoped sale or
        from explicit standalone data. Sale origin derives customer, point of
        sale, items, quantities, product identity, and warehouses. Creation is
        independent from invoicing and preserves the current
        one-delivery-note-per-sale rule.
      operationId: createApiDeliveryNote
      parameters:
        - name: Idempotency-Key
          in: header
          description: Clave estable para deduplicar reintentos de la misma operación.
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiDeliveryNoteCreateRequest'
            examples:
              sale:
                summary: Create from an existing sale
                value:
                  origin:
                    type: sale
                    sale_id: 550e8400-e29b-41d4-a716-446655440100
                  date: '2026-08-30'
                  notes: '2 pallets; weighed kilograms: 850'
                  carrier: Example carrier
                  delivery_address: Ruta 9 km 12
                  recipient_name: Juan Perez
                  recipient_document: '30123456'
              custom:
                summary: Create a standalone delivery note
                value:
                  origin:
                    type: custom
                  customer_id: 550e8400-e29b-41d4-a716-446655440101
                  point_of_sale_id: 550e8400-e29b-41d4-a716-446655440102
                  items:
                    - product_id: 550e8400-e29b-41d4-a716-446655440103
                      warehouse_id: 550e8400-e29b-41d4-a716-446655440104
                      quantity: 2
                    - is_custom: true
                      name: Additional package
                      quantity: 1
                  notes: Deliver at loading dock 3
      responses:
        '200':
          description: Idempotent replay of the existing delivery note
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiDeliveryNoteWriteResponse'
        '201':
          description: Delivery note created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiDeliveryNoteWriteResponse'
        '400':
          description: Invalid request or missing Idempotency-Key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: INVALID_REQUEST
                  value:
                    request_id: req_error_1
                    error:
                      type: invalid_request_error
                      code: INVALID_REQUEST
                      message: Invalid request or missing Idempotency-Key
                      retryable: false
                      details: []
        '401':
          description: Missing or invalid API credential
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: INVALID_REQUEST
                  value:
                    request_id: req_error_1
                    error:
                      type: invalid_request_error
                      code: INVALID_REQUEST
                      message: Missing or invalid API credential
                      retryable: false
                      details: []
        '403':
          description: Insufficient scopes or location access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: INVALID_REQUEST
                  value:
                    request_id: req_error_1
                    error:
                      type: invalid_request_error
                      code: INVALID_REQUEST
                      message: Insufficient scopes or location access
                      retryable: false
                      details: []
        '404':
          description: Sale or standalone reference not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: INVALID_REQUEST
                  value:
                    request_id: req_error_1
                    error:
                      type: invalid_request_error
                      code: INVALID_REQUEST
                      message: Sale or standalone reference not found
                      retryable: false
                      details: []
        '409':
          description: State or idempotency conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: IDEMPOTENCY_CONFLICT
                  value:
                    request_id: req_delivery_note_1
                    error:
                      type: idempotency_error
                      code: IDEMPOTENCY_CONFLICT
                      message: >-
                        The Idempotency-Key was already used with a different
                        delivery note request.
                      retryable: false
                      details: []
        '429':
          description: Límite de solicitudes excedido para la organización
          headers:
            Retry-After:
              description: Segundos a esperar antes de volver a intentar la solicitud.
              schema:
                type: string
                example: '30'
            X-RateLimit-Limit:
              description: Límite de la ventana activa.
              schema:
                type: string
                example: '5000'
            X-RateLimit-Remaining:
              description: Solicitudes restantes en la ventana activa.
              schema:
                type: string
                example: '0'
            X-RateLimit-Reset:
              description: Segundos restantes hasta el reset de la ventana activa.
              schema:
                type: string
                example: '30'
            RateLimit-Limit:
              description: Límite de la ventana activa en formato estándar.
              schema:
                type: string
                example: '5000'
            RateLimit-Remaining:
              description: Solicitudes restantes en la ventana activa en formato estándar.
              schema:
                type: string
                example: '0'
            RateLimit-Reset:
              description: >-
                Segundos hasta el reset de la ventana activa en formato
                estándar.
              schema:
                type: string
                example: '30'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: RATE_LIMITED
                  value:
                    request_id: req_rate_limit_1
                    error:
                      type: rate_limit_error
                      code: RATE_LIMITED
                      message: >-
                        The organization request limit was reached. Try again
                        later.
                      retryable: true
                      details: []
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: INVALID_REQUEST
                  value:
                    request_id: req_error_1
                    error:
                      type: invalid_request_error
                      code: INVALID_REQUEST
                      message: Internal server error
                      retryable: false
                      details: []
components:
  schemas:
    ApiDeliveryNoteCreateRequest:
      anyOf:
        - type: object
          properties:
            date:
              type: string
              format: date
            notes:
              anyOf:
                - type: string
                - type: 'null'
            carrier:
              anyOf:
                - type: string
                - type: 'null'
            delivery_address:
              anyOf:
                - type: string
                - type: 'null'
            scheduled_date:
              anyOf:
                - type: string
                  format: date
                - type: 'null'
            recipient_name:
              anyOf:
                - type: string
                - type: 'null'
            recipient_document:
              anyOf:
                - type: string
                - type: 'null'
            origin:
              $ref: '#/components/schemas/ApiSharedObjectc15d6ab2fa'
          required:
            - origin
          additionalProperties: false
        - type: object
          properties:
            date:
              type: string
              format: date
            notes:
              anyOf:
                - type: string
                - type: 'null'
            carrier:
              anyOf:
                - type: string
                - type: 'null'
            delivery_address:
              anyOf:
                - type: string
                - type: 'null'
            scheduled_date:
              anyOf:
                - type: string
                  format: date
                - type: 'null'
            recipient_name:
              anyOf:
                - type: string
                - type: 'null'
            recipient_document:
              anyOf:
                - type: string
                - type: 'null'
            origin:
              $ref: '#/components/schemas/ApiSharedObject05f64e43bb'
            customer_id:
              type: string
              format: uuid
            point_of_sale_id:
              type: string
              format: uuid
            items:
              minItems: 1
              maxItems: 500
              type: array
              items:
                anyOf:
                  - type: object
                    properties:
                      product_id:
                        type: string
                        format: uuid
                      warehouse_id:
                        type: string
                        format: uuid
                      name:
                        type: string
                      is_custom:
                        type: boolean
                        const: false
                      quantity:
                        type: number
                        exclusiveMinimum: 0
                    required:
                      - product_id
                      - quantity
                    additionalProperties: false
                  - type: object
                    properties:
                      name:
                        type: string
                      is_custom:
                        type: boolean
                        const: true
                      quantity:
                        type: number
                        exclusiveMinimum: 0
                    required:
                      - name
                      - is_custom
                      - quantity
                    additionalProperties: false
          required:
            - origin
            - customer_id
            - point_of_sale_id
            - items
          additionalProperties: false
    ApiDeliveryNoteWriteResponse:
      type: object
      properties:
        request_id:
          type: string
        data:
          type: object
          properties:
            object:
              type: string
              const: delivery_note
            id:
              type: string
              format: uuid
            number:
              anyOf:
                - type: string
                - type: 'null'
            date:
              type: string
              format: date
            customer:
              anyOf:
                - $ref: '#/components/schemas/ApiSharedObject738aa6c207'
                - type: 'null'
            origin:
              oneOf:
                - $ref: '#/components/schemas/ApiSharedObjectc15d6ab2fa'
                - $ref: '#/components/schemas/ApiSharedObject5a978938b1'
                - $ref: '#/components/schemas/ApiSharedObject05f64e43bb'
            created_at:
              type: string
              format: date-time
            delivery_note_number:
              type: integer
            point_of_sale:
              anyOf:
                - $ref: '#/components/schemas/ApiSharedObjectb4d57efe6e'
                - type: 'null'
            carrier:
              anyOf:
                - type: string
                - type: 'null'
            delivery_address:
              anyOf:
                - type: string
                - type: 'null'
            scheduled_date:
              anyOf:
                - type: string
                  format: date
                - type: 'null'
            delivered_at:
              anyOf:
                - type: string
                  format: date-time
                - type: 'null'
            recipient_name:
              anyOf:
                - type: string
                - type: 'null'
            recipient_document:
              anyOf:
                - type: string
                - type: 'null'
            driver_id:
              anyOf:
                - type: string
                  format: uuid
                - type: 'null'
            notes:
              anyOf:
                - type: string
                - type: 'null'
            items:
              type: array
              items:
                $ref: '#/components/schemas/ApiSharedObject8e3feaa104'
            updated_at:
              type: string
              format: date-time
            idempotent_replay:
              type: boolean
          required:
            - object
            - id
            - number
            - date
            - customer
            - origin
            - created_at
            - delivery_note_number
            - point_of_sale
            - carrier
            - delivery_address
            - scheduled_date
            - delivered_at
            - recipient_name
            - recipient_document
            - driver_id
            - notes
            - items
            - updated_at
            - idempotent_replay
          additionalProperties: false
      required:
        - request_id
        - data
      additionalProperties: false
    ApiErrorEnvelope:
      type: object
      properties:
        request_id:
          type: string
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - api_error
                - authentication_error
                - authorization_error
                - business_error
                - external_dependency_error
                - idempotency_error
                - invalid_request_error
                - rate_limit_error
            code:
              type: string
            message:
              type: string
            retryable:
              type: boolean
            details:
              type: array
              items:
                type: object
                properties:
                  field:
                    type: string
                  code:
                    type: string
                  message:
                    type: string
                  metadata:
                    type: object
                    propertyNames:
                      type: string
                    additionalProperties:
                      anyOf:
                        - type: string
                        - type: number
                        - type: boolean
                        - type: 'null'
                required:
                  - code
                  - message
                additionalProperties: false
          required:
            - type
            - code
            - message
            - retryable
            - details
          additionalProperties: false
      required:
        - request_id
        - error
      additionalProperties: false
    ApiSharedObjectc15d6ab2fa:
      type: object
      properties:
        type:
          type: string
          const: sale
        sale_id:
          type: string
          format: uuid
      required:
        - type
        - sale_id
      additionalProperties: false
    ApiSharedObject05f64e43bb:
      type: object
      properties:
        type:
          type: string
          const: custom
      required:
        - type
      additionalProperties: false
    ApiSharedObject738aa6c207:
      type: object
      properties:
        object:
          type: string
          const: customer
        id:
          type: string
          format: uuid
        name:
          anyOf:
            - type: string
            - type: 'null'
        email:
          anyOf:
            - type: string
              format: email
            - type: 'null'
        phone:
          anyOf:
            - type: string
            - type: 'null'
        tax_id_type:
          anyOf:
            - type: string
            - type: 'null'
        tax_id:
          anyOf:
            - type: string
            - type: 'null'
        tax_category:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - id
        - name
      additionalProperties: false
    ApiSharedObject5a978938b1:
      type: object
      properties:
        type:
          type: string
          const: fulfillment
        fulfillment_id:
          type: string
          format: uuid
      required:
        - type
        - fulfillment_id
      additionalProperties: false
    ApiSharedObjectb4d57efe6e:
      type: object
      properties:
        id:
          type: string
          format: uuid
        number:
          type: integer
        name:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - id
        - number
        - name
      additionalProperties: false
    ApiSharedObject8e3feaa104:
      type: object
      properties:
        id:
          type: string
          format: uuid
        sale_item_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
        quantity:
          type: number
        name:
          anyOf:
            - type: string
            - type: 'null'
        is_custom:
          type: boolean
        warehouse_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
        product:
          anyOf:
            - $ref: '#/components/schemas/ApiSharedObjectf03e2ce692'
            - type: 'null'
      required:
        - id
        - sale_item_id
        - quantity
        - name
        - is_custom
        - warehouse_id
        - product
      additionalProperties: false
    ApiSharedObjectf03e2ce692:
      type: object
      properties:
        object:
          type: string
          const: product
        id:
          type: string
          format: uuid
        sku:
          anyOf:
            - type: string
            - type: 'null'
        name:
          anyOf:
            - type: string
            - type: 'null'
        option_names:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
        variant_options:
          anyOf:
            - type: object
              propertyNames:
                type: string
              additionalProperties:
                type: string
            - type: 'null'
        product_type:
          anyOf:
            - $ref: '#/components/schemas/ApiSharedEnum5c962a8637'
            - type: 'null'
        kit_units:
          type: number
      required:
        - id
        - sku
        - name
        - option_names
        - variant_options
        - product_type
        - kit_units
      additionalProperties: false
    ApiSharedEnum5c962a8637:
      type: string
      enum:
        - product
        - combo
        - kit
        - service
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: Incluí tu API key en el header Authorization con el prefijo Bearer.

````