Updated update method in raml

Updated update method in raml

#%RAML 0.8
title: phonebook
version: 1.0.0
baseUri: http://example.com/api
protocols: [ HTTP ]
securitySchemes:
  - userKey:
      description: User Key for API authentication
      type: x-user-key
      describedBy:
        queryParameters:
          Authorization:
            type: string
schemas:
  - phonebookEntries-xml: |
        <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
        <xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">

          <xs:element name="phonebookEntries" type="phonebookEntries"/>

          <xs:element name="phonebookEntry" type="phonebookEntry"/>

          <xs:complexType name="phonebookEntries">
            <xs:sequence>
              <xs:element name="entries" type="phonebookEntry" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
          </xs:complexType>

          <xs:complexType name="phonebookEntry">
            <xs:sequence>
              <xs:element name="id" type="xs:long"/>
              <xs:element name="title" type="xs:string" minOccurs="0"/>
              <xs:element name="firstName" type="xs:string" minOccurs="0"/>
              <xs:element name="lastName" type="xs:string" minOccurs="0"/>
              <xs:element name="phoneNumber" type="xs:string" minOccurs="0"/>
            </xs:sequence>
          </xs:complexType>
        </xs:schema>
  - phonebookEntries: |
        {
          "$schema" : "http://json-schema.org/draft-03/schema" ,
          "type" : "object" ,
          "required" : true ,
          "properties" : {
            "entries" : {
              "type" : "array" ,
              "required" : false ,
              "items" : [
                {
                  "required" : false ,
                  "type" : "object" ,
                  "properties" : {
                    "id" : {
                      "required" : false ,
                      "type" : "number"
                    } ,
                    "title" : {
                      "required" : false ,
                      "type" : "string"
                    } ,
                    "firstName" : {
                      "required" : false ,
                      "type" : "string"
                    } ,
                    "lastName" : {
                      "required" : false ,
                      "type" : "string"
                    } ,
                    "phoneNumber" : {
                      "required" : false ,
                      "type" : "string"
                    }
                  }
                }
              ]
            }
          }
        }
  - phonebookEntry-xml: |
        <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
        <xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">

          <xs:element name="phonebookEntry" type="phonebookEntry"/>

          <xs:complexType name="phonebookEntry">
            <xs:sequence>
              <xs:element name="id" type="xs:long"/>
              <xs:element name="title" type="xs:string" minOccurs="0"/>
              <xs:element name="firstName" type="xs:string" minOccurs="0"/>
              <xs:element name="lastName" type="xs:string" minOccurs="0"/>
              <xs:element name="phoneNumber" type="xs:string" minOccurs="0"/>
            </xs:sequence>
          </xs:complexType>
        </xs:schema>
  - phonebookEntry: |
        {
          "$schema" : "http://json-schema.org/draft-03/schema" ,
          "type" : "object" ,
          "required" : true ,
          "properties" : {
            "id" : {
              "required" : false ,
              "type" : "number"
            } ,
            "title" : {
              "required" : false ,
              "type" : "string"
            } ,
            "firstName" : {
              "required" : false ,
              "type" : "string"
            } ,
            "lastName" : {
              "required" : false ,
              "type" : "string"
            } ,
            "phoneNumber" : {
              "required" : false ,
              "type" : "string"
            }
          }
        }
  - userEntry-xml: |
        <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
        <xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">

          <xs:element name="userEntry" type="userEntry"/>

          <xs:complexType name="userEntry">
            <xs:sequence>
              <xs:element name="userkey" type="xs:string" minOccurs="0"/>
            </xs:sequence>
          </xs:complexType>
        </xs:schema>
  - userEntry: |
        {
          "$schema" : "http://json-schema.org/draft-03/schema" ,
          "type" : "object" ,
          "required" : true ,
          "properties" : {
            "userkey" : {
              "required" : false ,
              "type" : "string"
            }
          }
        }
