openapi: 3.0.0
paths:
  /authorization/permission-group/list:
    get:
      operationId: ExternalAuthorizationController_listPermissionGroups
      summary: List permission groups (roles)
      description: >-
        Returns the permission groups (roles) available for your account. Use
        the `id` of the desired group as the `permission_group_id` when creating
        or updating a user.
      parameters:
        - name: user-token
          in: header
          description: Token
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Permission group list
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PermissionGroupDto'
      tags:
        - User
  /v3/order-create:
    post:
      operationId: OrderControllerV3_orderCreate
      summary: Create an order
      description: >-
        This endpoint allows you to create an order in the Rappi Cargo system
        and request a driver.


        The endpoint is built around action points. Each action is a stop that
        the driver will make to fulfill the order, making it possible to create
        many order variations sucha as the ones presented in the examples. Every
        order must have at least one action point of type STORE and at least one
        action point of type CLIENT. Whenever an action point is of type
        DROP_OFF the driver will deliver all the products that he has picked up
        until that point.
      parameters:
        - name: user-token
          in: header
          description: Token
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderCreateV3ReqDto'
            examples:
              Simple Order:
                summary: Simple order
                description: A simple order from store to client
                value:
                  total_value: 40000
                  user_tip: 1500
                  vehicle_type: BIKE
                  payment_method: ONLINE
                  action_points:
                    - external_picking_point_id: PP_123
                      instructions: >-
                        Ir a la puerta 23, decir que vienen de parte de
                        EcommerceX
                      products:
                        - product_id: HAM123
                          name: Hamburguesa con queso
                          description: Hamburguesa de carne de res 125g con queso
                          units: 2
                          ean: HAMBURGER123
                          image_url: >-
                            https://upload.wikimedia.org/wikipedia/commons/4/47/Hamburger_%28black_bg%29.jpg
                          unit_price: 15500
                      action_type: PICK_UP
                      location_type: STORE
                    - products: []
                      action_type: DROP_OFF
                      location_type: CLIENT
                  client_info:
                    email: oscar@yahoo.com
                    phone: '3234334356'
                    first_name: Oscar
                    last_name: Perez
                    address: 'calle 93 #19-58'
                    lat: 4.678646
                    lng: -74.05549
                    complement: edificio X apartamento Y
                    city: Bogota
                    comments: Dejar en porteria
                    zip_code: '110221'
                  order_id: lx3eRfCZ49-WTS57
                  in_store_reference_id: WTS57
              Multiple Picking points:
                summary: Multiple Picking points
                description: >-
                  An order that picks up the order from various stores before
                  delivering the order to the client. If the products of the
                  order are not all available at one store, it is possible to go
                  through multiple stores to pick up the complete order.
                value:
                  total_value: 40000
                  user_tip: 1500
                  vehicle_type: BIKE
                  payment_method: ONLINE
                  action_points:
                    - external_picking_point_id: PP_123
                      instructions: >-
                        Ir a la puerta 23, decir que vienen de parte de
                        EcommerceX
                      products:
                        - product_id: HAM123
                          name: Hamburguesa con queso
                          description: Hamburguesa de carne de res 125g con queso
                          units: 2
                          ean: HAMBURGER123
                          image_url: >-
                            https://upload.wikimedia.org/wikipedia/commons/4/47/Hamburger_%28black_bg%29.jpg
                          unit_price: 15500
                      action_type: PICK_UP
                      location_type: STORE
                    - picking_point_id: '456'
                      products:
                        - product_id: POS123
                          name: Helado de vainilla
                          description: Helado de vainilla hecho a mano
                          units: 1
                          ean: VAINILLA
                          unit_price: 5500
                      action_type: PICK_UP
                      location_type: STORE
                    - products: []
                      action_type: DROP_OFF
                      location_type: CLIENT
                  client_info:
                    email: oscar@yahoo.com
                    phone: '3234334356'
                    first_name: Oscar
                    last_name: Perez
                    address: 'calle 93 #19-58'
                    lat: 4.678646
                    lng: -74.05549
                    complement: edificio X apartamento Y
                    city: Bogota
                    comments: Dejar en porteria
                    zip_code: '110221'
                  order_id: lx3eRfCZ49-WTS57
                  in_store_reference_id: WTS57
              Inverse delivery:
                summary: Inverse delivery
                description: >-
                  Orders can also start at the clients address to allow for
                  inverse deliveries such as to get returns.
                value:
                  total_value: 0
                  user_tip: 1500
                  vehicle_type: BIKE
                  payment_method: ONLINE
                  action_points:
                    - products:
                        - product_id: TSHIRT1
                          name: Camiseta blanca
                          description: Camiseta blanca talla M
                          units: 1
                          unit_price: 25000
                      instructions: Pick up the products to return from XCommerce
                      action_type: PICK_UP
                      location_type: CLIENT
                    - picking_point_id: '456'
                      instructions: Entregar en caja los productos
                      products: []
                      action_type: DROP_OFF
                      location_type: STORE
                  client_info:
                    email: oscar@yahoo.com
                    phone: '3234334356'
                    first_name: Oscar
                    last_name: Perez
                    address: 'calle 93 #19-58'
                    lat: 4.678646
                    lng: -74.05549
                    complement: edificio X apartamento Y
                    city: Bogota
                    comments: Dejar en porteria
                    zip_code: '110221'
                  order_id: lx3eRfCZ49-WTS57
                  in_store_reference_id: WTS57
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderCreateV3ResDto'
        '400':
          description: >-
            The order could not be created. Branch on `code`: FIELD_VALIDATION
            (bad/missing field — see `field`), COVERAGE_VALIDATION,
            ALREADY_EXTERNAL_ORDER_ID (duplicate `order_id`),
            ORDER_DISTANCE_VALIDATION (>50km) or ORDER_TIME_VALIDATION (>40min).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              examples:
                FIELD_VALIDATION:
                  summary: Field validation failed
                  value:
                    message: action_points.0.products should not be empty
                    type: ValidationError
                    code: FIELD_VALIDATION
                    status: 400
                    field: action_points.0.products
                COVERAGE_VALIDATION:
                  summary: Outside Rappi coverage
                  value:
                    message: >-
                      The store and the client must both be inside a Rappi
                      coverage area.
                    type: ValidationError
                    code: COVERAGE_VALIDATION
                    status: 400
                ALREADY_EXTERNAL_ORDER_ID:
                  summary: Duplicate order_id
                  value:
                    message: An active order already exists with this order_id.
                    type: ValidationError
                    code: ALREADY_EXTERNAL_ORDER_ID
                    status: 400
                    field: order_id
                ORDER_DISTANCE_VALIDATION:
                  summary: Trip exceeds distance limit
                  value:
                    message: The store to client trip exceeds the 50km limit.
                    type: ValidationError
                    code: ORDER_DISTANCE_VALIDATION
                    status: 400
                    data:
                      limit_km: 50
                      actual_km: 63.2
                ORDER_TIME_VALIDATION:
                  summary: Trip exceeds time limit
                  value:
                    message: >-
                      The store to client trip exceeds the 40min travel time
                      limit.
                    type: ValidationError
                    code: ORDER_TIME_VALIDATION
                    status: 400
                    data:
                      limit_minutes: 40
                      actual_minutes: 52
        '401':
          description: The `user-token` header is missing or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              examples:
                Unauthorized:
                  summary: Missing or invalid user-token
                  value:
                    message: Invalid or missing user-token header.
                    type: UnauthorizedError
                    status: 401
        '404':
          description: The referenced resource (e.g. order) does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              examples:
                NotFound:
                  summary: Order not found
                  value:
                    message: No order was found for the given identifier.
                    type: NotFoundError
                    code: NOT_FOUND
                    status: 404
        '500':
          description: An unexpected error occurred on Cargo's side.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              examples:
                InternalServerError:
                  summary: Unexpected server error
                  value:
                    message: >-
                      An unexpected error occurred. Please retry or contact
                      support.
                    type: InternalServerError
                    status: 500
      tags:
        - Order V3
  /v3/order-validate:
    post:
      operationId: OrderControllerV3_deliveryServices
      summary: Check if an order can be created
      description: >-
        Rappi makes some validations before allowing the creation of an order.
        In order to verify that the order-create endpoint will have a successful
        response, this endpoint can be used. This can be useful to block the
        creation of the order in the partners system in cases where Rappi Cargo
        is the only delivery provider. 


        Additionally, the endpoint provides extra insights regarding the order
        that may be useful to receive before creating the order such as the ETA
        and the distance of the trip.

        This endpoint only goes through the validations, without creating the
        order.


        The validations that Rappi does are:


        1. All of the action points are inside a Rappi coverage area. Ask your
        commercial contact for a map regarding Rappi's coverage in LatAm.

        2. The travel time between the action points is under 40 minutes. This
        is the journey from the first to the last action point. Travel time is
        estimated by a proprietary service that determines the travel time
        between two coordinates.


        3. There is current courier availability.


        If any of these fail, the endpoint will respond with an error state and
        the reason for the error.
      parameters:
        - name: user-token
          in: header
          description: Token
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderDeliveryServicesV3ReqDto'
            examples:
              Simple Order:
                summary: Simple order
                description: A simple order from store to client
                value:
                  total_value: 40000
                  user_tip: 1500
                  vehicle_type: BIKE
                  payment_method: ONLINE
                  action_points:
                    - external_picking_point_id: PP_123
                      instructions: >-
                        Ir a la puerta 23, decir que vienen de parte de
                        EcommerceX
                      products:
                        - product_id: HAM123
                          name: Hamburguesa con queso
                          description: Hamburguesa de carne de res 125g con queso
                          units: 2
                          ean: HAMBURGER123
                          image_url: >-
                            https://upload.wikimedia.org/wikipedia/commons/4/47/Hamburger_%28black_bg%29.jpg
                          unit_price: 15500
                      action_type: PICK_UP
                      location_type: STORE
                    - products: []
                      action_type: DROP_OFF
                      location_type: CLIENT
                  client_info:
                    email: oscar@yahoo.com
                    phone: '3234334356'
                    first_name: Oscar
                    last_name: Perez
                    address: 'calle 93 #19-58'
                    lat: 4.678646
                    lng: -74.05549
                    complement: edificio X apartamento Y
                    city: Bogota
                    comments: Dejar en porteria
                    zip_code: '110221'
              Multiple Picking points:
                summary: Multiple Picking points
                description: >-
                  An order that picks up the order from various stores before
                  delivering the order to the client. If the products of the
                  order are not all available at one store, it is possible to go
                  through multiple stores to pick up the complete order.
                value:
                  total_value: 40000
                  user_tip: 1500
                  vehicle_type: BIKE
                  payment_method: ONLINE
                  action_points:
                    - external_picking_point_id: PP_123
                      instructions: >-
                        Ir a la puerta 23, decir que vienen de parte de
                        EcommerceX
                      products:
                        - product_id: HAM123
                          name: Hamburguesa con queso
                          description: Hamburguesa de carne de res 125g con queso
                          units: 2
                          ean: HAMBURGER123
                          image_url: >-
                            https://upload.wikimedia.org/wikipedia/commons/4/47/Hamburger_%28black_bg%29.jpg
                          unit_price: 15500
                      action_type: PICK_UP
                      location_type: STORE
                    - picking_point_id: '456'
                      products:
                        - product_id: POS123
                          name: Helado de vainilla
                          description: Helado de vainilla hecho a mano
                          units: 1
                          ean: VAINILLA
                          unit_price: 5500
                      action_type: PICK_UP
                      location_type: STORE
                    - products: []
                      action_type: DROP_OFF
                      location_type: CLIENT
                  client_info:
                    email: oscar@yahoo.com
                    phone: '3234334356'
                    first_name: Oscar
                    last_name: Perez
                    address: 'calle 93 #19-58'
                    lat: 4.678646
                    lng: -74.05549
                    complement: edificio X apartamento Y
                    city: Bogota
                    comments: Dejar en porteria
                    zip_code: '110221'
              Inverse delivery:
                summary: Inverse delivery
                description: >-
                  Orders can also start at the clients address to allow for
                  inverse deliveries such as to get returns.
                value:
                  total_value: 0
                  user_tip: 1500
                  vehicle_type: BIKE
                  payment_method: ONLINE
                  action_points:
                    - products:
                        - product_id: TSHIRT1
                          name: Camiseta blanca
                          description: Camiseta blanca talla M
                          units: 1
                          unit_price: 25000
                      instructions: Pick up the products to return from XCommerce
                      action_type: PICK_UP
                      location_type: CLIENT
                    - picking_point_id: '456'
                      instructions: Entregar en caja los productos
                      products: []
                      action_type: DROP_OFF
                      location_type: STORE
                  client_info:
                    email: oscar@yahoo.com
                    phone: '3234334356'
                    first_name: Oscar
                    last_name: Perez
                    address: 'calle 93 #19-58'
                    lat: 4.678646
                    lng: -74.05549
                    complement: edificio X apartamento Y
                    city: Bogota
                    comments: Dejar en porteria
                    zip_code: '110221'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderDeliveryServicesV3ResDto'
        '400':
          description: >-
            The request failed validation or a business rule. Branch on the
            `code` field to tell the cases apart.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              examples:
                FIELD_VALIDATION:
                  summary: Field validation failed
                  value:
                    message: action_points.0.products should not be empty
                    type: ValidationError
                    code: FIELD_VALIDATION
                    status: 400
                    field: action_points.0.products
                COVERAGE_VALIDATION:
                  summary: Outside Rappi coverage
                  value:
                    message: >-
                      The store and the client must both be inside a Rappi
                      coverage area.
                    type: ValidationError
                    code: COVERAGE_VALIDATION
                    status: 400
        '401':
          description: The `user-token` header is missing or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              examples:
                Unauthorized:
                  summary: Missing or invalid user-token
                  value:
                    message: Invalid or missing user-token header.
                    type: UnauthorizedError
                    status: 401
        '404':
          description: The referenced resource (e.g. order) does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              examples:
                NotFound:
                  summary: Order not found
                  value:
                    message: No order was found for the given identifier.
                    type: NotFoundError
                    code: NOT_FOUND
                    status: 404
        '500':
          description: An unexpected error occurred on Cargo's side.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              examples:
                InternalServerError:
                  summary: Unexpected server error
                  value:
                    message: >-
                      An unexpected error occurred. Please retry or contact
                      support.
                    type: InternalServerError
                    status: 500
      tags:
        - Order V3
  /v3/order-creation-body/{rappi_order_id}:
    get:
      operationId: OrderControllerV3_getOrderCreationBody
      summary: Duplicate an order — get the body that created it
      description: >-
        Returns the request body that created an existing order, already
        prepared to be sent back to
        [order-create](#tag/Order-V3/operation/OrderControllerV3_orderCreate).
        It is the shortcut for **duplicating an order** — repeating a delivery
        with the same stores, client, products and options — without rebuilding
        the payload on your side.


        Typical uses are a delivery that came back to the store and has to go
        out again, a client that asks for the same order later in the day, or a
        re-attempt after a failed delivery.


        **How to use it**


        1. `GET /v3/order-creation-body/{rappi_order_id}` with the
        `rappi_order_id` Cargo returned when the original order was created.

        2. Take the `body` from the response and change anything you need
        (products, tip, `deliver_at`, …). Everything else can be sent as is.

        3. `POST` that body to **order-create**. The response is the usual
        create response, with the `rappi_order_id` of the new order.


        **What comes prepared in the body**


        - `order_id` is removed. The duplicate does not reuse your identifier:
        Cargo derives one from the original, in the form `{original
        order_id}:cargo:duplicate:{n}`, where `n` grows with each duplicate. It
        is returned to you in the create response.

        - `parent_order_id` is set to the `rappi_order_id` of the original
        order. This is what links the duplicate to it, and it replaces
        `order_id` — send one or the other, never both.

        - Duplicating a duplicate keeps a single level of parenthood: the new
        order is linked to the original parent, not to the duplicate you copied
        from.


        **Things to keep in mind**


        - The body is a copy of what *you* sent originally, not of the order's
        current state. Changes made to the order after creation (cancellations,
        status, courier) are not reflected.

        - Creating the duplicate runs the full validation flow again — coverage,
        travel time and courier availability are re-evaluated at that moment —
        so a duplicate can be rejected even though the original went through.

        - Only orders that belong to the account of the `user-token` are
        returned. Orders of another account are reported as `404`, the same as
        orders that do not exist.
      parameters:
        - name: user-token
          in: header
          description: Token
          required: true
          schema:
            type: string
        - name: rappi_order_id
          required: true
          in: path
          description: >-
            Rappi identifier of the order to duplicate — the `rappi_order_id`
            returned when it was created.
          schema:
            example: 123456789
            type: number
      responses:
        '200':
          description: >-
            The creation body of the order, ready to be sent to order-create.
            `order_id` is removed and `parent_order_id` points to the order
            being duplicated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderCreationBodyResDto'
        '400':
          description: >-
            The request failed validation or a business rule. Branch on the
            `code` field to tell the cases apart.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              examples:
                FIELD_VALIDATION:
                  summary: Field validation failed
                  value:
                    message: action_points.0.products should not be empty
                    type: ValidationError
                    code: FIELD_VALIDATION
                    status: 400
                    field: action_points.0.products
                COVERAGE_VALIDATION:
                  summary: Outside Rappi coverage
                  value:
                    message: >-
                      The store and the client must both be inside a Rappi
                      coverage area.
                    type: ValidationError
                    code: COVERAGE_VALIDATION
                    status: 400
        '401':
          description: The `user-token` header is missing or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              examples:
                Unauthorized:
                  summary: Missing or invalid user-token
                  value:
                    message: Invalid or missing user-token header.
                    type: UnauthorizedError
                    status: 401
        '404':
          description: >-
            No order was found for this `rappi_order_id`, it belongs to another
            account, or the order has no stored creation body (orders created
            before this feature was released).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              examples:
                NotFound:
                  summary: Order not found
                  value:
                    message: No order was found for the given identifier.
                    type: NotFoundError
                    code: NOT_FOUND
                    status: 404
        '500':
          description: An unexpected error occurred on Cargo's side.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              examples:
                InternalServerError:
                  summary: Unexpected server error
                  value:
                    message: >-
                      An unexpected error occurred. Please retry or contact
                      support.
                    type: InternalServerError
                    status: 500
      tags:
        - Order V3
  /v3/order-cancel:
    post:
      operationId: OrderControllerV3_orderCancel
      summary: Cancel an order
      description: >-
        This API call gives the retailer the possibility to cancel an order in
        case he needs to. The order can only be canceled by the retailer when it
        is in state created, in_progress or in_store. Once the order is
        on_the_route (the courier has the products), the order cannot be
        canceled by the retailer.
      parameters:
        - name: user-token
          in: header
          description: Token
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderCancelReqDto'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderCancelResDto'
        '400':
          description: >-
            The order cannot be canceled — most commonly because it is already
            `on_the_route` (the courier has the products). Only orders in
            `created`, `in_progress` or `in_store` can be canceled by the
            retailer.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              examples:
                CannotCancel:
                  summary: Order can no longer be canceled
                  value:
                    message: >-
                      The order cannot be canceled because the courier already
                      has the products (on_the_route).
                    type: ValidationError
                    status: 400
        '401':
          description: The `user-token` header is missing or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              examples:
                Unauthorized:
                  summary: Missing or invalid user-token
                  value:
                    message: Invalid or missing user-token header.
                    type: UnauthorizedError
                    status: 401
        '404':
          description: The referenced resource (e.g. order) does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              examples:
                NotFound:
                  summary: Order not found
                  value:
                    message: No order was found for the given identifier.
                    type: NotFoundError
                    code: NOT_FOUND
                    status: 404
        '500':
          description: An unexpected error occurred on Cargo's side.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              examples:
                InternalServerError:
                  summary: Unexpected server error
                  value:
                    message: >-
                      An unexpected error occurred. Please retry or contact
                      support.
                    type: InternalServerError
                    status: 500
      tags:
        - Order V3
  /v3/order-status:
    post:
      operationId: OrderControllerV3_orderStatus
      summary: Get the status of an order.
      description: >-
        This endpoint is used to get updates on the state of an order. 


        It can either be called by sending a POST request to /order-status or by
        using the order status webhook. In order to configure the webhook,
        contact a KAM of the Rappi Cargo team and provide us with the endpoint
        where the status calls will be sent and, if needed, the header that must
        be included. The webhook sends updates every time the status of the
        order changes.

        The status changes can be repeated, for example, an order with multiple
        action points will have multiple on_the_route events when moving between
        action points.


        The list of possible order status [is available
        here](https://docs.google.com/spreadsheets/d/1SDb_1y7FQ6fgPkEkXOLVY8gMxOXuMIoiL3VjcN3-JZ8/edit?usp=sharing)
      callbacks:
        Order Status Change:
          Your Webhook URL:
            post:
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: '#/components/schemas/OrderStatusResDTOV3'
              description: >-
                Updates are sent when the orders status changes. We can send ONE
                custom header with key and value of your choice.
              responses:
                '200':
                  description: OK
      parameters:
        - name: user-token
          in: header
          description: Token
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderStatusReqDTO'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderStatusResDTOV3'
        '400':
          description: >-
            The request failed validation or a business rule. Branch on the
            `code` field to tell the cases apart.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              examples:
                FIELD_VALIDATION:
                  summary: Field validation failed
                  value:
                    message: action_points.0.products should not be empty
                    type: ValidationError
                    code: FIELD_VALIDATION
                    status: 400
                    field: action_points.0.products
                COVERAGE_VALIDATION:
                  summary: Outside Rappi coverage
                  value:
                    message: >-
                      The store and the client must both be inside a Rappi
                      coverage area.
                    type: ValidationError
                    code: COVERAGE_VALIDATION
                    status: 400
        '401':
          description: The `user-token` header is missing or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              examples:
                Unauthorized:
                  summary: Missing or invalid user-token
                  value:
                    message: Invalid or missing user-token header.
                    type: UnauthorizedError
                    status: 401
        '404':
          description: The referenced resource (e.g. order) does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              examples:
                NotFound:
                  summary: Order not found
                  value:
                    message: No order was found for the given identifier.
                    type: NotFoundError
                    code: NOT_FOUND
                    status: 404
        '500':
          description: An unexpected error occurred on Cargo's side.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              examples:
                InternalServerError:
                  summary: Unexpected server error
                  value:
                    message: >-
                      An unexpected error occurred. Please retry or contact
                      support.
                    type: InternalServerError
                    status: 500
      tags:
        - Order V3
  /v3/order/list:
    get:
      operationId: OrderControllerV3_listOrders
      summary: List the orders of the owner of the token
      parameters:
        - name: user-token
          in: header
          description: Token
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/OrderListElementResDto'
        '400':
          description: >-
            The request failed validation or a business rule. Branch on the
            `code` field to tell the cases apart.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              examples:
                FIELD_VALIDATION:
                  summary: Field validation failed
                  value:
                    message: action_points.0.products should not be empty
                    type: ValidationError
                    code: FIELD_VALIDATION
                    status: 400
                    field: action_points.0.products
                COVERAGE_VALIDATION:
                  summary: Outside Rappi coverage
                  value:
                    message: >-
                      The store and the client must both be inside a Rappi
                      coverage area.
                    type: ValidationError
                    code: COVERAGE_VALIDATION
                    status: 400
        '401':
          description: The `user-token` header is missing or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              examples:
                Unauthorized:
                  summary: Missing or invalid user-token
                  value:
                    message: Invalid or missing user-token header.
                    type: UnauthorizedError
                    status: 401
        '404':
          description: The referenced resource (e.g. order) does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              examples:
                NotFound:
                  summary: Order not found
                  value:
                    message: No order was found for the given identifier.
                    type: NotFoundError
                    code: NOT_FOUND
                    status: 404
        '500':
          description: An unexpected error occurred on Cargo's side.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              examples:
                InternalServerError:
                  summary: Unexpected server error
                  value:
                    message: >-
                      An unexpected error occurred. Please retry or contact
                      support.
                    type: InternalServerError
                    status: 500
      tags:
        - Order V3
  /v3/order-ready/{rappi_order_id}:
    post:
      operationId: OrderControllerV3_orderReady
      summary: Set order ready
      description: >-
        Calling this endpoint will mark this order as ready to be picked up.
        This means we will speed up the assignment process if there is no
        courier assigned. If there is, we will send a notification letting the
        courier know that the order is ready
      parameters:
        - name: user-token
          in: header
          description: Token
          required: true
          schema:
            type: string
        - name: rappi_order_id
          required: true
          in: path
          schema:
            type: number
      responses:
        '201':
          description: ''
        '400':
          description: >-
            The request failed validation or a business rule. Branch on the
            `code` field to tell the cases apart.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              examples:
                FIELD_VALIDATION:
                  summary: Field validation failed
                  value:
                    message: action_points.0.products should not be empty
                    type: ValidationError
                    code: FIELD_VALIDATION
                    status: 400
                    field: action_points.0.products
                COVERAGE_VALIDATION:
                  summary: Outside Rappi coverage
                  value:
                    message: >-
                      The store and the client must both be inside a Rappi
                      coverage area.
                    type: ValidationError
                    code: COVERAGE_VALIDATION
                    status: 400
        '401':
          description: The `user-token` header is missing or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              examples:
                Unauthorized:
                  summary: Missing or invalid user-token
                  value:
                    message: Invalid or missing user-token header.
                    type: UnauthorizedError
                    status: 401
        '404':
          description: The referenced resource (e.g. order) does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              examples:
                NotFound:
                  summary: Order not found
                  value:
                    message: No order was found for the given identifier.
                    type: NotFoundError
                    code: NOT_FOUND
                    status: 404
        '500':
          description: An unexpected error occurred on Cargo's side.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              examples:
                InternalServerError:
                  summary: Unexpected server error
                  value:
                    message: >-
                      An unexpected error occurred. Please retry or contact
                      support.
                    type: InternalServerError
                    status: 500
      tags:
        - Order V3
  /picking-point:
    post:
      operationId: PickingPointController_createPickingPoint
      summary: Create PickingPoint.
      parameters:
        - name: user-token
          in: header
          description: Token
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PickingPointCreateReqDTO'
      responses:
        '201':
          description: Created the picking point
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PickingPointResDTO'
        '400':
          description: Invalid request
        '401':
          description: Unauthorized
        '404':
          description: Not found
      tags:
        - Picking point
    put:
      operationId: PickingPointController_updatePickingPoint
      summary: Update PickingPoint.
      parameters:
        - name: user-token
          in: header
          description: Token
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PickingPointUpdateReqDTO'
      responses:
        '200':
          description: Updated picking point
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PickingPointResDTO'
        '400':
          description: Invalid request
        '401':
          description: Unauthorized
        '404':
          description: Not found
      tags:
        - Picking point
    delete:
      operationId: PickingPointController_deletePickingPoint
      summary: Delete the picking point passed by parameter.
      parameters:
        - name: user-token
          in: header
          description: Token
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PickingPointDeleteReqDTO'
      responses:
        '204':
          description: Deleted picking point
        '400':
          description: Invalid request
        '401':
          description: Unauthorized
        '404':
          description: Not found
      tags:
        - Picking point
  /picking-point/list:
    get:
      operationId: PickingPointController_listPickingPoints
      summary: Retrieve the list of the picking point of the retailer
      parameters:
        - name: user-token
          in: header
          description: Token
          required: true
          schema:
            type: string
        - name: orderdir
          required: false
          in: query
          description: 'Direction for orderby: asc or desc. Defaults to asc'
          schema:
            example: asc
            type: string
        - name: orderby
          required: false
          in: query
          description: >-
            The attribute that the picking points will be ordered by. Note that
            adding this parameter will slow down the query
          schema:
            example: name
            type: string
        - name: offset
          required: true
          in: query
          description: Amount of picking points you will skip in the a query
          schema:
            example: 1
            type: number
        - name: limit
          required: true
          in: query
          description: Amount of picking points you will retrieve (amount of user per page)
          schema:
            example: 50
            type: number
      responses:
        '200':
          description: Retrieved
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PickingPointResDTO'
        '400':
          description: Invalid request
        '401':
          description: Unauthorized
      tags:
        - Picking point
  /picking-point/nearby:
    get:
      operationId: PickingPointController_findNearbyPickingPoints
      summary: Retrieve the 5 nearest picking points to a given lat/lng
      parameters:
        - name: user-token
          in: header
          description: Token
          required: true
          schema:
            type: string
        - name: lat
          required: true
          in: query
          description: Latitude of the reference point
          schema:
            example: 4.60971
            type: number
        - name: lng
          required: true
          in: query
          description: Longitude of the reference point
          schema:
            example: -74.08175
            type: number
      responses:
        '200':
          description: Retrieved nearest picking points
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PickingPointNearbyResDTO'
        '400':
          description: Invalid request
        '401':
          description: Unauthorized
      tags:
        - Picking point
  /picking-point/view/{id}:
    get:
      operationId: PickingPointController_getPickingPoint
      summary: Get a PickingPoint.
      parameters:
        - name: user-token
          in: header
          description: Token
          required: true
          schema:
            type: string
        - name: id
          required: true
          in: path
          description: Id of the picking point you want to retrieve
          schema:
            example: 123445
            type: number
      responses:
        '200':
          description: Retrieved picking point
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PickingPointResDTO'
        '400':
          description: Invalid request
        '401':
          description: Unauthorized
        '404':
          description: Not found
      tags:
        - Picking point
  /picking-point/checkin:
    get:
      operationId: PickingPointController_GetCheckinCode
      summary: Get a Checkin Code for a given PickingPoint.
      parameters:
        - name: user-token
          in: header
          description: Token
          required: true
          schema:
            type: string
        - name: p
          required: true
          in: query
          description: Id of the picking point you want the checkin code for
          schema:
            example: '123445'
            type: string
      responses:
        '200':
          description: Retrieved checkin code
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PickingPointCheckinResDTO'
        '400':
          description: Invalid request
        '401':
          description: Unauthorized
        '404':
          description: Not found
      tags:
        - Picking point
  /picking-point/list/checkin-code:
    get:
      operationId: PickingPointController_GetAllCheckinCodes
      summary: Fetch all the checkin codes from the picking points
      parameters:
        - name: user-token
          in: header
          description: Token
          required: true
          schema:
            type: string
      responses:
        '200':
          description: List of the picking points and their checkin codes
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PickingPointListCheckinCodesItemResDTO'
        '400':
          description: Invalid request
        '401':
          description: Unauthorized
        '404':
          description: Not found
      tags:
        - Picking point
  /picking-point/checkin-refresh:
    post:
      operationId: PickingPointController_RefreshCheckinCode
      summary: Refresh the Checkin Code for a given PickingPoint.
      parameters:
        - name: user-token
          in: header
          description: Token
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PickingPointCheckinQuery'
      responses:
        '201':
          description: Updated checkin code
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PickingPointCheckinResDTO'
        '400':
          description: Invalid request
        '401':
          description: Unauthorized
        '404':
          description: Not found
      tags:
        - Picking point
  /user/create:
    post:
      operationId: UserController_userCreate
      summary: Creates a user in the platform
      parameters:
        - name: user-token
          in: header
          description: Token
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserCreateReqDTO'
      responses:
        '201':
          description: User successfully created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserResDTO'
        '400':
          description: Invalid user create request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
      tags:
        - User
  /user/update:
    put:
      operationId: UserController_userUpdate
      summary: Updates a user in the platform
      parameters:
        - name: user-token
          in: header
          description: Token
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserUpdateReqDTO'
      responses:
        '200':
          description: User updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserResDTO'
        '400':
          description: Invalid user update request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
      tags:
        - User
  /user/delete:
    post:
      operationId: UserController_userDelete
      summary: Deletes a user in the platform
      parameters:
        - name: user-token
          in: header
          description: Token
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserDeleteReqDTO'
      responses:
        '200':
          description: User deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserDeleteResDTO'
        '400':
          description: Invalid user delete request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
      tags:
        - User
  /user/list:
    get:
      operationId: UserController_getUsers
      summary: Retrieve the list of users from a retailer
      parameters:
        - name: user-token
          in: header
          description: Token
          required: true
          schema:
            type: string
        - name: offset
          required: false
          in: query
          description: >-
            Number of users to skip before collecting the page. Defaults to 0
            when omitted.
          schema:
            example: 0
            type: number
        - name: limit
          required: false
          in: query
          description: >-
            Number of users to retrieve (page size). Defaults to 50 when
            omitted.
          schema:
            example: 50
            type: number
      responses:
        '200':
          description: User list fetched successfully
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/UserResDTO'
        '400':
          description: Invalid user list request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
      tags:
        - User
  /user/view/{id}:
    get:
      operationId: UserController_getUser
      summary: Retrieve the user with the id provided
      parameters:
        - name: user-token
          in: header
          description: Token
          required: true
          schema:
            type: string
        - name: id
          required: true
          in: path
          description: Id of the user you want to retrieve
          schema:
            example: 1234567
            type: number
      responses:
        '200':
          description: User retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserResDTO'
        '400':
          description: Invalid user get request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
      tags:
        - User
  /rt/remove-debt/{rappi_order_id}:
    post:
      operationId: RtController_removeDebt
      summary: Confirm that an order was returned to the store
      description: >-
        Confirms that an order that never reached the customer came back to your
        store successfully. This is the endpoint you call to close the return:
        the order moves to `returned` and the courier gets a push notification
        in the Rappi app telling them your store accepted the delivery back.


        **Call it when the courier is physically in front of you handing the
        order back**, once you have checked that everything you expected is
        there. The confirmation is irreversible — from Rappi's side it is the
        receipt that your store already got the products or the cash back — so a
        second call on the same order fails.


        **Why it also settles the courier's debt**


        When an order carrying cash or products does not reach the customer,
        Rappi registers a **debt** against the courier for the value of the
        order, which would otherwise be discounted from their earnings.
        Confirming the return is what clears that debt: your confirmation is the
        proof that the courier gave the goods or the money back, so the two
        happen in the same call. This is why most of the errors below talk about
        the debt — they are the financial side of a return that cannot be
        confirmed yet.


        **When can it be called**


        The order must be in one of these states:


        | Status | Condition |

        | --- | --- |

        | `canceled` | only if the order was flagged as returnable
        (`return_allowed`) |

        | `failed_delivery` | — |

        | `failed_return` | — |

        | `return_in_store` | — |

        | `returned` | — |


        On top of that, the order must have a courier assigned, must not have
        been confirmed before, and must have a pending debt in Rappi's system.


        **Permissions**


        The user behind the `user-token` needs the `ORDER_REMOVE_DEBT`
        permission over the picking point of the order. Orders that belong to a
        different account are reported as `404`, the same as orders that do not
        exist, so a wrong token cannot be used to probe for order ids.


        **Return orders**


        If you send the id of a return order created by Cargo, the confirmation
        is applied to the original order that generated the return, so you can
        always use the id you are tracking.


        **Retries**


        The debt is registered in a separate financial system and can take a few
        seconds to appear after the order fails, so a return can be valid and
        still not be confirmable for a moment. A `422` with code
        `ORDER_WITH_WRONG_DEBT` means the amount is not settled yet — wait and
        retry. A `422` with `ORDER_HAS_NO_DEBT` or `ORDER_HAS_DEBT_ADJUSTMENT`
        means there is nothing left to settle and the return needs no
        confirmation; do not retry those.
      parameters:
        - name: user-token
          in: header
          description: Token
          required: true
          schema:
            type: string
        - name: rappi_order_id
          required: true
          in: path
          description: >-
            Rappi identifier of the order being returned — the `rappi_order_id`
            returned when the order was created.
          schema:
            example: 123456789
            type: number
      responses:
        '201':
          description: >-
            The return was confirmed: the order is marked as returned, the
            courier's debt was cleared and the courier was notified. The body is
            empty.
        '400':
          description: >-
            The order exists but its current status does not allow confirming a
            return (already confirmed, no courier assigned, or a status outside
            the return flow).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              examples:
                ORDER_NOT_ELIGIBLE_FOR_DEBT_CANCELATION:
                  summary: Order is not in a state that allows confirming a return
                  value:
                    message: >-
                      Order with rappi_order_id: 123456789 is not eligible for
                      debt cancelation
                    code: ORDER_NOT_ELIGIBLE_FOR_DEBT_CANCELATION
                    status: 400
        '401':
          description: The `user-token` header is missing or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              examples:
                Unauthorized:
                  summary: Missing or invalid user-token
                  value:
                    message: Invalid or missing user-token header.
                    type: UnauthorizedError
                    status: 401
        '404':
          description: >-
            No order was found for this id, the order belongs to another
            account, or the token's user lacks the `ORDER_REMOVE_DEBT`
            permission over its picking point.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              examples:
                ORDER_NOT_FOUND:
                  summary: Order does not exist, or does not belong to your account
                  value:
                    message: Order with rappi_order_id 123456789 does not exist.
                    code: ORDER_NOT_FOUND
                    status: 404
        '422':
          description: >-
            The return could not be confirmed because of the courier's debt.
            Branch on `code`: ORDER_HAS_NO_DEBT and ORDER_HAS_DEBT_ADJUSTMENT
            are final (there is nothing left to settle), ORDER_WITH_WRONG_DEBT
            means the amount is still being settled and the call can be retried
            in a few seconds.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              examples:
                ORDER_HAS_NO_DEBT:
                  summary: The courier never had a debt for this order
                  value:
                    message: 'Order with rappi_order_id: 123456789 has no debt'
                    code: ORDER_HAS_NO_DEBT
                    status: 422
                ORDER_HAS_DEBT_ADJUSTMENT:
                  summary: The return was already confirmed
                  value:
                    message: >-
                      Order with rappi_order_id: 123456789 already has a debt
                      adjustment
                    code: ORDER_HAS_DEBT_ADJUSTMENT
                    status: 422
                ORDER_WITH_WRONG_DEBT:
                  summary: The debt is not settled yet — retry in a few seconds
                  value:
                    message: >-
                      The order with id: 123456789 does not have debt in the
                      system yet. Please try again later
                    code: ORDER_WITH_WRONG_DEBT
                    status: 422
        '500':
          description: >-
            An unexpected error occurred on Cargo's side. The confirmation may
            have been partially processed — check the order status before
            retrying.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              examples:
                InternalServerError:
                  summary: Unexpected server error
                  value:
                    message: Internal Error
                    code: INTERNAL_ERROR
                    status: 500
      tags:
        - Order V3
info:
  title: Docs API Cargo | By Rappi
  description: >
    This API lets you do everything Cargo By Rappi can do — create and track
    deliveries, manage stores and users — without opening the Cargo portal. This
    page is the reference for every public endpoint; the guide below is the
    fastest path from zero to a delivered order.


    ## Cargo Portal


    Everything here can also be done in the portal, which is handy for browsing
    orders and configuration while you build your integration:


    - **[Dev](https://cargo.dev.rappi.com/auth/login) (Do not change country)**

    - **[Production](https://cargo.rappi.com.co/auth/login) (Choose country)**


    ## Getting started — the integration in 6 steps


    A minimal integration is really just one call (`order-create`). The steps
    below add the pieces most partners want, in the order you'll build them.


    ### Step 1 — Authenticate with your `user-token`


    Every request is authenticated with an API key sent in the **`user-token`**
    HTTP header. There is no login/OAuth flow: your KAM (Key Account Manager) at
    Rappi Cargo provisions the token for your account. Send it on every call; a
    missing or invalid token returns `401 Unauthorized`.


    > Tip: use the **DEV** server (see the "Servers" dropdown) while
    integrating, then switch the base URL to your country's production server
    when you go live. The token is environment-specific.


    ### Step 2 — Register your store (picking point)


    An order always starts at a **picking point** — the store the courier picks
    up from. Create your stores once via **[picking-point
    create](#tag/Picking-point)** (or in the portal). You'll reference a store
    in each order either by Cargo's `picking_point_id` or by your own
    `external_picking_point_id`. You only do this when your stores change, not
    per order.


    ### Step 3 — (Optional) Validate the delivery before creating it


    Call
    **[Order-validate](#tag/Order-V3/operation/OrderControllerV3_deliveryServices)**
    to check whether an order *could* be created, without creating it. It runs
    the same coverage/time/availability checks as create and returns the
    estimated **ETA** and **trip distance**. Many partners call it at checkout
    to show an ETA or to block an order Rappi can't deliver. It's optional —
    skip it if you don't need the preview.


    ### Step 4 — Create the order


    **[Order-create](#tag/Order-V3/operation/OrderControllerV3_orderCreate)** is
    the one required call. The request is built around **action points** — the
    ordered stops the courier makes. The essentials:


    - Provide **at least 2 action points**, including at least one `STORE` and
    one `CLIENT`. A `PICK_UP` at the store then a `DROP_OFF` at the client is
    the typical shape.

    - On each action point send a **`products` array**. On `PICK_UP` points list
    what's collected there; on `DROP_OFF` points send an empty `[]` (the courier
    drops off everything gathered so far). The field must be present on every
    action point — omitting it fails validation.

    - Send a unique **`order_id`** (your identifier). It doubles as the
    idempotency key, so retries won't create duplicate orders.

    - Set **`total_value`** to the full amount the client pays. For `CASH`
    orders this is exactly what the courier collects (plus tip).


    See the "Create an order" examples for ready-to-send request bodies (simple,
    multi-store, and inverse/return deliveries).


    To repeat a delivery you already created — the same stores, client and
    products — you don't have to rebuild the payload:
    **[order-creation-body](#tag/Order-V3/operation/OrderControllerV3_getOrderCreationBody)**
    returns the original request body ready to be sent back to order-create as a
    duplicate.


    ### Step 5 — Track the order status


    Use
    **[Order-status](#tag/Order-V3/operation/OrderControllerV3_orderStatus)** to
    follow the order. Two options: poll the endpoint, or (recommended) have
    Cargo push updates to a **webhook** — give your KAM the URL (and any header)
    and you'll receive a call on every status change. Status events can repeat
    (e.g. multiple `on_the_route` events across action points).


    ### Step 6 — Cancel when needed


    **[Order-cancel](#tag/Order-V3/operation/OrderControllerV3_orderCancel)**
    cancels an order via API. It only works while the order is in `created`,
    `in_progress` or `in_store`; once it's `on_the_route` (the courier holds the
    products) it can no longer be canceled this way.


    ## Pre-flight checklist — avoid the common mistakes


    Verify these before going live; each is a frequent cause of rejected or
    failed orders:


    - **Coordinates:** if you send `lat`/`lng`, use between 2 and 9 decimals. If
    you don't, make sure the address is precise enough to geocode.

    - **Phone numbers — no country code:** send the client and store phone
    *without* the country indicator (that goes in `phone_country_code`).

    - **Phone length:** the number must have the correct mobile length for the
    country, or the order is rejected.

    - **Mobile only, no landlines:** Cargo reaches the client via SMS and
    WhatsApp, so landlines are not accepted.

    - **Address complement:** always include an apartment/office/building
    detail. A bare address often means the courier can't find the client and the
    order gets canceled.

    - **At least 2 action points:** one `STORE` and one `CLIENT`.

    - **`total_value` is the full charge:** for `CASH` orders it must equal
    exactly what the courier collects — include surcharges, not just the sum of
    product prices.
  version: '3.0'
  contact: {}
tags:
  - name: Order V3
    description: ''
servers:
  - url: https://microservices.dev.rappi.com/api/cargo-api-gateway
    description: DEV
  - url: https://services.grability.rappi.com/api/cargo-api-gateway
    description: PROD Colombia
  - url: https://services.mxgrability.rappi.com/api/cargo-api-gateway
    description: PROD México
  - url: https://services.rappi.com.ar/api/cargo-api-gateway
    description: PROD Argentina
  - url: https://services.rappi.com.uy/api/cargo-api-gateway
    description: PROD Uruguay
  - url: https://services.rappi.com.br/api/cargo-api-gateway
    description: PROD Brasil
  - url: https://services.rappi.cl/api/cargo-api-gateway
    description: PROD Chile
  - url: https://services.rappi.co.cr/api/cargo-api-gateway
    description: PROD Costa Rica
  - url: https://services.rappi.com.ec/api/cargo-api-gateway
    description: PROD Ecuador
  - url: https://services.rappi.pe/api/cargo-api-gateway
    description: PROD Perú
components:
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: user-token
  schemas:
    PermissionGroupDto:
      type: object
      properties:
        id:
          type: number
          description: Unique identifier of the permission group
          example: 123
        brand_id:
          type: number
          description: Identifier of the associated brand
          example: 12345
        picking_point_permissions:
          type: array
          description: Permissions related to picking points
          items:
            type: string
            enum:
              - PP_MANAGE
              - PP_UPDATE_WITH_INCENTIVE_SETTINGS
              - PP_UPDATE
              - PP_CREATE
              - PP_READ
              - PP_DELETE
              - ORDER_MANAGE
              - ORDER_CREATE
              - ORDER_CANCEL
              - ORDER_REMOVE_DEBT
              - ORDER_ADD_INCENTIVE
              - ORDER_POSITION
              - ORDER_VALIDATE
              - ORDER_HAND_RT
              - ORDER_READY
        retailer_permissions:
          type: array
          description: Permissions related to retailers
          items:
            type: string
            enum:
              - RETAILER_MANAGE
              - RETAILER_READ
              - RETAILER_UPDATE
              - RETAILER_UPDATE_WITH_INCENTIVE_SETTINGS
              - PP_MANAGE
              - PP_UPDATE_WITH_INCENTIVE_SETTINGS
              - PP_UPDATE
              - PP_CREATE
              - PP_READ
              - PP_DELETE
              - ORDER_MANAGE
              - ORDER_CREATE
              - ORDER_CANCEL
              - ORDER_REMOVE_DEBT
              - ORDER_ADD_INCENTIVE
              - ORDER_POSITION
              - ORDER_VALIDATE
              - ORDER_HAND_RT
              - ORDER_READY
        global_permissions:
          type: array
          description: Global permissions
          items:
            type: string
            enum:
              - MANAGE_ACCOUNT
              - CREATE_USER
              - UPDATE_USER
              - DELETE_USER
              - LIST_USERS
              - USER_DETAIL
              - CHANGE_PASSWORDS
              - MI_TIENDA_GET_STORES
              - MI_TIENDA_ACTIVATE_STORES
              - PARTNER_PORTAL_GET_STORES
              - PARTNER_PORTAL_ACTIVATE_STORES
              - REPORTS
              - CONTROL_TOWER
              - HANDLE_ROLES
              - MANAGE_SETTLEMENT
              - DEV_PORTAL
              - RETAILER_MANAGE
              - RETAILER_READ
              - RETAILER_UPDATE
              - RETAILER_UPDATE_WITH_INCENTIVE_SETTINGS
              - PP_MANAGE
              - PP_UPDATE_WITH_INCENTIVE_SETTINGS
              - PP_UPDATE
              - PP_CREATE
              - PP_READ
              - PP_DELETE
              - ORDER_MANAGE
              - ORDER_CREATE
              - ORDER_CANCEL
              - ORDER_REMOVE_DEBT
              - ORDER_ADD_INCENTIVE
              - ORDER_POSITION
              - ORDER_VALIDATE
              - ORDER_HAND_RT
              - ORDER_READY
        name:
          type: string
          description: Name of the permission group
          example: Visualizador Global
        description:
          type: string
          description: Description of the permission group
          example: Ve todas las órdenes de todas las tiendas
        level:
          type: string
          description: Level of the permission group (e.g., RETAILER)
          enum:
            - GLOBAL
            - RETAILER
            - PICKING_POINT
        created_at:
          type: string
          description: Timestamp when the permission group was created. ISO String
          example: '2025-01-23T16:08:30.672Z'
        updated_at:
          type: string
          description: Timestamp when the permission group was last updated. ISO String
          example: '2025-01-23T16:08:30.672Z'
      required:
        - id
        - brand_id
        - picking_point_permissions
        - retailer_permissions
        - global_permissions
        - name
        - description
        - level
        - created_at
        - updated_at
    ApiErrorDto:
      type: object
      properties:
        message:
          type: string
          description: >-
            Human-readable explanation of what went wrong. Safe to log; not
            meant to be shown verbatim to end customers. Pair it with `code` for
            programmatic handling.
          example: The store and the client must both be inside a Rappi coverage area.
        type:
          type: string
          description: >-
            High-level category of the error (e.g. the failing subsystem or
            validation group). Use `code` for precise branching; `type` is
            informational.
          example: ValidationError
        code:
          type: string
          description: >-
            Machine-readable error code — branch on this, not on `message`.
            Meanings:

            - **USER_NOT_ALLOWED**: the token's user lacks permission over the
            picking point. A base user has all permissions.

            - **COLLECT_CASH_NOT_ENABLED**: the order is CASH but cash
            collection is not configured for the retailer.

            - **POS_TERMINAL_NOT_ENABLED**: POS terminal collection is not
            configured for the retailer.

            - **COORDINATES_VALIDATION**: coordinates were not sent and the
            address could not be geocoded — send `lat`/`lng` or a more precise
            address.

            - **COVERAGE_VALIDATION**: the store and/or client fall outside
            Rappi coverage. Ask your commercial contact for the coverage map.

            - **FIELD_VALIDATION**: a request field failed validation — read the
            `field` property to see which one.

            - **ALREADY_EXTERNAL_ORDER_ID**: an active (non-canceled) order
            already exists with this `order_id`; they must be unique.

            - **IMMEDIATE_DELIVERY_SATURATION_VALIDATION**: current demand
            saturation exceeds the configured limit; retry later.

            - **ORDER_DISTANCE_VALIDATION**: the store→client trip exceeds the
            50km distance limit.

            - **ORDER_TIME_VALIDATION**: the store→client trip exceeds the 40min
            travel-time limit.
          example: COVERAGE_VALIDATION
          enum:
            - USER_NOT_ALLOWED
            - COLLECT_CASH_NOT_ENABLED
            - POS_TERMINAL_NOT_ENABLED
            - COORDINATES_VALIDATION
            - COVERAGE_VALIDATION
            - FIELD_VALIDATION
            - ALREADY_EXTERNAL_ORDER_ID
            - IMMEDIATE_DELIVERY_SATURATION_VALIDATION
            - ORDER_DISTANCE_VALIDATION
            - ORDER_TIME_VALIDATION
        status:
          type: number
          description: >-
            HTTP status code, echoed in the body for convenience. Matches the
            response's HTTP status.
          example: 400
        field:
          type: string
          description: >-
            For `FIELD_VALIDATION` errors, the path of the offending request
            field (dot/bracket notation for nested fields and arrays, e.g.
            `action_points.0.products`). Absent for non-field errors.
          example: action_points.0.products
        data:
          type: object
          description: >-
            Optional structured context about the error (e.g. the offending
            value, limits that were exceeded). Shape varies by `code`.
          example:
            limit_km: 50
            actual_km: 63.2
      required:
        - message
        - type
        - code
        - status
        - field
        - data
    ProductDtoV3:
      type: object
      properties:
        product_id:
          type: string
          maxLength: 255
          minLength: 1
          description: >-
            **Required.** The product's identifier in your own system. Mandatory
            so the item can be reconciled back to your catalog/order in reports
            and support cases; it does not need to be unique within the order.
          example: pr123k
        name:
          type: string
          maxLength: 255
          minLength: 1
          description: >-
            **Required.** Human-readable product name. Mandatory because it is
            shown to the courier (and store staff) so they pick and hand over
            the correct item.
          example: zapatos superstart
        description:
          type: string
          description: Description of the product
          example: talla 42
        units:
          type: integer
          minimum: 1
          description: >-
            **Required.** How many units of this product are in the order. Must
            be a whole number ≥ 1 (a product line with 0 units is meaningless).
            Used for order composition and to help size the delivery.
          format: int32
          example: 2
        ean:
          type: string
          description: EAN of the product
          example: dsada1231
        image_url:
          type: string
          description: URL with the image of the product
          example: >-
            https://upload.wikimedia.org/wikipedia/commons/4/47/Hamburger_%28black_bg%29.jpg
        unit_price:
          type: number
          description: >-
            **Required.** Price of a single unit of this product (at most 2
            decimal places). Mandatory for value reconciliation and insurance of
            the goods being transported. Note this is the per-unit price, not
            the line total — the amount the courier collects for a CASH order
            comes from the order-level `total_value`, not from summing products.
          example: 10250
      required:
        - product_id
        - name
        - units
        - unit_price
    ActionPointV3DTO:
      type: object
      properties:
        picking_point_id:
          type: number
          description: >-
            ID of the picking point registered in Cargo. This is required if the
            location_type is STORE (unless external_picking_point_id is
            specified), and will be ignored if location_type is CLIENT.
          example: 123
        external_picking_point_id:
          type: string
          description: >-
            ID in your database, of the picking point registered in Cargo. This
            is required if the location_type is STORE (unless picking_point_id
            is specified), and will be ignored if location_type is CLIENT.
          example: '1234567'
        instructions:
          type: string
          description: >-
            Instructions for the driver in this point. If left empty, default
            instructions to pickup or dropoff (depending on the action_type)
            will be given to the driver.
          example: Ir a la puerta 23, decir que vienen de parte de EcommerceX
        products:
          description: >-
            **Required on every action point of an order-create request — send
            the key even when there is nothing to pick up, using an empty array
            `[]`.** The field is what defines the order's composition: on a
            `PICK_UP` point it lists the products the courier collects at that
            stop, so across all pick-up points it tells the courier and the
            store exactly what makes up the order. On a `DROP_OFF` point it
            should be `[]`: the courier always drops off everything picked up so
            far, so there is nothing to enumerate. Because the field is not
            optional, omitting it entirely fails validation (`FIELD_VALIDATION`
            on `action_points.<i>.products`) — that is the difference from
            order-validate, where products may be omitted.
          type: array
          items:
            $ref: '#/components/schemas/ProductDtoV3'
        action_type:
          type: string
          enum:
            - PICK_UP
            - DROP_OFF
          example: PICK_UP
          description: >-
            **Required.** What the courier does at this stop: `PICK_UP` to
            collect the products listed in `products`, or `DROP_OFF` to deliver
            everything picked up so far. A typical order is a `PICK_UP` at the
            store followed by a `DROP_OFF` at the client.
        location_type:
          type: string
          enum:
            - STORE
            - CLIENT
          example: STORE
          description: >-
            **Required.** Where this stop is located, which drives how the
            address is resolved: `STORE` uses the coordinates of the picking
            point referenced by `picking_point_id`/`external_picking_point_id`;
            `CLIENT` uses the address in the request's `client_info`. Every
            order needs at least one `STORE` and at least one `CLIENT` action
            point.
      required:
        - products
        - action_type
        - location_type
    ClientInfoDto:
      type: object
      properties:
        email:
          type: string
          description: Email of the client
          example: oscar@yahoo.com
          maxLength: 255
          minLength: 5
        phone:
          type: string
          maxLength: 15
          description: >-
            **Required.** Client's mobile phone **without the country code**
            (that goes in `phone_country_code`). Must be a mobile line with the
            correct length for the country — landlines are rejected because
            Cargo contacts the client via SMS and WhatsApp. Do not include the
            leading country indicator (e.g. send `3023311130`, not
            `573023311130`).
          example: '3023311130'
        phone_country_code:
          type: string
          description: >-
            Country code of the phone number, without the + sign. Example: 57
            for Colombia
          example: '57'
        first_name:
          type: string
          maxLength: 255
          minLength: 3
          description: Name of the client
          example: Oscar
        last_name:
          type: string
          maxLength: 255
          minLength: 1
          description: Last name of the client
          example: Perez
        address:
          type: string
          maxLength: 255
          description: >-
            **Required.** Street address where the order is delivered, used to
            locate the `CLIENT` action point. Send the most precise address
            possible and add unit details in `complement`; a vague address is a
            leading cause of failed/canceled deliveries because the courier
            cannot find the client.
          example: 'calle 93 #19-58'
        google_place_id:
          type: object
          maxLength: 255
          description: Google Place ID to make more reliable location management
          example: ChIJPdeRfD-FP44RSuTa17bkshg
        lat:
          type: number
          description: >-
            Latitude where the order will be delivered. Add at least 2 decimal
            places. 5 decimal places is enough
          format: double
          example: 4.67864
        lng:
          type: number
          description: >-
            Longitude where the order will be delivered. Add at least 2 decimal
            places. 5 decimal places is enough
          format: double
          example: -74.05549
        complement:
          type: string
          maxLength: 255
          description: >-
            Additional address detail such as apartment/office number, building
            name or floor. Technically optional, but **strongly recommended for
            every delivery**: without it the courier often cannot reach the
            exact door and the order may be canceled. Treat it as required for
            residential and office deliveries.
          example: edificio X apartamento Y
        city:
          type: string
          maxLength: 255
          minLength: 1
          description: City of the address where the order will be delivered
          example: Bogota
        comments:
          type: string
          maxLength: 255
          description: >-
            Extra comments for the courier to take into acccount when
            delivering.
          example: Dejar en porteria
        zip_code:
          type: string
          maxLength: 255
          description: Zip code of the address where the order will be delivered
          example: '110221'
      required:
        - email
        - phone
        - phone_country_code
        - first_name
        - last_name
        - address
        - city
    OrderCreateV3ReqDto:
      type: object
      properties:
        total_value:
          type: number
          minimum: 1
          example: 20500
          description: >-
            **Required.** Total monetary value of the order in the country's
            minor-unit-free currency (e.g. COP). Mandatory because for CASH
            orders this is the exact amount the courier must collect from the
            client (the courier charges `total_value + user_tip`); for ONLINE
            orders it is still required for billing, insurance and
            reconciliation. It must be at least 1 and should reflect the full
            price the client pays, including any surcharges — not only the sum
            of product prices.
        user_tip:
          type: number
          description: >-
            The Tip that the client wants to pay the courier. If the order is
            paid in cash, the courier will charge the total_value + tip.
                Tip directly paid to the courier. It is recommended that orders include tip because it makes them more attractive to couriers, thus they are incentivized to accept the orders quicker. This must be a positive integer. This should not be greater than the total_value of the order
          minimum: 0
        partner_tip:
          type: number
          description: >-
            The tip that the partner wants to pay the courier. This tip will not
            be charged to the user, it will be charged to the partner in the
            order charge.
                Tip directly paid to the courier. It is recommended that orders include tip because it makes them more attractive to couriers, thus they are incentivized to accept the orders quicker. This must be a positive integer. This should not be greater than the total_value of the order
          minimum: 0
        vehicle_type:
          type: string
          description: >-
            **Required.** Vehicle used for the delivery, which determines
            couriers eligible for assignment and the max cargo size. Send `CAR`
            for large orders that do not fit in a standard Rappi courier bag (43
            x 43 x 43 cm); otherwise send `BIKE` and Rappi will assign either a
            motorcycle or a bicycle.
          enum:
            - CAR
            - BIKE
          example: BIKE
        payment_method:
          type: string
          description: >-
            **Required.** How the client pays. It changes what the courier does
            on delivery, so it cannot be defaulted: `CASH` means the courier
            collects `total_value + user_tip` from the client on arrival (the
            retailer must have cash collection enabled); `ONLINE` means the
            order is already paid and the courier collects nothing.
          enum:
            - CASH
            - ONLINE
          example: ONLINE
        action_points:
          description: >-
            **Required, at least 2.** The ordered list of stops the courier
            makes to fulfill the order. Each action point is either a store
            (`location_type: STORE`) or the client (`location_type: CLIENT`),
            and at each one the courier either picks up or drops off products
            (`action_type`). Every order must contain **at least one STORE and
            at least one CLIENT** action point — that is why a lone stop is
            never valid. The array order is the route order the courier follows.
          type: array
          items:
            $ref: '#/components/schemas/ActionPointV3DTO'
        client_info:
          description: >-
            Client contact and address information. Required whenever the order
            has a `CLIENT` action point (essentially every delivery): its
            `address`/coordinates are used as the location of that stop, and its
            phone/email receive the tracking link and delivery notifications.
            Provide a precise address with a `complement` (apt/office) so the
            courier can find the client.
          allOf:
            - $ref: '#/components/schemas/ClientInfoDto'
        partner_channel:
          type: string
          description: >-
            Partner's channel for the order. The way the order was received. We
            don't do anything with this, we just store it and show it to you
          enum:
            - ECOMMERCE
            - MOBILE_APP
            - PHONE
            - INTERNAL
          example: PHONE
        priority_enabled:
          type: boolean
          description: Flag to enable priority delivery for this order
          default: false
        deliver_at:
          type: string
          example: '2022-10-13T04:23:03.560Z'
          description: >-
            The date at which the order should be delivered. It should be a
            valid UTC date time in ISO format (e.g.,
            2024-05-23T23:09:49.530Z).Only add this field if you want to
            schedule the order. *Do not use it for immediate deliveries.*
        order_id:
          type: string
          minLength: 1
          maxLength: 255
          description: >-
            **Required**, except when duplicating an order with
            `parent_order_id` (send one or the other, never both). Your own
            identifier for this order. It must be unique among your active
            orders — the API rejects a duplicate `order_id` with
            `ALREADY_EXTERNAL_ORDER_ID` (a value is reusable only after its
            previous order was canceled). This uniqueness is also what makes
            retries safe: it is used as the idempotency key, so re-sending the
            same request will not create a second order. It is also how you
            correlate this order across the status webhook and other endpoints.
          example: '123456744'
        parent_order_id:
          type: number
          description: >-
            Duplicates an existing order instead of creating a new one from
            scratch: send the `rappi_order_id` of the order being duplicated
            here and omit `order_id` (exactly one of the two must be present).
            The duplicate gets its own identifier derived from the original, in
            the form `{original order_id}:cargo:duplicate:{n}`. Duplicating a
            duplicate links the new order to the original parent, so there is
            only ever one level of parenthood. Use
            [order-creation-body](#tag/Order-V3/operation/OrderControllerV3_getOrderCreationBody)
            to obtain the original body with this field already filled in.
          example: 123456789
        in_store_reference_id:
          type: string
          description: >-
            Can be a shorter or different version of the order_id, used in the
            store, and easier to ask for by the courier
        preparation_time:
          type: number
          description: >-
            Preparation time of an order in minutes. The assignation algorithm
            will use this information to time the arrival of the driver as close
            to the end of the preparation time as possible.
          minimum: 1
          example: 20
        requires_photo:
          type: boolean
          description: >-
            Indicates if the order requires a photo to be taken at the time of
            delivery. Overrides the retailer configuration.
        requires_handshake:
          type: boolean
          description: >-
            Indicates if the order requires a code to be handed by the user at
            the time of delivery. Overrides the retailer configuration.
        handshake_code:
          type: string
          description: >-
            Caller-supplied code cargo should use for this order's handshake,
            instead of generating one. Must be a numeric string, 3 to 6 digits
            long — that length rule is the same for every order, whatever flow
            it resolves to. Honouring the code is what depends on the flow: it
            is supported on the basic RESTAURANT flow (one store pick-up
            followed by one client drop-off, with no picking, check-in or
            return), while an order that resolves to RAPPI_FAVOR (multi-stop or
            inverse) is rejected with 400 once its flow is known, because cargo
            cannot register the code with the handshake service in time for that
            flow. Only takes effect when the order actually ends up requiring a
            handshake — send `requires_handshake: true` alongside this field. If
            the order does not require a handshake, this value is silently
            ignored. An empty (or whitespace-only) string is treated exactly
            like omitting the field: it is dropped, and cargo generates the code
            itself — callers that build the body from a form or a spreadsheet
            can leave the column blank instead of having to strip the key.
          example: '482'
        sales_channel:
          type: string
          description: Sales channel from where the order was created.
        use_optimal_pp_order:
          type: boolean
          description: >-
            Indicates if the order should be rearranged to optimize the order of
            the action points.
        slot_id:
          type: number
          description: >-
            Slot id used to schedule the order. When provided, the order is
            scheduled to the slot's date and time (midpoint between start_time
            and end_time) and slot.current is incremented after creation.
          example: 42
      required:
        - total_value
        - vehicle_type
        - payment_method
        - action_points
        - order_id
    IntervalDto:
      type: object
      properties:
        lower:
          type: number
          example: 28
        upper:
          type: number
          example: 35
      required:
        - lower
        - upper
    OrderCreateV3ResDto:
      type: object
      properties:
        cargo_order_id:
          type: bigint
          example: 8907
        rappi_order_id:
          type: bigint
          example: 11232442
        external_order_id:
          type: string | number
          example: ABC123XYZ, 123456
        tracking_url:
          type: string
          example: >-
            https://cargo-tracking.rappi.com.co/eta/078c958514a82431bd72a2f39d9f9613
          description: >-
            This link allows the customer to track the order status in realtime.
            It will be sent via SMS and Email to the client.
        eta:
          type: number
          example: 31
        eta_interval:
          $ref: '#/components/schemas/IntervalDto'
        trip_distance:
          type: number
          description: >-
            It is an estimated distance, calculated by a proprietary service in
            Rappi. This can be used to estimate the cost of the delivery
            service.
        estimated_price:
          type: number
          description: It is an estimated price based on your billing info.
        requires_handshake:
          type: boolean
          description: Indicates if the order will need handshake code to verify delivery.
        rain_charge:
          type: boolean
          description: Flag that indicates if the order has a rain charge.
        raining_charge:
          type: number
          description: It is an estimated price based on your billing info.
        high_demand_charge:
          type: number
          description: It is an estimated price based on your billing info.
      required:
        - cargo_order_id
        - rappi_order_id
        - external_order_id
        - tracking_url
        - eta
        - eta_interval
        - trip_distance
        - estimated_price
        - requires_handshake
        - rain_charge
        - raining_charge
        - high_demand_charge
    OrderDeliveryServicesV3ReqDto:
      type: object
      properties:
        total_value:
          type: number
          minimum: 1
          example: 20500
          description: >-
            **Required.** Total monetary value of the order in the country's
            minor-unit-free currency (e.g. COP). Mandatory because for CASH
            orders this is the exact amount the courier must collect from the
            client (the courier charges `total_value + user_tip`); for ONLINE
            orders it is still required for billing, insurance and
            reconciliation. It must be at least 1 and should reflect the full
            price the client pays, including any surcharges — not only the sum
            of product prices.
        user_tip:
          type: number
          description: >-
            The Tip that the client wants to pay the courier. If the order is
            paid in cash, the courier will charge the total_value + tip.
                Tip directly paid to the courier. It is recommended that orders include tip because it makes them more attractive to couriers, thus they are incentivized to accept the orders quicker. This must be a positive integer. This should not be greater than the total_value of the order
          minimum: 0
        partner_tip:
          type: number
          description: >-
            The tip that the partner wants to pay the courier. This tip will not
            be charged to the user, it will be charged to the partner in the
            order charge.
                Tip directly paid to the courier. It is recommended that orders include tip because it makes them more attractive to couriers, thus they are incentivized to accept the orders quicker. This must be a positive integer. This should not be greater than the total_value of the order
          minimum: 0
        vehicle_type:
          type: string
          description: >-
            **Required.** Vehicle used for the delivery, which determines
            couriers eligible for assignment and the max cargo size. Send `CAR`
            for large orders that do not fit in a standard Rappi courier bag (43
            x 43 x 43 cm); otherwise send `BIKE` and Rappi will assign either a
            motorcycle or a bicycle.
          enum:
            - CAR
            - BIKE
          example: BIKE
        payment_method:
          type: string
          description: >-
            **Required.** How the client pays. It changes what the courier does
            on delivery, so it cannot be defaulted: `CASH` means the courier
            collects `total_value + user_tip` from the client on arrival (the
            retailer must have cash collection enabled); `ONLINE` means the
            order is already paid and the courier collects nothing.
          enum:
            - CASH
            - ONLINE
          example: ONLINE
        action_points:
          description: >-
            **Required, at least 2.** The ordered list of stops the courier
            makes to fulfill the order. Each action point is either a store
            (`location_type: STORE`) or the client (`location_type: CLIENT`),
            and at each one the courier either picks up or drops off products
            (`action_type`). Every order must contain **at least one STORE and
            at least one CLIENT** action point — that is why a lone stop is
            never valid. The array order is the route order the courier follows.
          type: array
          items:
            $ref: '#/components/schemas/ActionPointV3DTO'
        client_info:
          description: >-
            Client contact and address information. Required whenever the order
            has a `CLIENT` action point (essentially every delivery): its
            `address`/coordinates are used as the location of that stop, and its
            phone/email receive the tracking link and delivery notifications.
            Provide a precise address with a `complement` (apt/office) so the
            courier can find the client.
          allOf:
            - $ref: '#/components/schemas/ClientInfoDto'
        partner_channel:
          type: string
          description: >-
            Partner's channel for the order. The way the order was received. We
            don't do anything with this, we just store it and show it to you
          enum:
            - ECOMMERCE
            - MOBILE_APP
            - PHONE
            - INTERNAL
          example: PHONE
        priority_enabled:
          type: boolean
          description: Flag to enable priority delivery for this order
          default: false
      required:
        - total_value
        - vehicle_type
        - payment_method
        - action_points
    OrderDeliveryServicesV3ResDto:
      type: object
      properties:
        service_delivery:
          type: string
          description: >-
            If the field answers IMMEDIATE_DELIVERY this means Cargo is able to
            perform a delivery for the retailer
          example: IMMEDIATE_DELIVERY
        active:
          type: boolean
        eta_for_immediate_delivery:
          type: number
          description: >-
            It is an estimated time of arrival, calculated by a proprietary
            service in Rappi. This time of arrival can be used to show the user
            an ETA.
          example: 30
        trip_distance:
          type: number
          description: >-
            It is an estimated distance in Kilometers, calculated by a
            proprietary service in Rappi. This can be used to estimate the cost
            of the delivery service. Cargo charges using the ceiling function on
            the trip distance to turn it into an integer.
          example: 3.14
        eta_interval_for_immediate_delivery:
          description: Time interval for the immediate delivery
          allOf:
            - $ref: '#/components/schemas/IntervalDto'
        internal_validations:
          type: object
        estimated_price:
          type: number
          description: It is an estimated price based on your billing info.
        rain_charge:
          type: number
          description: Flag that indicates if the order has a rain charge.
        raining_charge:
          type: number
          description: It is an estimated price based on your billing info.
        high_demand_charge:
          type: number
          description: It is an estimated price based on your billing info.
      required:
        - service_delivery
        - active
        - eta_for_immediate_delivery
        - trip_distance
        - eta_interval_for_immediate_delivery
        - internal_validations
        - estimated_price
        - rain_charge
        - raining_charge
        - high_demand_charge
    OrderCreationBodyResDto:
      type: object
      properties:
        body:
          description: >-
            The body that created the original order, ready to be sent to
            order-create to duplicate it. `order_id` is removed and
            `parent_order_id` carries the `rappi_order_id` of the original
            order.
          allOf:
            - $ref: '#/components/schemas/OrderCreateV3ReqDto'
      required:
        - body
    OrderCancelReqDto:
      type: object
      properties:
        external_order_id:
          type: string
          description: Order id in your database
          minLength: 1
          maxLength: 255
          example: '123456744'
        rappi_order_id:
          type: number
          description: Id of generated Rappi order
          example: 958257716
        cargo_order_id:
          type: number
          description: Order id in cargo's system
          example: 109069
        partner_cancelation_reason:
          type: string
          description: >-
            The cancelation reason for the order. While this field is not
            required, it helps in understanding the operative issues that may
            occur and to analyze the data to improve operations. 
                The possible reasons are:
                CANCELED_BY_END_USER: The end user asked the partner to cancel the order.
                WILL_USE_OTHER_PROVIDER: The partner will use another logistics provider to deliver this order.
                ASSIGNMENT_TOOK_TOO_LONG: Rappi took too long to assign a driver.
                RT_TOOK_TOO_LONG: The assigned Rappi took too long getting to the store, or getting to the client.
                UNAVAILABLE_PRODUCTS: One or more products were unavailable and the order cannot be delivered this way.
                PAYMENT_FAILED: The online payment failed after the order was created.
                WRONG_ORDER_DATA: The order was created with invalid data.
                POSSIBLE_FRAUD_RT: The partner suspects the RT could be fraudulent.
                POSSIBLE_FRAUD_USER: The partner suspects the end user could be fraudulent.
                WILL_CREATE_NEW_ORDER: Order will be created with another data
                RT_DOES_NOT_ANSWER: The assigned RT does not answer the phone and is not completing the order.
                OTHER: Your reason is not listed here, please specify in the "partner_cancelation_reason_other" property.
          enum:
            - CANCELED_BY_END_USER
            - WILL_USE_OTHER_PROVIDER
            - ASSIGNMENT_TOOK_TOO_LONG
            - RT_TOOK_TOO_LONG
            - UNAVAILABLE_PRODUCTS
            - PAYMENT_FAILED
            - WRONG_ORDER_DATA
            - POSSIBLE_FRAUD_RT
            - POSSIBLE_FRAUD_USER
            - WILL_CREATE_NEW_ORDER
            - RT_DOES_NOT_ANSWER
            - OTHER
          example: POSSIBLE_FRAUD_RT
        partner_cancelation_reason_other:
          type: string
          description: >-
            If you sent OTHER as the reason, specify here what reason you did
            not find
          example: I no longer wanted to deliver the product
    OrderCancelResDto:
      type: object
      properties:
        successfull:
          type: boolean
          description: Indicates if cancellation was succesful
          example: true
    OrderStatusReqDTO:
      type: object
      properties:
        external_order_id:
          type: string
          description: Order id in your database
          minimum: 1
          maxLength: 255
          example: '123456744'
        rappi_order_id:
          type: number
          description: Id of generated Rappi order
          example: 958257716
        cargo_order_id:
          type: number
          description: Order id in cargo's system
          example: 109069
    OrderStatusEtaDTO:
      type: object
      properties:
        delivery_min_time:
          type: string
          example: '35'
          description: Minimum delivery time in minutes
        delivery_max_time:
          type: string
          example: '50'
          description: Maximum delivery time in minutes
        delivery_time:
          type: string
          example: '40'
          description: Estimated delivery time in minutes
        eta_publish:
          type: string
          example: 2:35 PM - 2:50 PM
          description: Human-readable ETA range for display
      required:
        - delivery_min_time
        - delivery_max_time
        - delivery_time
        - eta_publish
    ClientDTOV3:
      type: object
      properties:
        first_name:
          type: string
          example: Juan
        last_name:
          type: string
          example: Perez
        phone:
          type: string
          example: '3001234567'
        address:
          type: string
          example: 742 de Evergreen Terrace
        lat:
          type: number
          example: 4.60971
        lng:
          type: number
          example: -74.08175
        email:
          type: string
          example: fake@email.com
        address_description:
          type: string
          example: Apartamento 1229
        address_comments:
          type: string
          example: Dejar en porteria
      required:
        - first_name
        - last_name
        - phone
        - address
        - lat
        - lng
        - email
        - address_description
        - address_comments
    StoreKeeperDTOV3:
      type: object
      properties:
        id:
          type: number
          example: 11232442
        phone:
          type: string
          example: '3001234567'
        first_name:
          type: string
          example: Juan
        email:
          type: string
          example: test@test.com
        last_name:
          type: string
          example: Perez
        lat:
          type: number
          example: 4.60971
        lng:
          type: number
          example: -74.08175
        transport_media_type:
          type: string
          examples:
            - car
            - cargo_van
            - motorbike
            - bicycle
            - truck
            - neither
        timestamp:
          type: string
          example: '2025-01-22T13:38:20.000Z'
      required:
        - id
        - phone
        - first_name
        - email
        - last_name
        - lat
        - lng
        - transport_media_type
    PriceDTOV3:
      type: object
      properties:
        total:
          type: number
          example: 1000
        courier_tip_total:
          type: number
          example: 1000
          description: >-
            Total financiado por el retailer que recibe el courier por concepto
            de propina e incentivos: max(user_tip, default_tip) más las
            escalaciones de earnings por encima de ese base. Es el valor a
            mostrar; reemplaza a `tip` y `partner_incentive`, que no deben
            sumarse entre sí. Excluye los incentivos patrocinados por Cargo, que
            se acumulan en total_sponsored_earning_incentive y no se exponen en
            este DTO.
      required:
        - total
        - courier_tip_total
    OrderHistoryV3:
      type: object
      properties:
        id:
          type: number
          example: 209952
        order_id:
          type: number
          example: 110157
        order_status_id:
          type: number
          example: 1
        rappi_order_id:
          type: number
          example: 958284269
        core_status:
          type: string
          example: created
        updated_at:
          type: string
          example: '2022-10-15T19:58:29.000Z'
      required:
        - id
        - order_id
        - order_status_id
        - rappi_order_id
        - core_status
        - updated_at
    ProductsDTOV3:
      type: object
      properties:
        name:
          type: string
          example: Manzana
        description:
          type: string
          example: Manzana verde fresca
        units:
          type: number
          example: 8
        unit_price:
          type: number
          example: 25000
        comments:
          type: number
          example: Consumir antes de la fecha de vencimiento
        retailer_product_id:
          type: number
          example: MFNWX234
      required:
        - name
        - description
        - units
        - unit_price
        - comments
        - retailer_product_id
    ActionPointDTOV3:
      type: object
      properties:
        id:
          type: string
          example: fake@email.com
        index:
          type: number
          example: 0
        external_picking_point_id:
          type: string
          example: 1a43nq2nqo343n
        picking_point_id:
          type: number
          example: '234521'
        picking_point_name:
          type: string
          example: Sede norte
        instructions:
          type: string
          example: Recoger productos
        check_in_required:
          type: boolean
          example: true
        return_allowed:
          type: boolean
          example: true
        executed:
          type: boolean
          example: true
        products:
          example: true
          type: array
          items:
            $ref: '#/components/schemas/ProductsDTOV3'
        lat:
          type: number
          example: 4.7071
        lng:
          type: number
          example: -74.10721234
        address:
          type: string
          example: 742 de Evergreen Terrace
        city:
          type: string
          example: Bogota
        zip_code:
          type: string
          example: '110321'
        description:
          type: string
          example: Recoger productos
        comments:
          type: string
          example: Recoger productos
        contact_email:
          type: string
          example: prueba@rappi.com
        contact_phone:
          type: string
          example: '3001234567'
        contact_name:
          type: string
          example: Juan
        started_at:
          type: string
          example: '2022-11-23T03:41:59.648Z'
        executed_at:
          type: string
          example: '2022-11-23T03:41:59.648Z'
      required:
        - id
        - index
        - external_picking_point_id
        - picking_point_id
        - picking_point_name
        - instructions
        - check_in_required
        - return_allowed
        - executed
        - products
        - lat
        - lng
        - address
        - city
        - zip_code
        - description
        - comments
        - contact_email
        - contact_phone
        - contact_name
        - started_at
        - executed_at
    OrderModificationDto:
      type: object
      properties:
        id:
          type: number
          example: 37158688
          description: Id of the order modification
        type:
          type: string
          description: Name of the event.
        order_id:
          type: number
          example: 110530
          description: Id of the order for which this modification was applied.
        rappi_order_id:
          type: number
          example: 958294916
          description: >-
            Id of the order in Rappi Core for which this modification was
            applied.
        created_at:
          type: string
          example: '2022-11-23T03:41:59.648Z'
          description: Date in which this modification was applied (ISO format).
      required:
        - id
        - type
        - order_id
        - rappi_order_id
        - created_at
    OrderStatusResDTOV3:
      type: object
      properties:
        eta_range:
          description: ETA with min/max delivery times and publishable range
          example:
            delivery_min_time: '35'
            delivery_max_time: '50'
            delivery_time: '40'
            eta_publish: 2:35 PM - 2:50 PM
          allOf:
            - $ref: '#/components/schemas/OrderStatusEtaDTO'
        estimated_price:
          type: number
          example: 3
          description: Value estimated for the order
        estimated_tax_base_price:
          type: number
          example: 3
          description: Value estimated for the order
        in_store_reference_id:
          type: object
          description: In store reference id
        sales_channel:
          type: object
          description: Sales channel from where the order was created.
        order_ready_at:
          type: object
          description: Order ready at
          example: '2022-09-12T21:41:39.694Z'
        payment_method:
          type: string
          description: Payment method used. CASH or ONLINE
          example: ONLINE
        rain_charge:
          type: object
          description: States if a rain charge applies for this order
        raining_charge:
          type: object
          description: States if a rain charge applies for this order
        high_demand_charge:
          type: number
          example: 3
          description: Value estimated for the order
        version:
          type: number
          example: 3
          description: Version of the endpoint that created this order.
        handoff_code:
          type: string
          example: '3756'
          description: >-
            This represents the code that the store must give to the courier
            with the order. We generate the code some time after the creation of
            the order, so it might be null for some seconds. We will send a
            request to your sever as soon as we generate the code. The payload
            for such request has the same structure as the order status changes
            requests. Both handoff_code and handoff_qr are generated at the same
            time.
        handoff_qr:
          type: string
          example: >-
            iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAIAAAAiOjnJAAALRklEQVR4Xu2SQZJjOxLD+v6X/rOHsGAoxLRrnFhWgGT6lf79tywF/vEPy/KCfVhLhX1YS4V9WEuFfVhLhX1YS4V9WEuFfVhLhX1YS4V9WEuFfVhLhX1YS4V9WEuFfVhLhX1YS4V9WEuFfVhLhX1YS4V9WEuFfVhLhX1YS4V9WEuFfVhLhX1YS4V9WEuFfVhLhX1YS4V9WEuFfVhLhX1YS4V9WEuFfVhLhX1YS4V9WEuFfVhLhX1YS4Xph/Xvo/Ca5j1cam4l8Joy43sfhdc07+FScyuB15QZ3/sovKZ5D5eaWwm8psz43kfhNc17uNTcSuA1Zcb3Pgqvad7DpeZWAq8pM773UXhN8x4uNbcSeE2Z8b0DGu/gUrbFjKVomHPCTJa6g0vNLWV874DGO7iUbTFjKRrmnDCTpe7gUnNLGd87oPEOLmVbzFiKhjknzGSpO7jU3FLG9w5ovINL2RYzlqJhzgkzWeoOLjW3lPG9Axrv4FK2xYylaJhzwkyWuoNLzS1lfO+Axju4lG0xYyka5pwwk6Xu4FJzSxnfO6BhTgJbrIeGwYzBTAZbrIdGBlush0aZ8b0DGuYksMV6aBjMGMxksMV6aGSwxXpolBnfO6BhTgJbrIeGwYzBTAZbrIdGBlush0aZ8b0DGuYksMV6aBjMGMxksMV6aGSwxXpolBnfO6BhTgJbrIeGwYzBTAZbrIdGBlush0aZ8b0DGuYksMV6aBjMGMxksMV6aGSwxXpolBnfO6BhTgJbrIeGwUwGWwxmLEUjgy3WQ6PM+N4BDXMS2GI9NAxmMthiMGMpGhlssR4aZcb3DmiYk8AW66FhMJPBFoMZS9HIYIv10CgzvndAw5wEtlgPDYOZDLYYzFiKRgZbrIdGmfG9AxrmJLDFemgYzGSwxWDGUjQy2GI9NMqM7x3QMCeBLdZDw2Amgy0GM5aikcEW66FRZnzvgIY5CWyxHhoZbLEeGu+cBLZYD40y43sHNMxJYIv10Mhgi/XQeOcksMV6aJQZ3zugYU4CW6yHRgZbrIfGOyeBLdZDo8z43gENcxLYYj00MthiPTTeOQlssR4aZcb3DmiYk8AW66GRwRbrofHOSWCL9dAoM753QMOcBLZYD40MtlgPjXdOAlush0aZ8b0DGu/g0rst9hrMWIrGO7jU3FLG9w5ovINL77bYazBjKRrv4FJzSxnfO6DxDi6922KvwYylaLyDS80tZXzvgMY7uPRui70GM5ai8Q4uNbeU8b0DGu/g0rst9hrMWIrGO7jU3FLG9w5ovINL77bYazBjKRrv4FJzSxnf+yi8xu6h0XQm4TVlxvc+Cq+xe2g0nUl4TZnxvY/Ca+weGk1nEl5TZnzvo/Aau4dG05mE15QZ3/sovMbuodF0JuE1Zcb3PgqvsXtoNJ1JeE2Z6b1vg5//HVz6MX7+99fg0o/x87+/Bpd+jJ///TW49GP8/O+vwaUf4+d/fw0u/RjTv5+f32DmXYqGwYzBjKVoZM4ruNTcUsb3Aph5l6JhMGMwYykamfMKLjW3lPG9AGbepWgYzBjMWIpG5ryCS80tZXwvgJl3KRoGMwYzlqKROa/gUnNLGd8LYOZdiobBjMGMpWhkziu41NxSxvcCmHmXomEwYzBjKRqZ8wouNbeU8b0r2GI9NAxmLEXDYMZSNG6dO9g7zvQF/AAZbLEeGgYzlqJhMGMpGrfOHewdZ/oCfoAMtlgPDYMZS9EwmLEUjVvnDvaOM30BP0AGW6yHhsGMpWgYzFiKxq1zB3vHmb6AHyCDLdZDw2DGUjQMZixF49a5g73jTF/AD5DBFuuhYTBjKRoGM5aicevcwd5xpi/gB7BPQCODLdZDw5wEthjMGMzMpqqM7x3QMCeBLdZDw5wEthjMGMzMpqqM7x3QMCeBLdZDw5wEthjMGMzMpqqM7x3QMCeBLdZDw5wEthjMGMzMpqqM7x3QMCeBLdZDw5wEthjMGMzMpqqM7x3QMCeBLdZDw5wEthjMGMzMpqqM7x3QuHVOmLmFvQYz7+DSLewtM753QOPWOWHmFvYazLyDS7ewt8z43gGNW+eEmVvYazDzDi7dwt4y43sHNG6dE2ZuYa/BzDu4dAt7y4zvHdC4dU6YuYW9BjPv4NIt7C0zvndA49Y5YeYW9hrMvINLt7C3zPheADO3sDdrZiZLJbA3a2bGYMZSNMqM7wUwcwt7s2ZmslQCe7NmZgxmLEWjzPheADO3sDdrZiZLJbA3a2bGYMZSNMqM7wUwcwt7s2ZmslQCe7NmZgxmLEWjzPheADO3sDdrZiZLJbA3a2bGYMZSNMqM7wUwcwt7s2ZmslQCe7NmZgxmLEWjzPTet8HPb/8AGhlsMZixFA1zTpjJUg+Z3vs2+PntH0Ajgy0GM5aiYc4JM1nqIdN73wY/v/0DaGSwxWDGUjTMOWEmSz1keu/b4Oe3fwCNDLYYzFiKhjknzGSph0zvfRv8/PYPoJHBFoMZS9Ew54SZLPWQ6b1vg5/f/gE0MthiMGMpGuacMJOlHjK+91F4TQZbrIfGO7hkMJOlqkxfwA8wC6/JYIv10HgHlwxmslSV6Qv4AWbhNRlssR4a7+CSwUyWqjJ9AT/ALLwmgy3WQ+MdXDKYyVJVpi/gB5iF12SwxXpovINLBjNZqsr0BfwAs/CaDLZYD413cMlgJktVmb6AH6D5Cbh0u8WWW9h728yWrIeZMuN7BzTewaXbLbbcwt7bZrZkPcyUGd87oPEOLt1useUW9t42syXrYabM+N4BjXdw6XaLLbew97aZLVkPM2XG9w5ovINLt1tsuYW9t81syXqYKTO+d0DjHVy63WLLLey9bWZL1sNMmfG9AxrmJLDFemiYc8LM30zRKDO+d0DDnAS2WA8Nc06Y+ZspGmXG9w5omJPAFuuhYc4JM38zRaPM+N4BDXMS2GI9NMw5YeZvpmiUGd87oGFOAlush4Y5J8z8zRSNMuN7BzTMSWCL9dAw54SZv5miUWZ874CGOQlssR4a5ryCSxlsyWDLFzB9Ez+JfRQaGWyxHhrmvIJLGWzJYMsXMH0TP4l9FBoZbLEeGua8gksZbMlgyxcwfRM/iX0UGhlssR4a5ryCSxlsyWDLFzB9Ez+JfRQaGWyxHhrmvIJLGWzJYMsXMH0TP4l9FBoZbLEeGua8gksZbMlgyxcwfRM/iX0UGhlssR4aGWz5vp4EtpQZ3zugYU4CW6yHRgZbvq8ngS1lxvcOaJiTwBbroZHBlu/rSWBLmfG9AxrmJLDFemhksOX7ehLYUmZ874CGOQlssR4aGWz5vp4EtpQZ3zugYU4CW6yHRgZbvq8ngS1lxvcOaLyDS7ZFw2Amgy0GM5ai8c6pMr53QOMdXLItGgYzGWwxmLEUjXdOlfG9Axrv4JJt0TCYyWCLwYylaLxzqozvHdB4B5dsi4bBTAZbDGYsReOdU2V874DGO7hkWzQMZjLYYjBjKRrvnCrjewc03sEl26JhMJPBFoMZS9F451QZ3/sovMbuoWHOCTPv4FIGW8aZvoAfYBZeY/fQMOeEmXdwKYMt40xfwA8wC6+xe2iYc8LMO7iUwZZxpi/gB5iF19g9NMw5YeYdXMpgyzjTF/ADzMJr7B4a5pww8w4uZbBlnOkL+AFm4TV2Dw1zTph5B5cy2DLO5y9Y/i/Zh7VU2Ie1VNiHtVTYh7VU2Ie1VNiHtVTYh7VU2Ie1VNiHtVTYh7VU2Ie1VNiHtVTYh7VU2Ie1VNiHtVTYh7VU2Ie1VNiHtVTYh7VU2Ie1VNiHtVTYh7VU2Ie1VNiHtVTYh7VU2Ie1VNiHtVTYh7VU2Ie1VNiHtVTYh7VU2Ie1VNiHtVTYh7VU2Ie1VNiHtVT4H95l1FLTauXpAAAAAElFTkSuQmCC
          description: >-
            This represents the QR code that the store must give to the courier
            with the order. We suggest using a library to render the actual QR
            from this string. We generate the qr some time after the creation of
            the order, so it might be null for some seconds. We will send a
            request to your sever as soon as we generate the QR. The payload for
            such request has the same structure as the order status changes
            requests. Both handoff_code and handoff_qr are generated at the same
            time.
        was_processed_by_agent:
          type: boolean
          example: true
          description: This attribute is true if the order was closed by a support agent.
        deliver_at:
          type: string
          example: '2022-09-12T21:41:39.694Z'
        rappi_order_id:
          type: string
          example: 11232442
          description: This represents the rappi order id
        external_order_id:
          type: string
          example: MANDNFA-234
          description: Represents the id on your system
        callback_header:
          type: string
          example: ApiToken
        callback_header_value:
          type: string
          example: e093b561-7922-4c40-92d1-1ab0a1dd8a51
        cargo_order_id:
          type: string
          example: 11232442
          description: Represents the id in Cargo's system
        state:
          type: string
          examples:
            - in_progress
            - canceled
            - delivered_to_user
            - on_round_trip_route
            - failed_delivery
            - round_trip_finished
            - finished
            - pending_review
            - storekeeper_payment_canceled
            - paid_to_ask
            - storekeeper_payment_in_analysis
            - scheduled
            - on_the_route
            - in_store
            - pending_storekeeper_confirmation
            - arrive
            - expediter_taken
            - round_trip_incomplete
            - finding_courier
            - created
            - failed_return
            - returned
            - canceled_by_automation
            - canceled_by_fraud
          description: >-
            Represents the status of the order. The possible states [are
            available
            here](https://docs.google.com/spreadsheets/d/1SDb_1y7FQ6fgPkEkXOLVY8gMxOXuMIoiL3VjcN3-JZ8/edit?usp=sharing).
        order_created_at:
          type: string
          example: '2022-09-12T21:41:39.694Z'
        retailer_id:
          type: number
          example: 18
        brand_id:
          type: string
          example: 11232442
        total_value:
          type: number
          example: 22000
        client:
          $ref: '#/components/schemas/ClientDTOV3'
        storeKeeper:
          $ref: '#/components/schemas/StoreKeeperDTOV3'
        price:
          $ref: '#/components/schemas/PriceDTOV3'
        callBack:
          type: string
          example: https://myserver.com/
        handshake_code:
          type: string
          example: ApiToken
        order_status_id:
          type: number
          examples:
            - 24
            - 19
            - 21
            - 14
            - 3
            - 22
            - 20
            - 9
            - 10
            - 7
            - 1
            - 5
            - 18
            - 2
            - 12
            - 23
        tracking_url:
          type: string
          example: >-
            https://cargo-tracking.dev.rappi.com/eta/6ead8d94e5d0ic90ce8237411da31825
        collect_cash:
          type: number
          examples:
            - 0
            - 1
        cancelled_at:
          type: string
          example: '2022-09-12T21:41:39.694Z'
        delivered_at:
          type: string
          example: '2022-09-12T21:41:39.694Z'
        delivery_assigned_at:
          type: string
          example: '2022-09-12T21:41:39.694Z'
        transport_media_type:
          type: string
          examples:
            - car
            - cargo_van
            - motorbike
            - bicycle
            - truck
            - neither
        order_update:
          type: array
          items:
            $ref: '#/components/schemas/OrderHistoryV3'
        action_points:
          type: array
          items:
            $ref: '#/components/schemas/ActionPointDTOV3'
        state_detail:
          type: string
          example: canceled_by_fraud
        was_cancelled_by_integration:
          type: boolean
          example: true
        order_modification:
          type: array
          items:
            $ref: '#/components/schemas/OrderModificationDto'
        eta:
          type: string
        cancelation_reason:
          type: string
          enum:
            - client_doesnt_answer
            - sk_doesnt_answer
            - lack_of_rt
            - wrong_address_client_wants_to_change_orders
            - problems_with_client_payment
            - product_not_available
            - client_fraud_suspicion
            - technical_problems
            - sk_doesnt_want_delivery_order_with_product
            - another_sk_took_order
            - closed_store
            - delivery_delay
            - big_order_rt_innapropiate_vehicle
            - sk_couldnt_complete_order
            - duplicated_order
            - incomplete_order_bad_state
            - does_not_work_with_rappi
            - didnt_cancel_by_automation
            - released_with_product
            - wants_cancel_between_eta_no_delay
            - price_difference
            - client_whim_not_allowed_favor
            - billing_error
            - inner_test
            - review
            - cancel_by_user
            - too_many_releases
            - cancel_by_automation
            - badly_located_pin
            - client_wanted_to_change_address
            - client_doesnt_receive
            - technical_problems_ally
            - rt_couldnt_continue_with_product
            - client_doesnt_receive_problems_with_order
            - client_doesnt_receive_wanted_to_change_products
            - client_doesnt_receive_duplicated_order
            - order_not_closed
            - product_not_available_at_store
            - client_doesnt_receive_bad_state
            - rt_couldnt_continue
            - client_doesnt_have_how_to_pay
            - client_wants_to_change_payment_method
            - client_doesnt_receive_wants_to_cancel
            - limbo
            - other
            - relaunch
          description: The reason for the cancellation of the order
        cancel_tipification:
          type: string
          enum:
            - EARLY
            - RT_TO_STORE
            - RT_IN_STORE
            - RT_TO_USER
            - RT_AT_USER
            - DELAY_RT
            - LACK_OF_RT
            - LATE_ASSIGNMENT
            - RT_ISSUE
          description: The tipification of the cancellation of the order
        cancelation_moment:
          type: string
          enum:
            - RT_UNASSIGNED
            - RT_TO_STORE
            - RT_IN_STORE
            - RT_TO_USER
            - RT_AT_USER
          description: The moment of the cancellation of the order
        current_eta:
          type: number
          description: Minutes until delivery
          example: 27
        final_delivery_point_image:
          type: object
          description: >-
            Final delivery point image url of the order when the courier wasn't
            able to deliver correctly and had to leave the order in a safe place
          example: https://www.image.com/image.png
        final_delivery_comments:
          type: object
          description: >-
            Final delivery comments of the order when the courier wasn't able to
            deliver correctly and had to leave the order in a safe place
          example: Señor deje su pedido en portería, recibio Juan Lopez
        final_delivery_lat:
          type: object
          description: >-
            Final delivery lat of the order when the courier wasn't able to
            deliver correctly and had to leave the order in a safe place
          example: 4.741345
        final_delivery_lng:
          type: object
          description: >-
            Final delivery lng of the order when the courier wasn't able to
            deliver correctly and had to leave the order in a safe place
          example: -74.741345
        cancellation_username:
          type: object
          description: >-
            The name of the user that sent the cancellation request. It will be
            Null if the cancellation was made by Rappi.
          example: User 123
        order_ids_in_bundle:
          description: >-
            The Rappi Order Ids with which this order is bundled. This means
            that the same driver is assigned to these orders and will deliver
            them in a route. This attribute will only be sent when the status
            changes to “in_progress” meaning that a driver has just been
            assigned to the order. If this order is not bundled the attribute
            will be an empty array.
          type: array
          items:
            type: number
        debt_cancellation_user_name:
          type: string
          description: The name of the user that cancelled the debt of the order
        debt_cancelled_at:
          type: string
          description: The datetime at which the debt was cancelled
      required:
        - estimated_price
        - estimated_tax_base_price
        - in_store_reference_id
        - sales_channel
        - order_ready_at
        - payment_method
        - rain_charge
        - raining_charge
        - high_demand_charge
        - version
        - handoff_code
        - handoff_qr
        - was_processed_by_agent
        - deliver_at
        - rappi_order_id
        - external_order_id
        - callback_header
        - callback_header_value
        - cargo_order_id
        - state
        - order_created_at
        - retailer_id
        - brand_id
        - total_value
        - client
        - price
        - callBack
        - handshake_code
        - order_status_id
        - tracking_url
        - collect_cash
        - cancelled_at
        - delivered_at
        - delivery_assigned_at
        - transport_media_type
        - order_update
        - action_points
        - state_detail
        - was_cancelled_by_integration
        - order_modification
        - eta
        - current_eta
        - final_delivery_point_image
        - final_delivery_comments
        - final_delivery_lat
        - final_delivery_lng
    AdditionalDataDto:
      type: object
      properties:
        vehicle:
          type: number
          enum:
            - 3
            - 0
        template_id:
          type: string
        total_volume:
          type: number
          example: 8907
        total_weight:
          type: number
          example: 8907
        cargo_enabled:
          type: boolean
          example: 8907
        total_payment:
          type: number
          example: 8907
        tracking_code:
          type: string
          example: 8907
        send_tracking_sms:
          type: boolean
          example: 8907
        send_tracking_email:
          type: boolean
          example: 8907
      required:
        - vehicle
        - template_id
        - total_volume
        - total_weight
        - cargo_enabled
        - total_payment
        - tracking_code
        - send_tracking_sms
        - send_tracking_email
    OrderListElementResDto:
      type: object
      properties:
        id:
          type: string
          example: ''
        lat:
          type: number
          example: 8907
        lng:
          type: number
          example: 8907
        address:
          type: string
          example: 8907
        city:
          type: string
          example: 8907
        phone:
          type: string
          example: 8907
        zip_code:
          type: string
          example: 8907
        retailer_id:
          type: string
          example: 8907
        picking_point_id:
          type: number
          example: 8907
        order_type_id:
          type: number
          example: 8907
        order_status_id:
          type: number
          example: 8907
        delivery_type_id:
          type: number
          example: 8907
        dispatch_group_id:
          type: number
          example: 8907
        dispatch_group_priority:
          type: number
          example: 8907
        rappi_order_id:
          type: string
          example: 8907
        integration_external_id:
          type: number
          example: 8907
        external_order_id:
          type: string
          example: 8907
        total_value:
          type: number
          example: 8907
        destination_lat:
          type: number
          example: 8907
        destination_lng:
          type: number
          example: 8907
        destination_address:
          type: string
          example: 8907
        destination_city:
          type: string
          example: 8907
        destination_zip_code:
          type: string
          example: 8907
        destination_description:
          type: string
          example: 8907
        destination_comments:
          type: string
          example: 8907
        destination_email:
          type: string
          example: 8907
        destination_phone:
          type: string
          example: 8907
        destination_first_name:
          type: string
          example: 8907
        destination_last_name:
          type: string
          example: 8907
        destination_external_id:
          type: string
          example: 8907
        created_at:
          type: string
          example: 8907
        delivery_assigned_at:
          type: string
          example: 8907
        delivered_at:
          type: string
          example: 8907
        cancelled_at:
          type: string
          example: 8907
        collect_cash:
          type: number
          example: 8907
        roundtrip:
          type: boolean
          example: 8907
        roundtrip_comments:
          type: string
          example: 8907
        callback:
          type: string
          example: 8907
        sk_id:
          type: string
          example: 8907
        sk_phone:
          type: string
          example: 8907
        sk_email:
          type: string
          example: 8907
        sk_type:
          type: string
          example: 8907
        sk_reassigned:
          type: boolean
          example: 8907
        sk_first_name:
          type: string
          example: 8907
        sk_last_name:
          type: string
          example: 8907
        transport_media_type:
          type: string
          example: 8907
        sk_lat:
          type: number
          example: 8907
        sk_lng:
          type: number
          example: 8907
        sk_position_updated_at:
          type: string
          example: 8907
        additional_data:
          example: 8907
          allOf:
            - $ref: '#/components/schemas/AdditionalDataDto'
        placed_at:
          type: string
          example: 8907
        user_id:
          type: number
          example: 8907
        total_weight:
          type: number
          example: 8907
        total_volume:
          type: number
          example: 8907
        tracking_code:
          type: string
          example: 8907
        user_experience_rate:
          type: number
          example: 8907
        user_experience_comments:
          type: string
          example: 8907
        handshake_code:
          type: string
          example: 8907
        handshake_response:
          type: string
          example: 8907
        eta:
          type: number
          example: 8907
        calculated_tip:
          type: string
          example: 8907
        user_tip:
          type: string
          example: 8907
        default_tip:
          type: string
          example: 8907
        order_update:
          type: array
          items:
            type: string
      required:
        - id
        - lat
        - lng
        - address
        - city
        - phone
        - zip_code
        - retailer_id
        - picking_point_id
        - order_type_id
        - order_status_id
        - delivery_type_id
        - dispatch_group_id
        - dispatch_group_priority
        - rappi_order_id
        - integration_external_id
        - external_order_id
        - total_value
        - destination_lat
        - destination_lng
        - destination_address
        - destination_city
        - destination_zip_code
        - destination_description
        - destination_comments
        - destination_email
        - destination_phone
        - destination_first_name
        - destination_last_name
        - destination_external_id
        - created_at
        - delivery_assigned_at
        - delivered_at
        - cancelled_at
        - collect_cash
        - roundtrip
        - roundtrip_comments
        - callback
        - sk_id
        - sk_phone
        - sk_email
        - sk_type
        - sk_reassigned
        - sk_first_name
        - sk_last_name
        - transport_media_type
        - sk_lat
        - sk_lng
        - sk_position_updated_at
        - additional_data
        - placed_at
        - user_id
        - total_weight
        - total_volume
        - tracking_code
        - user_experience_rate
        - user_experience_comments
        - handshake_code
        - handshake_response
        - eta
        - calculated_tip
        - user_tip
        - default_tip
        - order_update
    PickingPointCreateReqDTO:
      type: object
      properties:
        lat:
          type: number
          description: Latitude number of the picking point
          example: 4.60971
        lng:
          type: number
          description: Longitude number of the picking point
          example: -74.08175
        address:
          type: string
          description: Address of the picking point
          example: 'Carrera 123 #12 - 1'
        city:
          type: string
          description: City of the picking point
          example: Bogotá
        phone:
          type: string
          description: Phone number of the picking point
          example: '31212345567'
        zip_code:
          type: string
          description: Zip code of the picking point
          example: '123321'
        status:
          type: number
          description: Status of the picking point
          default: 1
          example: 1
        name:
          type: string
          description: Name of the picking point
          example: Restaurante laureles
        contact_name:
          type: string
          description: Name of the contact in the picking point
          example: Julian
        contact_email:
          type: string
          description: Email of the contact in the picking point
          example: julian@email.com
        preparation_time:
          type: number
          description: >-
            Preparation time of an order in minutes. The assignation algorithm
            will use this information to time the arrival of the driver as close
            to the end of the preparation time as possible.
          example: 30
        external_id:
          type: string
          description: >-
            ID in your database, of the picking point registered in the Retailer
            Portal
          example: '1234567'
        rappi_store_id:
          type: object
          description: >-
            The Rappi Store id of the picking point, having this value will
            allow us to provide an improved experience such as having the same
            checkin code for Rappi and Cargo orders.
          example: 99019292
        default_tip:
          type: float
          description: >-
            This sets the default tip of the picking point that takes into
            account semaphore limits and will be used as a tip where this
            picking point is the first store in an order
          example: 500
        handshake_enabled:
          type: boolean
          description: >-
            If the value of the order has this value or higher, a verification
            code will be required on delivery
          example: true
        return_enabled:
          type: boolean
          description: This enables the return feature to the picking point
          example: true
        handoff_enabled:
          type: boolean
          description: >-
            This enables the handoff feature, you may ask your commercial about
            this feature
          example: true
        multiple_stops_tips:
          type: float
          description: >-
            Tip amount added to orders with multiple stops (more than 2 action
            points) when the retailer has multiple_stops_tips_status enabled
          example: 500
      required:
        - lat
        - lng
        - address
        - city
        - phone
        - name
        - contact_name
        - contact_email
        - preparation_time
    PickingPointResDTO:
      type: object
      properties:
        address:
          type: string
          example: 'Calle 123 #12 1'
          description: Address of the picking point
        city:
          type: string
          description: City of the picking point
          example: Bogotá
        contact_name:
          type: string
          description: Name of the contact in the picking point
          example: Julian
        contact_email:
          type: object
          description: Email of the contact in the picking point
          example: julian@email.com
        external_id:
          type: number
          description: >-
            ID in your database, of the picking point registered in the Retailer
            Portal
          example: 1234567
        lat:
          type: number
          description: Latitude number of the picking point
          example: 4.60971
        lng:
          type: number
          description: Longitude number of the picking point
          example: -74.08175
        name:
          type: string
          description: Name of the picking point
          example: Restaurant at laureles
        other:
          type: string
          description: Extra information of the picking point
          example: Store with 3 yellow doors
        phone:
          type: string
          description: Phone number of the picking point
          example: '31212345567'
        preparation_time:
          type: number
          description: Preparation time of an order in minutes
          example: 30
        rappi_city_code:
          type: number
          description: City id in Rappi's DB
          example: 1234567
        rappi_store_id:
          type: number
          description: store id in Rappi's DB
          example: 1234567
        rappi_zone_id:
          type: number
          description: Geolocation zone id in Rappi's DB
          example: 1234567
        retailer_id:
          type: string
          description: Retailer id in Cargo's DB
          example: 1234567
        status:
          type: number
          description: Store status
          example: 1
        zip_code:
          type: string
          description: Zip code of the picking point
          example: '123321'
        checkin_enabled:
          type: boolean
          description: Checkin enabled feature
          example: true
        return_enabled:
          type: boolean
          description: Return enabled feature
          example: true
        product_return_instructions:
          type: string
          description: Return instructions for that picking point
          example: By the red door
        default_tip:
          type: float
          description: default tip of the picking point
          example: 1234
        min_saturation_for_default_tips:
          type: float
          description: >-
            Minimum fleet saturation (orders per courier in the zone) from which
            default_tip applies. Null inherits the retailer value.
          example: 1.7
      required:
        - address
        - city
        - contact_name
        - contact_email
        - external_id
        - lat
        - lng
        - name
        - other
        - phone
        - preparation_time
        - retailer_id
    PickingPointUpdateReqDTO:
      type: object
      properties:
        lat:
          type: number
          description: Latitude number of the picking point
          example: 4.60971
        lng:
          type: number
          description: Longitude number of the picking point
          example: -74.08175
        address:
          type: string
          description: Address of the picking point
          example: 'Carrera 123 #12 - 1'
        city:
          type: string
          description: City of the picking point
          example: Bogotá
        phone:
          type: string
          description: Phone number of the picking point
          example: '31212345567'
        zip_code:
          type: string
          description: Zip code of the picking point
          example: '123321'
        status:
          type: number
          description: Status of the picking point
          default: 1
          example: 1
        name:
          type: string
          description: Name of the picking point
          example: Restaurante laureles
        contact_name:
          type: string
          description: Name of the contact in the picking point
          example: Julian
        contact_email:
          type: string
          description: Email of the contact in the picking point
          example: julian@email.com
        preparation_time:
          type: number
          description: >-
            Preparation time of an order in minutes. The assignation algorithm
            will use this information to time the arrival of the driver as close
            to the end of the preparation time as possible.
          example: 30
        external_id:
          type: string
          description: >-
            ID in your database, of the picking point registered in the Retailer
            Portal
          example: '1234567'
        rappi_store_id:
          type: object
          description: >-
            The Rappi Store id of the picking point, having this value will
            allow us to provide an improved experience such as having the same
            checkin code for Rappi and Cargo orders.
          example: 99019292
        default_tip:
          type: float
          description: >-
            This sets the default tip of the picking point that takes into
            account semaphore limits and will be used as a tip where this
            picking point is the first store in an order
          example: 500
        handshake_enabled:
          type: boolean
          description: >-
            If the value of the order has this value or higher, a verification
            code will be required on delivery
          example: true
        return_enabled:
          type: boolean
          description: This enables the return feature to the picking point
          example: true
        handoff_enabled:
          type: boolean
          description: >-
            This enables the handoff feature, you may ask your commercial about
            this feature
          example: true
        multiple_stops_tips:
          type: float
          description: >-
            Tip amount added to orders with multiple stops (more than 2 action
            points) when the retailer has multiple_stops_tips_status enabled
          example: 500
        id:
          type: number
          description: Id of the picking point you want to update
          example: 1234567
      required:
        - id
    PickingPointNearbyItemResDTO:
      type: object
      properties:
        id:
          type: number
          example: 1
          description: Picking point ID
        name:
          type: string
          example: Restaurant at laureles
          description: Name of the picking point
        address:
          type: string
          example: 'Calle 123 #12 1'
          description: Address of the picking point
        city:
          type: string
          example: Bogotá
          description: City of the picking point
        phone:
          type: string
          example: '31212345567'
          description: Phone number of the picking point
        lat:
          type: number
          example: 4.60971
          description: Latitude of the picking point
        lng:
          type: number
          example: -74.08175
          description: Longitude of the picking point
        retailer_id:
          type: number
          example: 1234567
          description: Retailer ID
        status:
          type: number
          example: 1
          description: Status of the picking point
        preparation_time:
          type: number
          example: 30
          description: Preparation time in minutes
        distance_meters:
          type: number
          example: 1523.45
          description: Distance in meters from the reference point
      required:
        - id
        - name
        - address
        - city
        - phone
        - lat
        - lng
        - retailer_id
        - status
        - preparation_time
        - distance_meters
    PickingPointNearbyResDTO:
      type: object
      properties:
        picking_points:
          description: List of the 5 nearest picking points
          type: array
          items:
            $ref: '#/components/schemas/PickingPointNearbyItemResDTO'
      required:
        - picking_points
    PickingPointDeleteReqDTO:
      type: object
      properties:
        id:
          type: number
          description: Id of the picking point you want to delete
          example: 123445
      required:
        - id
    CheckinResDTO:
      type: object
      properties:
        code:
          type: string
          description: Checkin code
          example: '8202'
        store_id:
          type: number
          description: Id of the store with the  checkin code
          example: 123
      required:
        - code
        - store_id
    PickingPointCheckinResDTO:
      type: object
      properties:
        checkin:
          description: Checkin code information
          allOf:
            - $ref: '#/components/schemas/CheckinResDTO'
        name:
          type: string
          description: Picking point's name
          example: Restaurant laureles
      required:
        - checkin
        - name
    PickingPointListCheckinCodesItemResDTO:
      type: object
      properties:
        id:
          type: number
          description: Picking point ID
          example: 1234
        external_id:
          type: string
          description: Picking point id in your database
          example: PP-1234
        name:
          type: string
          description: Picking point's name
          example: Picking point Boulevard AV.
        checkin_code:
          type: string
          description: Picking point's current checkin code
          example: '5678'
        checkin_code_url:
          type: string
          description: >-
            The url where at any point the checkin of that picking point can be
            found
          example: https://cargo.rappi.com.co/checkin/public?id=eyJwaWNraW5nX3Bva1M1J9
      required:
        - id
        - name
        - checkin_code
        - checkin_code_url
    PickingPointCheckinQuery:
      type: object
      properties: {}
    UserCreateReqDTO:
      type: object
      properties:
        user_enabled:
          type: boolean
          description: >-
            Whether the user can log in and use the platform right away. Send
            `true` to activate the user on creation, `false` to create it
            disabled.
          example: true
        email:
          type: string
          description: >-
            Email of the user being created. Used as the login identifier, so it
            must be unique — creating a user with an email that already exists
            is rejected.
          example: julian@email.com
          minLength: 5
          maxLength: 255
        password:
          type: string
          description: >-
            Password for the new user. Must be 8-80 characters and include at
            least one lowercase letter, one uppercase letter and one digit.
          minLength: 8
          maxLength: 80
          example: Passw0rd?
        name:
          type: string
          description: Full name of the user, shown across the platform.
          example: Julian
          minLength: 2
          maxLength: 60
        phone:
          type: string
          description: >-
            Phone of the user. Digits only (no spaces, dashes or country-code
            prefix).
          example: '3011234567'
          minLength: 7
          maxLength: 15
        confirm_password:
          type: string
          description: >-
            Must exactly match `password`. The request is rejected if the two
            differ.
          minLength: 8
          maxLength: 80
          example: Passw0rd?
        picking_points:
          description: >-
            Cargo ids of the picking points (stores) this user will have access
            to. Omit to grant access to all of the retailer's picking points.
            Use `external_picking_points` instead if you prefer to reference
            stores by your own external id.
          example:
            - 2
            - 1
            - 3
          type: array
          items:
            type: number
        permission_group_id:
          type: number
          description: >-
            Id of the permission group (role) assigned to the user. This
            determines what the user can do in the platform. Retrieve the
            available permission groups from the permission-group list endpoint
            or the Cargo portal.
          example: 42
        retailers:
          description: >-
            Ids of the retailers the user belongs to. Optional; when provided it
            must contain at least one id. Most integrations only need one
            retailer and can omit this.
          example:
            - 100
          type: array
          items:
            type: number
        external_picking_points:
          description: >-
            Picking points the user will have access to, referenced by your own
            external id instead of Cargo's `picking_points` id. Optional; when
            provided it must contain at least one id.
          example:
            - FH0197
            - FH0198
          type: array
          items:
            type: string
      required:
        - user_enabled
        - email
        - password
        - name
        - phone
        - confirm_password
        - permission_group_id
    UserResDTO:
      type: object
      properties:
        name:
          type: string
          description: Name of the user.
          example: Juan
        email:
          type: string
          description: Email of the user, used to log in.
          example: juan@gmail.com
        phone:
          type: string
          description: Phone of the user. Null if none was set.
          example: '3111234567'
        user_enabled:
          type: boolean
          description: Whether the user is currently enabled to use the platform.
          example: false
        id:
          type: number
          description: Cargo id of the user.
          example: 1234567
        has_token:
          type: boolean
          description: >-
            Whether this user has an API token issued (i.e. can authenticate
            against this API via the `user-token` header).
          example: false
      required:
        - name
        - email
        - user_enabled
        - id
        - has_token
    UserUpdateReqDTO:
      type: object
      properties:
        user_enabled:
          type: boolean
          description: >-
            Whether the user can log in and use the platform right away. Send
            `true` to activate the user on creation, `false` to create it
            disabled.
          example: true
        password:
          type: string
          description: >-
            Password for the new user. Must be 8-80 characters and include at
            least one lowercase letter, one uppercase letter and one digit.
          minLength: 8
          maxLength: 80
          example: Passw0rd?
        name:
          type: string
          description: Full name of the user, shown across the platform.
          example: Julian
          minLength: 2
          maxLength: 60
        phone:
          type: string
          description: >-
            Phone of the user. Digits only (no spaces, dashes or country-code
            prefix).
          example: '3011234567'
          minLength: 7
          maxLength: 15
        confirm_password:
          type: string
          description: >-
            Must exactly match `password`. The request is rejected if the two
            differ.
          minLength: 8
          maxLength: 80
          example: Passw0rd?
        picking_points:
          description: >-
            Cargo ids of the picking points (stores) this user will have access
            to. Omit to grant access to all of the retailer's picking points.
            Use `external_picking_points` instead if you prefer to reference
            stores by your own external id.
          example:
            - 2
            - 1
            - 3
          type: array
          items:
            type: number
        permission_group_id:
          type: number
          description: >-
            Id of the permission group (role) assigned to the user. This
            determines what the user can do in the platform. Retrieve the
            available permission groups from the permission-group list endpoint
            or the Cargo portal.
          example: 42
        retailers:
          description: >-
            Ids of the retailers the user belongs to. Optional; when provided it
            must contain at least one id. Most integrations only need one
            retailer and can omit this.
          example:
            - 100
          type: array
          items:
            type: number
        external_picking_points:
          description: >-
            Picking points the user will have access to, referenced by your own
            external id instead of Cargo's `picking_points` id. Optional; when
            provided it must contain at least one id.
          example:
            - FH0197
            - FH0198
          type: array
          items:
            type: string
        id:
          type: number
          description: User id
          example: 1234567
        email:
          type: string
          description: User email
          example: juan@email.com
      required:
        - id
    UserDeleteReqDTO:
      type: object
      properties:
        id:
          type: number
          description: Id of the user you want to delete
          example: 1234567
      required:
        - id
    UserDeleteResDTO:
      type: object
      properties:
        id:
          type: number
          description: Cargo id of the user that was deleted.
          example: 1234567
        success:
          type: boolean
          description: Whether the deletion succeeded.
          example: true
      required:
        - id
        - success
