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

# Create shipment collection



## OpenAPI

````yaml post /collections
openapi: 3.0.0
info:
  title: At Last Public Api Service
  description: This is the At Last public api specification.
  version: v1
servers:
  - url: https://api.atlast.co/v1
    description: Production
    variables: {}
security: []
tags: []
paths:
  /collections:
    post:
      operationId: Collections_create
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ShipmentCollectionRequest'
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShipmentCollectionCreationResponse'
      security:
        - OAuth2Auth: []
components:
  schemas:
    ShipmentCollectionRequest:
      type: object
      required:
        - shipmentId
      properties:
        shipmentId:
          type: string
          format: uuid
          description: >-
            The id of the shipment created with the return or simple shipment
            endpoints.
        bookingId:
          type: string
          description: >-
            Specify the booking id if given by the shipment collection timeslot
            endpoint.

            Not mandatory as if needed the system will try to resolve it as part
            of the collection process.

            **Used only for Royal Mail Home Collections**
        slot:
          allOf:
            - $ref: '#/components/schemas/CollectionRequestedTimeSlot'
          description: >-
            The timeslot you would like to book this home collection.

            if not provided, system will try to book at earliest available time,
            that will usually be next day.
        test:
          type: boolean
          description: >-
            Set this flag to true if you're testing this endpoint, omitting or
            setting to false will make the system try to book a collection with
            the carrier.

            Depending on the carrier this might be difficult to cancel and it
            will automatically incur costs!
        sendEmail:
          type: boolean
          description: >-
            Send customer email communications flag. Setting this to true will
            make At Last send any collection related emails to the end user.
            This only impact collection creation emails when using the API.
            Email communication are conditional on the Carrier. This flag
            defaults to false.
          default: false
      description: Home collection details
    ShipmentCollectionCreationResponse:
      type: object
      required:
        - shipmentId
        - collectionState
        - collection
      properties:
        shipmentId:
          type: string
        collectionState:
          type: string
        failureReason:
          type: string
        requestedTimeSlot:
          $ref: '#/components/schemas/CollectionTimeSlot'
        collection:
          $ref: '#/components/schemas/ShipmentCreationResponseCollectionData'
    CollectionRequestedTimeSlot:
      type: object
      required:
        - date
      properties:
        date:
          type: string
          description: The time slot date, in the format YYYY-MM-DD.
      description: Collection time slot
    CollectionTimeSlot:
      type: object
      required:
        - date
      properties:
        date:
          type: string
          description: The time slot date, in the format YYYY-MM-DD.
        time:
          type: string
          description: >-
            An optional time string, can be exact or a time range, will be
            carrier dependent.
      description: Resovled collection time slot
    ShipmentCreationResponseCollectionData:
      type: object
      required:
        - bookedTimeSlot
        - rebooked
      properties:
        externalId:
          type: string
          description: >-
            Given for specific carriers, this should allow consumers to manage
            the hc booking.

            **Currently only returned for Royal Mail Home Collections**
        bookedTimeSlot:
          allOf:
            - $ref: '#/components/schemas/CollectionTimeSlot'
          description: The final timeslot the home collection was booked
        rebooked:
          type: boolean
          description: >-
            A flag denoting if the carrier has not accepted the original
            timeslot.

            Will usually indicate tht the booked timeslot is different than the
            requested timeslot.
      description: Home Collection finalised details
  securitySchemes:
    OAuth2Auth:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://api.atlast.co/oauth2/token
          scopes: {}

````