/phonebook:
  post:
    description: Adds entry to phonebook
    displayName: create
    securedBy: [userKey]
    queryParameters:
    body:
      application/json:
        schema: phonebookEntry
        example: |
          {
            "id" : 123 ,
            "title" : "str1234" ,
            "firstName" : "str1234" ,
            "lastName" : "str1234" ,
            "phoneNumber" : "str1234"
          }
    responses:
      201:
        description: Created successfully
      401:
        description: User not authorized
  get:
    description: Returns list of entries matching the query
    displayName: queryPhonebook
    securedBy: [userKey]
    queryParameters:
      title:
      firstname:
      lastname:
    responses:
      200:
        description: OK
        body:
          application/json:
            schema: phonebookEntries
            example: |
              {
                "entries" : [
                  {
                    "id" : 123 ,
                    "title" : "str1234" ,
                    "firstName" : "str1234" ,
                    "lastName" : "str1234" ,
                    "phoneNumber" : "str1234"
                  } , {
                    "id" : 123 ,
                    "title" : "str1234" ,
                    "firstName" : "str1234" ,
                    "lastName" : "str1234" ,
                    "phoneNumber" : "str1234"
                  }
                ]
              }
      401:
        description: User not authorized
  /{id}:
    get:
      description: Returns entry with provided ID
      displayName: getEntry
      securedBy: [userKey]
      queryParameters:
      responses:
        200:
          description: OK
          body:
            application/json:
              schema: phonebookEntries
              example: |
                {
                  "entries" : [
                    {
                      "id" : 123 ,
                      "title" : "str1234" ,
                      "firstName" : "str1234" ,
                      "lastName" : "str1234" ,
                      "phoneNumber" : "str1234"
                    } , {
                      "id" : 123 ,
                      "title" : "str1234" ,
                      "firstName" : "str1234" ,
                      "lastName" : "str1234" ,
                      "phoneNumber" : "str1234"
                    }
                  ]
                }
        401:
          description: User not authorized
        404:
          description: Entry not found for given ID
    put:
      description: Updates an existing entry in the phonebook
      displayName: update
      securedBy: [userKey]
      queryParameters:
      body:
        application/json:
          schema: phonebookEntry
          example: |
            {
              "id" : 123 ,
              "title" : "str1234" ,
              "firstName" : "str1234" ,
              "lastName" : "str1234" ,
              "phoneNumber" : "str1234"
            }
      responses:
        401:
          description: User not authorized
        200:
          description: OK
          body:
            application/json:
              schema: phonebookEntry
              example: |
                {
                  "id" : 123 ,
                  "title" : "str1234" ,
                  "firstName" : "str1234" ,
                  "lastName" : "str1234" ,
                  "phoneNumber" : "str1234"
                }
        404:
          description: Entry not found for given ID
    delete:
      description: Deletes an existing entry from the phonebook
      displayName: deleteEntry
      securedBy: [userKey]
      queryParameters:
      responses:
        401:
          description: User not authorized
        204:
          description: OK
        404:
          description: Entry not found for given ID
/user:
  post:
    description: Creates new user entry
    displayName: createUser

    responses:
      201:
        description: User created successfully
        body:
          application/json:
            schema: userEntry

#%RAML 0.8
title: phonebook
version: 1.0.0
baseUri: http://example.com/api
protocols: [ HTTP ]
securitySchemes:
  - userKey:
      description: User Key for API authentication
      type: x-user-key
      describedBy:
        queryParameters:
          Authorization:
            type: string
schemas:
  - phonebookEntries-xml: |
        <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
        <xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">

          <xs:element name="phonebookEntries" type="phonebookEntries"/>

          <xs:element name="phonebookEntry" type="phonebookEntry"/>

          <xs:complexType name="phonebookEntries">
            <xs:sequence>
              <xs:element name="entries" type="phonebookEntry" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
          </xs:complexType>

          <xs:complexType name="phonebookEntry">
            <xs:sequence>
              <xs:element name="id" type="xs:long"/>
              <xs:element name="title" type="xs:string" minOccurs="0"/>
              <xs:element name="firstName" type="xs:string" minOccurs="0"/>
              <xs:element name="lastName" type="xs:string" minOccurs="0"/>
              <xs:element name="phoneNumber" type="xs:string" minOccurs="0"/>
            </xs:sequence>
          </xs:complexType>
        </xs:schema>
  - phonebookEntries: |
        {
          "$schema" : "http://json-schema.org/draft-03/schema" ,
          "type" : "object" ,
          "required" : true ,
          "properties" : {
            "entries" : {
              "type" : "array" ,
              "required" : false ,
              "items" : [
                {
                  "required" : false ,
                  "type" : "object" ,
                  "properties" : {
                    "id" : {
                      "required" : false ,
                      "type" : "number"
                    } ,
                    "title" : {
                      "required" : false ,
                      "type" : "string"
                    } ,
                    "firstName" : {
                      "required" : false ,
                      "type" : "string"
                    } ,
                    "lastName" : {
                      "required" : false ,
                      "type" : "string"
                    } ,
                    "phoneNumber" : {
                      "required" : false ,
                      "type" : "string"
                    }
                  }
                }
              ]
            }
          }
        }
  - phonebookEntry-xml: |
        <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
        <xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">

          <xs:element name="phonebookEntry" type="phonebookEntry"/>

          <xs:complexType name="phonebookEntry">
            <xs:sequence>
              <xs:element name="id" type="xs:long"/>
              <xs:element name="title" type="xs:string" minOccurs="0"/>
              <xs:element name="firstName" type="xs:string" minOccurs="0"/>
              <xs:element name="lastName" type="xs:string" minOccurs="0"/>
              <xs:element name="phoneNumber" type="xs:string" minOccurs="0"/>
            </xs:sequence>
          </xs:complexType>
        </xs:schema>
  - phonebookEntry: |
        {
          "$schema" : "http://json-schema.org/draft-03/schema" ,
          "type" : "object" ,
          "required" : true ,
          "properties" : {
            "id" : {
              "required" : false ,
              "type" : "number"
            } ,
            "title" : {
              "required" : false ,
              "type" : "string"
            } ,
            "firstName" : {
              "required" : false ,
              "type" : "string"
            } ,
            "lastName" : {
              "required" : false ,
              "type" : "string"
            } ,
            "phoneNumber" : {
              "required" : false ,
              "type" : "string"
            }
          }
        }
  - userEntry-xml: |
        <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
        <xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">

          <xs:element name="userEntry" type="userEntry"/>

          <xs:complexType name="userEntry">
            <xs:sequence>
              <xs:element name="userkey" type="xs:string" minOccurs="0"/>
            </xs:sequence>
          </xs:complexType>
        </xs:schema>
  - userEntry: |
        {
          "$schema" : "http://json-schema.org/draft-03/schema" ,
          "type" : "object" ,
          "required" : true ,
          "properties" : {
            "userkey" : {
              "required" : false ,
              "type" : "string"
            }
          }
        }
