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

# Store a new shipment and book a label

> This endpoint is used to create a new shipment and book a label in one request



## OpenAPI

````yaml /openapi-v1.json post /v1/website/{team}/shipments/labels
openapi: 3.0.0
info:
  title: Smart Send API
  description: >-
    This online documentation describes usage of the Smart Send api. We offer
    plugins for many webshop systems all consuming the API outlined in this
    documentation. Usage of the API require an active account for the Smart Send
    system and is subject to usage restrictions such as rate limit as described
    in the terms and conditions.
     *     Shopify plugin: https://www.smartsend.io/integrations/shopify
     *     WooCommerce plugin: https://www.smartsend.io/integrations/woocommerce
     *     PrestaShop plugin: https://www.smartsend.io/integrations/prestashop
     *     Magento plugin: https://www.smartsend.io/integrations/magento
  termsOfService: https://app.smartsend.io/terms-of-service/
  contact:
    name: Support
    url: https://app.smartsend.io/support/
    email: support@smartsend.io
  version: 1.0.1
servers:
  - url: https://app.smartsend.io/api/
    description: Production
security:
  - bearerAuth: []
    apiTokenQuery: []
tags:
  - name: Account
    description: Get account information
    externalDocs:
      description: Find out more
      url: https://smartsend.io/
  - name: Agents
    description: Get filtered lists of agents
    externalDocs:
      description: Find out more
      url: https://smartsend.io/agents
  - name: Closest Agents
    description: Find closest agents
    externalDocs:
      description: Find out more
      url: https://smartsend.io/agents
  - name: Shipments
    description: Everything about Shipments
    externalDocs:
      description: Find out more
      url: https://smartsend.io/shipments
  - name: Bookings
    description: Everything about Bookings
    externalDocs:
      description: Find out more
      url: https://smartsend.io/bookings
externalDocs:
  description: Find out more about Smart Send
  url: https://smartsend.io
paths:
  /v1/website/{team}/shipments/labels:
    post:
      tags:
        - Bookings
      summary: Store a new shipment and book a label
      description: >-
        This endpoint is used to create a new shipment and book a label in one
        request
      operationId: StoreTeamShipmentLabel
      parameters:
        - $ref: '#/components/parameters/team'
      requestBody:
        description: Input data format
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Shipment'
      responses:
        '201':
          description: Successful operation
          content:
            application/json:
              schema:
                properties:
                  data:
                    $ref: '#/components/schemas/LabelResource'
                type: object
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '422':
          $ref: '#/components/responses/422'
        '429':
          $ref: '#/components/responses/429'
