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

# Retrieve deliveries

> Retrieve the deliveries of the network, the most recently added first, or only those of a location, a customer, or a user. A delivery is a parcel, letter, or other item kept at a location until its customer picks it up; deleted deliveries are left out. With bearer token authentication, the user must be an administrator, and the list leaves out deliveries at locations where they cannot view deliveries; a user can also list their own with their <code>userRef</code>. <h3>OAuth</h3>Required scopes: <code>deliveries.readonly</code> or <code>deliveries</code>



## OpenAPI

````yaml /assets/openapi.json get /deliveries/v1
openapi: 3.0.2
info:
  title: Spacebring
  version: 1.0.0
  termsOfService: https://www.spacebring.com/terms
servers:
  - url: https://api.spacebring.com
security: []
paths:
  /deliveries/v1:
    get:
      tags:
        - Deliveries
      summary: Retrieve deliveries
      description: >-
        Retrieve the deliveries of the network, the most recently added first,
        or only those of a location, a customer, or a user. A delivery is a
        parcel, letter, or other item kept at a location until its customer
        picks it up; deleted deliveries are left out. With bearer token
        authentication, the user must be an administrator, and the list leaves
        out deliveries at locations where they cannot view deliveries; a user
        can also list their own with their <code>userRef</code>.
        <h3>OAuth</h3>Required scopes: <code>deliveries.readonly</code> or
        <code>deliveries</code>
      operationId: getDeliveries
      parameters:
        - in: query
          name: createDate[gte]
          required: false
          description: >-
            Filter deliveries added on or after this date (ISO 8601). Use with
            createDate[lte] for a range.
          schema:
            type: string
        - in: query
          name: createDate[lte]
          required: false
          description: >-
            Filter deliveries added on or before this date (ISO 8601). Use with
            createDate[gte] for a range.
          schema:
            type: string
        - in: query
          name: customerRef
          required: false
          description: >-
            UUID of the customer, a person's or a company's, whose deliveries to
            list. Cannot be combined with userRef.
          schema:
            type: string
            format: uuid
        - in: query
          name: limit
          required: false
          description: >-
            Maximum number of deliveries per page. Defaults to 25 when omitted
            or invalid; values above 100 are capped at 100.
          schema:
            type: integer
            minimum: 1
            maximum: 100
        - in: query
          name: locationRef
          required: false
          description: >-
            UUID of the location whose deliveries to list. Omit to list
            deliveries across every location of the network.
          schema:
            type: string
            format: uuid
        - in: query
          name: nextPageToken
          required: false
          description: >-
            Pagination token from nextPageToken in a previous response. Keep the
            same filters when fetching the next page.
          schema:
            type: string
        - in: query
          name: status
          required: false
          description: >-
            Filter by status. Defaults to every status. Comma-separated, one or
            more of: pending, pickedUp.
          schema:
            type: string
        - in: query
          name: userRef
          required: false
          description: >-
            UUID of the user whose deliveries to list: those for the user and
            for the companies the user manages. Users can list their own;
            administrators see those in the locations they manage.
          schema:
            type: string
            format: uuid
        - in: header
          name: spacebring-network-id
          schema:
            type: string
            format: uuid
          required: false
          description: >-
            The id of the network. Required when using bearer token
            authentication
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/getDeliveries'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseError'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseError'
      security:
        - BasicAuth: []
        - OAuth2:
            - deliveries.readonly
            - deliveries
