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

# List click-and-collect pickup points eligible for an order

> Returns the pickup points (carrier branches and Cubbo points) near a postal code to which
the order could be converted with
`PATCH /orders/{order_id}/convert-to-click-and-collect`. Only points whose conversion
would be accepted are listed: the order must be in a pre-label status (paused orders are
allowed), click and collect must be enabled for the store, and each point's pickup
carrier must be allowed for the store and not cost more than the order's original
shipping (unless the store waived that check).

- `store_id` is the store that owns the order and must be a store of your account; an
  order that does not belong to it answers 404.
- `postal_code` defaults to the order's shipping zip code. `address` refines the search
  for carriers that need a street address.
- An ineligible order still answers 200, with `cnc_eligible: false`, a `code` explaining
  why and an empty list.
- Unknown orders, orders of other accounts and orders your credential cannot read all
  answer the same 404 body.




## OpenAPI

````yaml /openapi.yaml get /orders/{order_id}/pickup-points
openapi: 3.1.0
info:
  title: Cubbo Clients API
  version: '1.0'
  summary: >-
    Orders, inventory, replenishments, returns, shipping and webhooks for Cubbo
    fulfillment.
  description: >
    The Cubbo Clients API connects your store, ERP or marketplace with Cubbo's
    fulfillment network.

    All endpoints except `POST /auth/token` require a bearer token; see the
    Authentication guide.

    Request and response bodies are JSON. Errors are JSON objects with an
    `error` key.
  contact:
    name: Cubbo integrations
    email: integraciones@cubbo.com
servers:
  - url: https://api.cubbo.com/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Authentication
    description: Exchange client credentials for a bearer token.
  - name: Orders
    description: Create, update, hold, cancel and read sales orders.
  - name: Shipping labels
    description: Read the shipping labels generated for an order.
  - name: Inventory
    description: Products and stock per store.
  - name: Lots
    description: Lot-level inventory for products with expiration or batch tracking.
  - name: Reports
    description: Bulk reports for reconciliation.
  - name: Replenishments
    description: Inbound shipments to the warehouse.
  - name: Returns
    description: Returns and exchanges.
  - name: Stores
    description: Store provisioning and settings.
  - name: Shipping methods
    description: Available shipping methods, coverage and quotes.
  - name: Click and collect
    description: Pickup points and in-store pickup orders.
paths:
  /orders/{order_id}/pickup-points:
    get:
      tags:
        - Click and collect
      summary: List click-and-collect pickup points eligible for an order
      description: >
        Returns the pickup points (carrier branches and Cubbo points) near a
        postal code to which

        the order could be converted with

        `PATCH /orders/{order_id}/convert-to-click-and-collect`. Only points
        whose conversion

        would be accepted are listed: the order must be in a pre-label status
        (paused orders are

        allowed), click and collect must be enabled for the store, and each
        point's pickup

        carrier must be allowed for the store and not cost more than the order's
        original

        shipping (unless the store waived that check).


        - `store_id` is the store that owns the order and must be a store of
        your account; an
          order that does not belong to it answers 404.
        - `postal_code` defaults to the order's shipping zip code. `address`
        refines the search
          for carriers that need a street address.
        - An ineligible order still answers 200, with `cnc_eligible: false`, a
        `code` explaining
          why and an empty list.
        - Unknown orders, orders of other accounts and orders your credential
        cannot read all
          answer the same 404 body.
      operationId: listOrderPickupPoints
      parameters:
        - name: order_id
          in: path
          required: true
          description: Id of the order
          schema:
            type: integer
            example: 55501
        - name: store_id
          in: query
          required: true
          description: Id of the store that owns the order; must belong to your account
          schema:
            type: integer
            example: 1234
        - name: postal_code
          in: query
          required: false
          description: >-
            Postal code to search around. Defaults to the order's shipping zip
            code.
          schema:
            type: string
            example: '06600'
        - name: address
          in: query
          required: false
          description: Street address to refine the search
          schema:
            type: string
            example: Av. Reforma 123
      responses:
        '200':
          description: Eligible pickup points, or the reason the order is not eligible
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PickupPointsResponse'
              examples:
                eligible:
                  value:
                    cnc_eligible: true
                    pickup_points:
                      - carrier: ESTAFETA
                        service_code: CUBBOCNCESTEST001
                        name: Sucursal Centro
                        address: Av. Reforma 123, CDMX
                        distance_km: 1.2
                        schedule: 'Lun a Vie: 10:00-18:00, Sab: 10:00-14:00, Dom: cerrado'
                      - carrier: CUBBO
                        service_code: CUBBOCNCCUBBOCUBBO001
                        name: Punto Cubbo Centro
                        address: Calle Centro 300, CDMX, 06000
                        distance_km: 0.8
                        schedule: 'Lunes a Sabado: 10:00-20:00'
                notEligible:
                  value:
                    cnc_eligible: false
                    code: CNC_NOT_ENABLED_FOR_STORE
                    pickup_points: []
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: >-
            The order or the claimed store does not exist or is not accessible
            to your credential
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClickAndCollectError'
              examples:
                orderNotFound:
                  value:
                    error: Order not found
                    code: ORDER_NOT_FOUND
                storeNotFound:
                  value:
                    error: store_not_found
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                missingStoreId:
                  value:
                    error: Parameter store_id is required
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClickAndCollectUnexpectedError'
              example:
                error: unexpected_error
                timestamp: 1700000000
      security:
        - bearerAuth: []