components:
  parameters:
    team:
      name: team
      in: path
      description: The domain of the website making the agent lookup request
      required: true
      schema:
        type: string
      example: example.com
  schemas:
    Shipment:
      allOf:
        - $ref: '#/components/schemas/ShipmentBase'
        - properties:
            receiver:
              $ref: '#/components/schemas/ReceiverBase'
            sender:
              $ref: '#/components/schemas/SenderBase'
            agent:
              $ref: '#/components/schemas/PickupBase'
            parcels:
              description: List of parcels
              type: array
              items:
                allOf:
                  - $ref: '#/components/schemas/ParcelBase'
                  - properties:
                      items:
                        description: List of items
                        type: array
                        items:
                          $ref: '#/components/schemas/ItemBase'
                    type: object
            addons:
              description: List of addons
              type: array
              items:
                $ref: '#/components/schemas/AddonResource'
          type: object
    LabelResource:
      description: Label Resource
      required:
        - shipment_id
        - type
      properties:
        shipment_id:
          description: Unique ID
          type: string
          format: uuid
          example: c5540f2b-3eea-45c4-957a-9d7b53f899e7
        type:
          description: Description of the resource type
          type: string
          example: label
        internal_id:
          description: The database id used by the website for the resource
          type: string
          example: '1226'
        internal_reference:
          description: The id that is used to reference the resource externally
          type: string
          example: AB-00001445
        carrier_code:
          description: The carrier code
          type: string
          enum:
            - postnord
            - gls
            - dao
            - bifrost
            - bring
          example: postnord
        carrier_name:
          description: The human readable carrier name
          type: string
          enum:
            - PostNord
            - GLS
            - DAO
            - Bifrost
            - Bring
          example: PostNord
        pdf:
          required:
            - link
            - base_64_encoded
          properties:
            link:
              description: Link to the PDF file
              example: https://example.com/labels/DK123456789.pdf
            base_64_encoded:
              description: The base64 encoded PDF file
              example: <base64-encoded-pdf-here>
          type: object
        parcels:
          description: Parcel container
          type: array
          items:
            $ref: '#/components/schemas/LabelParcelResource'
      type: object
    ShipmentBase:
      description: Base shipment
      required:
        - type
        - internal_id
        - internal_reference
        - shipping_carrier
        - shipping_method
      properties:
        internal_id:
          description: The database id used by the website for the resource
          type: string
          example: '1226'
        internal_reference:
          description: The id that is used to reference the resource externally
          type: string
          example: AB-00001445
        shipping_carrier:
          description: The carrier code
          type: string
          enum:
            - postnord
            - gls
            - dao
            - bifrost
            - bring
          example: postnord
        shipping_method:
          description: The code for the shipping method
          type: string
          example: collect
        subtotal_price_excluding_tax:
          description: The subtotal price excluding tax
          type: number
          example: 159.2
        subtotal_price_including_tax:
          description: The subtotal price including tax
          type: number
          example: 199
        shipping_price_excluding_tax:
          description: The shipping price excluding tax
          type: number
          example: 20
        shipping_price_including_tax:
          description: The shipping price including tax
          type: number
          example: 25
        total_price_excluding_tax:
          description: The total price excluding tax
          type: number
          example: 179.2
        total_price_including_tax:
          description: The total price including tax
          type: number
          example: 224
        total_tax_amount:
          description: The total tax amount
          type: number
          example: 44.8
        currency:
          description: The three letter ISO4217 currency code
          type: string
          example: EUR
      type: object
    ReceiverBase:
      description: Base Receiver
      required:
        - internal_id
        - internal_reference
        - address_line1
        - postal_code
        - city
        - country
        - email
      properties:
        internal_id:
          description: The database id used by the website for the resource
          type: string
          example: U3778
        internal_reference:
          description: The id that is used to reference the resource externally
          type: string
          example: U-00001675
        company:
          description: Company name
          type: string
          example: Maersk
        name_line1:
          description: First line used to store the name of the receiver
          type: string
          example: John Doe
        name_line2:
          description: Second line used to store the name of the receiver
          type: string
          example: Att. Finance
        address_line1:
          description: First line used to store the address
          type: string
          example: Esplanaden 50
        address_line2:
          description: Second line used to store the address
          type: string
          example: 2nd floor
        postal_code:
          description: Postal code
          type: string
          example: '1098'
        city:
          description: City
          type: string
          example: Copenhagen
        state:
          description: State
          type: string
        region:
          description: Region
          type: string
          example: Capital
        country:
          description: ISO3166 alpha 2 country code
          type: string
          example: DK
        sms:
          description: Mobile phone number
          type: string
          example: '30274735'
        email:
          description: Email address
          type: string
          format: email
          example: john@example.com
      type: object
    SenderBase:
      description: Base Sender
      required:
        - internal_id
        - internal_reference
        - company
        - address_line1
        - postal_code
        - city
        - country
        - email
      properties:
        internal_id:
          description: The database id used by the website for the resource
          type: string
          example: U3778
        internal_reference:
          description: The id that is used to reference the resource externally
          type: string
          example: U-00001675
        company:
          description: Company name
          type: string
          example: Maersk
        name_line1:
          description: First line used to store the name of the receiver
          type: string
          example: John Doe
        name_line2:
          description: Second line used to store the name of the receiver
          type: string
          example: Att. Finance
        address_line1:
          description: First line used to store the address
          type: string
          example: Esplanaden 50
        address_line2:
          description: Second line used to store the address
          type: string
          example: 2nd floor
        postal_code:
          description: Postal code
          type: string
          example: '1098'
        city:
          description: City
          type: string
          example: Copenhagen
        state:
          description: State
          type: string
        region:
          description: Region
          type: string
          example: Capital
        country:
          description: ISO3166 alpha 2 country code
          type: string
          example: DK
        sms:
          description: Mobile phone number
          type: string
          example: '30274735'
        email:
          description: Email address
          type: string
          format: email
          example: john@example.com
      type: object
    PickupBase:
      description: Base Pickup
      required:
        - internal_id
        - internal_reference
        - agent_no
      properties:
        internal_id:
          description: The database id used by the website for the resource
          type: string
          example: U3778
        internal_reference:
          description: The id that is used to reference the resource externally
          type: string
          example: U-00001675
        agent_no:
          description: The carriers own number for the agent
          type: string
          example: '2134'
        company:
          description: Company name
          type: string
          example: Maersk
        name_line1:
          description: First line used to store the name of the receiver
          type: string
          example: John Doe
        name_line2:
          description: Second line used to store the name of the receiver
          type: string
          example: Att. Finance
        address_line1:
          description: First line used to store the address
          type: string
          example: Esplanaden 50
        address_line2:
          description: Second line used to store the address
          type: string
          example: 2nd floor
        postal_code:
          description: Postal code
          type: string
          example: '1098'
        city:
          description: City
          type: string
          example: Copenhagen
        state:
          description: State
          type: string
        region:
          description: Region
          type: string
          example: Capital
        country:
          description: ISO3166 alpha 2 country code
          type: string
          example: DK
        sms:
          description: Mobile phone number
          type: string
          example: '30274735'
        email:
          description: Email address
          type: string
          format: email
          example: john@example.com
      type: object
    ParcelBase:
      description: Base Parcel
      required:
        - internal_id
        - internal_reference
      properties:
        internal_id:
          description: The database id used by the website for the resource
          type: string
          example: '1226'
        internal_reference:
          description: The id that is used to reference the resource externally
          type: string
          example: AB-00001445
        weight:
          description: Parcel weight in kilograms [kg]
          type: number
          minimum: 0
          example: 2.35
        height:
          description: Parcel height in centimeters [cm]
          type: number
          minimum: 0
          example: 12.2
        width:
          description: Parcel width in centimeters [cm]
          type: number
          minimum: 0
          example: 15.8
        length:
          description: Parcel length in centimeters [cm]
          type: number
          minimum: 0
          example: 30.5
        freetext:
          description: A freetext field which is intended to be printed on the label.
          type: string
          example: Leave at doorstep
        total_price_excluding_tax:
          description: Total price excluding tax
          type: number
          minimum: 0
          example: 79.2
        total_price_including_tax:
          description: Total price including tax
          type: number
          minimum: 0
          example: 99
        total_tax_amount:
          description: Total tax amount
          type: number
          minimum: 0
          example: 19.8
      type: object
    ItemBase:
      description: Base Item
      required:
        - internal_id
        - internal_reference
        - sku
        - name
      properties:
        internal_id:
          description: The database id used by the website for the resource
          type: string
          example: '1226'
        internal_reference:
          description: The id that is used to reference the resource externally
          type: string
          example: PRODUCT-1231456
        sku:
          description: Item SKU number
          type: string
          example: '12345678'
        name:
          description: Item name
          type: string
          example: Product A
        description:
          description: Item description
          type: string
          example: Small Blue Product A
        hs_code:
          description: The items HS customs number
          type: string
          example: '10203040'
        country_of_origin:
          description: ISO3166 Alpha2 country code
          type: string
          example: CN
        image_url:
          description: The url of an item image
          type: string
          format: url
          example: https://example.com/catalog/product-a.jpg
        unit_weight:
          description: The item unit weight in kilograms [kg]
          type: number
          example: 1.2
        unit_price_excluding_tax:
          description: The item unit price excluding tax
          type: number
          example: 40.6
        unit_price_including_tax:
          description: The item unit price including tax
          type: number
          example: 50.75
        quantity:
          description: The item quantity
          type: number
          example: 2
        total_price_excluding_tax:
          description: The item total price excluding tax
          type: number
          example: 81.2
        total_price_including_tax:
          description: The item total price including tax
          type: number
          example: 101.5
        total_tax_amount:
          description: The item total tax amount
          type: number
          example: 20.3
      type: object
    AddonResource:
      description: Addon Resource
      required:
        - code
      properties:
        code:
          description: A code describing the addon
          type: string
          enum:
            - ADHOC_PICKUP
            - AGE_CHECK
            - ALCOHOL
            - BAGONDOOR
            - CARRYIN
            - CARRYINHEAVY
            - CHRISTMASFUND
            - CLIMATE_COMPENSATION
            - DANGEROUS_GOODS
            - DANGEROUS_GOODS_LIMITED_QUANTITY
            - DELIVERYCONFIRMATION
            - ECONOMY
            - EXPRESS
            - EXTEND_DELIVERY
            - FLEXCHANGE
            - FLEXDELIVERY
            - HEAVY20KG
            - IDCHECK
            - INSURANCE
            - LABELESS
            - LEAVENOPOD
            - NOFLEX
            - NOTIFICATION
            - NOTIFICATION_EMAIL
            - NOTIFICATION_SMS
            - PNCREDITNOINVOICE
            - PRIVATERECEIVER
            - QR
            - SECONDDELIVERYATTEMPT
            - SIGNATURE
            - TYRES
            - VALUABLES
        value:
          description: Misc value required for certain addons
          type: string
          example: '+4530274735'
      type: object
    LabelParcelResource:
      description: Label Parcel Resource
      required:
        - parcel_id
        - parcel_internal_id
        - parcel_internal_reference
        - carrier_code
        - carrier_name
        - tracking_code
        - tracking_link
      properties:
        parcel_id:
          description: Unique ID
          type: string
          format: uuid
          example: c5540f2b-3eea-45c4-957a-9d7b53f899e7
        parcel_internal_id:
          description: The database id used by the website for the resource
          type: string
          example: '1226'
        parcel_internal_reference:
          description: The id that is used to reference the resource externally
          type: string
          example: AB-00001445
        carrier_code:
          description: The carrier code
          type: string
          enum:
            - postnord
            - gls
            - dao
            - bifrost
            - bring
          example: postnord
        carrier_name:
          description: The human readable carrier name
          type: string
          enum:
            - PostNord
            - GLS
            - DAO
            - Bifrost
            - Bring
          example: PostNord
        tracking_code:
          description: The parcels tracking code as generated by the carrier
          type: string
          example: DK123456789
        tracking_link:
          description: The parcels tracking link
          type: string
          format: url
          example: https://smartsend.io/tracking/DK123456789
      type: object
    DetailedError:
      description: Detailed Error response
      required:
        - message
        - code
      allOf:
        - $ref: '#/components/schemas/Error'
        - properties:
            id:
              description: Unique ID of the error
              type: string
              example: ''
              nullable: true
            code:
              description: Code describing the type of error
              type: string
              example: ValidationException
            errors:
              description: >-
                Object with keys corresponding to the fields and each key
                containing an array of errors. OpenAPI does not allow for
                dynamic keys until version 3.1 is released
              type: object
            links:
              description: >-
                Object with dynamic keys, each with a URL string value. Dynamic
                keys are not part of OpenAPI until version 3.1 is released
              type: object
          type: object
    Error:
      description: Error response
      required:
        - message
      properties:
        message:
          description: Description of the message
          type: string
          example: Description of the error will be inserted here.
      type: object
  responses:
    '401':
      description: Unauthenticated request. Please provide correct authentication.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DetailedError'
    '403':
      description: >-
        Forbidden request. User is authenticated but not authorized to perform
        the request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DetailedError'
    '422':
      description: Validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DetailedError'
    '429':
      description: >-
        Too Many Requests. Usage is subject to rate limiting and the limit has
        been reached.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Provide API Token as Bearer authentication
    apiTokenQuery:
      type: apiKey
      description: Query API Token
      name: api_token
      in: query

````