Documentation Updates

Documentation Updates

#%RAML 1.0
---
title: Shipment API
version: v1
baseUri: https://bapi.bring.com/shipment
mediaType: application/json
annotationTypes:
  hideInDocumentation: boolean
  hideRequired: boolean
types:
  Address:
    type: object
    description: An address
    properties:
      name:
        type: string
        required: true
        description: Name
      streetAddress:
        type: string
        required: true
        description: Senders address
      postalCode:
        type: string
        required: true
        description: Postal code. Must be a valid Norwegian postal code.
        pattern: "[0-9]{4}"
        example: "0150"
  AddressWithPostalName:
    type: object
    description: An address
    properties:
      name:
        type: string
        required: true
        description: Name
      streetAddress:
        type: string
        required: true
        description: Senders address
      postalCode:
        type: string
        required: true
        description: Senders postal code. Must be a valid Norwegian postal code.
        pattern: "[0-9]{4}"
        example: "0150"
      postalName:
        type: string
        required: true
        description: Name of the postalCode
  Order:
    type: object
    description: An order to place in Mybring.
    properties:
      customerNumber:
        type: string
        description: API customer number for which to place the order.
      senderName:
        type: string
        description: Sender's name.
        example: Min Bedrift
      senderEmail:
        required: false
        type: string
        description: Sender's email address. Defaults to the user's email address.
      postalCode:
        type: string
        description: Sender's postal code. Must be a valid Norwegian postal code.
      streetAddress:
        type: string
        description: Sender's street address.
      reference:
        required: false
        description: A reference for the shipment that will be shown on the invoice.
      testIndicator:
        required: false
        type: boolean
        description: Set to true when testing API implementation.
      returnAddress:
        required: false
        type: Address
        description: An optional return address. If set will override the return address in generated label.
      packages:
        minItems: 1
        maxItems: 500
        type: Package[]
        description: The packages to send in this shipment.
  Package:
    type: object
    description: A single package in a shipment.
    properties:
      GrossWeight:
        type: ccWeight
        description: Gross weight of the package.
      GrossVolume:
        type: ccVolume
        description: Gross volume of the package.
        required: false
      Dimensions:
        type: DimensionsTYPE
        description: Dimension of the package.
        required: false
      Insurance:
        type: PackageInsurance
        description: A valid Norwegian postal code.
        required: false
      packageId:
        type: string
        description: PackageId, can be inserted by the API.
        example: "370438101412578910"
  SuccessfulOrder:
    (hideRequired): true
    displayName: Successful Order
    description: A successfully placed order that contains links to labels and waybill.
    properties:
      testIndicator:
        type: boolean
        description: Whether the placed order had the testIndicator flag set or not.
      id:
        type: number
        description: The ID of the order that was placed.
      customerNumber:
        type: string
        description: The API customer number for which the order was placed.
      customerName:
        type: string
        description: The name of the customer for which the order was placed.
      customerOrganizationNumber:
        type: string
        description: The organization number of the customer for which the order was placed.
      senderName:
        type: string
        description: Sender's name.
      streetAddress:
        type: string
        description: Sender's street address.
      postalCode:
        type: string
        description: Sender's postal code.
      postalPlace:
        type: string
        description: The city/place for the postal code.
      email:
        type: string
        description: Sender's email address for the order that was placed.
      reference:
        type: string
        description: A reference for the shipment that will be shown on the invoice.
      labelUri:
        type: string
        description: URL to PDF label(s) for packages ordered without tracking.
      rfidLabelUri:
        type: string
        description: URL to ZPL label(s) for packages ordered with tracking.
      waybillUri:
        type: string
        description: URL to waybill PDF that has to be printed and sent with the shipment.
      orderNumberReference:
        type: string
        description: The order number reference for the placed order. This is the number on the waybill.
      priceWithoutVat:
        type: number
        description: Price of shipment without VAT (MVA).
      priceWithVat:
        type: number
        description: Price of shipment with VAT (MVA).
      vat:
        type: number
        description: How much of the price was VAT (MVA).
      currency:
        type: string
        default: NOK
        description: The currency for the price.
      orderTime:
        type: datetime
        example: 2017-09-01T14:00:00.000Z
        description: Timestamp for when the order was placed.
      returnAddress:
        type: AddressWithPostalName
        required: false
        description: Return address for the order if one is set
      packages:
        minItems: 1
        description: Packages in this shipment.
        type: OrderedPackage[]
  OrderedPackage:
    (hideRequired): true
    displayName: Ordered Package
    description: A single package in a successfully ordered shipment.
    properties:
      rfid:
        type: boolean
        description: Whether to [tracking for the package](#tracking-with-rfid) was activated.
      recipientName:
        type: string
        description: Recipient name.
      streetAddress:
        type: string
        description: Recipient's street address.
      postalCode:
        type: string
        description: Recipient's postal code.
      postalPlace:
        type: string
        description: The city/place for the postal code.
      phoneNumber:
        type: string
        pattern: "\\+[0-9 ]+"
        description: Recipient's phone number.
      email:
        type: string
        description: Recipient's email address.
      weight:
        maximum: 2000
        type: integer
        description: Package weight in grams.
      shipmentNumber:
        type: string
        description: The shipment number for this package. A package in a PIP shipment will have both a shipment number and a package number.
      packageNumber:
        type: string
        description: The package number for this package. This goes on the label.
      agreementNumber:
        type: boolean
        description: Whether the customer has an agreement price for this package.
  ValidatedOrder:
    (hideRequired): true
    displayName: Validated Order
    description: A valid order that can be placed.
    properties:
      testIndicator:
        type: boolean
        description: Whether the validated order had the testIndicator flag set or not.
      customerNumber:
        type: string
        description: The API customer number for the validated order.
      customerName:
        type: string
        description: The name of the customer for the validated order.
      customerOrganizationNumber:
        type: string
        description: The organization number of the customer for the validated order.
      senderName:
        type: string
        description: The sender's name.
      streetAddress:
        type: string
        description: The sender's street address.
      postalCode:
        type: string
        description: The sender's postal code.
      postalPlace:
        type: string
        description: The city/place for the postal code.
      email:
        type: string
        description: The sender's email address.
      reference:
        type: string
        description: A reference for the shipment that will be shown on the invoice.
      priceWithoutVat:
        type: number
        description: Calculated price without VAT (MVA).
      priceWithVat:
        type: number
        description: Calulated price with VAT (MVA).
      vat:
        type: number
        description: Calculated VAT (MVA).
      currency:
        type: string
        description: The price's currency.
      orderTime:
        type: datetime
        description: Timestamp for when the order was validated.
      returnAddress:
        type: AddressWithPostalName
        required: false
        description: Return address for the order if one is set
      packages:
        minItems: 1
        description: Packages in this validated shipment. The packages in the response will correspond to same order as it was in the request to make it easier for clients to do any mapping if needed.
        type: ValidatedPackage[]
  ValidatedPackage:
    (hideRequired): true
    displayName: Validated Package
    description: A single, valid package in a valid shipment.
    properties:
      rfid:
        type: boolean
        description: Whether to [tracking with RFID](#tracking-with-rfid) was activated for the package.
      recipientName:
        type: string
        description: Recipient's name.
      streetAddress:
        type: string
        description: Recipient's email address.
      postalCode:
        type: string
        description: Recipient's postal code.
      postalPlace:
        type: string
        description: The city/place for the postal code.
      phoneNumber:
        type: string
        description: Recipient's phone number.
      email:
        type: string
        description: Recipient's email address.
      weight:
        type: integer
        description: Package weight in grams.
      agreementNumber:
        type: boolean
        description: Whether the customer has an agreement price for this package.
  OrderRequest:
    (hideInDocumentation): true
    type: object
    properties:
      data:
        type: object
        description: JSON-API data object.
        properties:
          type:
            type: string
            enum: [ orders ]
            description: JSON-API type.
          attributes:
            type: Order
            description: Order properties.
  SuccessfulOrderResponse:
    (hideRequired): true
    (hideInDocumentation): true
    type: object
    properties:
      data:
        type: object
        description: JSON-API data object.
        properties:
          type:
            type: string
            description: JSON-API type.
          id: string
          attributes:
            type: SuccessfulOrder
            description: Order properties.
  ValidatedOrderResponse:
    (hideRequired): true
    (hideInDocumentation): true
    type: object
    properties:
      data:
        type: object
        description: JSON-API data object.
        properties:
          type:
            type: string
            pattern: "order"
            description: JSON-API type.
          attributes:
            type: ValidatedOrder
            description: Order properties.
  ErrorResponse:
    (hideRequired): true
    (hideInDocumentation): true
    type: object
    properties:
      errors:
        type: ErrorObject[]
        description: List of errors.
  ErrorObject:
    (hideRequired): true
    (hideInDocumentation): true
    type: object
    properties:
      code:
        type: string
        description: Machine-readable description of error.
      title:
        type: string
        description: Human-readable description of error.
      source:
        type: object
        properties:
          pointer:
            type: string
            description: A JSON pointer to the invalid field.
  PackageWithNumbers:
    displayName: Package Details
    description: Package Details with OrderID
    properties:
      rfid:
        type: boolean
        description: Whether to activate [tracking with RFID](#tracking-with-rfid) for the package.
      recipientName:
        type: string
        description: Recipient name.
      streetAddress:
        type: string
        description: Recipient's Street address.
      postalCode:
        type: string
        description: A valid Norwegian postal code.
      postalPlace:
        type: string
        description: The city/place for the postal code.
      phoneNumber:
        type: string
        pattern: "\\+[0-9 ]+"
        description: Recipient's phone number, including country code.
        example: "+4700000000"
      email:
        type: string
        description: Recipient's email address.
      weight:
        maximum: 2000
        type: integer
        description: Package weight in grams.
      shipmentNumber:
        type: string
        description: The shipment number for this package. A package in a PIP shipment will have both a shipment number and a package number.
      packageNumber:
        type: string
        description: The package number for this package. This goes on the label.
      priceType:
        type: string
        description: Whether the Price is Agreement or List
        enum: [ AGREEMENT_PRICE,  LIST_PRICE]
  OrderWithLabelResponse:
    (hideRequired): true
    displayName: Successful Order
    description: A successfully label generation that contains links to labels.
    properties:
      reference:
        type: string
        description: A reference for the shipment that will be shown on the invoice.
      senderName:
        type: string
        description: Sender's name.
      streetAddress:
        type: string
        description: Sender's street address.
      email:
        type: string
        description: Sender's email address for the order that was placed.
      labelUri:
        type: string
        description: URL to PDF label(s) for packages ordered without tracking.
      rfidLabelUri:
        type: string
        description: URL to ZPL label(s) for packages ordered with tracking.
      orderTime:
        type: datetime
        example: 2017-09-01T14:00:00.000Z
        description: Timestamp for when the order was placed.
      postalCode:
        type: string
        description: Sender's postal code.
      postalPlace:
        type: string
        description: The city/place for the postal code.
      customerNumber:
        type: string
        description: The API customer number for the validated order.
      customerName:
        type: string
        description: The API customer name for which the order was placed.
      customerOrganizationNumber:
        type: string
        description: The organization number of the customer for which the order was placed.
      testIndicator:
        type: boolean
        description: Whether the placed order had the testIndicator flag set or not.
      packages:
        minItems: 1
        description: Packages Number for the shipment.
        type: PackageWithNumbers[]
  SuccessfulLabelGenerationResponse:
    (hideRequired): true
    (hideInDocumentation): true
    type: object
    properties:
      data:
        type: object
        description: JSON-API data object.
        properties:
          type:
            type: string
            enum: [ labels ]
            description: JSON-API type.
          attributes:
            type: OrderWithLabelResponse
            description: Order properties.
  LabelRequest:
    (hideInDocumentation): true
    type: object
    properties:
      data:
        type: object
        description: JSON-API data object.
        properties:
          type:
            type: string
            enum: [ labels ]
            description: JSON-API type.
          attributes:
            type: CreateOrderRequest
            description: Order properties.
  CreateOrderRequest:
    displayName: Create Order Request
    description: It creates the Request for Label Generation.
    properties:
      customerNumber:
        type: string
        description: The API customer number for the validated order.
      senderName:
        type: string
        description: The sender's name.
      senderEmail:
        required: false
        type: string
        description: Sender's email address. Defaults to the user's email address.
      postalCode:
        type: string
        description: Sender's postal code. Must be a valid Norwegian postal code.
      streetAddress:
        type: string
        description: Recipient's email address.
      reference:
        required: false
        description: A reference for the shipment that will be shown on the invoice.
      testIndicator:
        type: boolean
        description: Whether the validated order had the testIndicator flag set or not.
      packages:
        minItems: 1
        maxItems: 500
        type: Package[]
        description: The packages to send in this shipment. Response will have packages in same order as requested to make it easier for clients to do any mapping if needed.
  LabelOrderRequest:
      (hideInDocumentation): true
      type: object
      properties:
        data:
          type: object
          description: JSON-API data object.
          properties:
            type:
              type: string
              enum: [ label_orders ]
              description: JSON-API type.
            attributes:
              type: CreateLabelOrderRequest
              description: Create Order properties.
  CreateLabelOrderRequest:
    displayName: Create Label Order Request
    description: Create Label Order Request
    properties:
      customerNumber:
        type: string
        description: The API customer number.
      packageNumbers:
        minItems: 1
        maxItems: 500
        type: string[]
        description: List of Package Numbers.
  OrderWithIdAndEdiMessage:
    displayName: Reponse of Create Order Request
    description: Reponse of Create Order Request
    properties:
      id:
        type: number
        description: The ID of the order that was placed.
      customerNumber:
        type: string
        description: The API customer number for the validated order.
      customerName:
        type: string
        description: The API customer name for which the order was placed.
      customerOrganizationNumber:
        type: string
        description: The organization number of the customer for which the order was placed.
      senderName:
        type: string
        description: Sender's name.
      streetAddress:
        type: string
        description: Sender's street address.
      email:
        type: string
        description: Sender's email address for the order that was placed.
      postalCode:
        type: string
        description: Sender's postal code.
      reference:
        type: string
        description: A reference for the shipment that will be shown on the invoice.
      labelUri:
        type: string
        description: URL to PDF label(s) for packages ordered without tracking.
      rfidLabelUri:
        type: string
        description: URL to ZPL label(s) for packages ordered with tracking.
      waybillUri:
        type: string
        description: URL to waybill PDF that has to be printed and sent with the shipment.
      orderNumberReference:
        type: string
        description: The order number reference for the placed order. This is the number on the waybill.
      priceWithoutVat:
        type: number
        description: Price of shipment without VAT (MVA).
      priceWithVat:
        type: number
        description: Price of shipment with VAT (MVA).
      vat:
        type: number
        description: How much of the price was VAT (MVA).
      currency:
        type: string
        default: NOK
        description: The currency for the price.
      orderTime:
        type: datetime
        example: 2017-09-01T14:00:00.000Z
        description: Timestamp for when the order was placed.
      returnAddress:
        type: AddressWithPostalName
        required: false
        description: Return address for the order if one is set
      packages:
        minItems: 1
        description: Packages Number for the shipment.
        type: PackageWithNumbers[]
  SuccessfulLabelOrderResponse:
     (hideRequired): true
     (hideInDocumentation): true
     type: object
     properties:
       data:
         type: object
         description: JSON-API data object.
         properties:
           type:
             type: string
             enum: [ order ]
             description: JSON-API type.
           id:
             type: string
             description: Order Id
           attributes:
             type: OrderWithIdAndEdiMessage
             description: Label Order properties.
  CreateShipmentRequest:
    type: object
    properties:
      RequestVersion:
        type: number
        description: Request version to use
        example: 1
      RequestDate:
        type: datetime
        description: Date and time for when the request was created
        example: 2018-11-22T08:58:52
      Shipment:
        type: object #Shipment
        description: Structure for the shipment
  Shipment:
    type: object
    properties:
      updateIndicator:
        type: string
        enum:
        - Original
        - Update
        - Replace
        - Delete
        description: Is this request an original, update or a deletion
        example: Original
      shipmentType:
        type: string
        enum:
        - Instruction
        - Booking
        - Healthcheck
        description: Type of shipment
        example: Instruction
      ShipmentHeaders:
        type: object #ShipmentHeaders
        description: Structure that handles information for the whole shipment
      DateAndTimes:
        type: object[] #DateAndTimes[]
        description: Date and times for the message, repeatable structure. Several dates are required
      Sender:
        type: object #BasicPartyTYPE
        description: Structure to hold sender information
      Receiver:
        type: object #BasicPartyTYPE
        description: Structure to hold receiver information
      AdditionalParty:
        type: object[] #PartyTYPE[]
        description: Additionalparties for the shipment, repeatable. Refer to detailed instructions
      ProductAndService:
        type: object #ProductAndService
        description: Product and service codes in addition to value added service structures
      DeliveryTerms:
        type: object #DeliveryTerms
        description: Terms of delivery
        required: false
      CashOnDelivery:
        type: object #CashOnDelivery
        description: Cash on delivery for the shipment
        required: false
      GoodsItem:
        type: object[] #GoodsItem[]
        description: Information about the goods being shipped
  ShipmentHeaders:
    type: object
    properties:
      SendersReference:
        type: string
        description: Senders reference for the shipment
        example: SOA-123222
      ReceiversReference:
        type: string
        description: Receivers reference for the shipment
        example: SOA-123222
        required: false
      NumberOfPackages:
        type: string
        description: Total number of packages for the whole shipment across all goodsitems. Must be equal to the number of GoodsItems in the message.
        example: "3"
      AdditionalReference:
        type: object[] #ReferenceTYPE[]
        description: Additional references for the shipment as indicated by referenceType
        required: false
      FreeText:
        type: object[] #FreeTextTYPE[]
        description: Freetext elements
        required: false
      GrossWeight:
        type: object #ccWeight
        description: Gross weight for the whole shipment
        required: false
      GrossVolume:
        type: object #ccVolume
        description: Gross volume for the whole shipment
        required: false
      Dimensions:
        type: object #DimensionsTYPE
        description: Dimensions required for the whole shipment
        required: false
      LoadingMetres:
        type: number
        description: How many metres of loading space required of a truck's length
        example: "12"
        required: false
      PalletFootPrints:
        type: integer
        description: How many pallet footprints are needed for the shipment
        example: "3"
        required: false
      HazardPoints:
        type: integer
        description: Sum of hazard points for the shipment
        example: "22"
        required: false
      ExchangableEquipment:
        type: object #ExchangableEquipment
        description: Equipment that can be reused, ie. pallets
        required: false
      shipmentId:
        type: string
        description: Id for the whole shipment, can be retrieved by the API. ShipmentId must be of length 17 for GS1, 10 for SIS or 11 for UPS.
        example: "70438101412575352"
  DateAndTimes:
    type: object
    properties:
      subClass:
        type: string
        description: Type of datetime
        example: DocumentDate
        enum:
        - DocumentDate
        - PickupRequested
        - PickupEarliest
        - PickupLatest
        - DeliveryRequested
        - DeliveryEarliest
        - DeliveryLatest
      DateTime:
        type: datetime
        description: Date and Time (for non DocumentDate, date cannot be in the past)
        example: 2018-11-22T08:58:52
  Sender:
    type: object
    properties:
      partyId:
        type: string
        description: Identifier for the party (compulsory if Receiver partyId and additionalParty of 'FreightPayer' not specified).
        example: BEX
        required: false
      subPartyId:
        type: string
        description: Further identification of the party
        example: GLW
        required: false
      Name:
        type: string
        description: Party name (compulsory if DangerousGoods are specified)
        example: Bring
        required: false
      Address:
        type: AddressTYPE
        description: Party address
        required: false
      ContactName:
        type: string
        description: Contact name for the party
        example: Atle Thorstensen
        required: false
      Phone:
        type: string
        description: Phone
        example: "+4712345678"
        required: false
      MobilePhone:
        type: string
        description: Mobile phone
        example: "+4712345678"
        required: false
      Email:
        type: string
        description: Email
        example: mail@mail.com
        required: false
      Fax:
        type: string
        description: Fax
        example: "+4712345678"
        required: false
      Reference:
        type: ReferenceTYPE[]
        description: Reference related to the party, can be used for account number of pallet system in Sweden for instance.
        required: false
  Receiver:
    type: object
    properties:
      partyId:
        type: string
        description: Identifier for the party (compulsory if Sender partyId and additionalParty of 'FreightPayer' not specified).
        example: BEX
        required: false
      subPartyId:
        type: string
        description: Further identification of the party
        example: GLW
        required: false
      Name:
        type: string
        description: Party name
        example: Bring
        required: false
      Address:
        type: AddressTYPE
        description: Party address
        required: false
      ContactName:
        type: string
        description: Contact name for the party
        example: Atle Thorstensen
        required: false
      Phone:
        type: string
        description: Phone
        example: "+4712345678"
        required: false
      MobilePhone:
        type: string
        description: Mobile phone
        example: "+4712345678"
        required: false
      Email:
        type: string
        description: Email
        example: mail@mail.com
        required: false
      Fax:
        type: string
        description: Fax
        example: "+4712345678"
        required: false
      Reference:
        type: ReferenceTYPE[]
        description: Reference related to the party, can be used for account number of pallet system in Sweden for instance.
        required: false
  AdditionalParty:
      type: object
      properties:
        subClass:
          type: string
          description: Type of Party (at least one subClass must be 'TansportCompany')
          example: DeliveryParty
          enum:
          - DespatchParty
          - DeliveryParty
          - OrderingParty
          - FreightPayer
          - CashOnDeliveryPayee
          - GoodsReturnParty
          - NotifyParty
          - TransportCompany
        partyId:
          type: string
          description: Identifier for the party
          example: BEX
        subPartyId:
          type: string
          description: Further identification for the party
          example: GLW
          required: false
        Name:
          type: string
          description: Party name
          example: Rogers antistatiske overledninger
          required: false
        Address:
          type: AddressTYPE
          description: Party address
          required: false
        ContactName:
          type: string
          description: Party contact name
          example: Ola Nordmann
          required: false
        Phone:
          type: string
          description: Phone
          example: "+4712345678"
          required: false
        MobilePhone:
          type: string
          description: Mobile phone
          example: "+4712345678"
          required: false
        Email:
          type: string
          description: Email
          example: "mail@mail.com"
          required: false
        Fax:
          type: string
          description: Fax
          example: "+4712345678"
          required: false
        Reference:
          type: ReferenceTYPE[]
          description: Further references related to the party
          example: "SOA-121232332-AN"
          required: false
  ProductAndService:
    type: object
    properties:
      ProductCode:
        type: string
        description: Productcode for shipment, refer to documentation for valid productcodes for this service
        example: COURIER_1H
      AdditionalService:
        type: AdditionalService[]
        description: Additional service codes
        required: false
      TariffReference:
        type: string
        description: Additional information about the price of the cargo in connection with the service
        example: GNCG
        enum:
        - COOL_ABERRANT
        - GENERAL_CARGO
        - MINERAL_WATER
        - CHILLED_0_4
        - TIRES
        - COOL_5_8
        - FISH_0_4
        - FROZEN_CARGO
        - FROST_FREE_CARGO
        - EARLY_DELIVERY
        - LATE_DELIVERY
        - SPECIAL_CARGO
        - COOL_0_2
        required: false
      NatureOfCargo:
        type: string
        description: Indicates if the cargo is out of bound of general expected parameters, dangerous goods or out of gauge
        example: "11"
        required: false
  DeliveryTerms:
    type: object
    properties:
      ConditionCode:
        type: string
        description: The actual terms for the chosen deliverytermstype
        example: EXW
      Location:
        type: DeliveryTermsLocation
        description: The location where the given deliveryterms (condition) applies (to or from given conditioncode.)
        required: false
      termsType:
        type: string
        description: Terms valid for this shipment
        example: Incoterms
        enum:
        - Incoterms
        - Freightterms
        - Combiterms
        - PrePaid
        - ThirdParty
  CashOnDelivery:
    type: object
    properties:
      TransactionIdentifier:
        type: CashOnDeliveryTransactionIdentifier
        description: Senders identifier for the transaction
        required: false
      Amount:
        type: ccAmount
        description: Amount expected on delivery
        example: "123450"
        required: false
      ControlDigit:
        type: integer
        description: Control digit for incoming amount when there is specified a KID number (Norwegian only)
        example: 8
        required: false
      DocumentId:
        type: string[]
        description: DocumentIds for Cash on Delivery
        example: "SA-46789"
        required: false
      MonetaryAccount:
        type: object #CashOnDeliveryMonetaryAccount
        description: Description of where the money should be received
        required: false
      codType:
        type: string
        description: Type of cash on delivery
        example: CashOnDelivery
        enum:
        - CashOnDelivery
        - PrePaid
        - CreditCard
  GoodsItem:
    type: object
    properties:
      PackageTypeCode:
        type: string
        description: Types of cargo, packaging of cargo. Either use supported enumeration or UN/ECE Recommendation 21
      GoodsDescription:
        type: string
        description: Description of goods being shipped
        example: Contains socks
        required: false
      LoadCarrier:
        type: string
        description: Transport equipment (pallet, container etc)
        example: EFP
        required: false
      SealId:
        type: string
        description: Item sealed for customs etc, number of the seal
        example: "123456"
        required: false
      Temperature:
        type: GoodsItemTemperature
        description: Temperature requirements for goods being shipped
        required: false
      Package:
        type: Package[]
        description: List of packages being shipped
      CustomsDetails:
        type: CustomsDetails[]
        description: List of Customs Details for goods being shipped
        required: false
      DangerousGoods:
        type: object[] #GoodsItemDangerousGoods[]
        description: Information about dangerousgoods being shipped
        required: false
      PackingDetails:
        type: PackingDetails[]
        description: List of Package Details for goods being shipped
        required: false
  ReferenceTYPE:
    type: object
    properties:
      ReferenceValue:
        type: string
        description: Extra Reference
        example: 4440/0189981/WEJ
      referenceType:
        type: string
        description: ReferenceType
        example: TRANSPORT_DOCUMENT_NUMBER
        enum:
        - DESPATCH_ADVICE_NUMBER (AAK)
        - TRANSPORT_DOCUMENT_NUMBER (AAS)
        - CUSTOMS_DECLARATION_NUMBER (ABT)
        - ACCOUNT_NUMBER (ADE)
        - PROJECT_NUMBER (AEP)
        - SECONDARY_CUSTOMS_REFERENCE (AFM)
        - TEMPORARY_IMPORTATION_DOCUMENT_NUMBER (AGM)
        - SENDERS_REFERENCE (AGO)
        - AIR_WAYBILL (AWB)
        - BILL_OF_LADING (BM)
        - BOOKING_REFERENCE (BN)
        - ROAD_CONSIGNMENT_NOTE (CMR)
        - SHIPMENT_REFERENCE (SRN)
        - TRANSPORT_INSTRUCTION (TIN)
        - GOODS_NUMBER (XC)
        - MESSAGE_SENDERS_IDENTITY (MS)
  FreeTextTYPE:
    type: object
    properties:
      Text:
        type: FreeTextTYPEText[]
        description: Sequence of freetext
      usageCode:
        type: string
        description: Typeof freetext
        example: PICKUP_INSTRUCTIONS
        enum:
        - PICKUP_INSTRUCTIONS (SIC)
        - DELIVERY_INSTRUCTIONS (DEL)
        - CARRIER_INSTRUCTIONS (SIC)
  ccWeight:
    type: object
    properties:
      unitCode:
        type: string
        description: Unitcode for weight
        example: KGM
        enum:
        - GRM
        - KGM
      Value:
        type: number
        description: Weight Value
        example: 2.33
  ccVolume:
    type: object
    properties:
      unitCode:
        type: string
        description: Unitcode for volume measurement
        example: DMQ
        enum:
        - DMQ
        - MTQ
      Value:
        type: number
        description: Value of the volume measurement
        example: 18.22
  DimensionsTYPE:
    type: object
    properties:
      Height:
        type: ccLength
        description: Height of package
      Length:
        type: ccLength
        description: Length of package
      Width:
        type: ccLength
        description: Width of package
  PackageInsurance:
    type: object
    properties:
      InsuranceValue:
        type: PackageInsuranceInsuranceValue
        description: The Amount the package is insured for.
      GoodsDescription:
        type: string
        description: Description of the insured package.
        example: Gold
      Email:
        type: string
        description: Email related to the insurance information
  PackageInsuranceInsuranceValue:
    type: object
    properties:
      currencycode:
        type: string
        description: Currencycode for the insured amount
        example: NOK
      Value:
        type: string
        description: Amount the package is insureed for
        example: 10000
  ExchangableEquipment:
    type: object
    properties:
      UnitType:
        type: string
        description: Type of exchangable equipment
        example: EFP
        enum:
        - EFP
      Value:
        type: number
        description: Quantity of exchangable equipments
        example: 3
  AddressTYPE:
    type: object
    properties:
      AddressLine:
        type: string[]
        description: Address lines. The first line will be mapped to primary address line
        example: ["Kong Oscars gate 12"]
      PostalCode:
        type: string
        description: Postal code for address
        example: "5122"
      City:
        type: string
        description: City for the posatl code
        example: Morvik
      StateOrRegion:
        type: string
        description: State or region, not in use in the nordic countries
        example: Washington DC
        required: false
      CountryCode:
        type: string
        description: Country code. Use valid country codes
        example: NO
  AdditionalService:
    type: object
    properties:
      AdditionalServiceCode:
        type: string
        description: The additional service code for the product
        example: EVARSLING
      ServiceRequirements:
        type: string[]
        description: Some AdditionalServiceCodes / valueadded service might require extra information.
  DeliveryTermsLocation:
    type: object
    properties:
      City:
        type: string
        description: City where the deliveryterms are valid to or from
        example: Bergen
      CountryCode:
        type: string
        description: Country where the deliveryterms ar valid to or from
        example: NO
  CashOnDeliveryTransactionIdentifier:
    type: object
    properties:
      identifierType:
        type: string
        description: Type of cash on delivery
        example: PQ
        enum:
        - PQ
        - SS
      accountType:
        type: string
        description: Typeof account to receive payment
        example: Bank
        enum:
        - Bank
        - Bankgiro
        - Plus
        - Post
        - Iban
        - Other
      Value:
        type: string
        description: The value to identify where the money should be sent
        example: "1234.12.123456"
  ccAmount:
    type: object
    properties:
      currencyCode:
        type: string
        description: Currencycode, valid currency codes allowed
        example: NOK
  MonetaryAccount:
    type: object
    properties:
      AccountNumber:
        type: CashOnDeliveryMonetaryAccountNumber
        description: Account number to receive payment
      SwiftCode:
        type: string
        description: Swift code for international transfers
        example: DNBANOKK
      BankName:
        type: string
        description: Bank where account is created
        example: DNB
      AccountHolderName:
        type: string
        description: Name of the owner of the account
        example: Ola Nordmann
  GoodsItemTemperature:
    type: object
    properties:
      Transport:
        type: ccTempMeasure
        description: Temperature requirements during transport
      Storage:
        type: ccTempMeasure
        description: Temperature requirements for storage of goods
  CustomsDetails:
    type: object
    properties:
      Quantity:
        type: number
        description: Quantity of packages
        required: false
        format: float
      CountryOfOrigin:
        type: string
        description: Country of origin of the package
        required: false
      TariffLineAmount:
        type: TariffLineAmount
        description: Tariff Line Amount of the package
        required: false
      CustomsArticleNumber:
        type: string
        description: Customs Article Number of the package
        required: false
      GoodsDescription:
        type: string
        description: Goods Description of the package
        required: false
      NetWeight:
        type: number
        format: float
        description: Net weight of the package
        required: false
  DangerousGoods:
    type: object
    properties:
      UNDGInformation:
        type: DangerousGoodsUNDGInformation
        description: United nations dangerous goods information
        required: false
      Flashpoint:
        type: DangerousGoodsFlashpoint
        description: Flashpointinformation for dangerousgoods (when will the item become volatile?)
        required: true
      HazardClass:
        type: string
        description: Classification of hazard
        example: "4.1"
        required: false
      AdditionalHazard:
        type: string
        description: Additional codes for hazard
        example: "2.3(8)"
        required: false
      PackingGroup:
        type: string
        description: Packing danger level code, roman numeral between  1 and 3
        example: II
        required: false
      Measures:
        type: MeasuresTYPE[]
        description: Measures for Dangerous Goods
        required: false
      TechnicalName:
        type: string
        description: Technical name of hazard
        example: KALSIUMRESINAT, SINTRET
        required: false
      Restrictions:
        type: DangerousGoodsRestrictions[]
        description: Restrictions when carrying these hazardous goods
        required: false
      HazardPoints:
        type: integer
        description: Points for this hazard. Calculated from factor for dangerousgoods multiplied by amount in kg / dm3 for each material in cargo
        example: 10
        required: false
      regulatonCode:
        type: string
        description: Regulation codes for the hazardous goods
        example: ADR
        required: false
  PackingDetails:
    type: object
    properties:
      PositionNumber:
        type: integer
        description: Position number within Packing Details
        required: false
      ArticleNumber:
        type: string
        description: Articla details of Packing Details
        required: false
      ArticleDescription:
        type: string
        description: Artical description of Packing Details
        required: false
      ItemDelivered:
        type: number
        format: float
        description: Item Delivered within Packing Details
        required: false
      ArticlePrice:
        type: ArticlePrice
        description: Artical Price of the Packing Details
        required: false
      ItemOrdered:
        type: number
        format: float
        description: Item Ordered within the Packing Details
        required: false
      ItemBackOrder:
        type: number
        format: float
        description: Item Back Order within Packing Details
        required: false
      ItemUnity:
        type: string
        description: Item Unity within Packing Details
        required: false
  FreeTextTYPEText:
    type: object
    properties:
      sequence:
        type: string
        description: Order of freetext elements
        example: "0"
        required: false
      Value:
        type: string
        description: Actual freetext
        example: Call the contact before delivering item
  ccLength:
    type: object
    properties:
      unitCode:
      type: string
      description: Unit for the length
      example: CMT
      enum:
      - CMT
      - DMT
      - MTR
      required: false
      Value:
        type: number
        format: float
        description: The length
        example: 1.22
        required: false
  CashOnDeliveryMonetaryAccountNumber:
    type: object
    properties:
      accountType:
        type: string
        description: Type of account to receive payment on delivery
        enum:
        - Bank
        - Bankgiro
        - Plus
        - Post
        - Iban
        - Other
      Value:
        type: string
        description: Actual account number
        example: "4567.45.12345"
  ccTempMeasure:
    type: object
    properties:
      unitCode:
        type: string
        description: Unit code for temperature measure
        example: CEL
        enum:
        - CEL
        - FAH
      minimum:
        type: string
        description: Minimum allowed temperature
        example: "-8"
        required: false
      maximum:
        type: string
        description: Maximum allowed temperature
        example: "4"
        required: false
      Value:
        type: integer
        description: Specific temperature for transportation of the cargo
        example: 3
  TariffLineAmount:
    type: object
    properties:
      currencyCode:
        type: string
        description: Currency code of the tariff line
        required: false
      Value:
        type: number
        format: float
        description: Value of the tariff line
        required: false
  DangerousGoodsUNDGInformation:
    type: object
    properties:
      HazardIdentifier:
        type: string
        description: United nations dangerous goods hazard identifier
        example: "1.1D"
        required: false
      FlashpointDescription:
        type: string
        description: Flashpoint for dangerous goods
        example: BLACK POWDER, granulated or in powderform
        required: false
  DangerousGoodsFlashpoint:
    type: object
    properties:
      unitCode:
        type: string
        description: Unit code for flashpoint
        example: CEL
        required: true
        enum:
        - CEL
        - FAH
      Value:
        type: integer
        description: Value when flashpoint occurs/ignites
        example: 18
        required: true
  MeasuresTYPE:
    type: object
    properties:
      Measure:
        type: ccMeasure
        description: Measurements for goods
        required: false
      subClass:
        type: string
        example: NetHazardWeight
        required: false
  DangerousGoodsRestrictions:
    type: object
    properties:
      restrictionType:
        type: string
        description: Type of restriction
        example: Tunnel
        enum:
        - Tunnel
        required: false
      Value:
        type: string
        description: Freetext specification of restriction for given tunnel. One element for each UN number in the dangerousgoods sequence
        example: Ellingsøy- og Valderøytunnelen på riksveg 658 utenfor Ålesund. Her gjelder tunnelkategori C i tidsrommet kl. 0600–2400 hver dag
        required: false
  ArticlePrice:
    type: object
    properties:
      currencyCode:
        type: string
        description: Quantity of packages
        required: false
      Value:
        type: number
        format: float
        description: Value of packages
        required: false
  ccMeasure:
    type: object
    properties:
      unitCode:
        type: string
        description: Unit code for measure
        example: DMQ
        required: true
      Value:
        type: number
        format: float
        description: Measure value
        example: 1.22
        required: true
  CreateShipmentResponse:
    type: object
    properties:
      Status:
        type: string
        enum:
        - OK
        - OK_CONFIRMED
        - ERROR
        - VALIDATION_ERROR
        - FORBIDDEN
        required: false
      StatusText:
        type: string
        required: false
      Errors:
        type: CreateShipmentResponseErrors[]
        required: false
      Identities:
        type: CreateShipmentResponseIdentities[]
        required: false
      ProcessingID:
        type: string
        required: false
      EndpointProcessingID:
        type: string
        required: false
  CreateShipmentResponseErrors:
    type: object
    properties:
      Error:
        type: string
        description: Error type
        enum:
        - VALIDATION
        - SYSTEM
        - BAD_REQUEST
        required: false
      ErrorText:
        type: string
        required: false
  CreateShipmentResponseIdentities:
    type: object
    properties:
      PackageId:
        type: string[]
      ShipmentId:
        type: string

/sendshipment?shipmentId={createShipmentId}&packageIds={createPackageId}:
  displayName: Create shipment
  description: |
        Sends a shipment consisting of one consignment, that must include at least one package, from one sender to one receiver.

        The **ShipmentType** must be "**Instruction**" and must include a Shipment Header.

        A Senders reference must be included and must have a value.

        The LM Service Codes, in the Shipping Guide, must consist of valid codes (see [Unit Codes](/api/shipment/#unit-codes) below).

        A valid combination of an additional party, with party type **TransportCompany** and a valid Transport company code as the **partyId** value and an optional **subPartyId** and service, is required. In addition there might be several value added services that can be added. Please refer to [valid product codes/services and VASes](https://bapiqa.bring.com/Shipment/Documentation/GetServiceAndVAS?responseType=XML).

        If an included product requires an additional service, that additional service must be included.

        Value Added Service Codes may only feature once in any Shipment.

        The following Additional Services must be accompanied by the following additions
        - 1000 - must include a Cash on Delivery entry
        - 1036 - must include a SubClass of DeliveryParty entry
        - 1134 - Receiver.ContactName must have a value
        - 1142 - Receiver.ContactName and Receiver.MobilePhone must both have a value
        - 1150 - Receiver.Email must have a value
        - 1245 - must include a DangerousGoods entry

        Conversely
        |  |
        | -------------- |
        | When Cash on Delivery is specified, it must be a valid CashOnDelivery and an AdditionalService with value 1000 must be included |
        | When a Goods Item is specified, it must be valid GoodsItem |
        | When a DangerousGoods is specified, AdditionalService must be 1245 |
        | The ProductAndService specified must have a valid TariffReference |
        | The Sender specified must be a valid GeneralParty |
        | The Receiver specified, must be a valid GeneralParty |
        | When an AdditionalParty is specified, it must be a valid AdditionalParty and must include a subClass of TransportCompany |

        If requested through the query parameters, the service will create a shipment ID (for the whole shipment) in addition to package IDs for each package. The package IDs will be returned in the order of the packages (i.e. package 1 in the input will have package ID 1 in returned array).

        The structure and most of the content will be validated.

#  description: |
#      Request is used to either create, update or delete an instruction for Bring.

  uriParameters:
    createShipmentId:
      description: If "true" the API will assign a shipment ID for you and return it in the response.
      type: boolean
    createPackageId:
      description: If "true" the API will assign all package IDs for you and return them in the response.
      type: boolean

  post:
    description: Request is used to either create, update or delete an instruction for Bring.
    headers:
      Content-Type:
        description: Specify request format (application/json, application/xml)
        required: true
        enum: [ application/json,application/xml ]
      Accept:
        description: Specify response format (application/json, application/xml)
        required: true
        enum: [ application/json,application/xml ]
    body:
      application/xml:
        type: [CreateShipmentRequest, Shipment, ShipmentHeaders, DateAndTimes, Sender, Receiver, AdditionalParty, ProductAndService, DeliveryTerms, CashOnDelivery, GoodsItem, MonetaryAccount, DangerousGoods]
        examples:
          valid_request:
            displayName: Valid Request
            value: !include examples/basic_example.xml
          express_courier:
            displayName: Bring Express Courier
            value: !include examples/basic_example.xml
            description: Sample request to book a Bring Express Courier shipment.
      application/json:
        type: [CreateShipmentRequest, Shipment, ShipmentHeaders, DateAndTimes, Sender, Receiver, AdditionalParty, ProductAndService, DeliveryTerms, CashOnDelivery, GoodsItem, MonetaryAccount, DangerousGoods]
        examples:
          valid_request:
            displayName: Valid Request
            value: !include examples/basic_example.json
          express_courier:
            displayName: Bring Express Courier
            value: !include examples/basic_example.json
            description: Sample request to book a Bring Express Courier shipment.
    responses:
      200:
        description: |
          Returns a confirmation of successful delivery and package IDs / shipment IDs if requested.
        body:
          application/xml:
            type: CreateShipmentResponse
            examples:
              valid_shipment:
                displayName: Valid Shipment Response
                value: !include examples/valid_shipment_response.xml
          application/json:
            type: CreateShipmentResponse
            examples:
              valid_shipment:
                displayName: Valid Shipment Response
                value: !include examples/valid_shipment_response.json
      400:
        displayName: Error
        description: |
          Error in validation of request or error in data structure of request.

      417:
        displayName: Error
        description: |
          Missing authentication headers.

      500:
        displayName: Error
        description: |
          Unknown error. Error sending data to destination.

/sendbooking?shipmentId={createShipmentId}&packageIds={createPackageId}:
  displayName: Create shipment booking
  description: |
        Sends a booking request consisting of a Shipment with a Goods Item attached. The Goods Item must contain a Package.

        A consignment value must not be included as this would imply that the shipment itself, was to be created.

#  description: |
#      Request is used to either create, update or delete an instruction for Bring.

  uriParameters:
    createShipmentId:
      description: If "true" the API will assign a shipment ID for you and return it in the response.
      type: boolean
    createPackageId:
      description: If "true" the API will assign all package IDs for you and return them in the response.
      type: boolean

  post:
    description: Request is used to either create, update or delete an instruction for Bring.
    headers:
          Content-Type:
            description: Specify request format (application/json, application/xml)
            required: true
            enum: [ application/json,application/xml ]
          Accept:
            description: Specify response format (application/json, application/xml)
            required: true
            enum: [ application/json,application/xml ]
    body:
      application/xml:
        examples:
          valid_request:
            displayName: Valid Request
            value: !include examples/basic_example_booking.xml
        type:
      application/json:
        examples:
          valid_request:
            displayName: Valid Request
            value: !include examples/basic_example_booking.json
        type:
    responses:
      200:
        displayName: Success
        description: |
          Returns a confirmation of successful delivery and package IDs / shipment IDs if requested.

      400:
        displayName: Error
        description: |
          Error in validation of request or error in data structure of request.

      417:
        displayName: Error
        description: |
          Missing authentication headers.

      500:
        displayName: Error
        description: |
          Unknown error. Error sending data to destination.

#%RAML 1.0
---
title: Shipment API
version: v1
baseUri: https://bapi.bring.com/shipment
mediaType: application/json
annotationTypes:
  hideInDocumentation: boolean
  hideRequired: boolean
types:
  Address:
    type: object
    description: An address
    properties:
      name:
        type: string
        required: true
        description: Name
      streetAddress:
        type: string
        required: true
        description: Senders address
      postalCode:
        type: string
        required: true
        description: Postal code. Must be a valid Norwegian postal code.
        pattern: "[0-9]{4}"
        example: "0150"
  AddressWithPostalName:
    type: object
    description: An address
    properties:
      name:
        type: string
        required: true
        description: Name
      streetAddress:
        type: string
        required: true
        description: Senders address
      postalCode:
        type: string
        required: true
        description: Senders postal code. Must be a valid Norwegian postal code.
        pattern: "[0-9]{4}"
        example: "0150"
      postalName:
        type: string
        required: true
        description: Name of the postalCode
  Order:
    type: object
    description: An order to place in Mybring.
    properties:
      customerNumber:
        type: string
        description: API customer number for which to place the order.
      senderName:
        type: string
        description: Sender's name.
        example: Min Bedrift
      senderEmail:
        required: false
        type: string
        description: Sender's email address. Defaults to the user's email address.
      postalCode:
        type: string
        description: Sender's postal code. Must be a valid Norwegian postal code.
      streetAddress:
        type: string
        description: Sender's street address.
      reference:
        required: false
        description: A reference for the shipment that will be shown on the invoice.
      testIndicator:
        required: false
        type: boolean
        description: Set to true when testing API implementation.
      returnAddress:
        required: false
        type: Address
        description: An optional return address. If set will override the return address in generated label.
      packages:
        minItems: 1
        maxItems: 500
        type: Package[]
        description: The packages to send in this shipment.
  Package:
    type: object
    description: A single package in a shipment.
    properties:
      rfid:
        type: boolean
        description: Whether to activate [tracking with RFID](#tracking-with-rfid) for the package.
      weight:
        maximum: 2000
        type: integer
        description: Weight in grams.
      recipientName:
        type: string
        description: Recipient name.
      postalCode:
        type: string
        description: A valid Norwegian postal code.
      streetAddress:
        type: string
        description: Recipient's street address.
      phoneNumber:
        type: string
        pattern: "\\+[0-9 ]+"
        description: Recipient's phone number, including country code.
        example: "+4700000000"
      email:
        type: string
        description: Recipient's email address.
  SuccessfulOrder:
    (hideRequired): true
    displayName: Successful Order
    description: A successfully placed order that contains links to labels and waybill.
    properties:
      testIndicator:
        type: boolean
        description: Whether the placed order had the testIndicator flag set or not.
      id:
        type: number
        description: The ID of the order that was placed.
      customerNumber:
        type: string
        description: The API customer number for which the order was placed.
      customerName:
        type: string
        description: The name of the customer for which the order was placed.
      customerOrganizationNumber:
        type: string
        description: The organization number of the customer for which the order was placed.
      senderName:
        type: string
        description: Sender's name.
      streetAddress:
        type: string
        description: Sender's street address.
      postalCode:
        type: string
        description: Sender's postal code.
      postalPlace:
        type: string
        description: The city/place for the postal code.
      email:
        type: string
        description: Sender's email address for the order that was placed.
      reference:
        type: string
        description: A reference for the shipment that will be shown on the invoice.
      labelUri:
        type: string
        description: URL to PDF label(s) for packages ordered without tracking.
      rfidLabelUri:
        type: string
        description: URL to ZPL label(s) for packages ordered with tracking.
      waybillUri:
        type: string
        description: URL to waybill PDF that has to be printed and sent with the shipment.
      orderNumberReference:
        type: string
        description: The order number reference for the placed order. This is the number on the waybill.
      priceWithoutVat:
        type: number
        description: Price of shipment without VAT (MVA).
      priceWithVat:
        type: number
        description: Price of shipment with VAT (MVA).
      vat:
        type: number
        description: How much of the price was VAT (MVA).
      currency:
        type: string
        default: NOK
        description: The currency for the price.
      orderTime:
        type: datetime
        example: 2017-09-01T14:00:00.000Z
        description: Timestamp for when the order was placed.
      returnAddress:
        type: AddressWithPostalName
        required: false
        description: Return address for the order if one is set
      packages:
        minItems: 1
        description: Packages in this shipment.
        type: OrderedPackage[]
  OrderedPackage:
    (hideRequired): true
    displayName: Ordered Package
    description: A single package in a successfully ordered shipment.
    properties:
      rfid:
        type: boolean
        description: Whether to [tracking for the package](#tracking-with-rfid) was activated.
      recipientName:
        type: string
        description: Recipient name.
      streetAddress:
        type: string
        description: Recipient's street address.
      postalCode:
        type: string
        description: Recipient's postal code.
      postalPlace:
        type: string
        description: The city/place for the postal code.
      phoneNumber:
        type: string
        pattern: "\\+[0-9 ]+"
        description: Recipient's phone number.
      email:
        type: string
        description: Recipient's email address.
      weight:
        maximum: 2000
        type: integer
        description: Package weight in grams.
      shipmentNumber:
        type: string
        description: The shipment number for this package. A package in a PIP shipment will have both a shipment number and a package number.
      packageNumber:
        type: string
        description: The package number for this package. This goes on the label.
      agreementNumber:
        type: boolean
        description: Whether the customer has an agreement price for this package.
  ValidatedOrder:
    (hideRequired): true
    displayName: Validated Order
    description: A valid order that can be placed.
    properties:
      testIndicator:
        type: boolean
        description: Whether the validated order had the testIndicator flag set or not.
      customerNumber:
        type: string
        description: The API customer number for the validated order.
      customerName:
        type: string
        description: The name of the customer for the validated order.
      customerOrganizationNumber:
        type: string
        description: The organization number of the customer for the validated order.
      senderName:
        type: string
        description: The sender's name.
      streetAddress:
        type: string
        description: The sender's street address.
      postalCode:
        type: string
        description: The sender's postal code.
      postalPlace:
        type: string
        description: The city/place for the postal code.
      email:
        type: string
        description: The sender's email address.
      reference:
        type: string
        description: A reference for the shipment that will be shown on the invoice.
      priceWithoutVat:
        type: number
        description: Calculated price without VAT (MVA).
      priceWithVat:
        type: number
        description: Calulated price with VAT (MVA).
      vat:
        type: number
        description: Calculated VAT (MVA).
      currency:
        type: string
        description: The price's currency.
      orderTime:
        type: datetime
        description: Timestamp for when the order was validated.
      returnAddress:
        type: AddressWithPostalName
        required: false
        description: Return address for the order if one is set
      packages:
        minItems: 1
        description: Packages in this validated shipment. The packages in the response will correspond to same order as it was in the request to make it easier for clients to do any mapping if needed.
        type: ValidatedPackage[]
  ValidatedPackage:
    (hideRequired): true
    displayName: Validated Package
    description: A single, valid package in a valid shipment.
    properties:
      rfid:
        type: boolean
        description: Whether to [tracking with RFID](#tracking-with-rfid) was activated for the package.
      recipientName:
        type: string
        description: Recipient's name.
      streetAddress:
        type: string
        description: Recipient's email address.
      postalCode:
        type: string
        description: Recipient's postal code.
      postalPlace:
        type: string
        description: The city/place for the postal code.
      phoneNumber:
        type: string
        description: Recipient's phone number.
      email:
        type: string
        description: Recipient's email address.
      weight:
        type: integer
        description: Package weight in grams.
      agreementNumber:
        type: boolean
        description: Whether the customer has an agreement price for this package.
  OrderRequest:
    (hideInDocumentation): true
    type: object
    properties:
      data:
        type: object
        description: JSON-API data object.
        properties:
          type:
            type: string
            enum: [ orders ]
            description: JSON-API type.
          attributes:
            type: Order
            description: Order properties.
  SuccessfulOrderResponse:
    (hideRequired): true
    (hideInDocumentation): true
    type: object
    properties:
      data:
        type: object
        description: JSON-API data object.
        properties:
          type:
            type: string
            description: JSON-API type.
          id: string
          attributes:
            type: SuccessfulOrder
            description: Order properties.
  ValidatedOrderResponse:
    (hideRequired): true
    (hideInDocumentation): true
    type: object
    properties:
      data:
        type: object
        description: JSON-API data object.
        properties:
          type:
            type: string
            pattern: "order"
            description: JSON-API type.
          attributes:
            type: ValidatedOrder
            description: Order properties.
  ErrorResponse:
    (hideRequired): true
    (hideInDocumentation): true
    type: object
    properties:
      errors:
        type: ErrorObject[]
        description: List of errors.
  ErrorObject:
    (hideRequired): true
    (hideInDocumentation): true
    type: object
    properties:
      code:
        type: string
        description: Machine-readable description of error.
      title:
        type: string
        description: Human-readable description of error.
      source:
        type: object
        properties:
          pointer:
            type: string
            description: A JSON pointer to the invalid field.
  PackageWithNumbers:
    displayName: Package Details
    description: Package Details with OrderID
    properties:
      rfid:
        type: boolean
        description: Whether to activate [tracking with RFID](#tracking-with-rfid) for the package.
      recipientName:
        type: string
        description: Recipient name.
      streetAddress:
        type: string
        description: Recipient's Street address.
      postalCode:
        type: string
        description: A valid Norwegian postal code.
      postalPlace:
        type: string
        description: The city/place for the postal code.
      phoneNumber:
        type: string
        pattern: "\\+[0-9 ]+"
        description: Recipient's phone number, including country code.
        example: "+4700000000"
      email:
        type: string
        description: Recipient's email address.
      weight:
        maximum: 2000
        type: integer
        description: Package weight in grams.
      shipmentNumber:
        type: string
        description: The shipment number for this package. A package in a PIP shipment will have both a shipment number and a package number.
      packageNumber:
        type: string
        description: The package number for this package. This goes on the label.
      priceType:
        type: string
        description: Whether the Price is Agreement or List
        enum: [ AGREEMENT_PRICE,  LIST_PRICE]
  OrderWithLabelResponse:
    (hideRequired): true
    displayName: Successful Order
    description: A successfully label generation that contains links to labels.
    properties:
      reference:
        type: string
        description: A reference for the shipment that will be shown on the invoice.
      senderName:
        type: string
        description: Sender's name.
      streetAddress:
        type: string
        description: Sender's street address.
      email:
        type: string
        description: Sender's email address for the order that was placed.
      labelUri:
        type: string
        description: URL to PDF label(s) for packages ordered without tracking.
      rfidLabelUri:
        type: string
        description: URL to ZPL label(s) for packages ordered with tracking.
      orderTime:
        type: datetime
        example: 2017-09-01T14:00:00.000Z
        description: Timestamp for when the order was placed.
      postalCode:
        type: string
        description: Sender's postal code.
      postalPlace:
        type: string
        description: The city/place for the postal code.
      customerNumber:
        type: string
        description: The API customer number for the validated order.
      customerName:
        type: string
        description: The API customer name for which the order was placed.
      customerOrganizationNumber:
        type: string
        description: The organization number of the customer for which the order was placed.
      testIndicator:
        type: boolean
        description: Whether the placed order had the testIndicator flag set or not.
      packages:
        minItems: 1
        description: Packages Number for the shipment.
        type: PackageWithNumbers[]
  SuccessfulLabelGenerationResponse:
    (hideRequired): true
    (hideInDocumentation): true
    type: object
    properties:
      data:
        type: object
        description: JSON-API data object.
        properties:
          type:
            type: string
            enum: [ labels ]
            description: JSON-API type.
          attributes:
            type: OrderWithLabelResponse
            description: Order properties.
  LabelRequest:
    (hideInDocumentation): true
    type: object
    properties:
      data:
        type: object
        description: JSON-API data object.
        properties:
          type:
            type: string
            enum: [ labels ]
            description: JSON-API type.
          attributes:
            type: CreateOrderRequest
            description: Order properties.
  CreateOrderRequest:
    displayName: Create Order Request
    description: It creates the Request for Label Generation.
    properties:
      customerNumber:
        type: string
        description: The API customer number for the validated order.
      senderName:
        type: string
        description: The sender's name.
      senderEmail:
        required: false
        type: string
        description: Sender's email address. Defaults to the user's email address.
      postalCode:
        type: string
        description: Sender's postal code. Must be a valid Norwegian postal code.
      streetAddress:
        type: string
        description: Recipient's email address.
      reference:
        required: false
        description: A reference for the shipment that will be shown on the invoice.
      testIndicator:
        type: boolean
        description: Whether the validated order had the testIndicator flag set or not.
      packages:
        minItems: 1
        maxItems: 500
        type: Package[]
        description: The packages to send in this shipment. Response will have packages in same order as requested to make it easier for clients to do any mapping if needed.
  LabelOrderRequest:
      (hideInDocumentation): true
      type: object
      properties:
        data:
          type: object
          description: JSON-API data object.
          properties:
            type:
              type: string
              enum: [ label_orders ]
              description: JSON-API type.
            attributes:
              type: CreateLabelOrderRequest
              description: Create Order properties.
  CreateLabelOrderRequest:
    displayName: Create Label Order Request
    description: Create Label Order Request
    properties:
      customerNumber:
        type: string
        description: The API customer number.
      packageNumbers:
        minItems: 1
        maxItems: 500
        type: string[]
        description: List of Package Numbers.
  OrderWithIdAndEdiMessage:
    displayName: Reponse of Create Order Request
    description: Reponse of Create Order Request
    properties:
      id:
        type: number
        description: The ID of the order that was placed.
      customerNumber:
        type: string
        description: The API customer number for the validated order.
      customerName:
        type: string
        description: The API customer name for which the order was placed.
      customerOrganizationNumber:
        type: string
        description: The organization number of the customer for which the order was placed.
      senderName:
        type: string
        description: Sender's name.
      streetAddress:
        type: string
        description: Sender's street address.
      email:
        type: string
        description: Sender's email address for the order that was placed.
      postalCode:
        type: string
        description: Sender's postal code.
      reference:
        type: string
        description: A reference for the shipment that will be shown on the invoice.
      labelUri:
        type: string
        description: URL to PDF label(s) for packages ordered without tracking.
      rfidLabelUri:
        type: string
        description: URL to ZPL label(s) for packages ordered with tracking.
      waybillUri:
        type: string
        description: URL to waybill PDF that has to be printed and sent with the shipment.
      orderNumberReference:
        type: string
        description: The order number reference for the placed order. This is the number on the waybill.
      priceWithoutVat:
        type: number
        description: Price of shipment without VAT (MVA).
      priceWithVat:
        type: number
        description: Price of shipment with VAT (MVA).
      vat:
        type: number
        description: How much of the price was VAT (MVA).
      currency:
        type: string
        default: NOK
        description: The currency for the price.
      orderTime:
        type: datetime
        example: 2017-09-01T14:00:00.000Z
        description: Timestamp for when the order was placed.
      returnAddress:
        type: AddressWithPostalName
        required: false
        description: Return address for the order if one is set
      packages:
        minItems: 1
        description: Packages Number for the shipment.
        type: PackageWithNumbers[]
  SuccessfulLabelOrderResponse:
     (hideRequired): true
     (hideInDocumentation): true
     type: object
     properties:
       data:
         type: object
         description: JSON-API data object.
         properties:
           type:
             type: string
             enum: [ order ]
             description: JSON-API type.
           id:
             type: string
             description: Order Id
           attributes:
             type: OrderWithIdAndEdiMessage
             description: Label Order properties.
  CreateShipmentRequest:
    type: object
    properties:
      RequestVersion:
        type: number
        description: Request version to use
        example: 1
      RequestDate:
        type: datetime
        description: Date and time for when the request was created
        example: 2018-11-22T08:58:52
      Shipment:
        type: object #Shipment
        description: Structure for the shipment
  Shipment:
    type: object
    properties:
      updateIndicator:
        type: string
        enum:
        - Original
        - Update
        - Replace
        - Delete
        description: Is this request an original, update or a deletion
        example: Original
      shipmentType:
        type: string
        enum:
        - Instruction
        - Booking
        - Healthcheck
        description: Type of shipment
        example: Instruction
      ShipmentHeaders:
        type: object #ShipmentHeaders
        description: Structure that handles information for the whole shipment
      DateAndTimes:
        type: object[] #DateAndTimes[]
        description: Date and times for the message, repeatable structure. Several dates are required
      Sender:
        type: object #BasicPartyTYPE
        description: Structure to hold sender information
      Receiver:
        type: object #BasicPartyTYPE
        description: Structure to hold receiver information
      AdditionalParty:
        type: object[] #PartyTYPE[]
        description: Additionalparties for the shipment, repeatable. Refer to detailed instructions
      ProductAndService:
        type: object #ProductAndService
        description: Product and service codes in addition to value added service structures
      DeliveryTerms:
        type: object #DeliveryTerms
        description: Terms of delivery
        required: false
      CashOnDelivery:
        type: object #CashOnDelivery
        description: Cash on delivery for the shipment
        required: false
      GoodsItem:
        type: object[] #GoodsItem[]
        description: Information about the goods being shipped
  ShipmentHeaders:
    type: object
    properties:
      SendersReference:
        type: string
        description: Senders reference for the shipment
        example: SOA-123222
      ReceiversReference:
        type: string
        description: Receivers reference for the shipment
        example: SOA-123222
        required: false
      NumberOfPackages:
        type: string
        description: Total number of packages for the whole shipment across all goodsitems.
        example: "3"
      AdditionalReference:
        type: object[] #ReferenceTYPE[]
        description: Additional references for the shipment as indicated by referenceType
        required: false
      FreeText:
        type: object[] #FreeTextTYPE[]
        description: Freetext elements
        required: false
      GrossWeight:
        type: object #ccWeight
        description: Gross weight for the whole shipment
        required: false
      GrossVolume:
        type: object #ccVolume
        description: Gross volume for the whole shipment
        required: false
      Dimensions:
        type: object #DimensionsTYPE
        description: Dimensions required for the whole shipment
        required: false
      LoadingMetres:
        type: number
        description: How many metres of loading space required of a truck's length
        example: "12"
        required: false
      PalletFootPrints:
        type: integer
        description: How many pallet footprints are needed for the shipment
        example: "3"
        required: false
      HazardPoints:
        type: integer
        description: Sum of hazard points for the shipment
        example: "22"
        required: false
      ExchangableEquipment:
        type: object #ExchangableEquipment
        description: Equipment that can be reused, ie. pallets
        required: false
      shipmentId:
        type: string
        description: Id for the whole shipment, can be retrieved by the API
        example: "70438101412575352"
  DateAndTimes:
    type: object
    properties:
      subClass:
        type: string
        description: Type of datetime
        example: DocumentDate
        enum:
        - DocumentDate
        - PickupRequested
        - PickupEarliest
        - PickupLatest
        - DeliveryRequested
        - DeliveryEarliest
        - DeliveryLatest
      DateTime:
        type: datetime
        description: Date and Time
        example: 2018-11-22T08:58:52
  Sender:
    type: object
    properties:
      partyId:
        type: string
        description: Identifier for the party
        example: BEX
        required: false
      subPartyId:
        type: string
        description: Further identification of the party
        example: GLW
        required: false
      Name:
        type: string
        description: Party name
        example: Bring
        required: false
      Address:
        type: AddressTYPE
        description: Party address
        required: false
      ContactName:
        type: string
        description: Contact name for the party
        example: Atle Thorstensen
        required: false
      Phone:
        type: string
        description: Phone
        example: "+4712345678"
        required: false
      MobilePhone:
        type: string
        description: Mobile phone
        example: "+4712345678"
        required: false
      Email:
        type: string
        description: Email
        example: mail@mail.com
        required: false
      Fax:
        type: string
        description: Fax
        example: "+4712345678"
        required: false
      Reference:
        type: ReferenceTYPE[]
        description: Reference related to the party, can be used for account number of pallet system in Sweden for insatnce.
        required: false
  Receiver:
    type: object
    properties:
      partyId:
        type: string
        description: Identifier for the party
        example: BEX
        required: false
      subPartyId:
        type: string
        description: Further identification of the party
        example: GLW
        required: false
      Name:
        type: string
        description: Party name
        example: Bring
        required: false
      Address:
        type: AddressTYPE
        description: Party address
        required: false
      ContactName:
        type: string
        description: Contact name for the party
        example: Atle Thorstensen
        required: false
      Phone:
        type: string
        description: Phone
        example: "+4712345678"
        required: false
      MobilePhone:
        type: string
        description: Mobile phone
        example: "+4712345678"
        required: false
      Email:
        type: string
        description: Email
        example: mail@mail.com
        required: false
      Fax:
        type: string
        description: Fax
        example: "+4712345678"
        required: false
      Reference:
        type: ReferenceTYPE[]
        description: Reference related to the party, can be used for account number of pallet system in Sweden for insatnce.
        required: false
  AdditionalParty:
      type: object
      properties:
        subClass:
          type: string
          description: Type of Party
          example: DeliveryParty
          enum:
          - DespatchParty
          - DeliveryParty
          - OrderingParty
          - FreightPayer
          - CashOnDeliveryPayee
          - GoodsReturnParty
          - NotifyParty
          - TransportCompany
        partyId:
          type: string
          description: Identifier for the party
          example: BEX
        subPartyId:
          type: string
          description: Further identification for the party
          example: GLW
          required: false
        Name:
          type: string
          description: Party name
          example: Rogers antistatiske overledninger
          required: false
        Address:
          type: AddressTYPE
          description: Party address
          required: false
        ContactName:
          type: string
          description: Party contact name
          example: Ola Nordmann
          required: false
        Phone:
          type: string
          description: Phone
          example: "+4712345678"
          required: false
        MobilePhone:
          type: string
          description: Mobile phone
          example: "+4712345678"
          required: false
        Email:
          type: string
          description: Email
          example: "mail@mail.com"
          required: false
        Fax:
          type: string
          description: Fax
          example: "+4712345678"
          required: false
        Reference:
          type: ReferenceTYPE[]
          description: Further references related to the party
          example: "SOA-121232332-AN"
          required: false
  ProductAndService:
    type: object
    properties:
      ProductCode:
        type: string
        description: Productcode for shipment, refer to documentation for valid productcodes for this service
        example: COURIER_1H
      AdditionalService:
        type: AdditionalService[]
        description: Additional service codes
        required: false
      TariffReference:
        type: string
        description: Additional information about the price of the cargo in connection with the service
        example: GNCG
        enum:
        - COOL_ABERRANT
        - GENERAL_CARGO
        - MINERAL_WATER
        - CHILLED_0_4
        - TIRES
        - COOL_5_8
        - FISH_0_4
        - FROZEN_CARGO
        - FROST_FREE_CARGO
        - EARLY_DELIVERY
        - LATE_DELIVERY
        - SPECIAL_CARGO
        - COOL_0_2
        required: false
      NatureOfCargo:
        type: string
        description: Indicates if the cargo is out of bound of general expected parameters, dangerous goods or out og gauge
        example: "11"
        required: false
  DeliveryTerms:
    type: object
    properties:
      ConditionCode:
        type: string
        description: The actual terms for the chosen deliverytermstype
        example: EXW
      Location:
        type: DeliveryTermsLocation
        description: The location where the given deliveryterms (condition) applies (to or from given conditioncode.)
        required: false
      termsType:
        type: string
        description: Terms valid for this shipment
        example: Incoterms
        enum:
        - Incoterms
        - Freightterms
        - Combiterms
        - PrePaid
        - ThirdParty
  CashOnDelivery:
    type: object
    properties:
      TransactionIdentifier:
        type: CashOnDeliveryTransactionIdentifier
        description: Senders identifier for the transaction
        required: false
      Amount:
        type: ccAmount
        description: Amount expected on delivery
        example: "123450"
        required: false
      ControlDigit:
        type: integer
        description: Control digit for incoming amount when there is specified a KID number (Norwegian only)
        example: 8
        required: false
      DocumentId:
        type: string[]
        description: DocumentIds for Cash on Delivery
        example: "SA-46789"
        required: false
      MonetaryAccount:
        type: object #CashOnDeliveryMonetaryAccount
        description: Description of where the money should be received
        required: false
      codType:
        type: string
        description: Type of cash on delivery
        example: CashOnDelivery
        enum:
        - CashOnDelivery
        - PrePaid
        - CreditCard
  GoodsItem:
    type: object
    properties:
      PackageTypeCode:
        type: string
        description: Types of cargo, packaging of cargo. Either use supported enumeration or UN/ECE Recommendation 21
      GoodsDescription:
        type: string
        description: Description of goods being shipped
        example: Contains socks
        required: false
      LoadCarrier:
        type: string
        description: Transport equipment (pallet, container etc)
        example: EFP
        required: false
      SealId:
        type: string
        description: Item sealed for customs etc, number of the seal
        example: "123456"
        required: false
      Temperature:
        type: GoodsItemTemperature
        description: Temperature requirements for goods being shipped
        required: false
      Package:
        type: Package[]
        description: List of packages being shipped
      CustomsDetails:
        type: CustomsDetails[]
        description: List of Customs Details for goods being shipped
        required: false
      DangerousGoods:
        type: object[] #GoodsItemDangerousGoods[]
        description: Information about dangerousgoods being shipped
        required: false
      PackingDetails:
        type: PackingDetails[]
        description: List of Package Details for goods being shipped
        required: false
  ReferenceTYPE:
    type: object
    properties:
      ReferenceValue:
        type: string
        description: Extra Reference
        example: 4440/0189981/WEJ
      referenceType:
        type: string
        description: ReferenceType
        example: TRANSPORT_DOCUMENT_NUMBER
        enum:
        - DESPATCH_ADVICE_NUMBER (AAK)
        - TRANSPORT_DOCUMENT_NUMBER (AAS)
        - CUSTOMS_DECLARATION_NUMBER (ABT)
        - ACCOUNT_NUMBER (ADE)
        - PROJECT_NUMBER (AEP)
        - SECONDARY_CUSTOMS_REFERENCE (AFM)
        - TEMPORARY_IMPORTATION_DOCUMENT_NUMBER (AGM)
        - SENDERS_REFERENCE (AGO)
        - AIR_WAYBILL (AWB)
        - BILL_OF_LADING (BM)
        - BOOKING_REFERENCE (BN)
        - ROAD_CONSIGNMENT_NOTE (CMR)
        - SHIPMENT_REFERENCE (SRN)
        - TRANSPORT_INSTRUCTION (TIN)
        - GOODS_NUMBER (XC)
        - MESSAGE_SENDERS_IDENTITY (MS)
  FreeTextTYPE:
    type: object
    properties:
      Text:
        type: FreeTextTYPEText[]
        description: Sequence of freetext
      usageCode:
        type: string
        description: Typeof freetext
        example: PICKUP_INSTRUCTIONS
        enum:
        - PICKUP_INSTRUCTIONS (SIC)
        - DELIVERY_INSTRUCTIONS (DEL)
        - CARRIER_INSTRUCTIONS (SIC)
  ccWeight:
    type: object
    properties:
      unitCode:
        type: string
        description: Unitcode for weight
        example: KGM
        enum:
        - GRM
        - KGM
      Value:
        type: number
        description: Weight Value
        example: 2.33
  ccVolume:
    type: object
    properties:
      unitCode:
        type: string
        description: Unitcode for volume measurement
        example: DMQ
        enum:
        - DMQ
        - MTQ
      Value:
        type: number
        description: Value of the volume measurement
        example: 18.22
  DimensionsTYPE:
    type: object
    properties:
      Height:
        type: ccLength
        description: Height of package
      Length:
        type: ccLength
        description: Length of package
      Width:
        type: ccLength
        description: Width of package
  ExchangableEquipment:
    type: object
    properties:
      UnitType:
        type: string
        description: Type of exchangable equipment
        example: EFP
        enum:
        - EFP
      Value:
        type: number
        description: Quantity of exchangable equipments
        example: 3
  AddressTYPE:
    type: object
    properties:
      AddressLine:
        type: string[]
        description: Address lines. The first line will be mapped to primary address line
        example: "Kong Oscars gate 12", ""
      PostalCode:
        type: string
        description: Postal code for address
        example: "5122"
      City:
        type: string
        description: City for the posatl code
        example: Morvik
      StateOrRegion:
        type: string
        description: State or region, not in use in the nordic countries
        example: Washington DC
        required: false
      CountryCode:
        type: string
        description: Country code. Use valid country codes
        example: NO
  AdditionalService:
    type: object
    properties:
      AdditionalServiceCode:
        type: string
        description: The additional service code for the product
        example: EVARSLING
      ServiceRequirements:
        type: string[]
        description: Some AdditionalServiceCodes / valueadded service might require extra information
  DeliveryTermsLocation:
    type: object
    properties:
      City:
        type: string
        description: City where the deliveryterms are valid to or from
        example: Bergen
      CountryCode:
        type: string
        description: Country where the deliveryterms ar valid to or from
        example: NO
  CashOnDeliveryTransactionIdentifier:
    type: object
    properties:
      identifierType:
        type: string
        description: Type of cash on delivery
        example: PQ
        enum:
        - PQ
        - SS
      accountType:
        type: string
        description: Typeof account to receive payment
        example: Bank
        enum:
        - Bank
        - Bankgiro
        - Plus
        - Post
        - Iban
        - Other
      Value:
        type: string
        description: The value to identify where the money should be sent
        example: "1234.12.123456"
  ccAmount:
    type: object
    properties:
      currencyCode:
        type: string
        description: Currencycode, valid currency codes allowed
        example: NOK
  MonetaryAccount:
    type: object
    properties:
      AccountNumber:
        type: CashOnDeliveryMonetaryAccountNumber
        description: Account number to receive payment
      SwiftCode:
        type: string
        description: Swift code for international transfers
        example: DNBANOKK
      BankName:
        type: string
        description: Bank where account is created
        example: DNB
      AccountHolderName:
        type: string
        description: Name of the owner of the account
        example: Ola Nordmann
  GoodsItemTemperature:
    type: object
    properties:
      Transport:
        type: ccTempMeasure
        description: Temperature requirements during transport
      Storage:
        type: ccTempMeasure
        description: Temperature requirements for storage of goods
  CustomsDetails:
    type: object
    properties:
      Quantity:
        type: number
        description: Quantity of packages
        required: false
        format: float
      CountryOfOrigin:
        type: string
        description: Country of origin of the package
        required: false
      TariffLineAmount:
        type: TariffLineAmount
        description: Tariff Line Amount of the package
        required: false
      CustomsArticleNumber:
        type: string
        description: Customs Article Number of the package
        required: false
      GoodsDescription:
        type: string
        description: Goods Description of the package
        required: false
      NetWeight:
        type: number
        format: float
        description: Net weight of the package
        required: false
  DangerousGoods:
    type: object
    properties:
      UNDGInformation:
        type: DangerousGoodsUNDGInformation
        description: United nations dangerous goods information
        require: false
      Flashpoint:
        type: DangerousGoodsFlashpoint
        description: Flashpointinformation for dangerousgoods (when will the item become volatile?)
        require: false
      HazardClass:
        type: string
        description: Classification of hazard
        example: "4.1"
        required: false
      AdditionalHazard:
        type: string
        description: Additional codes for hazard
        example: "2.3(8)"
        required: false
      PackingGroup:
        type: string
        description: Packing danger level code, roman numeral between  1 and 3
        example: II
        required: false
      Measures:
        type: MeasuresTYPE[]
        description: Measures for Dangerous Goods
        required: false
      TechnicalName:
        type: string
        description: Technical name of hazard
        example: KALSIUMRESINAT, SINTRET
        required: false
      Restrictions:
        type: DangerousGoodsRestrictions[]
        description: Restrictions when carrying these hazardous goods
        required: false
      HazardPoints:
        type: integer
        description: Points for this hazard. Calculated from factor for dangerousgoods multiplied by amount in kg / dm3 for each material in cargo
        example: 10
        required: false
      regulatonCode:
        type: string
        description: Regulation codes for the hazardous goods
        example: ADR
        required: false
  PackingDetails:
    type: object
    properties:
      PositionNumber:
        type: integer
        description: Position number within Packing Details
        required: false
      ArticleNumber:
        type: string
        description: Articla details of Packing Details
        required: false
      ArticleDescription:
        type: string
        description: Artical description of Packing Details
        required: false
      ItemDelivered:
        type: number
        format: float
        description: Item Delivered within Packing Details
        required: false
      ArticlePrice:
        type: ArticlePrice
        description: Artical Price of the Packing Details
        required: false
      ItemOrdered:
        type: number
        format: float
        description: Item Ordered within the Packing Details
        required: false
      ItemBackOrder:
        type: number
        format: float
        description: Item Back Order within Packing Details
        required: false
      ItemUnity:
        type: string
        description: Item Unity within Packing Details
        required: false
  FreeTextTYPEText:
    type: object
    properties:
      sequence:
        type: string
        description: Order of freetext elements
        example: "0"
        required: false
      Value:
        type: string
        description: Actual freetext
        example: Call the contact before delivering item
  ccLength:
    type: object
    properties:
      unitCode:
      type: string
      description: Unit for the length
      example: CMT
      enum:
      - CMT
      - DMT
      - MTR
      required: false
      Value:
        type: number
        format: float
        description: The length
        example: 1.22
        required: false
  CashOnDeliveryMonetaryAccountNumber:
    type: object
    properties:
      accountType:
        type: string
        description: Type of account to receive payment on delivery
        enum:
        - Bank
        - Bankgiro
        - Plus
        - Post
        - Iban
        - Other
      Value:
        type: string
        description: Actual account number
        example: "4567.45.12345"
  ccTempMeasure:
    type: object
    properties:
      unitCode:
        type: string
        description: Unit code for temperature measure
        example: CEL
        enum:
        - CEL
        - FAH
      minimum:
        type: string
        description: Minimum allowed temperature
        example: "-8"
        required: false
      maximum:
        type: string
        description: Maximum allowed temperature
        example: "4"
        required: false
      Value:
        type: integer
        description: Specific temperature for transportation of the cargo
        example: 3
  TariffLineAmount:
    type: object
    properties:
      currencyCode:
        type: string
        description: Currency code of the tariff line
        required: false
      Value:
        type: number
        format: float
        description: Value of the tariff line
        required: false
  DangerousGoodsUNDGInformation:
    type: object
    properties:
      HazardIdentifier:
        type: string
        description: United nations dangerous goods hazard identifier
        example: "1.1D"
        required: false
      FlashpointDescription:
        type: string
        description: Flashpoint for dangerous goods
        example: BLACK POWDER, granulated or in powderform
        required: false
  DangerousGoodsFlashpoint:
    type: object
    properties:
      unitCode:
        type: string
        description: Unit code for flashpoint
        example: CEL
        required: false
        enum:
        - CEL
        - FAH
      Value:
        type: integer
        description: Value when flashpoint occurs/ignites
        example: 18
        required: false
  MeasuresTYPE:
    type: object
    properties:
      Measure:
        type: ccMeasure
        description: Measurements for goods
        required: false
      subClass:
        type: string
        example: NetHazardWeight
        required: false
  DangerousGoodsRestrictions:
    type: object
    properties:
      restrictionType:
        type: string
        description: Type of restriction
        example: Tunnel
        enum:
        - Tunnel
        required: false
      Value:
        type: string
        description: Freetext specification of restriction for given tunnel. One element for each UN number in the dangerousgoods sequence
        example: Ellingsøy- og Valderøytunnelen på riksveg 658 utenfor Ålesund. Her gjelder tunnelkategori C i tidsrommet kl. 0600–2400 hver dag
        required: false
  ArticlePrice:
    type: object
    properties:
      currencyCode:
        type: string
        description: Quantity of packages
        required: false
      Value:
        type: number
        format: float
        description: Value of packages
        required: false
  ccMeasure:
    type: object
    properties:
      unitCode:
        type: string
        description: Unit code for measure
        example: DMQ
        required: false
      Value:
        type: number
        format: float
        description: Measure value
        example: 1.22
        required: false
  CreateShipmentResponse:
    type: object
    properties:
      Status:
        type: string
        enum:
        - OK
        - OK_CONFIRMED
        - ERROR
        - VALIDATION_ERROR
        - FORBIDDEN
        required: false
      StatusText:
        type: string
        required: false
      Errors:
        type: CreateShipmentResponseErrors[]
        required: false
      Identities:
        type: CreateShipmentResponseIdentities[]
        required: false
      ProcessingID:
        type: string
        required: false
      EndpointProcessingID:
        type: string
        required: false
  CreateShipmentResponseErrors:
    type: object
    properties:
      Error:
        type: string
        description: Error type
        enum:
        - VALIDATION
        - SYSTEM
        - BAD_REQUEST
        required: false
      ErrorText:
        type: string
        required: false
  CreateShipmentResponseIdentities:
    type: object
    properties:
      PackageId:
        type: string[]
      ShipmentId:
        type: string

/sendshipment?shipmentId={createShipmentId}&packageIds={createPackageId}:
  displayName: Create shipment
  description: |
        Sends a shipment consisting of one consignment, that must include at least one package, from one sender to one receiver.

        The **ShipmentType** must be "**Instruction**" and must include a Shipment Header.

        A Senders reference must be included and must have a value.

        The LM Service Codes, in the Shipping Guide, must consist of valid codes (see [Unit Codes](/api/shipment/#unit-codes) below).

        A valid combination of an additional party, with party type **TransportCompany** and a valid Transport company code as the **partyId** value and an optional **subPartyId** and service, is required. In addition there might be several value added services that can be added. Please refer to [valid product codes/services and VASes](https://bapiqa.bring.com/Shipment/Documentation/GetServiceAndVAS?responseType=XML).

        If an included product requires an additional service, that additional service must be included.

        Value Added Service Codes may only feature once in any Shipment.

        The following Additional Services must be accompanied by the following additions
        - 1000 - must include a Cash on Delivery entry
        - 1036 - must include a SubClass of DeliveryParty entry
        - 1134 - Receiver.ContactName must have a value
        - 1142 - Receiver.ContactName and Receiver.MobilePhone must both have a value
        - 1150 - Receiver.Email must have a value
        - 1245 - must include a DangerousGoods entry

        Conversely
        |  |
        | -------------- |
        | When Cash on Delivery is specified, it must be a valid CashOnDelivery and an AdditionalService with value 1000 must be included |
        | When a Goods Item is specified, it must be valid GoodsItem |
        | When a DangerousGoods is specified, AdditionalService must be 1245 |
        | The ProductAndService specified must have a valid TariffReference |
        | The Sender specified must be a valid GeneralParty |
        | The Receiver specified, must be a valid GeneralParty |
        | When an AdditionalParty is specified, it must be a valid AdditionalParty and must include a subClass of TransportCompany |

        If requested through the query parameters, the service will create a shipment ID (for the whole shipment) in addition to package IDs for each package. The package IDs will be returned in the order of the packages (i.e. package 1 in the input will have package ID 1 in returned array).

        The structure and most of the content will be validated.

#  description: |
#      Request is used to either create, update or delete an instruction for Bring.

  uriParameters:
    createShipmentId:
      description: If "true" the API will assign a shipment ID for you and return it in the response.
      type: boolean
    createPackageId:
      description: If "true" the API will assign all package IDs for you and return them in the response.
      type: boolean

  post:
    description: Request is used to either create, update or delete an instruction for Bring.
    headers:
      Content-Type:
        description: Specify request format (application/json, application/xml)
        required: true
        enum: [ application/json,application/xml ]
      Accept:
        description: Specify response format (application/json, application/xml)
        required: true
        enum: [ application/json,application/xml ]
    body:
      application/xml:
        type: [CreateShipmentRequest, Shipment, ShipmentHeaders, DateAndTimes, Sender, Receiver, AdditionalParty, ProductAndService, DeliveryTerms, CashOnDelivery, GoodsItem, MonetaryAccount, DangerousGoods]
        examples:
          valid_request:
            displayName: Valid Request
            value: !include examples/basic_example.xml
          express_courier:
            displayName: Bring Express Courier
            value: !include examples/basic_example.xml
            description: Sample request to book a Bring Express Courier shipment.
      application/json:
        type: [CreateShipmentRequest, Shipment, ShipmentHeaders, DateAndTimes, Sender, Receiver, AdditionalParty, ProductAndService, DeliveryTerms, CashOnDelivery, GoodsItem, MonetaryAccount, DangerousGoods]
        examples:
          valid_request:
            displayName: Valid Request
            value: !include examples/basic_example.json
          express_courier:
            displayName: Bring Express Courier
            value: !include examples/basic_example.json
            description: Sample request to book a Bring Express Courier shipment.
    responses:
      200:
        description: |
          Returns a confirmation of successful delivery and package IDs / shipment IDs if requested.
        body:
          application/xml:
            type: CreateShipmentResponse
            examples:
              valid_shipment:
                displayName: Valid Shipment Response
                value: !include examples/valid_shipment_response.xml
          application/json:
            type: CreateShipmentResponse
            examples:
              valid_shipment:
                displayName: Valid Shipment Response
                value: !include examples/valid_shipment_response.json
      400:
        displayName: Error
        description: |
          Error in validation of request or error in data structure of request.

      417:
        displayName: Error
        description: |
          Missing authentication headers.

      500:
        displayName: Error
        description: |
          Unknown error. Error sending data to destination.

/sendbooking?shipmentId={createShipmentId}&packageIds={createPackageId}:
  displayName: Create shipment booking
  description: |
        Sends a booking request consisting of a Shipment with a Goods Item attached. The Goods Item must contain a Package.

        A consignment value must not be included as this would imply that the shipment itself, was to be created.

#  description: |
#      Request is used to either create, update or delete an instruction for Bring.

  uriParameters:
    createShipmentId:
      description: If "true" the API will assign a shipment ID for you and return it in the response.
      type: boolean
    createPackageId:
      description: If "true" the API will assign all package IDs for you and return them in the response.
      type: boolean

  post:
    description: Request is used to either create, update or delete an instruction for Bring.
    headers:
          Content-Type:
            description: Specify request format (application/json, application/xml)
            required: true
            enum: [ application/json,application/xml ]
          Accept:
            description: Specify response format (application/json, application/xml)
            required: true
            enum: [ application/json,application/xml ]
    body:
      application/xml:
        examples:
          valid_request:
            displayName: Valid Request
            value: !include examples/basic_example_booking.xml
        type:
      application/json:
        examples:
          valid_request:
            displayName: Valid Request
            value: !include examples/basic_example_booking.json
        type:
    responses:
      200:
        displayName: Success
        description: |
          Returns a confirmation of successful delivery and package IDs / shipment IDs if requested.

      400:
        displayName: Error
        description: |
          Error in validation of request or error in data structure of request.

      417:
        displayName: Error
        description: |
          Missing authentication headers.

      500:
        displayName: Error
        description: |
          Unknown error. Error sending data to destination.