openapi: 3.0.3
info:
  title: performance-dashboard
  description: ''
  version: 1.0.0
servers:
  -
    url: 'https://dashboard.wearewuunder.com'
paths:
  /api/auth/login:
    post:
      summary: 'Get Bearer authorization token'
      operationId: getBearerAuthorizationToken
      description: ''
      parameters: []
      responses:
        200:
          description: Ok
          content:
            application/json:
              schema:
                type: object
                example:
                  status: Success
                  message: null
                  data:
                    token: 28|wTSuF1AdPOmx8bTP2XSgVfsoD5V4sFMqUNMEg4Eq
                properties:
                  status:
                    type: string
                    example: Success
                  message:
                    type: string
                    example: null
                  data:
                    type: object
                    properties:
                      token:
                        type: string
                        example: 28|wTSuF1AdPOmx8bTP2XSgVfsoD5V4sFMqUNMEg4Eq
        401:
          description: 'Wrong email/password combination'
          content:
            application/json:
              schema:
                type: object
                example:
                  status: Error
                  message: 'Wrong email/password combination'
                  data: null
                properties:
                  status:
                    type: string
                    example: Error
                  message:
                    type: string
                    example: 'Wrong email/password combination'
                  data:
                    type: string
                    example: null
      tags:
        - Endpoints
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  description: 'Must be a valid email address.'
                  example: fstracke@example.org
                password:
                  type: string
                  description: 'Must be at least 6 characters.'
                  example: '})xX|s&FCU'
              required:
                - email
                - password
      security: []
  /api/v1/shipments:
    get:
      summary: 'Get shipments'
      operationId: getShipments
      description: ''
      parameters:
        -
          in: query
          name: inserted_at_start
          description: 'Filter shipments created at equal to or after datetime.'
          example: '2022-01-01T00:10:12'
          required: false
          schema:
            type: string
            description: 'Filter shipments created at equal to or after datetime.'
            example: '2022-01-01T00:10:12'
        -
          in: query
          name: inserted_at_end
          description: 'Filter shipments created at equal to or before datetime.'
          example: '2022-10-18T00:10:12'
          required: false
          schema:
            type: string
            description: 'Filter shipments created at equal to or before datetime.'
            example: '2022-10-18T00:10:12'
        -
          in: query
          name: shipment_status
          description: "Filter shipments on a certain status (e.g. delivered). To see all possible values,\nfill in a random string for this parameter and read the error message."
          example: delivered
          required: false
          schema:
            type: string
            description: "Filter shipments on a certain status (e.g. delivered). To see all possible values,\nfill in a random string for this parameter and read the error message."
            example: delivered
        -
          in: query
          name: ref
          description: "Filter shipments on customer_reference field. Field is case-sensitive.\nPlease specificy entire reference (substring search is not supported)"
          example: testref
          required: false
          schema:
            type: string
            description: "Filter shipments on customer_reference field. Field is case-sensitive.\nPlease specificy entire reference (substring search is not supported)"
            example: testref
        -
          in: query
          name: track_and_trace_code
          description: "Filter shipments on a certain T&T code. Field is case-sensitive.\nPlease specificy entire reference (substring search is not supported)"
          example: 0ABCDE012345678
          required: false
          schema:
            type: string
            description: "Filter shipments on a certain T&T code. Field is case-sensitive.\nPlease specificy entire reference (substring search is not supported)"
            example: 0ABCDE012345678
      responses:
        200:
          description: Ok
          content:
            text/plain:
              schema:
                type: string
                example: "{\n    \"data\": [{\n          \"wuunder_id\": \"LAM-768\",\n          \"correlation_id\": \"123456789\",\n          \"customer_reference\": \"123456\",\n          \"inserted_at\": \"2022-09-17 21:23:49\",\n          \"shipment_status\": \"delivered\",\n          // Since when shipment_status?\n          \"shipment_status_inserted_at\": \"2022-09-20 09:42:24\",\n          // Carrier information\n          \"carrier_name\": \"DHL Parcel\",\n          \"carrier_code\": \"DHL_PARCEL\",\n          \"carrier_product_description\": \"DHL Parcel Connect\",\n          \"service_level\": \"DHL_PARCEL_CONNECT\",\n          \"actual_track_and_trace_url\": \"https://my-tracking-url\",\n          \"track_and_trace_code\": \"A1CWOED133\",\n          \"is_return\": 1,\n          \"source\": \"Woocommerce extension\",\n          // In centimeters\n          \"length\": 475,\n          \"width\": 370,\n          \"height\": 883,\n          // In grams\n          \"weight\": null,\n          // In eurocents\n          \"value\": 1234.4,\n          // Options: package, pallet, null, document, letterbox\n          \"kind\": \"package\",\n          // Pickup address information\n          \"pickup_country_code\": \"NL\",\n          \"pickup_type\": null,\n          \"pickup_given_name\": \"John\",\n          \"pickup_family_name\": \"Doe\",\n          \"pickup_locality\": \"Amsterdam\",\n          \"pickup_zip_code\": \"1234AB\",\n          \"pickup_email_address\": null,\n          \"pickup_phone_number\": \"58923298\",\n          \"pickup_chamber_of_commerce_number\": null,\n          \"pickup_house_number\": \"123\",\n          \"pickup_street_name\": \"Kerkstraat\",\n          \"pickup_vat\": null,\n          \"pickup_eori_number\": null,\n          \"pickup_business\": \"Primera\",\n          \"pickup_date\": \"2022-09-23\",\n          // Delivery address information\n          \"delivery_country_code\": \"DJ\",\n          \"delivery_type\": null,\n          \"delivery_given_name\": \"John\",\n          \"delivery_family_name\": \"Doe\",\n          \"delivery_locality\": \"Amsterdam\",\n          \"delivery_zip_code\": \"1234AB\",\n          \"delivery_email_address\": null,\n          \"delivery_phone_number\": \"123456\",\n          \"delivery_chamber_of_commerce_number\": null,\n          \"delivery_house_number\": \"123\",\n          \"delivery_street_name\": \"Kerkstraat\",\n          \"delivery_vat\": null,\n          \"delivery_eori_number\": null,\n          \"delivery_date\": \"2022-02-14\",\n          \"delivery_business\": \"Test business\",\n          \"route_type\": \"b2c\",\n          // Delay information\n          \"delay_in_transit_days\": 1,\n          \"days_in_transit\": 2,\n          \"first_delivered_date\": \"2022-02-02\",\n          \"predicted_days_in_transit\": 1,\n          \"first_in_transit_date\": \"2022-02-01\",\n          // Shipment flags. Datetime corresponds to the first time detected\n          \"address_issue\": 1,\n          \"address_issue_date\": \"2022-02-01 17:02:56\",\n          \"delivery_neighbour\": 0,\n          \"delivery_neighbour_date\": null,\n          \"issue_carrier\": 0,\n          \"issue_carrier_date\": null,\n          \"issue_receiver\": 0,\n          \"issue_receiver_date\": null,\n          \"issue_sender\": 0,\n          \"issue_sender_date\": null,\n          \"issue_unidentified\": 0,\n          \"issue_unidentified_date\": null,\n          \"no_transit_scan\": 0,\n          \"no_transit_scan_date\": null,\n          \"parcelshop_pickup\": 0,\n          \"parcelshop_pickup_date\": null,\n          \"parcelshop_delivery\": 0,\n          \"parcelshop_delivery_date\": null,\n          \"returned_to_sender\": 0,\n          \"returned_to_sender_date\": null,\n          \"delay_in_transit\": 1,\n          \"delay_in_transit_date\": \"2022-02-01 17:02:56\",\n          \"is_pre_transit\": 0,\n          \"is_pre_transit_date\": null,\n          \"is_in_transit\": 0,\n          \"is_in_transit_date\": null,\n          \"is_out_for_delivery\": 0,\n          \"is_out_for_delivery_date\": null,\n    }],\n    \"links\": {\n         \"first\": \"http://base_url/api/v1/shipments?page=1\",\n         \"last\": \"http://dashboard.wearewuunder.com/api/v1/shipments?page=14\",\n         \"prev\": null,\n         \"next\": \"http://dashboard.wearewuunder.com/api/v1/shipments?page=2\"\n    },\n    \"meta\": {\n         \"current_page\": 1,\n         \"from\": 1,\n         \"last_page\": 14,\n         \"links\": [\n             {\n                 \"url\": null,\n                 \"label\": \"previous\",\n                 \"active\": false\n             },\n             {\n                 \"url\": \"http://dashboard.wearewuunder.com/api/v1/shipments?page=1\",\n                 \"label\": \"1\",\n                 \"active\": true\n             },\n             ....\n         ],\n         \"path\": \"http://dashboard.wearewuunder.com/api/v1/shipments\",\n         \"per_page\": 15,\n         \"to\": 15,\n         \"total\": 206\n     }\n}"
        400:
          description: 'Start time later than end time'
          content:
            application/json:
              schema:
                type: object
                example:
                  status: Error
                  message: 'inserted_at_start is later than inserted_at_end'
                  data: null
                properties:
                  status:
                    type: string
                    example: Error
                  message:
                    type: string
                    example: 'inserted_at_start is later than inserted_at_end'
                  data:
                    type: string
                    example: null
        422:
          description: 'Invalid shipment status'
          content:
            application/json:
              schema:
                type: object
                example:
                  status: Error
                  message: 'Invalid value for shipment status. Please send one of the following available statuses: ....'
                  data: null
                properties:
                  status:
                    type: string
                    example: Error
                  message:
                    type: string
                    example: 'Invalid value for shipment status. Please send one of the following available statuses: ....'
                  data:
                    type: string
                    example: null
      tags:
        - Endpoints
tags:
  -
    name: Endpoints
    description: ''
components:
  securitySchemes:
    default:
      type: http
      scheme: bearer
      description: 'You can retrieve your token by visiting your dashboard and clicking <b>Generate API token</b>.'
security:
  -
    default: []
