Mybring-events-cast context path update

Mybring-events-cast context path update

#%RAML 1.0
---
title: Tracking Webhook API
version: v1
baseUri: https://api.bring.com/event-cast
mediaType: application/json
annotationTypes:
  hideInDocumentation: boolean
  hideRequired: boolean
types:
  WebhookRequest:
    type: object
    properties:
      trackingId:
        type: string
        required: true
      event_groups:
        type: string
        required: true
      configuration:
        type: Configuration
        required: true
  WebhookBatchRequest:
      type: object
      properties:
        trackingIds:
          type: string[]
          required: true
        event_groups:
          type: string
          required: true
        configuration:
          type: Configuration
          required: true
  Webhook:
    type: object
    properties:
      id:
        type: string
        required: false
        description: Represents an unique identifiaction
      authenticator:
        type: string
        required: false
        description: Represents your authentication identification
      trackingId:
        type: string
        required: true
      event_groups:
        type: string
        required: true
        description: Represents the group(s) that is part of this Webhook
      expiry:
        type: datetime
        required: false
        description: TimeZone is set to UTC. Use this format to parse the instant; `yyyy-MM-dd'T'HH:mm:ssZ`
      created:
        type: datetime
        required: false
        description: TimeZone is set to UTC. Use this format to parse the instant; `yyyy-MM-dd'T'HH:mm:ssZ`
      configuration:
        type: Configuration
        required: true
  Configuration:
    type: object
    properties:
      url:
        type: string
        required: true
      content_type:
        type: string
        required: false
      headers:
        type: ConfigurationHeader[]
        required: false
  ConfigurationHeader:
    type: object
    properties:
      key:
        type: string
        required: true
      value:
        type: string
        required: true
        description: This value will not be available in any response
  ErrorResponse:
    type: object
    properties:
      uuid:
        type: string
        description: This represents an unique identifier for the failing request. Can be used whilst contacting Bring
      status:
        type: string
        description: Represents a 3/4 digit code that can be used to identify the problem
      reason:
        type: string
        required: false
        description: Can contain some hints on what went wrong during the request

documentation:
- title: Introduction
  content: |

    #### Webohook Definition
    > A Webhook in web development is a method of augmenting or altering the behaviour of a web page, or web application, with custom callbacks.
    > These callbacks may be maintained, modified, and managed by third-party users and developers who may not necessarily be affiliated with the originating website or application.

    #### Webhooks in Bring
    In the context of Bring, Webhooks allows you to get notifications for the subscribed parcels and/or shipments.

    In essence, this means that whenever an event is registered in Bring for a subscribed parcel and/or shipment,
    we'll send a HTTP POST to your callback URL that were defined during the Webhook registration.

    Using Webhooks is quite simple, and allows for immediate feedback based on the event that occured for the subscribed entity.
    Additionally, it allows integrations of customers to become simpler, as no scheduled mechanism is required to be implemented.
    You basically just define an endpoint that accepts HTTP POST, and the event details will be sent there - quite amazing 🙌
