openapi: 3.0.0
info:
  title: Enviame API
  description: |-
    # Intro 
     Hello world, this is the new Enviame API v3 definition. 
     # Authentication 
     Before using this API version, you have to request an initial setup of your company's account to our support team. You'll be provided with a cURL example to an **Auth0 application** that we will have created for you (we're sorry for this unsophisticated way, we are working on a better setup). The Auth0 app provides valid access tokens to call our API methods.
  version: 3.0.0
  license:
    name: Apache 2.0
host: api.enviame.io
basePath: /enviame
schemes:
  - https
produces:
  - application/json
consumes:
  - application/json
servers:
  - url: https://api.enviame.io/v3
    description: Production server
  - url: https://stage.api.enviame.io/v3
    description: Staging server
paths:
  /shippers/{shipper_id}/pickups:
    get:
      tags:
        - Pickups
      summary: Get Pickups as a Company/Seller
      operationId: Get-Pickups-list-v3
      description: Lista todos los retiros creados por una Empresa/Seller.
      parameters:
        - name: shipper_id
          in: path
          description: ID of the Company/Seller, generated by Enviame
          required: true
          schema:
            type: integer
            format: int64
        - name: Accept
          in: header
          required: true
          description: Not modified
          schema:
            type: string
            default: application/json
      responses:
        '200':
          description: successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 201
                  data:
                    type: array
                    items:
                      properties:
                        identifier:
                          type: string
                          description: Pickup Number generated
                          example: '1285372591218'
                        company:
                          type: object
                          properties:
                            id:
                              type: integer
                              description: ID of the Company/Seller, generated by Enviame
                              example:
                                carrier_code: BLX
                                warehouse_code: bod_ruka1
                                weight: 5
                                qty: 4
                                contact_name: User Test
                                contact_phone: 987654321
                                warehouse_contact_email: contacto@bodega.com
                                range_time: 13:00 - 14:00
                                pick_up_date: '2026-03-01'
                                size: c
                                width: 40
                                length: 40
                                height: 40
                                information: Este es un retiro
                            place_id:
                              type: integer
                              description: ID interno asignado al place del lugar de retiro
                              example: 378
                            full_address:
                              type: string
                              description: >-
                                Dirección completa de la bodega, sin incluir
                                comuna
                              example: Avenida Vitacura 123
                            place:
                              type: string
                              description: >-
                                Comuna (CL) - Ciudad/Municipio (CO)- Distrito
                                (PE) - Colonia (MX) - Municipio (AR) donde está
                                ubicada la bodega
                              example: Santiago
                            information:
                              type: string
                              description: >-
                                Información adicional o complemento de la
                                direccion
                              example: H23
                            place_parents:
                              type: object
                              properties:
                                parent1:
                                  type: object
                                  properties:
                                    id:
                                      type: integer
                                      description: >-
                                        ID interno asignado al level1 del lugar
                                        de retiro
                                      example: 61
                                    name:
                                      type: string
                                      description: ''
                                      example: Santiago
                                    level_name:
                                      type: string
                                      description: ''
                                      example: Provincia
                                parent2:
                                  type: object
                                  properties:
                                    id:
                                      type: integer
                                      description: >-
                                        ID interno asignado al level2 del lugar
                                        de retiro
                                      example: 7
                                    name:
                                      type: string
                                      description: ''
                                      example: Metropolitana de Santiago
                                    level_name:
                                      type: string
                                      description: ''
                                      example: Region
                            place_level_name:
                              type: string
                              description: ''
                              example: Comuna
                            zip_code:
                              type: string
                              description: ''
                              example: null
                        carrier:
                          type: object
                          properties:
                            code:
                              type: string
                              description: Código interno del carrier
                              example: BLX
                            name:
                              type: string
                              description: Nombre del carrier
                              example: Bluexpress
                            country:
                              type: string
                              description: Código del pais del carrier
                              example: CL
                            is_integrated:
                              type: integer
                              description: >-
                                Indica si el carrier está integrado y
                                automatizado
                              example: 1
                            time_zome:
                              type: string
                              description: Zona horaria del retiro agendado
                              example: America/Santiago
                            config:
                              type: object
                              properties:
                                time_limit:
                                  type: string
                                  description: Horario de corte del carrier
                                  example: '10:29'
                                time_limit_key:
                                  type: string
                                  description: ''
                                  example: default
                        range_time:
                          type: string
                          example: 13:00 - 18:00
                        qty:
                          type: integer
                          example: 7
                        weight:
                          type: integer
                          example: 10
                        contact:
                          type: object
                          properties:
                            name:
                              type: string
                              example: John Doe
                            phone:
                              type: string
                              example: 999999999
                        status:
                          type: object
                          properties:
                            code:
                              type: string
                              description: Código del estado del retiro
                              example: created
                            name:
                              type: string
                              description: Nombre del estado del operador
                              example: retiro creado
                            date:
                              type: integer
                              format: date
                              description: Horario del estado del retiro
                              example: '2025-04-04 16:50:11'
                        created_at:
                          type: integer
                          format: date
                          description: Hora y fecha de creacion del retiro
                          example: '2025-04-04 16:50:11'
                        updated_at:
                          type: integer
                          format: date
                          description: Hora y fecha la última actualización del retiro
                          example: '2025-04-04 16:50:11'
                        deleted_at:
                          type: integer
                          format: date
                          description: Hora y fecha de eliminación del retiro
                          example: null
                        uuid:
                          type: string
                          description: ''
                          example: d3e8a7ae-5a2a-43b3-a77b-e8c0a3e1718a
                        marketplace:
                          type: object
                          properties:
                            id:
                              type: integer
                              description: >-
                                ID del Marketplace, generado por Enviame (En
                                caso de que sean sellers independientes,
                                aparecerá la empresa 10)
                              example: 10
                            code:
                              type: string
                              description: Código del marketplace
                              example: enviame
                            name:
                              type: string
                              description: Nombre del marketplace
                              example: Envíame
                        type:
                          type: object
                          properties:
                            code:
                              type: string
                              description: Código del tipo de retiro
                              example: normal
                            name:
                              type: string
                              description: Nombre del tpo de retiro
                              example: retiro normal
                        size:
                          type: string
                          example: s
                        dimensions:
                          type: string
                          description: Dimensiones promedio relacionadas con el campo size
                          example: 10cm x 15cm x 5cm
                        pickup_date:
                          type: integer
                          format: date
                          description: Fecha en la cual se realizará el retiro
                          example: '2025-04-07'
                        warehouse:
                          type: object
                          properties:
                            id:
                              type: integer
                              description: Id interno de la bodega
                              example: 8710
                            code:
                              type: string
                              example: DEV
                            name:
                              type: string
                              description: Nombre de la bodega
                              example: DEV
                            contact:
                              type: object
                              properties:
                                name:
                                  type: string
                                  description: Nombre de contacto interno de la bodega
                                  example: Javier Smith
                                phone:
                                  type: string
                                  description: Numero de telefono de contacto de la bodega
                                  example: 998874910
                                email:
                                  type: string
                                  description: Correo electronico de contacto de la bodega
                                  example: cinthia.garrido@enviame.io
                        need_evaluation:
                          type: boolean
                          description: >-
                            Indica si el retiro requiere de evaluación al
                            finalizar el plazo
                          example: false
                        carrier_pickup_number:
                          type: string
                          description: Número de retiro asignado por el carrier
                          example: 1285372591218
                        carrier_pickup_created:
                          type: boolean
                          description: Indica si el retiro se creo en el operador
                          example: false
                        max_cancelation_date:
                          type: integer
                          format: date
                          description: Fecha máxima en la cual se puede cancelar el envío
                          example: null
                        id:
                          type: string
                          description: ID interno
                          example: cRr8Kbj8zPAb4OsCyQxU
        '422':
          description: The request was not successful.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: An error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    post:
      tags:
        - Pickups
      summary: Create Pickup as a Company/Seller
      operationId: Create-pickup-as-a-Company/Seller-v3
      description: >-
        Endpoint to create pickup as a Company/Seller. The response depends on
        the schedule of each carrier.
      parameters:
        - name: shipper_id
          in: path
          description: ID of the Company/Seller, generated by Enviame
          required: true
          schema:
            type: integer
            format: int64
        - name: Accept
          in: header
          required: true
          description: Not modified
          schema:
            type: string
            default: application/json
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - carrier_code
                - warehouse_code
                - qty
                - contact_name
                - contact_phone
                - range_time
                - pick_up_date
                - weight
                - size
              properties:
                carrier_code:
                  type: string
                  description: Carrier code to which the pickup will be requested.
                warehouse_code:
                  type: string
                  description: Warehouse code from which the pickup will be requested.
                qty:
                  type: number
                  format: int64
                  description: Quantity of packages
                contact_name:
                  type: string
                  description: Name of the contact responsible for the pickup.
                contact_phone:
                  type: string
                  description: Number phone of the contact responsible for the pickup.
                warehouse_contact_email:
                  type: string
                  format: email
                  description: >-
                    Email of the contact responsible for the pickup at the
                    warehouse.
                range_time:
                  type: string
                  description: 'Range time for the pickup (Ej: 13:00 - 14:00)'
                pick_up_date:
                  type: string
                  format: date
                  description: Date of pickup in format AAAA-MM-DD.
                information:
                  type: string
                  maxLength: 250
                  description: Aditional information to add to the pickup.
                weight:
                  type: integer
                  description: Weight (Kg) of the packages.
                size:
                  type: string
                  description: Size of the packages (xs, s, m, l, c)
                width:
                  type: integer
                  description: Width of the packages. Required when the size is "c"
                length:
                  type: integer
                  description: Length of the packages. Required when the size is "c"
                height:
                  type: integer
                  description: Height of the packages. Required when the size is "c"
                description:
                  type: string
                  maxLength: 250
                  description: Description of the packages. Required when the size is "c"
            example:
              carrier_code: BLX
              warehouse_code: bod_ruka1
              weight: 5
              qty: 4
              contact_name: Usuario Bodega
              contact_phone: 987654321
              warehouse_contact_email: contacto@bodega.com
              range_time: 13:00 - 14:00
              pick_up_date: '2026-03-01'
              size: c
              width: 80
              length: 80
              height: 80
              information: Este es un retiro
              description: Requerido porque es tipo c
      responses:
        '200':
          description: successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 201
                  data:
                    type: object
                    properties:
                      identifier:
                        type: string
                        description: Pickup Number generated
                        example: '1285372591218'
                      company:
                        type: object
                        properties:
                          id:
                            type: integer
                            description: ID of the Company/Seller, generated by Enviame
                            example: 2279
                          code:
                            type: string
                            description: Codigo alfanumerico de la Empresa/Seller
                            example: DEV
                          name:
                            type: string
                            description: Nombre de la Empresa/Seller
                            example: Development
                          dni:
                            type: string
                            description: RUT (DNI) de la Empresa/Seller
                            example: 106719926
                      address:
                        type: object
                        properties:
                          place_id:
                            type: integer
                            description: ID interno asignado al place del lugar de retiro
                            example: 378
                          full_address:
                            type: string
                            description: >-
                              Dirección completa de la bodega, sin incluir
                              comuna
                            example: Avenida Vitacura 123
                          place:
                            type: string
                            description: >-
                              Comuna (CL) - Ciudad/Municipio (CO)- Distrito (PE)
                              - Colonia (MX) - Municipio (AR) donde está ubicada
                              la bodega
                            example: Santiago
                          information:
                            type: string
                            description: >-
                              Información adicional o complemento de la
                              direccion
                            example: H23
                          place_parents:
                            type: object
                            properties:
                              parent1:
                                type: object
                                properties:
                                  id:
                                    type: integer
                                    description: >-
                                      ID interno asignado al level1 del lugar de
                                      retiro
                                    example: 61
                                  name:
                                    type: string
                                    description: ''
                                    example: Santiago
                                  level_name:
                                    type: string
                                    description: ''
                                    example: Provincia
                              parent2:
                                type: object
                                properties:
                                  id:
                                    type: integer
                                    description: >-
                                      ID interno asignado al level2 del lugar de
                                      retiro
                                    example: 7
                                  name:
                                    type: string
                                    description: ''
                                    example: Metropolitana de Santiago
                                  level_name:
                                    type: string
                                    description: ''
                                    example: Region
                          place_level_name:
                            type: string
                            description: ''
                            example: Comuna
                          zip_code:
                            type: string
                            description: ''
                            example: null
                      carrier:
                        type: object
                        properties:
                          code:
                            type: string
                            description: Código interno del carrier
                            example: BLX
                          name:
                            type: string
                            description: Nombre del carrier
                            example: Bluexpress
                          country:
                            type: string
                            description: Código del pais del carrier
                            example: CL
                          is_integrated:
                            type: integer
                            description: Indica si el carrier está integrado y automatizado
                            example: 1
                          time_zome:
                            type: string
                            description: Zona horaria del retiro agendado
                            example: America/Santiago
                          config:
                            type: object
                            properties:
                              time_limit:
                                type: string
                                description: Horario de corte del carrier
                                example: '10:29'
                              time_limit_key:
                                type: string
                                description: ''
                                example: default
                      range_time:
                        type: string
                        example: 13:00 - 18:00
                      qty:
                        type: integer
                        example: 7
                      weight:
                        type: integer
                        example: 10
                      contact:
                        type: object
                        properties:
                          name:
                            type: string
                            example: John Doe
                          phone:
                            type: string
                            example: 999999999
                      status:
                        type: object
                        properties:
                          code:
                            type: string
                            description: Código del estado del retiro
                            example: created
                          name:
                            type: string
                            description: Nombre del estado del operador
                            example: retiro creado
                          date:
                            type: integer
                            format: date
                            description: Horario del estado del retiro
                            example: '2025-04-04 16:50:11'
                      created_at:
                        type: integer
                        format: date
                        description: Hora y fecha de creacion del retiro
                        example: '2025-04-04 16:50:11'
                      updated_at:
                        type: integer
                        format: date
                        description: Hora y fecha la última actualización del retiro
                        example: '2025-04-04 16:50:11'
                      deleted_at:
                        type: integer
                        format: date
                        description: Hora y fecha de eliminación del retiro
                        example: null
                      uuid:
                        type: string
                        description: ''
                        example: d3e8a7ae-5a2a-43b3-a77b-e8c0a3e1718a
                      marketplace:
                        type: object
                        properties:
                          id:
                            type: integer
                            description: >-
                              ID del Marketplace, generado por Enviame (En caso
                              de que sean sellers independientes, aparecerá la
                              empresa 10)
                            example: 10
                          code:
                            type: string
                            description: Código del marketplace
                            example: enviame
                          name:
                            type: string
                            description: Nombre del marketplace
                            example: Envíame
                      type:
                        type: object
                        properties:
                          code:
                            type: string
                            description: Código del tipo de retiro
                            example: normal
                          name:
                            type: string
                            description: Nombre del tpo de retiro
                            example: retiro normal
                      size:
                        type: string
                        example: s
                      dimensions:
                        type: string
                        description: Dimensiones promedio relacionadas con el campo size
                        example: 10cm x 15cm x 5cm
                      pickup_date:
                        type: integer
                        format: date
                        description: Fecha en la cual se realizará el retiro
                        example: '2025-04-07 00:00:00'
                      warehouse:
                        type: object
                        properties:
                          id:
                            type: integer
                            description: Id interno de la bodega
                            example: 8710
                          code:
                            type: string
                            example: DEV
                          name:
                            type: string
                            description: Nombre de la bodega
                            example: DEV
                          contact:
                            type: object
                            properties:
                              name:
                                type: string
                                description: Nombre de contacto interno de la bodega
                                example: Javier Smith
                              phone:
                                type: string
                                description: Numero de telefono de contacto de la bodega
                                example: 998874910
                              email:
                                type: string
                                description: Correo electronico de contacto de la bodega
                                example: cinthia.garrido@enviame.io
                      need_evaluation:
                        type: boolean
                        description: >-
                          Indica si el retiro requiere de evaluación al
                          finalizar el plazo
                        example: false
                      carrier_pickup_number:
                        type: string
                        description: Número de retiro asignado por el carrier
                        example: 1285372591218
                      carrier_pickup_created:
                        type: boolean
                        description: Indica si el retiro se creo en el operador
                        example: false
                      max_cancelation_date:
                        type: integer
                        format: date
                        description: Fecha máxima en la cual se puede cancelar el envío
                        example: null
                      id:
                        type: string
                        description: ID interno
                        example: cRr8Kbj8zPAb4OsCyQxU
        '422':
          description: The request was not successful.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: An error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /shippers/{shipper_id}/return-pickups:
    post:
      tags:
        - Pickups
      summary: Create Return Pickup as a Company/Seller
      operationId: Create-return-pickup-as-a-Company/Seller-v3
      description: >-
        Endpoint to create return pickup as a Company/Seller. The response
        depends on the schedule of each carrier.
      parameters:
        - name: shipper_id
          in: path
          description: ID of the Company/Seller, generated by Enviame
          required: true
          schema:
            type: integer
            format: int64
        - name: Accept
          in: header
          required: true
          description: Not modified
          schema:
            type: string
            default: application/json
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - carrier_code
                - qty
                - weight
                - address
                - pick_up_date
                - contact_name
                - contact_phone
                - range_time
                - size
                - return_deliveries
                - information
              properties:
                carrier_code:
                  type: string
                  description: Carrier code to which the pickup will be requested.
                return_deliveries:
                  type: array
                  description: OTs of the return deliveries.
                  items:
                    type: string
                qty:
                  type: integer
                  description: Quantity of packages
                weight:
                  type: integer
                  description: Weight (Kg) of the packages.
                address:
                  type: object
                  required:
                    - full_address
                    - place
                  properties:
                    full_address:
                      type: string
                      description: Full address of the location
                    place:
                      type: string
                      description: 'Name of the place (Ej: Santiago)'
                    information:
                      type: string
                pick_up_date:
                  type: string
                  format: date
                  description: Pickup date in format AAAA-MM-DD.
                contact_name:
                  type: string
                  description: Name of the contact responsible for the pickup.
                contact_phone:
                  type: string
                  description: Number phone of the contact responsible for the pickup.
                range_time:
                  type: string
                  description: 'Range time of the pickup (Ej: 13:00 - 14:00)'
                information:
                  type: string
                  maxLength: 250
                  description: Aditional information to add to the return pickup.
                size:
                  type: string
                  description: Size of the packages (xs, s, m, l, c)
                width:
                  type: integer
                  description: Width of the packages. Required when the size is "c"
                length:
                  type: integer
                  description: Length of the packages. Required when the size is "c"
                height:
                  type: integer
                  description: Height of the packages. Required when the size is "c"
                description:
                  type: string
                  maxLength: 250
                  description: Description of the packages. Required when the size is "c"
            example:
              carrier_code: CHX
              qty: 1
              weight: 1
              address:
                full_address: Dirección 1
                place: Santiago
                place_id: 367
                information: Entre calles X e Y
              pick_up_date: '2026-01-02'
              contact_name: Nombre del contacto
              contact_phone: '999999999'
              range_time: 15:00 - 16:00
              size: c
              length: 80
              width: 80
              height: 80
              information: Caja grande
              description: Paquete de prueba
              return_deliveries:
                - '123456789'
      responses:
        '200':
          description: successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 201
                  data:
                    type: object
                    properties:
                      identifier:
                        type: string
                        description: Pickup Number generated
                        example: '1285372591218'
                      company:
                        type: object
                        properties:
                          id:
                            type: integer
                            description: ID of the Company/Seller, generated by Enviame
                            example: 2279
                          code:
                            type: string
                            description: Codigo alfanumerico de la Empresa/Seller
                            example: DEV
                          name:
                            type: string
                            description: Nombre de la Empresa/Seller
                            example: Development
                          dni:
                            type: string
                            description: RUT (DNI) de la Empresa/Seller
                            example: 106719926
                      address:
                        type: object
                        properties:
                          place_id:
                            type: integer
                            description: ID interno asignado al place del lugar de retiro
                            example: 378
                          full_address:
                            type: string
                            description: >-
                              Dirección completa de la bodega, sin incluir
                              comuna
                            example: Avenida Vitacura 123
                          place:
                            type: string
                            description: >-
                              Comuna (CL) - Ciudad/Municipio (CO)- Distrito (PE)
                              - Colonia (MX) - Municipio (AR) donde está ubicada
                              la bodega
                            example: Santiago
                          information:
                            type: string
                            description: >-
                              Información adicional o complemento de la
                              direccion
                            example: H23
                          place_parents:
                            type: object
                            properties:
                              parent1:
                                type: object
                                properties:
                                  id:
                                    type: integer
                                    description: >-
                                      ID interno asignado al level1 del lugar de
                                      retiro
                                    example: 61
                                  name:
                                    type: string
                                    description: ''
                                    example: Santiago
                                  level_name:
                                    type: string
                                    description: ''
                                    example: Provincia
                              parent2:
                                type: object
                                properties:
                                  id:
                                    type: integer
                                    description: >-
                                      ID interno asignado al level2 del lugar de
                                      retiro
                                    example: 7
                                  name:
                                    type: string
                                    description: ''
                                    example: Metropolitana de Santiago
                                  level_name:
                                    type: string
                                    description: ''
                                    example: Region
                          place_level_name:
                            type: string
                            description: ''
                            example: Comuna
                          zip_code:
                            type: string
                            description: ''
                            example: null
                      carrier:
                        type: object
                        properties:
                          code:
                            type: string
                            description: Código interno del carrier
                            example: BLX
                          name:
                            type: string
                            description: Nombre del carrier
                            example: Bluexpress
                          country:
                            type: string
                            description: Código del pais del carrier
                            example: CL
                          is_integrated:
                            type: integer
                            description: Indica si el carrier está integrado y automatizado
                            example: 1
                          time_zome:
                            type: string
                            description: Zona horaria del retiro agendado
                            example: America/Santiago
                          config:
                            type: object
                            properties:
                              time_limit:
                                type: string
                                description: Horario de corte del carrier
                                example: '10:29'
                              time_limit_key:
                                type: string
                                description: ''
                                example: default
                      range_time:
                        type: string
                        example: 13:00 - 18:00
                      qty:
                        type: integer
                        example: 7
                      weight:
                        type: integer
                        example: 10
                      contact:
                        type: object
                        properties:
                          name:
                            type: string
                            example: John Doe
                          phone:
                            type: string
                            example: 999999999
                      status:
                        type: object
                        properties:
                          code:
                            type: string
                            description: Código del estado del retiro
                            example: created
                          name:
                            type: string
                            description: Nombre del estado del operador
                            example: retiro creado
                          date:
                            type: integer
                            format: date
                            description: Horario del estado del retiro
                            example: '2025-04-04 16:50:11'
                      created_at:
                        type: integer
                        format: date
                        description: Hora y fecha de creacion del retiro
                        example: '2025-04-04 16:50:11'
                      updated_at:
                        type: integer
                        format: date
                        description: Hora y fecha la última actualización del retiro
                        example: '2025-04-04 16:50:11'
                      deleted_at:
                        type: integer
                        format: date
                        description: Hora y fecha de eliminación del retiro
                        example: null
                      uuid:
                        type: string
                        description: ''
                        example: d3e8a7ae-5a2a-43b3-a77b-e8c0a3e1718a
                      marketplace:
                        type: object
                        properties:
                          id:
                            type: integer
                            description: >-
                              ID del Marketplace, generado por Enviame (En caso
                              de que sean sellers independientes, aparecerá la
                              empresa 10)
                            example: 10
                          code:
                            type: string
                            description: Código del marketplace
                            example: enviame
                          name:
                            type: string
                            description: Nombre del marketplace
                            example: Envíame
                      type:
                        type: object
                        properties:
                          code:
                            type: string
                            description: Código del tipo de retiro
                            example: normal
                          name:
                            type: string
                            description: Nombre del tpo de retiro
                            example: retiro normal
                      size:
                        type: string
                        example: s
                      dimensions:
                        type: string
                        description: Dimensiones promedio relacionadas con el campo size
                        example: 10cm x 15cm x 5cm
                      pickup_date:
                        type: integer
                        format: date
                        description: Fecha en la cual se realizará el retiro
                        example: '2025-04-07 00:00:00'
                      warehouse:
                        type: object
                        properties:
                          id:
                            type: integer
                            description: Id interno de la bodega
                            example: 8710
                          code:
                            type: string
                            example: DEV
                          name:
                            type: string
                            description: Nombre de la bodega
                            example: DEV
                          contact:
                            type: object
                            properties:
                              name:
                                type: string
                                description: Nombre de contacto interno de la bodega
                                example: Javier Smith
                              phone:
                                type: string
                                description: Numero de telefono de contacto de la bodega
                                example: 998874910
                              email:
                                type: string
                                description: Correo electronico de contacto de la bodega
                                example: cinthia.garrido@enviame.io
                      need_evaluation:
                        type: boolean
                        description: >-
                          Indica si el retiro requiere de evaluación al
                          finalizar el plazo
                        example: false
                      carrier_pickup_number:
                        type: string
                        description: Número de retiro asignado por el carrier
                        example: 1285372591218
                      carrier_pickup_created:
                        type: boolean
                        description: Indica si el retiro se creo en el operador
                        example: false
                      max_cancelation_date:
                        type: integer
                        format: date
                        description: Fecha máxima en la cual se puede cancelar el envío
                        example: null
                      id:
                        type: string
                        description: ID interno
                        example: cRr8Kbj8zPAb4OsCyQxU
        '422':
          description: The request was not successful.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: An error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /export-pickups:
    post:
      tags:
        - Pickups
      summary: Export pickups
      operationId: export-pickups-v3
      description: Export pickups to a excel file
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                pickup_date_from:
                  type: string
                  format: date
                  description: Date From
                pickup_date_to:
                  type: string
                  format: date
                  description: Date To
                pickup_date:
                  type: string
                  format: date
                  description: >-
                    If this parameter is set, the pickup_date_from and
                    pickup_date_to parameters will be ignored.
                updated_at_from:
                  type: string
                  format: date
                  description: Date of last update from
                updated_at_to:
                  type: string
                  format: date
                  description: Date of last update to
                shipper_id:
                  type: integer
                  format: int64
                  description: Shipper ID
                organization_id:
                  type: integer
                  format: int64
                  description: Organization ID
                carrier_code:
                  type: string
                  description: Carrier code
                carrier_pickup_number:
                  type: string
                  description: Carrier pickup number
                status_code:
                  type: array
                  items:
                    type: string
                    enum:
                      - scheduled
                      - done
                      - failed
                      - canceled
                  description: Statuses of the pickups to export
                type:
                  type: string
                  enum:
                    - return
                  description: Types of pickups
      responses:
        '200':
          description: The excel file was created successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - success
                    description: Status of the request
                  data:
                    type: object
                    properties:
                      url:
                        type:
                          - string
                          - null
                        format: uri
                        description: URL to download the excel file.
        '422':
          description: The request was not successful.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: An error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /pudos:
    get:
      tags:
        - PUDOs
      summary: List PUDOs by place
      description: Retrieves a list of PUDOs, based on the provided place.
      parameters:
        - name: type
          in: query
          description: |
            The type of PUDOs that you want to retrieve.
          required: true
          schema:
            type: string
            enum:
              - store
              - courier
            example: store
        - name: place_name
          in: query
          description: |
            Specifies the name of the smallest geographic administrative unit
            for the specified country. For Chile, this refers to the name of
            the commune; for Colombia, it corresponds to the municipality; for
            Peru, it refers to the name of the district. In the case of Mexico,
            this parameter accepts the name of any administrative division such
            as neighborhood, city, municipality, or state.
          required: true
          schema:
            type: string
        - name: parent_place_name
          in: query
          description: |
            <span class="required-text-description">required: </span> <span
            class="regular-text-description">only for Colombia and Peru.</span>

            Specifies the name of the parent administrative division of the
            given place for the specified country. For Chile and Peru, this
            refers to the name of the province; for Colombia, it
            corresponds to the department. **In the case of Mexico, this
            parameter is ignored and is not necessary**.
          required: false
          schema:
            type: string
          x-nullable: true
        - name: place_level_name
          in: query
          description: >
            <span class="required-text-description">required: </span> <span

            class="regular-text-description">for Mexico only.</span>


            Name of the geographical subdivision corresponding to the sent
            place.
          required: false
          schema:
            type: string
            enum:
              - state
              - municipality
              - city
              - neighborhood
            example: city
          x-nullable: true
        - name: zip_code
          in: query
          description: >
            <span class="required-text-description">applies: </span> <span

            class="regular-text-description">for Mexico only.</span>


            The zip code of the neighborhood.

            **If this field is provided, it is assumed that the place
            corresponds to a neighborhood**.
          required: false
          schema:
            type: string
        - name: page
          in: query
          description: >
            The page number from which you want your page search results to be
            displayed.
          required: false
          schema:
            type: integer
          x-nullable: true
        - name: limit
          in: query
          description: |
            <span class="regular-text-description">Default 20 per
            page.</span>

            Number of results per page.
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: Success response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiPudoSuccessfulResponse'
              examples:
                success:
                  summary: Example of a successful response
                  value:
                    status: success
                    message: PUDOs obtained successfully
                    paging:
                      page: 1
                      limit: 20
                      data_count: 1
                      page_count: 1
                    data:
                      - code: 0001-stgo
                        name: PUDO 1 of Stgo
                        address: address of pudo 0001-stgo
                        places:
                          place: Santiago Centro
                          level1: Santiago
                          level2: Región Metropolitana
                successWithoutPudos:
                  summary: Example of a successful response but without pudos
                  value:
                    status: success
                    message: PUDOs obtained successfully
                    paging:
                      page: 1
                      limit: 20
                      data_count: 0
                      page_count: 1
                    data: []
                successPudosFromMx:
                  summary: Example of a successful PUDOS from Mexico response
                  value:
                    status: success
                    message: PUDOs obtained successfully
                    paging:
                      page: 1
                      limit: 5
                      data_count: 2
                      page_count: 1
                    data:
                      - code: 0001-ABC
                        name: PUDO 1 of Mexico
                        address: address of pudo 0001-ABC
                        places:
                          neighborhood: Prado Churubusco
                          city: Ciudad de México
                          municipality: Coyoacán
                          state: Ciudad de México
                      - code: 0002-ABC
                        name: PUDO 2 of Mexico
                        address: address of pudo 0002-ABC
                        places:
                          neighborhood: Independencia
                          city: Ciudad de México
                          municipality: Benito Juárez
                          state: Ciudad de México
        '400':
          description: |
            Operation rejected because one or more received queries are invalid
            or the required ones were not received
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ApiInvalidPudoTypeResponse'
                  - $ref: '#/components/schemas/ApiPudoMissingRequiredQueryResponse'
              examples:
                invalidPudoType:
                  summary: Example of fail response due to invalid PUDO type
                  value:
                    status: fail
                    message: There was an error in the input data
                    errors:
                      - field: type
                        code: invalid_value
                        message: >-
                          Field must have one of the following values: courier,
                          store
                missingRequiredQuery:
                  summary: Example of fail response due to missing required parameter
                  value:
                    status: fail
                    message: There was an error in the input data
                    errors:
                      - field: place_name
                        code: required
                        message: Field required
        '403':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedResponse'
              examples:
                success:
                  summary: Example of a unauthorized response
                  value:
                    status: success
                    message: We could not fetch PUDOs
                    errors:
                      - code: FORBIDDEN
                        message: You do not have permissions to perform this action
        '404':
          description: >-
            The operation was not completed because the received place name was
            not found
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ApiPudoPlaceNotFoundResponse'
              examples:
                invalidPudoType:
                  summary: Example of response for place name not found
                  value:
                    status: fail
                    message: >-
                      PUDOs not fetched because we could not find the received
                      place name
                    errors:
                      place_name: Taltel
                      description: Place name not found
        '500':
          description: An error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /tickets:
    get:
      tags:
        - Tickets
      summary: Get all tickets
      operationId: get-tickets-v3
      description: Retrieve a list of tickets.
      parameters:
        - name: delivery_id
          in: query
          description: ID of the delivery
          required: false
          schema:
            type: integer
            format: int64
        - name: current_type
          in: query
          description: current type of the ticket
          required: false
          schema:
            type: string
        - name: current_status
          in: query
          description: current status of the ticket
          required: false
          schema:
            type: string
        - name: page
          in: query
          description: page number to retrieve
          required: false
          schema:
            type: integer
            format: int64
        - name: limit
          in: query
          description: number of tickets per page to retrieve
          required: false
          schema:
            type: integer
            format: int64
        - name: delivery_status
          in: query
          description: filter ticket by current delivery status
          required: false
          schema:
            type: string
        - name: ticket_mode
          in: query
          description: filter by tickets mode (delivery or return)
          required: false
          schema:
            type: string
            enum:
              - delivery
              - return
        - name: order_by
          in: query
          description: >-
            order by a specific field. The available fields are: CREATED_AT_ASC,
            CREATED_AT_DESC, LAST_MESSAGE_ASC, LAST_MESSAGE_DESC,
            WAITING_DAYS_ASC, WAITING_DAYS_DESC
          required: false
          schema:
            type: string
            enum:
              - CREATED_AT_ASC
              - CREATED_AT_DESC
              - LAST_MESSAGE_ASC
              - LAST_MESSAGE_DESC
              - WAITING_DAYS_ASC
              - WAITING_DAYS_DESC
        - name: created_at_from
          in: query
          description: filter tickets created from a date in UTC timezone
          required: false
          schema:
            type: string
        - name: created_at_to
          in: query
          description: filter tickets created to a date in UTC timezone
          required: false
          schema:
            type: string
        - name: country
          in: query
          description: filter tickets where the carrier is from the specified country
          required: false
          schema:
            type: string
            enum:
              - CL
              - PE
              - CO
              - MX
        - name: carrier
          in: query
          description: filter tickets by carrier code
          required: false
          schema:
            type: string
        - name: shipper
          in: query
          description: filter tickets by shipper code
          required: false
          schema:
            type: string
        - name: shipper_id
          in: query
          description: filter tickets by shipper id
          required: false
          schema:
            type: string
        - name: current_status_date_from
          in: query
          description: >-
            filter tickets where the date of their current status is equal to or
            greater than a specified date in utc
          required: false
          schema:
            type: string
        - name: current_status_date_to
          in: query
          description: >-
            filter tickets where the date of their current status is equal to or
            less than a specified date in utc
          required: false
          schema:
            type: string
        - name: current_type_date_from
          in: query
          description: >-
            filter tickets where the date of their current subject is equal to
            or less than a specified date in utc
          required: false
          schema:
            type: string
        - name: current_type_date_to
          in: query
          description: >-
            filter tickets where the date of their current subject is equal to
            or less than a specified date in utc
          required: false
          schema:
            type: string
        - name: current_stage_date_from
          in: query
          description: >-
            filter tickets where the date of their current stage is equal to or
            less than a specified date in utc
          required: false
          schema:
            type: string
        - name: current_stage_date_to
          in: query
          description: >-
            filter tickets where the date of their current stage is equal to or
            less than a specified date in utc
          required: false
          schema:
            type: string
        - name: last_message_from
          in: query
          description: >-
            filter tickets where the date of their last message is equal to or
            less than a specified date in utc
          required: false
          schema:
            type: string
        - name: last_message_to
          in: query
          description: >-
            filter tickets where the date of their last message is equal to or
            less than a specified date in utc
          required: false
          schema:
            type: string
        - name: current_stage
          in: query
          description: filter tickets by current stage
          required: false
          schema:
            type: string
            enum:
              - ISSUE
              - COMPLAINT
              - COMPENSATION
              - CLOSED
              - DISAGREEMENT
        - name: fulfillment
          in: query
          description: filter tickets by fulfillment type
          required: false
          schema:
            type: boolean
        - name: organization
          in: query
          description: filter tickets by organization code
          required: false
          schema:
            type: string
        - name: organization_id
          in: query
          description: filter tickets by organization id
          required: false
          schema:
            type: integer
            format: int64
        - name: read_client
          in: query
          description: >-
            filter tickets where the last message has been read or not by the
            client
          required: false
          schema:
            type: boolean
        - name: read_agent
          in: query
          description: >-
            filter tickets where the last message has been read or not by the
            agent
          required: false
          schema:
            type: boolean
      responses:
        '200':
          description: The tickets were found successfully.
        '500':
          description: An error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /ticket/{delivery_id}:
    get:
      tags:
        - Tickets
      summary: Get ticket details by delivery id
      operationId: get-ticket-v3
      description: Retrieve a ticket by delivery id.
      parameters:
        - name: delivery_id
          in: path
          description: ID of the delivery
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: The ticket was found successfully.
        '404':
          description: The ticket was not found.
        '500':
          description: An error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /ticket/{delivery_id}/message:
    post:
      tags:
        - Tickets
      summary: Create a message for a ticket
      operationId: create-message-v3
      description: Create a message for a ticket.
      parameters:
        - name: delivery_id
          in: path
          description: ID of the delivery
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                message:
                  type: string
                  description: The message to be sent.
                timezone:
                  type: string
                  description: The timezone of the message.
                type:
                  type: object
                  properties:
                    name:
                      type: string
                    code:
                      type: string
                extra_fields:
                  type: object
                  properties:
                    place_2:
                      type: object
                      properties:
                        label:
                          type: string
                        value:
                          type: string
                    place_1:
                      type: object
                      properties:
                        label:
                          type: string
                        value:
                          type: string
                    phone:
                      type: object
                      properties:
                        label:
                          type: string
                        value:
                          type: string
                    ref2:
                      type: object
                      properties:
                        label:
                          type: string
                        value:
                          type: string
                    place:
                      type: object
                      properties:
                        label:
                          type: string
                        value:
                          type: string
                    full_address:
                      type: object
                      properties:
                        label:
                          type: string
                        value:
                          type: string
                    ref1:
                      type: object
                      properties:
                        label:
                          type: string
                        value:
                          type: string
      responses:
        '200':
          description: The message was created successfully.
        '500':
          description: An error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /deliveries/{delivery_id}/status:
    post:
      tags:
        - Deliveries
      summary: Manual Status Update
      operationId: update-delivery-status-v3
      description: >
        Allows manual updating of a shipment's status (delivery or return). 

        By default, this is only allowed for internal transport (INT), unless
        the company or organization has the external carrier configuration
        enabled.
      parameters:
        - in: path
          name: delivery_id
          schema:
            type: integer
          description: Internal shipment ID.
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - status_change
              properties:
                status_change:
                  type: object
                  required:
                    - status
                  properties:
                    status:
                      type: integer
                      description: ID of the new status.
                      example: 6
                    info:
                      type: string
                      description: Additional information about the change.
                      example: Manual test movement
                    user:
                      type: string
                      description: >-
                        Email of the user performing the change (optional,
                        defaults to the token user).
                      example: user@enviame.io
                    date:
                      type: string
                      description: Change date (YYYY-MM-DD HH:MM:SS).
                      example: '2026-02-20 17:25:11'
                    proof:
                      type: object
                      description: Supporting data (optional).
                      properties:
                        date:
                          type: string
                          example: '2026-02-20 17:20:00'
                        coordinates:
                          type: object
                          properties:
                            lat:
                              type: number
                              example: -33.456
                            lng:
                              type: number
                              example: -70.648
                        carrier_urls:
                          type: array
                          items:
                            type: string
                            format: uri
                          example:
                            - https://storage.googleapis.com/proofs/img123.jpg
      responses:
        '200':
          description: Update processed successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: success
                  message:
                    type: string
                    example: Status updated successfully
        '400':
          description: Validation error (e.g., carrier not allowed).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedResponse'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /deliveries/{identifier}/tracking:
    get:
      tags:
        - Deliveries
      summary: Get delivery and return tracking
      description: >-
        Gets the tracking of a delivery using its identifier (delivery_id,
        imported_id, or tracking_number).
      parameters:
        - in: path
          name: identifier
          schema:
            type: string
          description: delivery_id, imported_id, or tracking_number.
          required: true
      responses:
        '200':
          description: Tracking retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeliveryTrackingResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedResponse'
        '500':
          description: Internal Server Error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /companies/{company_id}/deliveries:
    post:
      tags:
        - Deliveries
      summary: Create delivery
      operationId: Create-Deliveries-V3
      description: Endpoint to create deliveries for a Company.
      parameters:
        - name: company_id
          in: path
          description: Company ID, generated by Enviame
          required: true
          schema:
            type: integer
            format: int64
        - name: Accept
          in: header
          description: Do not modify
          required: true
          schema:
            type: string
            default: application/json
        - name: Content-Type
          in: header
          description: Do not modify
          required: true
          schema:
            type: string
            default: application/json
      requestBody:
        description: Create a new delivery
        content:
          application/json:
            schema:
              type: object
              properties:
                shipping_order:
                  type: object
                  required:
                    - n_packages
                    - content_description
                    - order_price
                    - weight
                    - type
                  properties:
                    n_packages:
                      type: integer
                      description: >-
                        Number of packages.<br><small><b>Constraints:</b> 16-bit
                        integer</small>
                    content_description:
                      type: string
                      nullable: true
                      description: >-
                        Product description.<br><br><code>Nullable</code>
                        <code>Allow Empty</code><br><small><b>Constraints:</b>
                        Max 1GB</small>
                    imported_id:
                      type: string
                      nullable: true
                      description: >-
                        Reference number.<br><br><code>Nullable</code>
                        <code>Allow Empty</code><br><small><b>Constraints:</b>
                        Max 1GB</small>
                    order_price:
                      type: number
                      format: float
                      description: >-
                        Product value.<br><small><b>Constraints:</b> Max 16
                        digits, up to 2 decimals</small>
                    weight:
                      type: number
                      format: float
                      description: >-
                        Weight in kilograms.<br><small><b>Constraints:</b>
                        Double precision float</small>
                    volume:
                      type: number
                      format: float
                      nullable: true
                      description: >-
                        Indicate the volume in cubic meters (m³). If not sent,
                        the system will assign 1 by
                        default.<br><br><code>Nullable</code><br><small><b>Constraints:</b>
                        Double precision float</small>
                    type:
                      type: string
                      description: >-
                        Indicates if it is a shipment or a return. For this
                        endpoint, it must be 'delivery'.
                      enum:
                        - delivery
                      default: delivery
                      example: delivery
                shipping_origin:
                  type: object
                  required:
                    - warehouse_code
                  properties:
                    warehouse_code:
                      type: string
                      minLength: 1
                      description: >-
                        Alphanumeric warehouse code of the
                        Company.<br><br><code>Cannot be
                        empty</code><br><small><b>Constraints:</b> Max
                        1GB</small>
                shipping_destination:
                  type: object
                  properties:
                    customer:
                      type: object
                      required:
                        - name
                      properties:
                        name:
                          type: string
                          minLength: 1
                          description: >-
                            Add the name of the person to whom the product is
                            addressed.<br><br><code>Cannot be
                            empty</code><br><small><b>Constraints:</b> Max
                            1GB</small>
                        email:
                          type: string
                          nullable: true
                          description: >-
                            Recipient's email necessary for notification to the
                            final customer.<br><br><code>Nullable</code>
                            <code>Allow
                            Empty</code><br><small><b>Constraints:</b> Max
                            1GB</small>
                        phone:
                          type: string
                          nullable: true
                          minLength: 1
                          description: >-
                            Recipient's cell phone
                            number.<br><br><code>Nullable</code> <code>Cannot be
                            empty</code><br><small><b>Constraints:</b> Max
                            1GB</small>
                    delivery_address:
                      type: object
                      required:
                        - place
                        - full_address
                      properties:
                        place:
                          type: string
                          description: >-
                            Commune (CL) - City/Municipality (CO) - District
                            (PE) - Colony (MX) - Municipality
                            (AR).<br><small><b>Constraints:</b> Max 1GB</small>
                        full_address:
                          type: string
                          description: >-
                            Recipient's address.<br><br><code>Allow
                            Empty</code><br><small><b>Constraints:</b> Max
                            1GB</small>
                        information:
                          type: string
                          nullable: true
                          description: >-
                            Detailed information about the
                            destination.<br><br><code>Nullable</code>
                            <code>Allow
                            Empty</code><br><small><b>Constraints:</b> Max
                            1GB</small>
                        level1:
                          type: string
                          nullable: true
                          description: >-
                            Province (PE) - Department (CO, AR) - State
                            (MX).<br><br><code>Nullable</code> <code>Allow
                            Empty</code><br><small><b>Constraints:</b> Max
                            1GB</small>
                        level2:
                          type: string
                          nullable: true
                          description: >-
                            Municipality (MX).<br><br><code>Nullable</code>
                            <code>Allow
                            Empty</code><br><small><b>Constraints:</b> Max
                            1GB</small>
                        level3:
                          type: string
                          nullable: true
                          description: >-
                            City (MX).<br><br><code>Nullable</code> <code>Allow
                            Empty</code><br><small><b>Constraints:</b> Max
                            1GB</small>
                        pickup_point_code:
                          type: string
                          nullable: true
                          description: >-
                            Pickup point code.<br><br><code>Nullable</code>
                            <code>Allow
                            Empty</code><br><small><b>Constraints:</b> Max
                            1GB</small>
                dimensions:
                  type: object
                  properties:
                    width:
                      type: number
                      format: float
                      nullable: true
                      description: >-
                        Width in
                        centimeters.<br><br><code>Nullable</code><br><small><b>Constraints:</b>
                        Double precision float</small>
                    height:
                      type: number
                      format: float
                      nullable: true
                      description: >-
                        Height in
                        centimeters.<br><br><code>Nullable</code><br><small><b>Constraints:</b>
                        Double precision float</small>
                    length:
                      type: number
                      format: float
                      nullable: true
                      description: >-
                        Length in
                        centimeters.<br><br><code>Nullable</code><br><small><b>Constraints:</b>
                        Double precision float</small>
                carrier:
                  type: object
                  required:
                    - carrier_code
                    - carrier_service
                    - tracking_number
                  properties:
                    carrier_code:
                      type: string
                      nullable: true
                      description: >-
                        Carrier code.<br><br><code>Nullable</code> <code>Allow
                        Empty</code><br><small><b>Constraints:</b> Max 8
                        characters</small>
                    carrier_service:
                      type: string
                      nullable: true
                      description: >-
                        Carrier service type.<br><br><code>Nullable</code>
                        <code>Allow Empty</code><br><small><b>Constraints:</b>
                        Max 128 characters</small>
                    tracking_number:
                      type: string
                      nullable: true
                      description: >-
                        Tracking number assigned by the
                        carrier.<br><br><code>Nullable</code> <code>Allow
                        Empty</code><br><small><b>Constraints:</b> Max
                        1GB</small>
                extra_fields:
                  type: array
                  description: <br><code>Allow Empty Array</code>
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                        description: Attribute name
                      value:
                        type: string
                        description: Attribute value
          responses:
            '200':
              description: Operation successful.
              content:
                application/json:
                  schema:
                    title: SuccessResponseV3
                    type: object
                    properties:
                      code:
                        title: Code
                        default: success
                        example: success
                        type: string
                      message:
                        title: Message
                        default: OK
                        example: OK
                        type: string
                      data:
                        title: Data
                        default: {}
                        example:
                          id: 123456
                          parent_id: null
                          type: delivery
                        type: object
                      errors:
                        title: Errors
                        default: []
                        example: []
                        type: array
                        items: {}
            '403':
              description: >-
                Unauthorized. The user is not authenticated or does not have
                permissions for the requested shipper.
              content:
                application/json:
                  schema:
                    title: ErrorResponseV3
                    type: object
                    properties:
                      code:
                        title: Code
                        default: fail
                        example: fail
                        type: string
                      message:
                        title: Message
                        description: General error message.
                        type: string
                      data:
                        title: Data
                        type: 'null'
                      errors:
                        title: Errors
                        default: []
                        example:
                          - code: value_error.missing
                            message: field required
                            field: order.packages
                        type: array
                        items:
                          type: object
                    required:
                      - message
            '404':
              description: Not Found. A related resource was not found.
              content:
                application/json:
                  schema:
                    title: ErrorResponseV3
                    type: object
                    properties:
                      code:
                        title: Code
                        default: fail
                        example: fail
                        type: string
                      message:
                        title: Message
                        description: General error message.
                        type: string
                      data:
                        title: Data
                        type: 'null'
                      errors:
                        title: Errors
                        default: []
                        example:
                          - code: value_error.missing
                            message: field required
                            field: order.packages
                        type: array
                        items:
                          type: object
                    required:
                      - message
            '422':
              description: Validation Error. The request payload is invalid.
              content:
                application/json:
                  schema:
                    title: ErrorResponseV3
                    type: object
                    properties:
                      code:
                        title: Code
                        default: fail
                        example: fail
                        type: string
                      message:
                        title: Message
                        description: General error message.
                        type: string
                      data:
                        title: Data
                        type: 'null'
                      errors:
                        title: Errors
                        default: []
                        example:
                          - code: value_error.missing
                            message: field required
                            field: order.packages
                        type: array
                        items:
                          type: object
                    required:
                      - message
  /companies/{company_id}/return_deliveries:
    parameters:
      - name: id_seller
        in: path
        required: true
        schema:
          type: integer
        description: Seller ID
    post:
      tags:
        - Returns
      summary: Create return
      operationId: Crear-devolucion-V2
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/return.create.request'
            examples:
              domicilio_a_domicilio:
                summary: Origin address → Destination address
                value:
                  origin:
                    place: Valparaíso
                    full_address: Av. Siempre Viva 123
                    information: White house, 2 floors
                    contact:
                      name: Alicia Pérez
                      phone: '+56911111111'
                      email: alicia.perez@example.com
                  destination:
                    place: Santiago
                    full_address: Av. Providencia 456
                    information: Apt 702
                    contact:
                      name: Roberto Díaz
                      phone: '+56922222222'
                      email: roberto.diaz@example.com
                  order:
                    type: return
                    imported_id: RET-001234
                    n_packages: 1
                    packages:
                      - id: 1
                        price: '4000'
                        description: Generic accessory
                        weight: '1'
                        volume: '2'
                  carrier:
                    code: CHX
                    service: nextdayReturn
                    type: ''
                    attribute: ''
              domicilio_a_bodega:
                summary: Origin address → Destination warehouse
                value:
                  origin:
                    place: Valparaíso
                    full_address: Calle Verde 789
                    information: Black door
                    contact:
                      name: Alicia Pérez
                      phone: '+56911111111'
                      email: alicia.perez@example.com
                  destination:
                    code_warehouse: DEV
                  order:
                    type: return
                    imported_id: RET-001235
                    n_packages: 1
                    packages:
                      - id: 1
                        price: '4000'
                        description: Generic accessory
                        weight: '1'
                        volume: '2'
                  carrier:
                    code: CHX
                    service: nextdayReturn
                    type: ''
                    attribute: ''
              pudo_a_bodega:
                summary: Origin PUDO → Destination warehouse
                value:
                  origin:
                    type: pudo_or_agency_legacy
                    pudo_code: CHX9999
                    contact:
                      name: Alicia Pérez
                      email: alicia.perez@example.com
                  destination:
                    code_warehouse: DEV
                  order:
                    type: return
                    imported_id: RET-001236
                    n_packages: 1
                    packages:
                      - id: 1
                        price: '4000'
                        description: Generic accessory
                        weight: '1'
                        volume: '2'
                  carrier:
                    code: CHX
                    service: nextdayReturn
                    type: ''
                    attribute: ''
              pudo_a_domicilio:
                summary: Origin PUDO → Destination address
                value:
                  origin:
                    type: pudo_or_agency_legacy
                    pudo_code: CHX9999
                    contact:
                      name: Alicia Pérez
                      email: alicia.perez@example.com
                  destination:
                    place: Iquique
                    full_address: Av. Monte de los Olivos 2923
                    information: Brown gate
                    contact:
                      name: Roberto Díaz
                      phone: '+56922222222'
                      email: roberto.diaz@example.com
                  order:
                    type: return
                    imported_id: RET-001237
                    n_packages: 1
                    packages:
                      - id: 1
                        price: '4000'
                        description: Generic accessory
                        weight: '1'
                        volume: '2'
                  carrier:
                    code: CHX
                    service: nextdayReturn
                    type: ''
                    attribute: ''
      responses:
        '200':
          description: Operation successful.
          content:
            application/json:
              schema:
                title: SuccessResponseV3
                type: object
                properties:
                  code:
                    title: Code
                    default: success
                    example: success
                    type: string
                  message:
                    title: Message
                    default: OK
                    example: OK
                    type: string
                  data:
                    title: Data
                    default: {}
                    example:
                      id: 123456
                      parent_id: null
                      type: delivery
                    type: object
                  errors:
                    title: Errors
                    default: []
                    example: []
                    type: array
                    items: {}
        '403':
          description: >-
            Unauthorized. The user is not authenticated or does not have
            permissions for the requested shipper.
          content:
            application/json:
              schema:
                title: ErrorResponseV3
                type: object
                properties:
                  code:
                    title: Code
                    default: fail
                    example: fail
                    type: string
                  message:
                    title: Message
                    description: General error message.
                    type: string
                  data:
                    title: Data
                    type: 'null'
                  errors:
                    title: Errors
                    default: []
                    example:
                      - code: value_error.missing
                        message: field required
                        field: order.packages
                    type: array
                    items:
                      type: object
                required:
                  - message
        '404':
          description: Not Found. A related resource was not found.
          content:
            application/json:
              schema:
                title: ErrorResponseV3
                type: object
                properties:
                  code:
                    title: Code
                    default: fail
                    example: fail
                    type: string
                  message:
                    title: Message
                    description: General error message.
                    type: string
                  data:
                    title: Data
                    type: 'null'
                  errors:
                    title: Errors
                    default: []
                    example:
                      - code: value_error.missing
                        message: field required
                        field: order.packages
                    type: array
                    items:
                      type: object
                required:
                  - message
        '422':
          description: Validation Error. The request payload is invalid.
          content:
            application/json:
              schema:
                title: ErrorResponseV3
                type: object
                properties:
                  code:
                    title: Code
                    default: fail
                    example: fail
                    type: string
                  message:
                    title: Message
                    description: General error message.
                    type: string
                  data:
                    title: Data
                    type: 'null'
                  errors:
                    title: Errors
                    default: []
                    example:
                      - code: value_error.missing
                        message: field required
                        field: order.packages
                    type: array
                    items:
                      type: object
                required:
                  - message
  /companies/{company_id}/deliveries/{delivery_id}/return:
    parameters:
      - name: id_seller
        in: path
        required: true
        schema:
          type: integer
        description: Seller ID
      - name: delivery_id
        in: path
        required: true
        schema:
          type: integer
        description: Original delivery ID
    post:
      tags:
        - Returns
      summary: Create return from an existing delivery
      operationId: Crear-devolucion-desde-envio-v2
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                order:
                  type: object
                  required:
                    - imported_id
                    - n_packages
                    - packages
                  properties:
                    imported_id:
                      type: string
                      description: >-
                        External order identifier.<br><br><code>Cannot be
                        empty</code><br><small><b>Constraints:</b> Max
                        1GB</small>
                    n_packages:
                      type: integer
                      description: >-
                        Total number of packages.<br><small><b>Constraints:</b>
                        16-bit integer</small>
                    packages:
                      type: array
                      items:
                        type: object
                        required:
                          - weight
                        properties:
                          id:
                            type:
                              - integer
                              - string
                            nullable: true
                            description: >-
                              Package ID.<br><br><code>Nullable</code>
                              <code>Allow
                              Empty</code><br><small><b>Constraints:</b> Max
                              1GB</small>
                          description:
                            type: string
                            nullable: true
                            description: >-
                              Package description.<br><br><code>Nullable</code>
                              <code>Allow
                              Empty</code><br><small><b>Constraints:</b> Max
                              1GB</small>
                          price:
                            type: number
                            format: float
                            nullable: true
                            description: >-
                              Declared
                              value.<br><br><code>Nullable</code><br><small><b>Constraints:</b>
                              Max 16 digits, up to 2 decimals</small>
                          weight:
                            type: number
                            format: float
                            description: >-
                              Package weight.<br><small><b>Constraints:</b>
                              Double precision float</small>
                          volume:
                            type: number
                            format: float
                            nullable: true
                            description: >-
                              Package
                              volume.<br><br><code>Nullable</code><br><small><b>Constraints:</b>
                              Double precision float</small>
                carrier:
                  type: object
                  required:
                    - code
                    - service
                  properties:
                    code:
                      type: string
                      description: >-
                        Carrier code.<br><br><code>Cannot be
                        empty</code><br><small><b>Constraints:</b> Max 8
                        characters</small>
                    service:
                      type: string
                      description: >-
                        Carrier service type.<br><br><code>Cannot be
                        empty</code><br><small><b>Constraints:</b> Max 128
                        characters</small>
      responses:
        '200':
          description: Operation successful.
          content:
            application/json:
              schema:
                title: SuccessResponseV3
                type: object
                properties:
                  code:
                    title: Code
                    default: success
                    example: success
                    type: string
                  message:
                    title: Message
                    default: OK
                    example: OK
                    type: string
                  data:
                    title: Data
                    default: {}
                    example:
                      id: 123456
                      parent_id: null
                      type: delivery
                    type: object
                  errors:
                    title: Errors
                    default: []
                    example: []
                    type: array
                    items: {}
        '403':
          description: >-
            Unauthorized. The user is not authenticated or does not have
            permissions for the requested shipper.
          content:
            application/json:
              schema:
                title: ErrorResponseV3
                type: object
                properties:
                  code:
                    title: Code
                    default: fail
                    example: fail
                    type: string
                  message:
                    title: Message
                    description: General error message.
                    type: string
                  data:
                    title: Data
                    type: 'null'
                  errors:
                    title: Errors
                    default: []
                    example:
                      - code: value_error.missing
                        message: field required
                        field: order.packages
                    type: array
                    items:
                      type: object
                required:
                  - message
        '404':
          description: Not Found. A related resource was not found.
          content:
            application/json:
              schema:
                title: ErrorResponseV3
                type: object
                properties:
                  code:
                    title: Code
                    default: fail
                    example: fail
                    type: string
                  message:
                    title: Message
                    description: General error message.
                    type: string
                  data:
                    title: Data
                    type: 'null'
                  errors:
                    title: Errors
                    default: []
                    example:
                      - code: value_error.missing
                        message: field required
                        field: order.packages
                    type: array
                    items:
                      type: object
                required:
                  - message
        '422':
          description: Validation Error. The request payload is invalid.
          content:
            application/json:
              schema:
                title: ErrorResponseV3
                type: object
                properties:
                  code:
                    title: Code
                    default: fail
                    example: fail
                    type: string
                  message:
                    title: Message
                    description: General error message.
                    type: string
                  data:
                    title: Data
                    type: 'null'
                  errors:
                    title: Errors
                    default: []
                    example:
                      - code: value_error.missing
                        message: field required
                        field: order.packages
                    type: array
                    items:
                      type: object
                required:
                  - message
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        status:
          type: string
          enum:
            - fail
          description: Status of the request
        message:
          type: string
          description: A message describing that the request failed
        errors:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
                description: >-
                  A unique code for the error. This code can be used to look up
                  more information about the error in our documentation.
              description:
                type: string
                description: >-
                  A human-readable explanation of the error, specific to this
                  occurrence of the problem.
              field:
                type:
                  - string
                  - null
                description: >-
                  The field that caused the error. If the error is not specific
                  to a field, this property will be null.
              value:
                type:
                  - string
                  - null
                description: >-
                  The value of the field that caused the error. If the error is
                  not specific to a field, this property will be null.
    UnauthorizedResponse:
      type: object
      properties:
        status:
          type: string
          enum:
            - fail
          description: Status of the request
        message:
          type: string
          description: >-
            A message describing that the request failed due to a lack of
            permissions
        errors:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
                description: >-
                  A unique code for the error. This code can be used to look up
                  more information about the error in our documentation.
              description:
                type: string
                description: >-
                  A human-readable explanation of the error, specific to this
                  occurrence of the problem.
    ApiPudoSuccessfulResponse:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        paging:
          type: object
          properties:
            page:
              type: integer
            limit:
              type: integer
            data_count:
              type: integer
            page_count:
              type: integer
        data:
          type: array
          minItems: 0
          items:
            type: object
            properties:
              name:
                type: string
              code:
                type: string
              address:
                type: string
              places:
                type: object
                properties:
                  place:
                    type: string
                  level1:
                    type: string
                  level2:
                    type: string
                  level3:
                    type: string
    ApiInvalidPudoTypeResponse:
      type: object
      properties:
        status:
          type: string
        message:
          type: string
        errors:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
              code:
                type: string
              message:
                type: string
    ApiPudoMissingRequiredQueryResponse:
      type: object
      properties:
        status:
          type: string
        message:
          type: string
        errors:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
              code:
                type: string
              message:
                type: string
    ApiPudoPlaceNotFoundResponse:
      type: object
      properties:
        status:
          type: string
        message:
          type: string
        data:
          type: object
          properties:
            place_name:
              type: string
    DeliveryTrackingResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            identifier:
              type: integer
              description: ID interno del envío
              example: 139174791
            imported_id:
              type: string
              description: ID externo proporcionado por el cliente
              example: '6032667002262'
            tracking_number:
              type: string
              description: Número de seguimiento asignado por el carrier
              example: '9436431244'
            status:
              type: object
              properties:
                id:
                  type: integer
                  example: 10
                name:
                  type: string
                  example: Entregado
                code:
                  type: string
                  example: DELIVERED_DOM
                info:
                  type: string
                  example: ENTREGADO
                created_at:
                  type: string
                  example: '2026-02-10 18:52:13+00:00'
            customer:
              type: object
              properties:
                full_name:
                  type: string
                  example: benjamin gon
                phone:
                  type: string
                  example: '946890920'
                email:
                  type: string
                  example: benjamin.g.andres@gmail.com
            shipping_address:
              type: object
              properties:
                full_address:
                  type: string
                  example: Principe Igor 5963 casa
                place:
                  type: string
                  example: San Joaquín
                type:
                  type: string
                  example: home
            country:
              type: string
              example: CL
            carrier:
              type: string
              example: BLUEXPRESS
            service:
              type: string
              example: priority
            label:
              type: object
              properties:
                PDF:
                  type: string
                  format: uri
                  nullable: true
                  example: >-
                    https://storage.googleapis.com/carrier-labels/202602/139174791/15260319-label.pdf
                ZPL:
                  type: string
                  nullable: true
                  example: null
                PNG:
                  type: string
                  nullable: true
                  example: null
            barcodes:
              type: string
              example: '5330094364312440013201131297'
            tracking:
              type: array
              items:
                type: object
                properties:
                  status_id:
                    type: integer
                  code:
                    type: string
                  name:
                    type: string
                  comment:
                    type: string
                  created_at:
                    type: string
              example:
                - status_id: 10
                  code: DELIVERED_DOM
                  name: Entregado
                  comment: ENTREGADO
                  created_at: '2026-02-10 18:52:13+00:00'
                - status_id: 9
                  code: DISPATCHED
                  name: En Reparto
                  comment: EN REPARTO
                  created_at: '2026-02-10 13:07:13+00:00'
                - status_id: 6
                  code: IN_ORIGIN
                  name: En planta de origen
                  comment: PICK UP HUB
                  created_at: '2026-02-10 05:43:34+00:00'
                - status_id: 5
                  code: CREATED
                  name: Listo para despacho
                  comment: 'Ya creamos tu envío en: BLUEXPRESS '
                  created_at: '2026-02-08 20:41:45+00:00'
                - status_id: 1
                  code: PENDING
                  name: Creado
                  comment: Envio creado por api
                  created_at: '2026-02-08 20:41:40+00:00'
            deadline_at:
              type: string
              example: 11-02-2026
            created_at:
              type: string
              example: '2026-02-08 20:41:41+00:00'
            updated_at:
              type: string
              example: '2026-02-10 18:52:34.356266+00:00'
    DeliveryType:
      title: DeliveryType
      description: An enumeration.
      enum:
        - delivery
        - return
        - flash
    PackageSchemaDetailV3:
      title: PackageSchemaDetailV3
      type: object
      properties:
        weight:
          title: Weight
          description: Required / Weight in kilograms (kg)
          example: 1
          type: number
        volume:
          title: Volume
          description: Volume in cubic meters (m³)
          example: 1
          type: number
        width:
          title: Width
          description: Width in centimeters (cm)
          example: 10
          type: number
        height:
          title: Height
          description: Height in centimeters (cm)
          example: 10
          type: number
        length:
          title: Length
          description: Length in centimeters (cm)
          example: 10
          type: number
        price:
          title: Price
          description: Required / Unit price of the package
          example: 21990
          type: number
        quantity:
          title: Quantity
          description: Required / Quantity of this package type
          example: 1
          type: integer
        info:
          title: Info
          description: Required / Description of the package content
          example: Orden 123
          type: string
      required:
        - weight
        - volume
        - width
        - height
        - length
        - price
        - quantity
        - info
    OrderCreationSchemaV3:
      title: OrderCreationSchemaV3
      type: object
      properties:
        imported_id:
          title: Imported Id
          description: Required / Reference Number (imported_id)
          example: '123'
          minLength: 0
          maxLength: 256
          type: string
        packages:
          title: Packages
          description: Required / List of packages
          minItems: 1
          maxItems: 1
          type: array
          items:
            $ref: '#/components/schemas/PackageSchemaDetailV3'
      required:
        - imported_id
        - packages
    CarrierCreationSchemaV3:
      title: CarrierCreationSchemaV3
      type: object
      properties:
        code:
          title: Code
          description: Carrier Code
          example: SKN
          type: string
        service:
          title: Service
          description: Carrier Service Type
          example: ''
          type: string
        type:
          title: Type
          description: Carrier Modality
          example: ''
          type: string
        attributes:
          title: Attributes
          description: Additional Carrier Attributes
          default: []
          example:
            - fragile
          type: array
          items:
            type: string
        tracking_number:
          title: Tracking Number
          description: Tracking Number assigned by the carrier
          example: ''
          type: string
        amount_to_collect:
          title: Amount To Collect
          description: Amount to collect if cash on delivery (COD)
          example: 0
          type: number
        labels:
          title: Labels
          description: Carrier Labels
          type: object
        insurance:
          title: Insurance
          description: True if delivery has insurance
          default: false
          example: false
          type: boolean
      required:
        - code
        - service
        - type
        - tracking_number
        - amount_to_collect
        - labels
    PlaceType:
      title: PlaceType
      description: An enumeration.
      enum:
        - warehouse
        - agency
        - custom
        - home
        - pudo
        - pudo_or_agency_legacy
    AddressSchemaBaseV3:
      title: AddressSchemaBaseV3
      type: object
      properties:
        level1:
          title: Level1
          description: Province (PE), Department (CO, AR), State (MX)
          type: string
        level2:
          title: Level2
          description: Municipality (MX)
          type: string
        level3:
          title: Level3
          description: City (MX)
          type: string
        level4:
          title: Level4
          description: Additional Administrative Level
          type: string
        zip_code:
          title: Zip Code
          description: Zip Code
          example: '54614'
          type: string
        latitude:
          title: Latitude
          description: Latitude
          type: number
        longitude:
          title: Longitude
          description: Longitude
          type: number
        full_address:
          title: Full Address
          description: Required / Full Address
          example: Calle Falsa 123
          type: string
        information:
          title: Information
          description: Additional Address Information
          example: Indicaciones adicionales
          type: string
        country_code:
          title: Country Code
          description: Country Code (for international deliveries)
          type: string
      required:
        - full_address
    ContactCreationSchemaV3:
      title: ContactCreationSchemaV3
      type: object
      properties:
        name:
          title: Name
          description: Required / Contact Name
          example: Cliente Feliz
          minLength: 1
          maxLength: 128
          type: string
        email:
          title: Email
          description: Recipient Email Address
          example: prueba@enviame.io
          type: string
          format: email
        phone:
          title: Phone
          description: Phone Number
          example: '987654321'
          minLength: 1
          type: string
        dni:
          title: Dni
          description: National ID Document
          example: 12345678-9
          minLength: 1
          type: string
      required:
        - name
    PointSchemaV3:
      title: PointSchemaV3
      type: object
      properties:
        type:
          description: Required / Location Type
          example: home
          allOf:
            - $ref: '#/components/schemas/PlaceType'
        code:
          title: Code
          description: Warehouse, PUDO or Agency Code
          example: bod_sell
          type: string
        address:
          title: Address
          description: Address details (required if type is home)
          allOf:
            - $ref: '#/components/schemas/AddressSchemaBaseV3'
        contact:
          title: Contact
          description: Contact details
          allOf:
            - $ref: '#/components/schemas/ContactCreationSchemaV3'
      required:
        - type
    return.create.request:
      type: object
      required:
        - origin
        - destination
        - order
        - carrier
      properties:
        origin:
          description: Origen de la devolución (domicilio o PUDO/agencia)
          oneOf:
            - type: object
              required:
                - place
                - full_address
                - contact
              properties:
                place:
                  type: string
                  description: Comuna/ciudad/distrito del retiro
                full_address:
                  type: string
                  description: Dirección completa de origen
                information:
                  type: string
                  nullable: true
                  description: Complemento de dirección
                contact:
                  type: object
                  required:
                    - name
                    - email
                  properties:
                    name:
                      type: string
                    phone:
                      type: string
                      nullable: true
                    email:
                      type: string
            - type: object
              required:
                - type
                - pudo_code
                - contact
              properties:
                type:
                  type: string
                  enum:
                    - pudo_or_agency_legacy
                pudo_code:
                  type: string
                contact:
                  type: object
                  required:
                    - name
                    - email
                  properties:
                    name:
                      type: string
                    phone:
                      type: string
                      nullable: true
                    email:
                      type: string
        destination:
          description: Destino de la devolución (domicilio o bodega)
          oneOf:
            - type: object
              required:
                - place
                - full_address
                - contact
              properties:
                place:
                  type: string
                full_address:
                  type: string
                information:
                  type: string
                  nullable: true
                contact:
                  type: object
                  required:
                    - name
                    - email
                  properties:
                    name:
                      type: string
                    phone:
                      type: string
                      nullable: true
                    email:
                      type: string
            - type: object
              required:
                - code_warehouse
              properties:
                code_warehouse:
                  type: string
                  description: Código de la bodega destino
        order:
          type: object
          required:
            - imported_id
            - type
            - n_packages
            - packages
          properties:
            imported_id:
              type: string
            type:
              type: string
              enum:
                - return
            n_packages:
              type: integer
            packages:
              type: array
              items:
                type: object
                required:
                  - id
                  - price
                  - description
                  - weight
                  - volume
                properties:
                  id:
                    type:
                      - integer
                      - string
                  price:
                    type: string
                    description: Valor declarado
                  description:
                    type: string
                  weight:
                    type: string
                  volume:
                    type: string
        carrier:
          type: object
          required:
            - code
            - service
          properties:
            code:
              type: string
            service:
              type: string
            type:
              type: string
              nullable: true
            attribute:
              type: string
              nullable: true
            attributes:
              type: array
              items:
                type: string
              nullable: true