components:
  schemas:
    getDeliveries:
      type: object
      properties:
        deliveries:
          type: array
          items:
            type: object
            additionalProperties: false
            properties:
              comment:
                nullable: true
                description: >-
                  Comment about the delivery for the customer, such as the
                  carrier or how to handle the item.
                type: string
              createDate:
                type: string
                format: date-time
                description: ISO timestamp of when the delivery was added.
              id:
                type: string
                format: uuid
                description: Unique identifier of the delivery.
              locationRef:
                type: string
                format: uuid
                description: ID of the location where the delivery is kept.
              media:
                type: array
                items:
                  type: object
                  properties:
                    key:
                      type: string
                      description: Storage key of the media file.
                    url:
                      type: string
                      description: Public URL of the media file.
                  required:
                    - key
                    - url
                  additionalProperties: false
                description: Photo of the delivery, or an empty list when it has none.
              pickupDate:
                nullable: true
                description: ISO timestamp of when the delivery was picked up.
                type: string
                format: date-time
              customer:
                type: object
                properties:
                  company:
                    description: >-
                      The company the delivery is for, read from the customers
                      service so the name is current.
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                        description: Unique identifier of the company.
                      logo:
                        description: Company logo, when the company has one.
                        type: object
                        properties:
                          key:
                            type: string
                            description: Storage key of the logo.
                          url:
                            type: string
                            description: Public URL of the logo.
                        required:
                          - key
                          - url
                        additionalProperties: false
                      publicLogoUrl:
                        description: >-
                          Logo found from the company website, to show when the
                          company has no logo of its own.
                        type: string
                      title:
                        type: string
                        description: Name of the company.
                    required:
                      - id
                      - title
                    additionalProperties: false
                  id:
                    type: string
                    format: uuid
                    description: ID of the customer the delivery is for.
                  type:
                    type: string
                    enum:
                      - company
                      - user
                    description: >-
                      Whether the delivery is for a person or for a whole
                      company.
                  user:
                    description: >-
                      The person the delivery is for, read from the users
                      service so the details are current.
                    type: object
                    properties:
                      deleteDate:
                        description: ISO timestamp of when the user account was deleted.
                        type: string
                        format: date-time
                      email:
                        description: Email address of the user.
                        nullable: true
                        type: string
                      id:
                        type: string
                        format: uuid
                        description: Unique identifier of the user.
                      name:
                        description: First name of the user.
                        nullable: true
                        type: string
                      phoneNumber:
                        description: Phone number of the user.
                        nullable: true
                        type: string
                      photoUrl:
                        description: User profile photo URL.
                        nullable: true
                        type: string
                      surname:
                        description: Surname of the user.
                        nullable: true
                        type: string
                    required:
                      - id
                    additionalProperties: false
                required:
                  - id
                  - type
                additionalProperties: false
                description: The customer the delivery is for.
              status:
                type: string
                enum:
                  - pending
                  - pickedUp
                description: >-
                  Whether the delivery is still kept at the location or was
                  picked up.
            required:
              - comment
              - createDate
              - id
              - locationRef
              - media
              - pickupDate
              - customer
              - status
          description: List of deliveries, the most recently added first.
        nextPageToken:
          description: Pagination token to fetch the next page of results.
          type: string
        searchQueryNext:
          description: >-
            Search query parameters for the next page of results. Includes all
            filters used to fetch the current page.
          type: string
      required:
        - deliveries
      additionalProperties: false
    responseError:
      type: object
      properties:
        message:
          type: string
        type:
          type: string
  securitySchemes:
    BasicAuth:
      type: http
      description: >-
        See our [authentication
        documentation](https://www.spacebring.com/docs/developer/api/authentication#basic-authentication)
        for how to authorize your requests
      scheme: basic
    OAuth2:
      type: oauth2
      description: >-
        See our [authentication
        documentation](https://www.spacebring.com/docs/developer/api/authentication#oauth2)
        for how to authorize your requests
      flows:
        authorizationCode:
          authorizationUrl: https://oauth2.spacebring.com/api/oauth2/authorize
          tokenUrl: https://oauth2.spacebring.com/api/oauth2/token
          refreshUrl: https://oauth2.spacebring.com/api/oauth2/token
          scopes:
            benefits.readonly: Read benefits and applications
            benefits: Read and write benefits and applications
            campaigns.readonly: Read campaigns
            campaigns: Read and write campaigns
            checkIns.readonly: Read check-ins
            checkIns: Read and write check-ins
            community.readonly: Read community companies and memberships
            community: Read and write community companies and memberships
            deliveries.readonly: Read deliveries
            deliveries: Read and write deliveries
            events.readonly: Read events and tickets
            events: Read and write events and tickets
            feed.readonly: Read feed posts
            feed: Read and write feed posts
            invoices.readonly: Read contracts, credit notes, discounts and invoices
            invoices: Read and write contract, credit notes, discounts and invoices
            locations.readonly: Read locations
            locations: Read and write locations
            plans.readonly: Read plans
            plans: Read and write plans
            resources.readonly: Read resources and bookings
            resources: Read and write resources and bookings
            subscriptions.readonly: Read subscriptions
            subscriptions: Read and write subscriptions
            shop.readonly: Read products and orders
            shop: Read and write products and orders
            support.readonly: Read support tickets
            support: Read and write support tickets
            transactions.readonly: Read transactions
            transactions: Read and write transactions
            visitors.readonly: Read visitors
            visitors: Read and write visitors

````

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