components:
  schemas:
    PickupPointsResponse:
      type: object
      required:
        - cnc_eligible
        - pickup_points
      properties:
        cnc_eligible:
          type: boolean
          description: Whether the order can be converted to click and collect
          example: true
        code:
          type: string
          description: >-
            Present only when `cnc_eligible` is false; why the order is not
            eligible
          enum:
            - CNC_INVALID_ORDER_STATUS
            - CNC_NOT_ENABLED_FOR_STORE
            - CNC_NO_CARRIERS_ENABLED_FOR_STORE
            - CNC_MISSING_POSTAL_CODE
            - CNC_ORIGINAL_NOT_CUBBO_BILLED
            - CNC_ORIGINAL_NOT_NATIONAL_SHIPPING
            - CNC_RATE_CARD_UNAVAILABLE
          example: CNC_NOT_ENABLED_FOR_STORE
        pickup_points:
          type: array
          description: Eligible points; empty when the order is not eligible
          items:
            $ref: '#/components/schemas/PickupPoint'
    ClickAndCollectError:
      type: object
      description: 404 body of the click-and-collect endpoints
      required:
        - error
      properties:
        error:
          type: string
          description: '`Order not found` or `store_not_found`'
          example: Order not found
        code:
          type: string
          description: Present for order lookups
          enum:
            - ORDER_NOT_FOUND
          example: ORDER_NOT_FOUND
    Error:
      type: object
      description: Error body returned by every failed request.
      required:
        - error
      properties:
        error:
          type: string
          description: >-
            Human-readable description of the failure. For `401` responses it is
            always `Unauthorized`.
          example: Parameter store_id is required
        message:
          type: string
          description: >-
            Present on `401` responses only; the reason the request was
            rejected.
          example: invalid token
        code:
          type:
            - string
            - 'null'
          description: >-
            Stable machine-readable code, present on some order, return and
            replenishment errors.
          example: ORDER_ALREADY_EXISTS
        context:
          type:
            - object
            - 'null'
          description: >-
            Extra data about the failure when available, for example the id of
            the conflicting order.
          additionalProperties: true
          example:
            order_id: 987654
    ClickAndCollectUnexpectedError:
      type: object
      description: 500 body of the click-and-collect endpoints
      required:
        - error
        - timestamp
      properties:
        error:
          type: string
          description: Always `unexpected_error`
          example: unexpected_error
        timestamp:
          type: integer
          description: Unix timestamp to quote when contacting support
          example: 1700000000
    PickupPoint:
      type: object
      description: A pickup point eligible for click and collect
      required:
        - carrier
        - service_code
        - name
        - address
        - distance_km
        - schedule
      properties:
        carrier:
          type: string
          description: Pickup carrier
          enum:
            - ESTAFETA
            - DHL
            - CUBBO
            - Punto Post
          example: ESTAFETA
        service_code:
          type: string
          description: >-
            Identifier of the point, to send as `service_code` when converting
            the order
          example: CUBBOCNCESTEST001
        name:
          type: string
          description: Point name
          example: Sucursal Centro
        address:
          type: string
          description: Point address
          example: Av. Reforma 123, CDMX
        distance_km:
          type:
            - number
            - 'null'
          description: >-
            Distance from the searched postal code in kilometers; null when the
            carrier does not report it
          example: 1.2
        schedule:
          type:
            - string
            - 'null'
          description: Opening hours as reported by the carrier; null when unknown
          example: 'Lun a Vie: 10:00-18:00, Sab: 10:00-14:00, Dom: cerrado'
  responses:
    Unauthorized:
      description: >-
        Missing or invalid token, wrong credentials, or no access to the
        requested store.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            invalidToken:
              value:
                error: Unauthorized
                message: invalid token
            noHeader:
              value:
                error: Unauthorized
                message: no authorization header found
            storeNotAllowed:
              value:
                error: Unauthorized
                message: not allowed to show? this Store
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Token returned by `POST /auth/token`, sent as `Authorization: Bearer
        <token>`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.