/phonebook:
  post:
    description: Adds entry to phonebook
    displayName: create
    securedBy: [userKey]
    queryParameters:
    body:
      application/json:
        schema: phonebookEntry
        example: |
          {
            "id" : 123 ,
            "title" : "str1234" ,
            "firstName" : "str1234" ,
            "lastName" : "str1234" ,
            "phoneNumber" : "str1234"
          }
    responses:
      201:
        description: Created successfully
      401:
        description: User not authorized
  get:
    description: Returns list of entries matching the query
    displayName: queryPhonebook
    securedBy: [userKey]
    queryParameters:
      title:
      firstname:
      lastname:
    responses:
      200:
        description: OK
        body:
          application/json:
            schema: phonebookEntries
            example: |
              {
                "entries" : [
                  {
                    "id" : 123 ,
                    "title" : "str1234" ,
                    "firstName" : "str1234" ,
                    "lastName" : "str1234" ,
                    "phoneNumber" : "str1234"
                  } , {
                    "id" : 123 ,
                    "title" : "str1234" ,
                    "firstName" : "str1234" ,
                    "lastName" : "str1234" ,
                    "phoneNumber" : "str1234"
                  }
                ]
              }
      401:
        description: User not authorized
  /{id}:
    get:
      description: Returns entry with provided ID
      displayName: getEntry
      securedBy: [userKey]
      queryParameters:
      responses:
        200:
          description: OK
          body:
            application/json:
              schema: phonebookEntries
              example: |
                {
                  "entries" : [
                    {
                      "id" : 123 ,
                      "title" : "str1234" ,
                      "firstName" : "str1234" ,
                      "lastName" : "str1234" ,
                      "phoneNumber" : "str1234"
                    } , {
                      "id" : 123 ,
                      "title" : "str1234" ,
                      "firstName" : "str1234" ,
                      "lastName" : "str1234" ,
                      "phoneNumber" : "str1234"
                    }
                  ]
                }
        401:
          description: User not authorized
        404:
          description: Entry not found for given ID
    put:
      description: Updates an existing entry in the phonebook
      displayName: update
      securedBy: [userKey]
      queryParameters:
      body:
        application/json:
          schema: phonebookEntry
          example: |
            {
              "id" : 123 ,
              "title" : "str1234" ,
              "firstName" : "str1234" ,
              "lastName" : "str1234" ,
              "phoneNumber" : "str1234"
            }
      responses:
        401:
          description: User not authorized
        204:
          description: OK
        404:
          description: Entry not found for given ID
    delete:
      description: Deletes an existing entry from the phonebook
      displayName: deleteEntry
      securedBy: [userKey]
      queryParameters:
      responses:
        401:
          description: User not authorized
        204:
          description: OK
        404:
          description: Entry not found for given ID
/user:
  post:
    description: Creates new user entry
    displayName: createUser

    responses:
      201:
        description: User created successfully
        body:
          application/json:
            schema: userEntry