- title: Authentication
  content: |
    In order to use the API, you will need to register with Mybring and create an API key. Whenever issuing a request, the following headers is required to be present.

    | Header | Example | Comment | Required |
    |:-------|:--------|:--------|
    | `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 you | |

    **Note:** See the [getting started guide on authentication](/api/#authentication) if you want to know more about how to get started with authentication for APIs in Mybring.
- title: API limitations
  content: |
    There is some known/deliberate limitations for the API:

    | Resource | Limitation description |
    |:--------|:---------|
    | All requests | The Webhook API allows a maximum of **50 concurrent requests** per user |
    | Batch creation | Whilst creating requests for Webhooks is a feature we encurage to use, its maximum amount of parcels and/or shipments is limited to **100 per request**. If you have more than 100 at the time, split to mulitple requests using the batch-API |
    | Webhook testing | The `/api/v1/Webhooks/{WebhookId}/test`-api allows a maximum of **10 concurrent requests** per user |
- title: Events
  content: |
    When registering for a Webhook you can choose between a range of different event groups that you can subscribe for.
    It is recommended to limit the amount of events to subscribe for. Bring will send an event on each of the events occurred which in result may send quite a few HTTP-requests to your server.
    So, as a good practise, keep the list of event groups as small as possible.

    Each of the event groups corresponds to a certain set of actions that can happen to the package/shipment you subscribe for. For instance, if you subscribe to `DELIVERED`, all internal Bring-events
    will trigger a request to your defined callback URL.

    #### Event groups

    Default set of subscribeable event groups. Notice that this list is subject for change.

    | Event | Description |
    |:-------|:--------|
    | `ARRIVED_DELIVERY` | Arrived Delivery point - This is when a container arrives at recipients address, and can start unloading.
 |
    | `ARRIVED_COLLECTION` | Arrived for collection at pickup point |
    | `ATTEMPTED_DELIVERY` | The package has been attempted delivered at the door. Depending on the service it will be tried again or sent to closest pickup point. |
    | `CUSTOMS` | Package is in customs clearance. |
    | `COLLECTED` | The parcel has been collected at pickup address. |
    | `DELIVERED` | Package has been delivered. |
    | `DELIVERED_SENDER` | Package has been returned to the sender |
    | `DELIVERY_CANCELLED` | Home delivery has been canceled by the customer. |
    | `DELIVERY_CHANGED` | Date for Home delivery has been changed by customer. |
    | `DELIVERY_ORDERED` | Home delivery has been ordered |
    | `DEVIATION` | Deviation in production. Something wrong has happened and there is a probability for delay. |
    | `HANDED_IN` | Package has been handed in to Bring. |
    | `INTERNATIONAL` | Package has been sent from origin country or arrived at destination country.
 |
    | `IN_TRANSIT` | Package is in transit. |
    | `NOTIFICATION_SENT` | Notification for this package has been sent by sms, push and/or mail. This can be informational notifications and action notification like pickup notice. |
    | `PRE_NOTIFIED` | EDI message for the package has been received by Bring. |
    | `READY_FOR_PICKUP` | Package has arrived at pickup point. |
    | `RETURN` | The package has been returned to sender.
 |
    | `TRANSPORT_TO_RECIPIENT` | Package has been loaded for delivery to the recipient. |
    | `TERMINAL` | The package is now registered/arrived at inbound/outbound storage terminal |

    There is also a specific set of events that will be sent if something deviates from the normal event flow:

    | Event | Description |
    |:-------|:--------|
    | `NO_REG` | Webhook not registered. This might be due to the parcel-/shipment-number not being found with Bring' systems and can trigger after up to two - 2 - days |
    | `EXPIRED` | Webhook expired |

    #### Subscribing to multiple event groups

    The Webhook API supports the possibility to subscribe to multiple event groups at the same time.
    Doing so requires that groups are separated with comma and is defined as an array.
    Example:

    ```
    ['IN_TRANSIT', 'NOTIFICATION_SENT', 'TERMINAL', .., ..]
    ```

    Need more examples? See the "Create Webhook" section below.

- title: Receiving Callbacks
  content: |
    In order to receive requests from Bring, your callback URL must be accessible on the internet and able to receive requests from Bring IPs.
    Additionally, to minimize risk, you should also provide HTTPS-enabled endpoints and use some kind of authentication mechanism.
    For HTTPS, please do not use self-signed certificates, as requests may fail from Bring' side and you'll receive no requests.

    If you need a simple authentication whilst receiving requests from Bring, we recommend utilizing the header funcitonality provided by the Webhook configuration.

    All received callbacks from Bring will be using **UTC** as its current timezone and is based on the following format (Java):

    ```
    "yyyy-MM-dd'T'HH:mm:ssZ"
    ```

- title: Payload
  content: |

    #### Payload delivery headers

    `HTTP POST` payloads that are delivered to your Webhook's configured URL endpoint contains several Bring specific headers:

    | Header | Description |
    |:-------|:--------|
    | `X-Bring-Application` | Identifies the application that sent the request to your endpoint |
    | `X-bring-Correlation` | Correlation Id can be used whilst contacting Bring on error cases |
    | `X-bring-Version` | Indicates the version of application |
    | `<your headers>` | Any headers that were specified in the Webhook configuration will also be appended |

    #### Example

    Requests issued from Bring to your endpoint will look similar to this:

    ```
      POST /callback/Webhook HTTP/1.1
      host: localhost:80
      Accept: application/json
      User-Agent: Bringcast-Webhook/v1.0.34-SNAPSHOT
      X-Bring-Application: BMEC
      X-bring-Correlation: xA3n7
      X-some-fancy-custom-header: with-some-value-that-I-expect
      Content-Type: application/json
      Content-Length: 188

      {
        "status": "IN_TRANSIT",
        "id": "ad84cbca-2e89-43e0-a301-a8d5d7fe7804",
        "shipment": "SHIPMENTNUMBER",
        "package": "TESTPACKAGEDELIVERED",
        "created": "2019-03-16T14:58:48+0000",
        "pushed": "2019-03-16T14:58:49+0000"
      }
    ```
- title: Q & A
  content: |

    #### Can I have multiple Webhooks for the same parcel?
    You can register for multiple Webhooks on the same parcel/shipment, as long as the event groups are different for each registration.

    #### How many active Webhooks can I have simultaneously?
    Currently there is no limitation.

    #### Is the expiration duration configurable?
    No.

    #### Can I get a history of events that were sent for a subscription?
    Not in this version. It may be available in the future.

    #### Will I be able to see my previous/expired Webhooks (active and inactive)?
    No.

    #### What happens if our endpoint is down and a callback is being sent?
    We'll try issuing a request to your defined endpoint up to three - 3 - times with a delay on 30 minutes for the two first, then wait an hour for the last retry.
    After this, callbacks will not be retried.

    #### Do you support wildcard events/event groups (e.g `*` or `ALL`)?
    No.

    #### Do you support modifying existing active webhooks?
    No.

    #### My shipment is not yet registered with Bring, will registering for Webhook work related to that tracking number?
    Yes.

    When you subscribe for a parcel that does not yet exist in Bring' systems, a retry mechanism will try for up to two - 2 - days to ensure that the Webhook will be registered when the parcel is found internally.
    Eventually, if the package was not found with Bring within this timeframe - a notification will be sent on the callback URL configured for that Webhook which notifies this.

    **Note**: Retry-timing is non-configurable.

/api/v1/webhooks:
  displayName: Create Webhook
  description: |
    Create a new subscription for a Webhook.
    Webhooks lives for up to 30 days, or until the entity subscribed for is marked as "delivered by Bring".
  post:
    description: Register a new Webhook subscription for a parcel or shipment.
    body:
      application/json:
        type: WebhookRequest
        examples:
          valid_request:
            displayName: Valid Request
            value: !include examples/create-Webhook-request.json
    responses:
      201:
        description: Returns the registered Webhook after creation request.
        body:
          application/json:
            type: Webhook
            examples:
              reqister_Webhook:
                displayName: Registered Webhook
                value: !include examples/Webhook-request.json
      400:
        displayName: Bad request
        description: Unable to register Webhook due to some bad request from the client side.
        body:
          application/json:
            type: ErrorResponse
            examples:
              invalid_Webhook:
                displayName: Invalid creation request
                value: !include examples/create-Webhook-invalid.json
      401:
        displayName: Error
        description: Missing authentication headers
      409:
        displayName: Conflict
        description: Webhook of similar subscription already exists
      429:
        displayName: Too many requests
        description: This may happen due to client sending too many requests. Try again a bit later, or decrease amount of requests
      500:
        displayName: Internal Bring error
        description: If this happens, try again a bit later as it might be due to some internal mechanism not working
/batch/api/v1/webhooks:
  displayName: Create multiple Webhooks
  description: |
        Create a range of new Webhooks based on a list of any parcel or shipment.
        Webhooks lives for up to 30 days, or until the entity subscribed for is marked as "delivered by Bring".
  post:
    description: Register a new Webhook subscription for an array parcels and/or shipments
    body:
      application/json:
        type: WebhookBatchRequest
        examples:
          valid_request:
            displayName: Valid Request
            value: !include examples/batch-create-Webhook-request.json
    responses:
      201:
        description: |
          Returns the registered Webhook after creation request.
        body:
          application/json:
            type: Webhook
            examples:
              reqister_Webhook:
                displayName: Registered Webhook
                value: !include examples/batch-Webhook-request.json
      400:
        displayName: Bad request
        description: |
          Unable to register Webhook due to some bad request from the client side.
        body:
          application/json:
            type: ErrorResponse
            examples:
              invalid_Webhook:
                displayName: Invalid creation request
                value: !include examples/create-Webhook-invalid.json
      401:
        displayName: Error
        description: Missing authentication headers
      429:
        displayName: Too many requests
        description: This may happen due to client sending too many requests. Try again a bit later, or decrease amount of requests
      500:
        displayName: Internal Bring error
        description: If this happens, try again a bit later as it might be due to some internal mechanism not working
/api/v1/webhooks/{Webhookid}:
  displayName: Delete Webhook
  uriParameters:
    Webhookid:
      displayName: WebhookId
      type: string
      description: This represents the specific identifier of the Webhook
  delete:
    description: Remove an existing subscribed Webhook
    queryParameters:
      includeWebhook:
        description: If set to true, the deleted Webhook will be returned
        type: boolean
        required: false
        example: true
    responses:
      200:
        body:
          application/json:
            type: Webhook
            examples:
              get_Webhook:
                displayName: Registered Webhook
                value: !include examples/Webhook-request.json
      204:
        displayName: Webhook successfully removed
        description: Webhook unregistered and removed. No content supplied in response
      401:
        displayName: Error
        description: Missing authentication headers
      404:
        displayName: Error
        description: Webhook not found (not registered?)
/api/v1/webhooks/:
  displayName: Get all Webhooks
  get:
    description: Get all your current registered and active Webhooks. Pagination is currently not supported.
    responses:
      200:
        body:
          application/json:
            type: Webhook
            examples:
              get_Webhook:
                displayName: Registered Webhook
                value: !include examples/webhook-request-all.json
      400:
        displayName: Bad request
        description: Unable to register Webhook due to some bad request from the client side.
        body:
          application/json:
            type: ErrorResponse
            examples:
              invalid_request:
                displayName: Invalid creation request
                value: !include examples/create-Webhook-invalid.json
      401:
        displayName: Error
        description: Missing authentication headers.
      404:
        displayName: Error
        description: Webhook not found (not registered?)
/api/v1/webhooks/{WebhookId}:
  displayName: Get single Webhook
  uriParameters:
    WebhookId:
      displayName: WebhookId
      type: string
      description: This represents the specific identifier of the Webhook
  get:
    description: Get the specification that belongs to a registered Webhook
    responses:
      200:
        body:
          application/json:
            type: Webhook
            examples:
              get_Webhook:
                displayName: Registered Webhook
                value: !include examples/Webhook-request.json
      400:
        displayName: Bad request
        description: Unable to register Webhook due to some bad request from the client side.
        body:
          application/json:
            type: ErrorResponse
            examples:
              invalid_request:
                displayName: Invalid creation request
                value: !include examples/create-Webhook-invalid.json
      401:
        displayName: Error
        description: Missing authentication headers
      404:
        displayName: Error
        description: Webhook not found (not registered?)
/api/v1/webhooks/{WebhookId}/test:
  displayName: Test a push Webhook
  description: |
    This will trigger a Webhook to receive a dummy request to the registered Webhook.

    **Note**: There is no retry mechanism in place for this, so if a request fails for some reason, it will go on un-noticed.
  uriParameters:
    WebhookId:
      displayName: WebhookId
      type: string
      description: This represents the specific identifier of the Webhook
  post:
    description: Get all your current registered and active Webhooks
    responses:
      202:
        displayName: Accepted
        description: The request have been registered, and a dummy-request will be sent to the registered Webhook
      401:
        displayName: Error
        description: Missing authentication headers
      404:
        displayName: Error
        description: Webhook not found (not registered?)

#%RAML 1.0
---
title: Tracking Webhook API
version: v1
baseUri: https://api.bring.com/events
mediaType: application/json
annotationTypes:
  hideInDocumentation: boolean
  hideRequired: boolean
types:
  WebhookRequest:
    type: object
    properties:
      trackingId:
        type: string
        required: true
      event_groups:
        type: string
        required: true
      configuration:
        type: Configuration
        required: true
  WebhookBatchRequest:
      type: object
      properties:
        trackingIds:
          type: string[]
          required: true
        event_groups:
          type: string
          required: true
        configuration:
          type: Configuration
          required: true
  Webhook:
    type: object
    properties:
      id:
        type: string
        required: false
        description: Represents an unique identifiaction
      authenticator:
        type: string
        required: false
        description: Represents your authentication identification
      trackingId:
        type: string
        required: true
      event_groups:
        type: string
        required: true
        description: Represents the group(s) that is part of this Webhook
      expiry:
        type: datetime
        required: false
        description: TimeZone is set to UTC. Use this format to parse the instant; `yyyy-MM-dd'T'HH:mm:ssZ`
      created:
        type: datetime
        required: false
        description: TimeZone is set to UTC. Use this format to parse the instant; `yyyy-MM-dd'T'HH:mm:ssZ`
      configuration:
        type: Configuration
        required: true
  Configuration:
    type: object
    properties:
      url:
        type: string
        required: true
      content_type:
        type: string
        required: false
      headers:
        type: ConfigurationHeader[]
        required: false
  ConfigurationHeader:
    type: object
    properties:
      key:
        type: string
        required: true
      value:
        type: string
        required: true
        description: This value will not be available in any response
  ErrorResponse:
    type: object
    properties:
      uuid:
        type: string
        description: This represents an unique identifier for the failing request. Can be used whilst contacting Bring
      status:
        type: string
        description: Represents a 3/4 digit code that can be used to identify the problem
      reason:
        type: string
        required: false
        description: Can contain some hints on what went wrong during the request

documentation:
- title: Introduction
  content: |

    #### Webohook Definition
    > A Webhook in web development is a method of augmenting or altering the behaviour of a web page, or web application, with custom callbacks.
    > These callbacks may be maintained, modified, and managed by third-party users and developers who may not necessarily be affiliated with the originating website or application.

    #### Webhooks in Bring
    In the context of Bring, Webhooks allows you to get notifications for the subscribed parcels and/or shipments.

    In essence, this means that whenever an event is registered in Bring for a subscribed parcel and/or shipment,
    we'll send a HTTP POST to your callback URL that were defined during the Webhook registration.

    Using Webhooks is quite simple, and allows for immediate feedback based on the event that occured for the subscribed entity.
    Additionally, it allows integrations of customers to become simpler, as no scheduled mechanism is required to be implemented.
    You basically just define an endpoint that accepts HTTP POST, and the event details will be sent there - quite amazing 🙌
- title: Authentication
  content: |
    In order to use the API, you will need to register with Mybring and create an API key. Whenever issuing a request, the following headers is required to be present.

    | Header | Example | Comment | Required |
    |:-------|:--------|:--------|
    | `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 you | |

    **Note:** See the [getting started guide on authentication](/api/#authentication) if you want to know more about how to get started with authentication for APIs in Mybring.
- title: API limitations
  content: |
    There is some known/deliberate limitations for the API:

    | Resource | Limitation description |
    |:--------|:---------|
    | All requests | The Webhook API allows a maximum of **50 concurrent requests** per user |
    | Batch creation | Whilst creating requests for Webhooks is a feature we encurage to use, its maximum amount of parcels and/or shipments is limited to **100 per request**. If you have more than 100 at the time, split to mulitple requests using the batch-API |
    | Webhook testing | The `/api/v1/Webhooks/{WebhookId}/test`-api allows a maximum of **10 concurrent requests** per user |
- title: Events
  content: |
    When registering for a Webhook you can choose between a range of different event groups that you can subscribe for.
    It is recommended to limit the amount of events to subscribe for. Bring will send an event on each of the events occurred which in result may send quite a few HTTP-requests to your server.
    So, as a good practise, keep the list of event groups as small as possible.

    Each of the event groups corresponds to a certain set of actions that can happen to the package/shipment you subscribe for. For instance, if you subscribe to `DELIVERED`, all internal Bring-events
    will trigger a request to your defined callback URL.

    #### Event groups

    Default set of subscribeable event groups. Notice that this list is subject for change.

    | Event | Description |
    |:-------|:--------|
    | `ARRIVED_DELIVERY` | Arrived Delivery point - This is when a container arrives at recipients address, and can start unloading.
 |
    | `ARRIVED_COLLECTION` | Arrived for collection at pickup point |
    | `ATTEMPTED_DELIVERY` | The package has been attempted delivered at the door. Depending on the service it will be tried again or sent to closest pickup point. |
    | `CUSTOMS` | Package is in customs clearance. |
    | `COLLECTED` | The parcel has been collected at pickup address. |
    | `DELIVERED` | Package has been delivered. |
    | `DELIVERED_SENDER` | Package has been returned to the sender |
    | `DELIVERY_CANCELLED` | Home delivery has been canceled by the customer. |
    | `DELIVERY_CHANGED` | Date for Home delivery has been changed by customer. |
    | `DELIVERY_ORDERED` | Home delivery has been ordered |
    | `DEVIATION` | Deviation in production. Something wrong has happened and there is a probability for delay. |
    | `HANDED_IN` | Package has been handed in to Bring. |
    | `INTERNATIONAL` | Package has been sent from origin country or arrived at destination country.
 |
    | `IN_TRANSIT` | Package is in transit. |
    | `NOTIFICATION_SENT` | Notification for this package has been sent by sms, push and/or mail. This can be informational notifications and action notification like pickup notice. |
    | `PRE_NOTIFIED` | EDI message for the package has been received by Bring. |
    | `READY_FOR_PICKUP` | Package has arrived at pickup point. |
    | `RETURN` | The package has been returned to sender.
 |
    | `TRANSPORT_TO_RECIPIENT` | Package has been loaded for delivery to the recipient. |
    | `TERMINAL` | The package is now registered/arrived at inbound/outbound storage terminal |

    There is also a specific set of events that will be sent if something deviates from the normal event flow:

    | Event | Description |
    |:-------|:--------|
    | `NO_REG` | Webhook not registered. This might be due to the parcel-/shipment-number not being found with Bring' systems and can trigger after up to two - 2 - days |
    | `EXPIRED` | Webhook expired |

    #### Subscribing to multiple event groups

    The Webhook API supports the possibility to subscribe to multiple event groups at the same time.
    Doing so requires that groups are separated with comma and is defined as an array.
    Example:

    ```
    ['IN_TRANSIT', 'NOTIFICATION_SENT', 'TERMINAL', .., ..]
    ```

    Need more examples? See the "Create Webhook" section below.

- title: Receiving Callbacks
  content: |
    In order to receive requests from Bring, your callback URL must be accessible on the internet and able to receive requests from Bring IPs.
    Additionally, to minimize risk, you should also provide HTTPS-enabled endpoints and use some kind of authentication mechanism.
    For HTTPS, please do not use self-signed certificates, as requests may fail from Bring' side and you'll receive no requests.

    If you need a simple authentication whilst receiving requests from Bring, we recommend utilizing the header funcitonality provided by the Webhook configuration.

    All received callbacks from Bring will be using **UTC** as its current timezone and is based on the following format (Java):

    ```
    "yyyy-MM-dd'T'HH:mm:ssZ"
    ```

- title: Payload
  content: |

    #### Payload delivery headers

    `HTTP POST` payloads that are delivered to your Webhook's configured URL endpoint contains several Bring specific headers:

    | Header | Description |
    |:-------|:--------|
    | `X-Bring-Application` | Identifies the application that sent the request to your endpoint |
    | `X-bring-Correlation` | Correlation Id can be used whilst contacting Bring on error cases |
    | `X-bring-Version` | Indicates the version of application |
    | `<your headers>` | Any headers that were specified in the Webhook configuration will also be appended |

    #### Example

    Requests issued from Bring to your endpoint will look similar to this:

    ```
      POST /callback/Webhook HTTP/1.1
      host: localhost:80
      Accept: application/json
      User-Agent: Bringcast-Webhook/v1.0.34-SNAPSHOT
      X-Bring-Application: BMEC
      X-bring-Correlation: xA3n7
      X-some-fancy-custom-header: with-some-value-that-I-expect
      Content-Type: application/json
      Content-Length: 188

      {
        "status": "IN_TRANSIT",
        "id": "ad84cbca-2e89-43e0-a301-a8d5d7fe7804",
        "shipment": "SHIPMENTNUMBER",
        "package": "TESTPACKAGEDELIVERED",
        "created": "2019-03-16T14:58:48+0000",
        "pushed": "2019-03-16T14:58:49+0000"
      }
    ```
- title: Q & A
  content: |

    #### Can I have multiple Webhooks for the same parcel?
    You can register for multiple Webhooks on the same parcel/shipment, as long as the event groups are different for each registration.

    #### How many active Webhooks can I have simultaneously?
    Currently there is no limitation.

    #### Is the expiration duration configurable?
    No.

    #### Can I get a history of events that were sent for a subscription?
    Not in this version. It may be available in the future.

    #### Will I be able to see my previous/expired Webhooks (active and inactive)?
    No.

    #### What happens if our endpoint is down and a callback is being sent?
    We'll try issuing a request to your defined endpoint up to three - 3 - times with a delay on 30 minutes for the two first, then wait an hour for the last retry.
    After this, callbacks will not be retried.

    #### Do you support wildcard events/event groups (e.g `*` or `ALL`)?
    No.

    #### Do you support modifying existing active webhooks?
    No.

    #### My shipment is not yet registered with Bring, will registering for Webhook work related to that tracking number?
    Yes.

    When you subscribe for a parcel that does not yet exist in Bring' systems, a retry mechanism will try for up to two - 2 - days to ensure that the Webhook will be registered when the parcel is found internally.
    Eventually, if the package was not found with Bring within this timeframe - a notification will be sent on the callback URL configured for that Webhook which notifies this.

    **Note**: Retry-timing is non-configurable.

/api/v1/webhooks:
  displayName: Create Webhook
  description: |
    Create a new subscription for a Webhook.
    Webhooks lives for up to 30 days, or until the entity subscribed for is marked as "delivered by Bring".
  post:
    description: Register a new Webhook subscription for a parcel or shipment.
    body:
      application/json:
        type: WebhookRequest
        examples:
          valid_request:
            displayName: Valid Request
            value: !include examples/create-Webhook-request.json
    responses:
      201:
        description: Returns the registered Webhook after creation request.
        body:
          application/json:
            type: Webhook
            examples:
              reqister_Webhook:
                displayName: Registered Webhook
                value: !include examples/Webhook-request.json
      400:
        displayName: Bad request
        description: Unable to register Webhook due to some bad request from the client side.
        body:
          application/json:
            type: ErrorResponse
            examples:
              invalid_Webhook:
                displayName: Invalid creation request
                value: !include examples/create-Webhook-invalid.json
      401:
        displayName: Error
        description: Missing authentication headers
      409:
        displayName: Conflict
        description: Webhook of similar subscription already exists
      429:
        displayName: Too many requests
        description: This may happen due to client sending too many requests. Try again a bit later, or decrease amount of requests
      500:
        displayName: Internal Bring error
        description: If this happens, try again a bit later as it might be due to some internal mechanism not working
/batch/api/v1/webhooks:
  displayName: Create multiple Webhooks
  description: |
        Create a range of new Webhooks based on a list of any parcel or shipment.
        Webhooks lives for up to 30 days, or until the entity subscribed for is marked as "delivered by Bring".
  post:
    description: Register a new Webhook subscription for an array parcels and/or shipments
    body:
      application/json:
        type: WebhookBatchRequest
        examples:
          valid_request:
            displayName: Valid Request
            value: !include examples/batch-create-Webhook-request.json
    responses:
      201:
        description: |
          Returns the registered Webhook after creation request.
        body:
          application/json:
            type: Webhook
            examples:
              reqister_Webhook:
                displayName: Registered Webhook
                value: !include examples/batch-Webhook-request.json
      400:
        displayName: Bad request
        description: |
          Unable to register Webhook due to some bad request from the client side.
        body:
          application/json:
            type: ErrorResponse
            examples:
              invalid_Webhook:
                displayName: Invalid creation request
                value: !include examples/create-Webhook-invalid.json
      401:
        displayName: Error
        description: Missing authentication headers
      429:
        displayName: Too many requests
        description: This may happen due to client sending too many requests. Try again a bit later, or decrease amount of requests
      500:
        displayName: Internal Bring error
        description: If this happens, try again a bit later as it might be due to some internal mechanism not working
/api/v1/webhooks/{Webhookid}:
  displayName: Delete Webhook
  uriParameters:
    Webhookid:
      displayName: WebhookId
      type: string
      description: This represents the specific identifier of the Webhook
  delete:
    description: Remove an existing subscribed Webhook
    queryParameters:
      includeWebhook:
        description: If set to true, the deleted Webhook will be returned
        type: boolean
        required: false
        example: true
    responses:
      200:
        body:
          application/json:
            type: Webhook
            examples:
              get_Webhook:
                displayName: Registered Webhook
                value: !include examples/Webhook-request.json
      204:
        displayName: Webhook successfully removed
        description: Webhook unregistered and removed. No content supplied in response
      401:
        displayName: Error
        description: Missing authentication headers
      404:
        displayName: Error
        description: Webhook not found (not registered?)
/api/v1/webhooks/:
  displayName: Get all Webhooks
  get:
    description: Get all your current registered and active Webhooks. Pagination is currently not supported.
    responses:
      200:
        body:
          application/json:
            type: Webhook
            examples:
              get_Webhook:
                displayName: Registered Webhook
                value: !include examples/webhook-request-all.json
      400:
        displayName: Bad request
        description: Unable to register Webhook due to some bad request from the client side.
        body:
          application/json:
            type: ErrorResponse
            examples:
              invalid_request:
                displayName: Invalid creation request
                value: !include examples/create-Webhook-invalid.json
      401:
        displayName: Error
        description: Missing authentication headers.
      404:
        displayName: Error
        description: Webhook not found (not registered?)
/api/v1/webhooks/{WebhookId}:
  displayName: Get single Webhook
  uriParameters:
    WebhookId:
      displayName: WebhookId
      type: string
      description: This represents the specific identifier of the Webhook
  get:
    description: Get the specification that belongs to a registered Webhook
    responses:
      200:
        body:
          application/json:
            type: Webhook
            examples:
              get_Webhook:
                displayName: Registered Webhook
                value: !include examples/Webhook-request.json
      400:
        displayName: Bad request
        description: Unable to register Webhook due to some bad request from the client side.
        body:
          application/json:
            type: ErrorResponse
            examples:
              invalid_request:
                displayName: Invalid creation request
                value: !include examples/create-Webhook-invalid.json
      401:
        displayName: Error
        description: Missing authentication headers
      404:
        displayName: Error
        description: Webhook not found (not registered?)
/api/v1/webhooks/{WebhookId}/test:
  displayName: Test a push Webhook
  description: |
    This will trigger a Webhook to receive a dummy request to the registered Webhook.

    **Note**: There is no retry mechanism in place for this, so if a request fails for some reason, it will go on un-noticed.
  uriParameters:
    WebhookId:
      displayName: WebhookId
      type: string
      description: This represents the specific identifier of the Webhook
  post:
    description: Get all your current registered and active Webhooks
    responses:
      202:
        displayName: Accepted
        description: The request have been registered, and a dummy-request will be sent to the registered Webhook
      401:
        displayName: Error
        description: Missing authentication headers
      404:
        displayName: Error
        description: Webhook not found (not registered?)


Align Invoice header levels and order

Align Invoice header levels and order

#%RAML 1.0
---
title: Invoice API
baseUri: https://www.mybring.com/invoicearchive
types:
  Invoices:
    type: object
    properties:
      customerNumber:
        type: string
        required: false
        description: Represents a customerNumber
      invoiceNumber:
        type: string
        required: true
        description: Represents a invoiceNumber
      invoiceDate:
        type: string
        required: true
        description: Represents a invoice date
      invoiceIssuer:
        type: string
        required: false
        description: Represents the invoice issuer
      status:
        type: string
        required: false
        description: Represents the invoice status
      totalAmount:
        type: string
        required: false
        description: Represents the invoice total amount
      currency:
        type: string
        required: false
        description: Represents the currency used in invoice
      type:
        type: string
        required: false
        description: Represents the invoice or credit note
      dueDate:
        type: string
        required: false
        description: Represents the invoice due date
      attachmentCount:
        type: number
        required: false
        description: Represents the number of attachments associated with invoice number
      batchSource:
        type: string
        required: true
        description: Represents the invoice generated source
      invoiceSpecificationAvailable:
        type: boolean
        required: false
        description: Represents the invoice specification report available or not
      parentInvoiceNumber:
        type: string
        required: false
        description: Represents the parent invoice number

documentation:
- title: Introduction
  content: |
      The invoice API is used to list invoices and download the invoice pdfs same as in Mybring.

- title: Authentication
  content: |
      Before you can begin using the new API you'll have to do the following:
      * [Sign up for a Mybring account](https://www.mybring.com/signup/register/user) if you do not already have one. If you're already registered in Mybring, head to the [settings and API](https://www.mybring.com/useradmin/account/settings/api) page to get your API key.
      * [Generate an API key](/api/#authentication) for your user

      ### Get your API key from Mybring
      To make API requests you will need an API key. Click the link below, which sends you to your "Settings and API" page in Mybring profile administration. Scroll down to the "API key" section. Your generated API key which you will use to authenticate your requests can be found here.

      Get API key

      ### Add authentication headers
      A description of the headers can be found in [Getting Started / Authentication](/api/#authentication).

/invoicearchive/api/invoices/{apiCustomerNumber}{mediaTypeExtension}:
  displayName: List of all Invoices
  description: Gets the list of invoices corresponding to the given customer number.
               By default it shows last 65 days of invoices, with the possibilty to access last 365 days by providing "fromDate" and "toDate".
               This endpoint supports Parcel Domestic, Parcel International and Cargo customers.
  uriParameters:
    apiCustomerNumber:
      enum: [ Main customer number, PARCELS_NORWAY_INTERNATIONAL-xxxxx,PARCELS_SWEDEN-xxxxx,PARCELS_DENMARK-xxxxx,PARCELS_FINLAND-xxxxx,EXPRESS_SWEDEN-xxxxx,EXPRESS_NORWAY-xxxxx,EXPRESS_DENMARK-xxxxx,EXPRESS_FINLAND-xxxxx]
      description: Unique API Customer Number.
    mediaTypeExtension:
      enum: [ .json, .xml ]
      description: Use .json to specify application/json or .xml to specify application/xml
  get:
    description: List of invoices
    headers:
      X-MyBring-API-Uid:
        description: Your Mybring login ID
      X-MyBring-API-Key:
        description: Your user's API key
      X-Bring-Client-URL:
        description: A URL that sort of identifies where you're using the APIs.
    queryParameters:
      fromDate:
        description: Start date for fetching invoices in format dd.mm.yyyy.
        type: string
        required: false
        example: 15.01.2020
      toDate:
        description: End date for fetching invoices in format dd.mm.yyyy.
        type: string
        required: false
        example: 25.01.2020
    responses:
      200:
        displayName: Successful response
        description:
        body:
          application/json:
            type: Invoices
            examples:
              successful:
                displayName: Successful
                description: The example below shows an list of invoices
                value: !include example/list_invoices.json
          application/xml:
            type: Invoices
            examples:
              successful:
                displayName: Successful
                description: The example below shows an list of invoices
                value: !include example/list_invoices.xml

/invoicearchive/pdf/{apiCustomerNumber}/{invoiceNumber}.pdf:
  displayName: Invoice PDF download endpoint
  description: This link is used to download the invoice pdf for the customers by providing API customer number and invoice number in URI params.
  uriParameters:
    apiCustomerNumber:
      description: Unique API Customer Number for each customer.
    invoiceNumber:
      description: Invoice number of the particular invoice to be downloaded.
  get:
    description: Download pdf for invoice

#%RAML 1.0
---
title: Invoice API
baseUri: https://www.mybring.com/invoicearchive
types:
  Invoices:
    type: object
    properties:
      customerNumber:
        type: string
        required: false
        description: Represents a customerNumber
      invoiceNumber:
        type: string
        required: true
        description: Represents a invoiceNumber
      invoiceDate:
        type: string
        required: true
        description: Represents a invoice date
      invoiceIssuer:
        type: string
        required: false
        description: Represents the invoice issuer
      status:
        type: string
        required: false
        description: Represents the invoice status
      totalAmount:
        type: string
        required: false
        description: Represents the invoice total amount
      currency:
        type: string
        required: false
        description: Represents the currency used in invoice
      type:
        type: string
        required: false
        description: Represents the invoice or credit note
      dueDate:
        type: string
        required: false
        description: Represents the invoice due date
      attachmentCount:
        type: number
        required: false
        description: Represents the number of attachments associated with invoice number
      batchSource:
        type: string
        required: true
        description: Represents the invoice generated source
      invoiceSpecificationAvailable:
        type: boolean
        required: false
        description: Represents the invoice specification report available or not
      parentInvoiceNumber:
        type: string
        required: false
        description: Represents the parent invoice number

documentation:
- title: Introduction
  content: |
      The invoice API is used to list invoices and download the invoice pdfs same as in Mybring.

      ### Before you start
      Before you can begin using the new API you'll have to do the following:

      * [Sign up for a Mybring account](https://www.mybring.com/signup/register/user) if you do not already have one. If you're already registered in Mybring, head to the [settings and API](https://www.mybring.com/useradmin/account/settings/api) page to get your API key.
      * [Generate an API key](/api/#authentication) for your user

      ### Get your API key from Mybring
      To make API requests you will need an API key. Click the link below, which sends you to your "Settings and API" page in Mybring profile administration. Scroll down to the "API key" section. Your generated API key which you will use to authenticate your requests can be found here.

      Get API key

      ### Add authentication headers
      A description of the headers can be found in [Getting Started / Authentication](/api/#authentication).

/invoicearchive/api/invoices/{apiCustomerNumber}{mediaTypeExtension}:
  displayName: List of all Invoices
  description: Gets the list of invoices corresponding to the given customer number.
               By default it shows last 65 days of invoices, with the possibilty to access last 365 days by providing "fromDate" and "toDate".
               This endpoint supports Parcel Domestic, Parcel International and Cargo customers.
  uriParameters:
    apiCustomerNumber:
      enum: [ Main customer number, PARCELS_NORWAY_INTERNATIONAL-xxxxx,PARCELS_SWEDEN-xxxxx,PARCELS_DENMARK-xxxxx,PARCELS_FINLAND-xxxxx,EXPRESS_SWEDEN-xxxxx,EXPRESS_NORWAY-xxxxx,EXPRESS_DENMARK-xxxxx,EXPRESS_FINLAND-xxxxx]
      description: Unique API Customer Number.
    mediaTypeExtension:
      enum: [ .json, .xml ]
      description: Use .json to specify application/json or .xml to specify application/xml
  get:
    description: List of invoices
    headers:
      X-MyBring-API-Uid:
        description: Your Mybring login ID
      X-MyBring-API-Key:
        description: Your user's API key
      X-Bring-Client-URL:
        description: A URL that sort of identifies where you're using the APIs.
    queryParameters:
      fromDate:
        description: Start date for fetching invoices in format dd.mm.yyyy.
        type: string
        required: false
        example: 15.01.2020
      toDate:
        description: End date for fetching invoices in format dd.mm.yyyy.
        type: string
        required: false
        example: 25.01.2020
    responses:
      200:
        displayName: Successful response
        description:
        body:
          application/json:
            type: Invoices
            examples:
              successful:
                displayName: Successful
                description: The example below shows an list of invoices
                value: !include example/list_invoices.json
          application/xml:
            type: Invoices
            examples:
              successful:
                displayName: Successful
                description: The example below shows an list of invoices
                value: !include example/list_invoices.xml

/invoicearchive/pdf/{apiCustomerNumber}/{invoiceNumber}.pdf:
  displayName: Invoice PDF download endpoint
  description: This link is used to download the invoice pdf for the customers by providing API customer number and invoice number in URI params.
  uriParameters:
    apiCustomerNumber:
      description: Unique API Customer Number for each customer.
    invoiceNumber:
      description: Invoice number of the particular invoice to be downloaded.
  get:
    description: Download pdf for invoice


Added the Scope concept to the api definition

#%RAML 1.0
title: ItsYouOnline
version: 0.1
baseUri: /
types:
  Scope:
    description: For an explanation about scopes and scopemapping, see https://github.com/itsyouonline/identityserver/blob/master/docs/oauth2/scopes.md
    properties:
        username: string
        grantedTo:
          type: string
          description: The organization that is granted read access to some of the user's information
        address?:
          type: string{}
          description: Mapping of the labels of the granted ones to the labels the organization requested.
        publicKeys?: string[]
        email?:
          type: string{}
          description: Mapping of the labels of the granted ones to the labels the organization requested.
        phone?:
          type: string{}
          description: Mapping of the labels of the granted ones to the labels the organization requested.
        bank?:
          type: string{}
          description: Mapping of the labels of the granted ones to the labels the organization requested.
        facebook?: boolean
        github?: boolean
        organizations:
          type: string[]
          description: List of organizations the requesting organization can see your membership of.

  BankAccount:
    properties:
        iban:
          type: string
          maxLength: 30
        bic:
          type: string
          maxLength: 10
        country:
          type: string
          maxLength: 40

  Phonenumber:
    pattern: ^\+[0-9]+$
  Address:
    properties:
        city:
            type: string
            maxLength: 30
        street:
            type: string
            maxLength: 50
        nr:
            type: string
            maxLength: 10
        other?:
            type: string
            maxLength: 30
        country:
            type: string
            maxLength: 40
        postalcode:
            type: string
            maxLength: 20
  User:
    properties:
        username:
            type: string
            maxLength: 30
            minLength: 2
        publicKeys: string[]
        expire?: date
        email?: string{}
        phone?: Phonenumber{}
        address?: Address{}
        bank?: BankAccount{}
        facebook?:
            type: string
            maxLength: 40
        github?:
            type: string
            maxLength: 50

    example:
        username: bob
        publicKeys:
            - 1GVS7544tvWM2TM13vNH8sboamJzL6mJ36
        expire: 2018-10-20
        email:
            work: bob@company.com
            home: bob@example.com
            "dance club": bob@linedanceclub.example.org
        phone:
          be: +3212341234123
          eg: +2012341234123
        address:
            home:
                city: Springfield
                street: Main street
                nr: 45B
                country: Tomorrowland
                postalcode: T-9450
            work:
                city: Capital City
                street: Capital street
                nr: 1
                country: Tomorrowland
                postalcode: T-1000
        bank:
            kbc:
                iban: TL123451234512345
                bic: ABCDEF
                country: Tomorrowland

  userview:
    properties:
        username:
            type: string
        publicKeys?: string[]
        email?: string{}
        phone?: Phonenumber{}
        address?: Address{}
        bank?: BankAccount{}
        facebook?:
            type: string
            maxLength: 40
        github?:
            type: string
            maxLength: 50
        organizations: string[]

  JoinOrganizationRequest:
    properties:
        organization: string
        user: string
        role:
            type: string
            enum: [owner, member]

  ContractSigningRequest:
    properties:
        contractId: string
        party: string

/users:
  post:
    description: Create a new user
    body:
        application/json:
            type: User
  /{username}:
    get:
        responses:
            200:
                body:
                    application/json:
                        type: User
    put:
      description: Update an existing user. Updating ``username`` is not allowed. The labelled lists can not be updated this way, the normal properties can (like github and facebook account).
      responses:
        200:
          body:
            application/json:
              type: User
        403:
          description: Updating username is Forbidden!
  /{username}/info:
    get:
        displayName: getUserInformation
        responses:
            200:
                body:
                    application/json:
                        type: userview
  /{username}/validate:
    get:
        queryParameters:
            token:
                type: string
  /{username}/addresses:
    get:
        responses:
            200:
                body:
                    application/json:
                      type: Address{}
  /{username}/addresses/{label}:
    get:
        responses:
            200:
                body:
                    application/json:
                      type: Address
    put:
        description: Update or create an existing address.
        body:
            application/json:
                type: Address
    delete:
        description: Delete an address
  /{username}/phonenumbers:
    get:
        responses:
            200:
                body:
                    application/json:
                      type: Phonenumber{}
  /{username}/phonenumbers/{label}:
    get:
        responses:
            200:
                body:
                    application/json:
                        type: Phonenumber
    put:
        description: Update or create an existing phonenumber.
        body:
            application/json:
                type: Phonenumber
    delete:
        description: Delete a phonenumber
  /{username}/banks:
    get:
        responses:
            200:
                body:
                    application/json:
                      type: BankAccount{}
  /{username}/banks/{label}:
    get:
        responses:
            200:
                body:
                    application/json:
                        type: BankAccount
    put:
        description: Update or create an existing bankaccount.
        body:
            application/json:
                type: BankAccount
    delete:
        description: Delete a BankAccount
  /{username}/organizations:
    get:
        description: Get the list organizations a user is owner of member of
        responses:
            200:
                body:
                    application/json:
                      properties:
                        owner: string[]
                        member: string[]
  /{username}/notifications:
    get:
        description: Get the list of notifications, these are pending invitations or approvals
        responses:
            200:
                body:
                    application/json:
                        properties:
                            invitations: JoinOrganizationRequest[]
                            approvals: JoinOrganizationRequest[]
                            contractRequests: ContractSigningRequest[]

  /{username}/contracts:
    get:
      description: Get the contracts where the user is 1 of the parties. Order descending by date.
      queryParameters:
        includeExpired:
            type: boolean
            description: Include the expired contracts, by default only the active contracts are returned.
            required: false
        start:
            type: integer
            description: Start offset, useful for paging. Default is `0`.
            required: false
        max:
            type: integer
            description: Max page size, useful for paging. Default is `50`.
            required: false
            maximum: 250

  /{username}/scopes:
    get:
        description: Get the list of authorization scopes
        responses:
            200:
                body:
                    application/json:
                        type: Scope[]
  /{username}/scopes/{grantedTo}:
    get:
        description: Get a specific authorization
        responses:
            200:
                body:
                    application/json:
                        type: Scope
    delete:
        description: Remove a Scope, the granted organization will no longer have access the user's information.
    put:
        description: Update a Scope

#%RAML 1.0
title: ItsYouOnline
version: 0.1
baseUri: /
types:
  BankAccount:
    properties:
        iban:
          type: string
          maxLength: 30
        bic:
          type: string
          maxLength: 10
        country:
          type: string
          maxLength: 40

  Phonenumber:
    pattern: ^\+[0-9]+$
  Address:
    properties:
        city:
            type: string
            maxLength: 30
        street:
            type: string
            maxLength: 50
        nr:
            type: string
            maxLength: 10
        other?:
            type: string
            maxLength: 30
        country:
            type: string
            maxLength: 40
        postalcode:
            type: string
            maxLength: 20
  User:
    properties:
        username:
            type: string
            maxLength: 30
            minLength: 2
        publicKeys: string[]
        expire?: date
        email?: string{}
        phone?: Phonenumber{}
        address?: Address{}
        bank?: BankAccount{}
        facebook?:
            type: string
            maxLength: 40
        github?:
            type: string
            maxLength: 50

    example:
        username: bob
        publicKeys:
            - 1GVS7544tvWM2TM13vNH8sboamJzL6mJ36
        expire: 2018-10-20
        email:
            work: bob@company.com
            home: bob@example.com
            "dance club": bob@linedanceclub.example.org
        phone:
          be: +3212341234123
          eg: +2012341234123
        address:
            home:
                city: Springfield
                street: Main street
                nr: 45B
                country: Tomorrowland
                postalcode: T-9450
            work:
                city: Capital City
                street: Capital street
                nr: 1
                country: Tomorrowland
                postalcode: T-1000
        bank:
            kbc:
                iban: TL123451234512345
                bic: ABCDEF
                country: Tomorrowland

  userview:
    properties:
        username:
            type: string
        publicKeys?: string[]
        email?: string[]
        phone?: Phonenumber[]
        address?: Address[]
        bank?: BankAccount[]
        facebook?:
            type: string
            maxLength: 40
        github?:
            type: string
            maxLength: 50

  JoinOrganizationRequest:
    properties:
        organization: string
        user: string
        role:
            type: string
            enum: [owner, member]

  ContractSigningRequest:
    properties:
        contractId: string
        party: string

/users:
  post:
    description: Create a new user
    body:
        application/json:
            type: User
  /{username}:
    get:
        responses:
            200:
                body:
                    application/json:
                        type: User
    put:
      description: Update an existing user. Updating ``username`` is not allowed. The labelled lists can not be updated this way, the normal properties can (like github and facebook account).
      responses:
        200:
          body:
            application/json:
              type: User
        403:
          description: Updating username is Forbidden!
  /{username}/info:
    get:
        displayName: getUserInformation
        responses:
            200:
                body:
                    application/json:
                        type: userview
  /{username}/validate:
    get:
        queryParameters:
            token:
                type: string
  /{username}/addresses:
    get:
        responses:
            200:
                body:
                    application/json:
                      type: Address{}
  /{username}/addresses/{label}:
    get:
        responses:
            200:
                body:
                    application/json:
                      type: Address
    put:
        description: Update or create an existing address.
        body:
            application/json:
                type: Address
    delete:
        description: Delete an address
  /{username}/phonenumbers:
    get:
        responses:
            200:
                body:
                    application/json:
                      type: Phonenumber{}
  /{username}/phonenumbers/{label}:
    get:
        responses:
            200:
                body:
                    application/json:
                        type: Phonenumber
    put:
        description: Update or create an existing phonenumber.
        body:
            application/json:
                type: Phonenumber
    delete:
        description: Delete a phonenumber
  /{username}/banks:
    get:
        responses:
            200:
                body:
                    application/json:
                      type: BankAccount{}
  /{username}/banks/{label}:
    get:
        responses:
            200:
                body:
                    application/json:
                        type: BankAccount
    put:
        description: Update or create an existing bankaccount.
        body:
            application/json:
                type: BankAccount
    delete:
        description: Delete a BankAccount
  /{username}/organizations:
    get:
        description: Get the list organizations a user is owner of member of
        responses:
            200:
                body:
                    application/json:
                      properties:
                        owner: string[]
                        member: string[]
  /{username}/notifications:
    get:
        description: Get the list of notifications, these are pending invitations or approvals
        responses:
            200:
                body:
                    application/json:
                        properties:
                            invitations: JoinOrganizationRequest[]
                            approvals: JoinOrganizationRequest[]
                            contractRequests: ContractSigningRequest[]

  /{username}/contracts:
    get:
      description: Get the contracts where the user is 1 of the parties. Order descending by date.
      queryParameters:
        includeExpired:
            type: boolean
            description: Include the expired contracts, by default only the active contracts are returned.
            required: false
        start:
            type: integer
            description: Start offset, useful for paging. Default is `0`.
            required: false
        max:
            type: integer
            description: Max page size, useful for paging. Default is `50`.
            required: false
            maximum: 250