Align Warehousing header levels and order

#%RAML 0.8
---
title: Warehousing API
baseUri: https://api.bring.com/po/api/v1

documentation:
- title: Introduction
  content: |
    A typical usage pattern for an Warehousing customer type is to create an order in Order Management that will go to the correct warehouse for picking, packing and sending. Then follow up with creating a packing list from the warehouse with transport information. All steps can be followed in Mybring Order Management.

    Warehousing API has several interfaces (SOAP and XML/JSON). Choose the option that fits your needs best (see table below). The XML/JSON interface is the core interface with complete functionality.

    Please note that this API currently doesn't support json on all of its methods yet. Look in the example section to see which are supported.

- title: Versioning
  content: |
    Warehousing API makes an effort to always be backwards compatible regarding data format for requests and responses of the Web Service. To achieve this, a SchemaVersion element is used in the request, indicating which version the client is on and what data-format the client expects in the result.

    We make an effort not to return new elements in the response when an old schema version is specified. When changes in the schema are made, the SchemaVersion is incremented by one. The new schema is used at the same endpoint URL as before and uses the same namespace for its XML elements. A TraceMessage element (info message) in the response is added to inform the client that its schema should be updated. Old schema versions might in the future be unsupported.

    Regarding the XML API (not Web Services), an XML Schema is not used at all. Therefore, clients of the XML API are expected to handle new elements that appear. Nevertheless, the response will be backwards compatible in the sense that elements are not renamed or deleted.

- title: Authentication
  content: |
    The Warehousing API requires authentication for all its endpoints. See the [getting started guide on authentication](/api/#authentication) if you're not sure what this means.

    | Header | Example | Comment |
    |:-------|:--------|:--------|
    | `X-MyBring-API-Uid` | `john.doe@example.com` | Mybring login ID |
    | `X-MyBring-API-Key` | `1234abc-abcd-1234-5678-abcd1234abcd ` | Mybring login's API key |
    | `X-Bring-Client-URL` | `https://example.com/ ` | A URL that sort of identifies where you're using the APIs. |

    Those headers must be set for all endpoints documented below.

- title: SOAP
  content: |
    ### WSDL

    [https://api.bring.com/po/api/ws/purchaseorder-v1.wsdl](https://api.bring.com/po/api/ws/purchaseorder-v1.wsdl)

    [https://api.bring.com/po/api/ws/om-order-v1.wsdl](https://api.bring.com/po/api/ws/om-order-v1.wsdl)

- title: Error handling
  content: |
    When using the Warehousing API, errors or service unavailability can occur, although we do our utmost to prevent any downtime. Thus it is important to use timeouts and other error handling techniques when making requests to the service.

    How you handle errors depends on the nature of your application, but one strategy for handling such situations is by providing a failover if the shipping guide responds with an error or does not respond at all (timeout).

    See [the list of error codes](#list-error-codes) for hints on how to implement error handling.

/omorder:
  displayName: Send an order
  description: |
      Send an order to Warehousing system. There are different types of order supported in Warehousing system.

       - Order / SalesOrder (as an pickorder for Warehousing)
            - Warehousing functionality sends it to Warhousing system for picking and delivery.
       - PurchaseOrder (as an receiving order for Warehousing)
            - Warehousing functionality sends it to Warhousing system for receiving orderinfo.

  post:
    description: Send an order
    queryParameters:
      CreateOrderRequest version:
          description: Version of request, current 2.0.
          type: string
          required: true
          example: 2.0
      CreateOrderRequest messageFunction:
          description: Type of order.
"Order"
"SalesOrder (Not in use)"
"PurchaseOrder"
          type: string
          required: true
          example: Order
      CreateOrderRequest messageId:
          description: Unique id for this message.
          type: string
          required: true
          example: 3dcc8b71-2bf7-4574-813d-9295bd5db8c0
      MessageSender partyId:
          description: Customer Number which Bring has provided. It cannot be demo customer number. An 6 digits number.
          type: string
          required: true
          example: 999999
      MessageRecipient partyId:
          description: Receiving Bring system. Constant value. An GLN number for Warehousing. Always use 7080003388100.
          type: string
          required: true
          example: 7080003388100
      MessageDate:
          description: The date on which message is sent.
          type: dateTime
          required: true
          example: 22.01.2017 11:36:22
      OrderSet updateIndicator:
          description: Type of order data. Original, Update or Delete
          type: string
          required: true
          example: Original
      Order/orderId:
          description: Ordernumber.
          type: string
          required: true
          example: 101010
      Order/ExternalOrderType:
          description: Type of order.

 Order types
 220 = Standard order
 224 = Rush order
 Or other agreed by Warehouse.

PurchaseOrder types
 R = Return order
 S = Sampakk
          type: string
          required: false
          example:
For Order : 220
For PurchaseOrder : R
      Order/Reference:
          description: Set of references.
          type: sequence
          required: false
      Order/Reference referenceType:
          description: Type of reference coded. https://www.stylusstudio.com/edifact/D04A/1153.htm
ACD = Additional reference number
CU = Sellers reference
ON = Buyers reference
          type: String
          required: true
          example: CU
      Order/Reference ReferenceNo:
          description: Reference.
          type: String
          required: true
          example: 10003455TT
      Order/DateAndTimes Date & Time with subClass DocumentDate:
          description: The date on which order is booked.
          type: dateTime
          required: true
          example: Date 22.01.2017 Time 11:36:22
      Order/DateAndTimes Date & Time with subClass DeliveryDateRequested:
          description: The date on which order is requested delivered.
          type: dateTime
          required: true
          example: Date 22.01.2017 Time 11:36:22
      Order/TermsOfDelivery TODConditionCode:
          description: Ordernumber.
          type: dateTime
          required: false
          example: DDP
      TransportService BasicServiceCode:
          description: Optional for PurchaseOrder. Transport service for shipment to customer. http://developer.bring.com/api/services/
          type: String
          required: true
          example: SERVICEPAKKE
      TransportService AdditionalService AdditionalServiceCode:
          description: Optional for PurchaseOrder. Transport services for shipment to customer. http://developer.bring.com/api/services/
          type: String
          required: false
          example: EVARSLING
      TransportLeg TransportLegType:
          description: Optional for PurchaseOrder. TransportLegType id. Default value 30.
          type: String
          required: false
          example: 30
      TransportLeg ModeOfTransport:
          description: Optional for PurchaseOrder. Type of transport.
1 = Sea
2 = Train
3 = Road
4 = Air.
          type: String
          required: false
          example: 3
      Party/subClass OrderingParty:
          description: Details of sender. Must have Name, Street, City, CountryCode.
          required: true
      Party/subClass DeliveryParty:
          description: Details of recipient. Must have Name, Street, City, CountryCode.
          required: true
      Party/subClass Supplier:
          description: Required when sending purchaseorder.Details of supplier. Must have Name, Street, City, CountryCode if used.
          required: false
      Party/subClass PerformingUnit partyId:
          description: Warehouse id for order. Required if order to Warehousing system.

4033 = Stavanger (Norway)
5500 = Haugesund (Norway)
AES = Ålesund (Norway)
BERGER = Berger/Skedsmokorset (Norway)
BS02 = Kongshavn (Norway)
BS07 = Trollåsen (Norway)
BS17 = Bergen (Norway)
BS26 = Trondheim (Norway)
BS34 = Tromsø (Norway)
FI01 = Vantaa (Finland)
JKPG01 = Jönköping (Sweden)
NCD = Lierstrand (Norway)
          type: string
          required: true
          example: BERGER
      OrderLineSet:
          description: Set of order items.
          type: sequence
          required: true
      OrderItem/articleLineId:
          description: Unique line id for this order line. Counter that identify orderline.
          type: integer
          required: true
          example: (10) First line
(20) Second line
      OrderItem/ArticleId codeListAgencyIdentifier:
          description: Sets type of ArticleId.
"CustomerItemNo" = Your article number/id
"VendorItemNo" = Supplier article number/id
"EAN" = EAN article id
If not used ArticleId default is CustomerItemNo.
          type: string
          required: true
          example: CustomerItemNo
      OrderItem/ArticleId:
          description: Article number or id.
          type: sequence
          required: true
          example: 123-4000
      OrderItem/ArticleQuantity unitCode:
          description: Unit code for quantity ordered.
          type: string
          required: true
          example: STK
      OrderItem/ArticleQuantity:
          description: Quantity ordered.
          type: float
          required: true
          example: 2.0
      OrderItem/Description usageCode:
          description: Article description type. If description used set to AAA.
          type: string
          required: false
          example: AAA
      OrderItem/Description:
          description: Article description.
          type: string
          required: false
          example: Spear parts with all parts
      OrderItem/ArticleMonetaryAmounts :
          description: Article unit sales price.
          type: float
          required: false
          example: 230.30
      OrderItem/ArticleName:
          description: Article name.
          type: string
          required: false
          example: Spear parts

    body:
        application/xml:
          example: !include examples/create_order.xml
        application/json:
          example: !include examples/create_order.json
    responses:
      200:
        displayName: Success
        description: |
          Successfully created a order.

/omorder/{customerId}/{orderId}:
  displayName: List order information
  description: |
      Get all information on a given order.
  get:
    description: List order information
    responses:
      200:
        displayName: Success
        description: |
          Complete order information including order items.
        body:
          application/xml:
            example: !include examples/retrieve_order.xml
          application/json:
            example: !include examples/retrieve_order.json

/items/{customerId}/{orderId}:
  displayName: List order items
  description: |
      List all item lines on an order.
  get:
    description: List order items
    responses:
      200:
        displayName: Success
        description: |
          List of order items.
        body:
          application/xml:
            example: !include examples/retrieve_orderitems.xml
          application/json:
            example: !include examples/retrieve_orderitems.json

/articlebalance:
  displayName: Create or update article balance list
  post:
    description: Create or update article balance list
    body:
      application/xml:
        example: !include examples/create_articlebalance.xml
    responses:
      200:
        displayName: Success
        description: |
          Successfully created balance list

/articlebalance/{customerId}:
  displayName: Get stock balance and info for all articles
  get:
    description: Get stock balance and info for all articles
    responses:
      200:
        displayName: Success
        description: |
        body:
          application/xml:
            example: !include examples/retrieve_articlebalance_all.xml
          application/json:
            example: !include examples/retrieve_articlebalance_all.json

/articlebalance/{customerId}/{articleNo}:
  displayName: Get stock balance and info for one article
  get:
    description: Get stock balance and info for one article
    responses:
      200:
        displayName: Success
        description: |
        body:
          application/xml:
            example: !include examples/retrieve_articlebalance_one.xml
          application/json:
            example: !include examples/retrieve_articlebalance_one.json

/articlebalance/info/{customerId}/{articleSearchString}:
  displayName: Get stock balance and info for all articles matching search string
  get:
    description: Get stock balance and info for all articles matching search string
    responses:
      200:
        displayName: Success
        description: |
        body:
          application/xml:
            example: !include examples/retrieve_articlebalance_search.xml
          application/json:
            example: !include examples/retrieve_articlebalance_search.json

/errorCodes:
  displayName: List error codes
  get:
    description: List error codes
    responses:
      200:
        displayName: Success
        description: |
          Dynamic list of error codes used in the solution.
        body:
          application/xml:
            example: !include examples/error_codes.xml
          application/json:
            example: !include examples/error_codes.json

#%RAML 0.8
---
title: Warehousing API
baseUri: https://api.bring.com/po/api/v1

documentation:
- title: Introduction
  content: |
    A typical usage pattern for an Warehousing customer type is to create an order in Order Management that will go to the correct warehouse for picking, packing and sending. Then follow up with creating a packing list from the warehouse with transport information. All steps can be followed in Mybring Order Management.

    Warehousing API has several interfaces (SOAP and XML/JSON). Choose the option that fits your needs best (see table below). The XML/JSON interface is the core interface with complete functionality.

    Please note that this API currently doesn't support json on all of its methods yet. Look in the example section to see which are supported.

    ## SOAP

    ### Versioning

    Warehousing API makes an effort to always be backwards compatible regarding data format for requests and responses of the Web Service. To achieve this, a SchemaVersion element is used in the request, indicating which version the client is on and what data-format the client expects in the result.

    We make an effort not to return new elements in the response when an old schema version is specified. When changes in the schema are made, the SchemaVersion is incremented by one. The new schema is used at the same endpoint URL as before and uses the same namespace for its XML elements. A TraceMessage element (info message) in the response is added to inform the client that its schema should be updated. Old schema versions might in the future be unsupported.

    Regarding the XML API (not Web Services), an XML Schema is not used at all. Therefore, clients of the XML API are expected to handle new elements that appear. Nevertheless, the response will be backwards compatible in the sense that elements are not renamed or deleted.

    ### WSDL

    [https://api.bring.com/po/api/ws/purchaseorder-v1.wsdl](https://api.bring.com/po/api/ws/purchaseorder-v1.wsdl)

    [https://api.bring.com/po/api/ws/om-order-v1.wsdl](https://api.bring.com/po/api/ws/om-order-v1.wsdl)

    ## Error handling

    When using the Warehousing API, errors or service unavailability can occur, although we do our utmost to prevent any downtime. Thus it is important to use timeouts and other error handling techniques when making requests to the service.

    How you handle errors depends on the nature of your application, but one strategy for handling such situations is by providing a failover if the shipping guide responds with an error or does not respond at all (timeout).

    See [the list of error codes](#list-error-codes) for hints on how to implement error handling.

- title: Authentication
  content: |
    The Warehousing API requires authentication for all its endpoints. See the [getting started guide on authentication](/api/#authentication) if you're not sure what this means.

    | Header | Example | Comment |
    |:-------|:--------|:--------|
    | `X-MyBring-API-Uid` | `john.doe@example.com` | Mybring login ID |
    | `X-MyBring-API-Key` | `1234abc-abcd-1234-5678-abcd1234abcd ` | Mybring login's API key |
    | `X-Bring-Client-URL` | `https://example.com/ ` | A URL that sort of identifies where you're using the APIs. |

    Those headers must be set for all endpoints documented below.

/omorder:
  displayName: Send an order
  description: |
      Send an order to Warehousing system. There are different types of order supported in Warehousing system.

       - Order / SalesOrder (as an pickorder for Warehousing)
            - Warehousing functionality sends it to Warhousing system for picking and delivery.
       - PurchaseOrder (as an receiving order for Warehousing)
            - Warehousing functionality sends it to Warhousing system for receiving orderinfo.

  post:
    description: Send an order
    queryParameters:
      CreateOrderRequest version:
          description: Version of request, current 2.0.
          type: string
          required: true
          example: 2.0
      CreateOrderRequest messageFunction:
          description: Type of order.
"Order"
"SalesOrder (Not in use)"
"PurchaseOrder"
          type: string
          required: true
          example: Order
      CreateOrderRequest messageId:
          description: Unique id for this message.
          type: string
          required: true
          example: 3dcc8b71-2bf7-4574-813d-9295bd5db8c0
      MessageSender partyId:
          description: Customer Number which Bring has provided. It cannot be demo customer number. An 6 digits number.
          type: string
          required: true
          example: 999999
      MessageRecipient partyId:
          description: Receiving Bring system. Constant value. An GLN number for Warehousing. Always use 7080003388100.
          type: string
          required: true
          example: 7080003388100
      MessageDate:
          description: The date on which message is sent.
          type: dateTime
          required: true
          example: 22.01.2017 11:36:22
      OrderSet updateIndicator:
          description: Type of order data. Original, Update or Delete
          type: string
          required: true
          example: Original
      Order/orderId:
          description: Ordernumber.
          type: string
          required: true
          example: 101010
      Order/ExternalOrderType:
          description: Type of order.

 Order types
 220 = Standard order
 224 = Rush order
 Or other agreed by Warehouse.

PurchaseOrder types
 R = Return order
 S = Sampakk
          type: string
          required: false
          example:
For Order : 220
For PurchaseOrder : R
      Order/Reference:
          description: Set of references.
          type: sequence
          required: false
      Order/Reference referenceType:
          description: Type of reference coded. https://www.stylusstudio.com/edifact/D04A/1153.htm
ACD = Additional reference number
CU = Sellers reference
ON = Buyers reference
          type: String
          required: true
          example: CU
      Order/Reference ReferenceNo:
          description: Reference.
          type: String
          required: true
          example: 10003455TT
      Order/DateAndTimes Date & Time with subClass DocumentDate:
          description: The date on which order is booked.
          type: dateTime
          required: true
          example: Date 22.01.2017 Time 11:36:22
      Order/DateAndTimes Date & Time with subClass DeliveryDateRequested:
          description: The date on which order is requested delivered.
          type: dateTime
          required: true
          example: Date 22.01.2017 Time 11:36:22
      Order/TermsOfDelivery TODConditionCode:
          description: Ordernumber.
          type: dateTime
          required: false
          example: DDP
      TransportService BasicServiceCode:
          description: Optional for PurchaseOrder. Transport service for shipment to customer. http://developer.bring.com/api/services/
          type: String
          required: true
          example: SERVICEPAKKE
      TransportService AdditionalService AdditionalServiceCode:
          description: Optional for PurchaseOrder. Transport services for shipment to customer. http://developer.bring.com/api/services/
          type: String
          required: false
          example: EVARSLING
      TransportLeg TransportLegType:
          description: Optional for PurchaseOrder. TransportLegType id. Default value 30.
          type: String
          required: false
          example: 30
      TransportLeg ModeOfTransport:
          description: Optional for PurchaseOrder. Type of transport.
1 = Sea
2 = Train
3 = Road
4 = Air.
          type: String
          required: false
          example: 3
      Party/subClass OrderingParty:
          description: Details of sender. Must have Name, Street, City, CountryCode.
          required: true
      Party/subClass DeliveryParty:
          description: Details of recipient. Must have Name, Street, City, CountryCode.
          required: true
      Party/subClass Supplier:
          description: Required when sending purchaseorder.Details of supplier. Must have Name, Street, City, CountryCode if used.
          required: false
      Party/subClass PerformingUnit partyId:
          description: Warehouse id for order. Required if order to Warehousing system.

4033 = Stavanger (Norway)
5500 = Haugesund (Norway)
AES = Ålesund (Norway)
BERGER = Berger/Skedsmokorset (Norway)
BS02 = Kongshavn (Norway)
BS07 = Trollåsen (Norway)
BS17 = Bergen (Norway)
BS26 = Trondheim (Norway)
BS34 = Tromsø (Norway)
FI01 = Vantaa (Finland)
JKPG01 = Jönköping (Sweden)
NCD = Lierstrand (Norway)
          type: string
          required: true
          example: BERGER
      OrderLineSet:
          description: Set of order items.
          type: sequence
          required: true
      OrderItem/articleLineId:
          description: Unique line id for this order line. Counter that identify orderline.
          type: integer
          required: true
          example: (10) First line
(20) Second line
      OrderItem/ArticleId codeListAgencyIdentifier:
          description: Sets type of ArticleId.
"CustomerItemNo" = Your article number/id
"VendorItemNo" = Supplier article number/id
"EAN" = EAN article id
If not used ArticleId default is CustomerItemNo.
          type: string
          required: true
          example: CustomerItemNo
      OrderItem/ArticleId:
          description: Article number or id.
          type: sequence
          required: true
          example: 123-4000
      OrderItem/ArticleQuantity unitCode:
          description: Unit code for quantity ordered.
          type: string
          required: true
          example: STK
      OrderItem/ArticleQuantity:
          description: Quantity ordered.
          type: float
          required: true
          example: 2.0
      OrderItem/Description usageCode:
          description: Article description type. If description used set to AAA.
          type: string
          required: false
          example: AAA
      OrderItem/Description:
          description: Article description.
          type: string
          required: false
          example: Spear parts with all parts
      OrderItem/ArticleMonetaryAmounts :
          description: Article unit sales price.
          type: float
          required: false
          example: 230.30
      OrderItem/ArticleName:
          description: Article name.
          type: string
          required: false
          example: Spear parts

    body:
        application/xml:
          example: !include examples/create_order.xml
        application/json:
          example: !include examples/create_order.json
    responses:
      200:
        displayName: Success
        description: |
          Successfully created a order.

/omorder/{customerId}/{orderId}:
  displayName: List order information
  description: |
      Get all information on a given order.
  get:
    description: List order information
    responses:
      200:
        displayName: Success
        description: |
          Complete order information including order items.
        body:
          application/xml:
            example: !include examples/retrieve_order.xml
          application/json:
            example: !include examples/retrieve_order.json

/items/{customerId}/{orderId}:
  displayName: List order items
  description: |
      List all item lines on an order.
  get:
    description: List order items
    responses:
      200:
        displayName: Success
        description: |
          List of order items.
        body:
          application/xml:
            example: !include examples/retrieve_orderitems.xml
          application/json:
            example: !include examples/retrieve_orderitems.json

/articlebalance:
  displayName: Create or update article balance list
  post:
    description: Create or update article balance list
    body:
      application/xml:
        example: !include examples/create_articlebalance.xml
    responses:
      200:
        displayName: Success
        description: |
          Successfully created balance list

/articlebalance/{customerId}:
  displayName: Get stock balance and info for all articles
  get:
    description: Get stock balance and info for all articles
    responses:
      200:
        displayName: Success
        description: |
        body:
          application/xml:
            example: !include examples/retrieve_articlebalance_all.xml
          application/json:
            example: !include examples/retrieve_articlebalance_all.json

/articlebalance/{customerId}/{articleNo}:
  displayName: Get stock balance and info for one article
  get:
    description: Get stock balance and info for one article
    responses:
      200:
        displayName: Success
        description: |
        body:
          application/xml:
            example: !include examples/retrieve_articlebalance_one.xml
          application/json:
            example: !include examples/retrieve_articlebalance_one.json

/articlebalance/info/{customerId}/{articleSearchString}:
  displayName: Get stock balance and info for all articles matching search string
  get:
    description: Get stock balance and info for all articles matching search string
    responses:
      200:
        displayName: Success
        description: |
        body:
          application/xml:
            example: !include examples/retrieve_articlebalance_search.xml
          application/json:
            example: !include examples/retrieve_articlebalance_search.json

/errorCodes:
  displayName: List error codes
  get:
    description: List error codes
    responses:
      200:
        displayName: Success
        description: |
          Dynamic list of error codes used in the solution.
        body:
          application/xml:
            example: !include examples/error_codes.xml
          application/json:
            example: !include examples/error_codes.json