---
openapi: 3.0.0
info:
  version: v1
  title: Elite EXTRA API
  contact:
    name: Elite EXTRA Integrators
    email: integration@eliteextra.com
    url: https://eliteextra.com
  description: |
    # Introduction

    The EliteEXTRA API is organized around REST and communication is 
    secured through the use of HTTPS. The API uses predictable, 
    resource-oriented URLs, as well as HTTP response codes to 
    indicate errors. It also uses built-in HTTP features, like HTTP 
    authentication and HTTP verbs, which are understood by standard 
    HTTP clients.
servers:
  - url: https://{siteName}.eliteextra.com
    variables:
      siteName:
        default: demoSite
        description: Your Elite EXTRA site name to use.
    description: URL to your Elite EXTRA site
tags:
  - name: Order JSON API
    description: |
      This API exposes the necessary tooling to integrate Order JSONs
      into your Elite EXTRA site.
paths:
  /x/api/upload_order:
    post:
      summary: Upload an Order JSON
      tags:
        - Order JSON API
      description: Upload order JSON data to an EXTRA site.
      parameters:
        - in: header
          name: X-Name
          schema:
            type: string
            default: filename.json
          required: true
      security:
        - basicAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Order"
      responses:
        "200":
          description: OK; Request valid. Operation successful.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"
        "400":
          description: Bad Request; Request invalid. Fix, then resend.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadRequest"
        "401":
          description: Unauthorized; Request invalid. Invalid or missing user/pass. Check Authorization.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Unauthorized"
        "500":
          description: Internal Server Error; Request invalid due to server error. Retry later.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ServerError"
security:
  - basicAuth: []
components:
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
  schemas:
    Success:
      properties:
        details:
          type: string
          description: Processing message.
          example: Uploaded file
        filename:
          type: string
          description: Filename provided in request.
          example: ABC123.json
        hash:
          type: string
          description: Lowercased MD5 checksum.
          example: 30wafsdf213awfasdf2q3r
        site:
          type: string
          description: Site uploaded for.
          example: my-site
        tracking:
          type: string
          description: Tracking number.
          example: ABCDE12345
        valid:
          type: boolean
          description: True when request body is valid JSON.
    BadRequest:
      properties:
        details:
          type: string
          description: Message details explaining why the request is bad.
          example: The supplied data's schema is invalid.
        filename:
          type: string
          description: Filename provided in request.
          example: ABC123.json
        site:
          type: string
          description: Site uploaded for.
          example: my-site
        valid:
          type: boolean
          description: True when request body is valid JSON.
          example: False
    Unauthorized:
      properties:
        details:
          type: string
          description: Message details explaining why the request is unauthorized.
          example: Supplied username or password is not valid.
        filename:
          type: string
          description: Filename provided in request.
          example: ABC123.json
        site:
          type: string
          description: Site uploaded for.
          example: my-site
    ServerError:
      properties:
        details:
          type: string
          description: Message details explaining why the request failed.
          example: The server currently has too many requests.
        filename:
          type: string
          description: Filename provided in request.
          example: ABC123.json
        site:
          type: string
          description: Site uploaded for.
          example: my-site
    Order:
      required:
        - id
        - warehouse
      properties:
        id:
          type: string
          description: A unique ID.
          example: 1234asbc
        warehouse:
          $ref: "#/components/schemas/Warehouse"
          description: The warehouse that will be managing the provided order.
          example: 01
        po:
          type: string
          description: The purchase order number.
          example: 1234abcd
        ship_via:
          type: string
          decription: The shipping method to use
          example: north
        invoice:
          type: string
          description: A generic order identifier, this is the main identifier in the user.
          example: 1234abcd
        invoice_time:
          type: string
          format: date-time
          description: The time when the order was created in API user's system
          example: 2015-12-14T09:33:22Z
        type:
          type: string
          description: Use `I` or `P` These stand for invoice or pickup. Sending `P` will flip the source and destination to create a pickup. For more information on how these are processed within the Elite EXTRA System, please contact support.
          enum:
            - I
            - P
          example: I
        cash_on_delivery:
          type: boolean
          description: True when the driver should collect cash or check payment on delivery.
        pay_type:
          type: string
          description: A free text field used to store the payment terms.
          example: CHG60
        void_time:
          type: string
          format: date-time
          description: The time when the order has been voided.
          example: 2015-12-14T09:33:22Z
        print_time:
          type: string
          format: date-time
          description: The time when the order was printed in the API user's system.
          example: 2015-12-14T09:33:22Z
        comment:
          type: string
          description: A comment about the order.
          example: A valuable order
        instructions:
          type: string
          descriptions: Some instructions about the order
          example: Some valuable instructions
        ecommerce_id:
          type: string
          description: Thirty six characters of free text set by the API user to use as desired.
          example: 123456
        priority_code:
          type: string
          description: Priority codes must first be set up in the Elite EXTRA system. Once setup, the desired text is used to determine order priority across various features. For more information, please contact Elite EXTRA support.
          example: A
        manifest_locked_position:
          type: integer
          description: The desired stop sequence for the order Example, if you supply a 5, this will be stop 5 on a manifest.
          example: 1
        held:
          type: boolean
          description: When the value is set to true, the order will be held in the Elite EXTRA system.
        parts:
          type: integer
          description: The number of parts contained within the order.
          example: 10
        will_call:
          type: boolean
          description: Will flag the order as will call and will be available on the Will Call grid
        delivery_zone:
          type: string
          description: The zone the order should belong to.
          example: A really neat delivery zone
        route_number:
          type: string
          description: The number of the route the order is supposed to be on.
          example: AFZ123
        manifest_number:
          type: string
          description: The number of the manifest correlated to the order.
          example: the manifest number
        requested_start:
          type: string
          format: date-time
          description: The beginning of the desired delivery window.
          example: 2015-12-14T09:33:22Z
        requested_end:
          type: string
          format: date-time
          description: The conclusion of the desired delivery window.
          example: 2015-12-14T09:33:22Z
        load_type:
          type: string
          description: The general classifaction for the type of items being delivered. The setup of load types in the Elite EXTRA system should be coordinated with the integration support team.
          example: framing
        stop_duration:
          type: integer
          description: The anticipated total time of the stop in minutes.
          example: 30
        load_duration:
          type: integer
          description: The anticipated time to load the order onto a vehicle in minutes.
          example: 30
        delivered:
          type: boolean
          description: True when delivered
        delivery_time:
          type: string
          format: date-time
          description: The time the order was delivered.
          example: 2015-12-14T09:33:22Z
        weight:
          type: number
          description: The total weight of the order
          example: 123.4
        volume:
          type: number
          description: The total volume of the order.
          example: 12.3
        cubes:
          type: integer
          description: This is a cubic unit of measure. The most common usage would represent cubic feet or cubic meters that the order occupies.
          example: 12
        pallets:
          type: integer
          description: The number of pallets
          example: 12
        backorder:
          type: boolean
          description: A visual aid to show that an order is backordered.
        hazmat:
          type: boolean
          description: True indicates that the order contains hazardous materials.
        postponed:
          type: boolean
          description: True indicates that the order has been postponed.
        voided:
          type: boolean
          description: True will void the order in the Elite EXTRA system.
        drop_ship:
          type: boolean
          description: True when the order is a drop shipment.
        notes:
          type: string
          description: The delivery instructions to be read by the driver.
          example: Deliver by 5 PM; Deliver to back door.
        picked_by:
          type: string
          description: The name of the person who pulled the order.
          example: John Doe
        caller_name:
          type: string
          description: The name of the person who called in the order.
          example: Jane Doe
        caller_phone:
          type: string
          description: The phone number of the person who called in the order
          example: +12122223452
        reference_number:
          type: string
          description: A free text order identification field.
          example: XJC
        wait_time:
          type: string
          description: The expected wait time at the stop. HH:mm
          example: 10:12
        price:
          type: number
          description: The sum of all fees or a general invoice amount.
          example: 99.99
        cost:
          type: number
          description: The supplier's cost of goods on the order.
          example: 75.99
        tax:
          type: number
          description: The tax on the order.
          example: 5.99
        deposit:
          type: number
          description: The deposit put down on the order.
          example: 56.99
        freight:
          type: number
          description: The freight charge on the order.
          example: 22.32
        bill_to:
          $ref: "#/components/schemas/Location"
          description: The location used for billing
        ship_to:
          $ref: "#/components/schemas/Location"
          description: The end destination of the order.
        sales_person:
          $ref: "#/components/schemas/SalesPerson"
          description: The contact information of the person who sold the order.
        vehicle:
          $ref: "#/components/schemas/Vehicle"
          description: The suggested vehicle to use for an order.
        items:
          type: array
          items:
            $ref: "#/components/schemas/Item"
    Warehouse:
      properties:
        id:
          type: string
          description: The Elite EXTRA ID of the warehouse location.
        source:
          $ref: "#/components/schemas/Location"
          description: The source of the delivery.
        destination:
          $ref: "#/components/schemas/Location"
          description: The destination of the delivery.
        ordered_by:
          $ref: "#/components/schemas/Location"
          description: The ordered by location.
    Location:
      properties:
        id:
          type: string
          description: The ID or account number of the customer.
          example: 123456
        notes:
          type: string
          description: These notes are stored on the customer record and surfaced to the driver making deliveries.
          example: Closes at 5 PM
        name:
          type: string
          description: The business name.
          example: customer name
        address_line_1:
          type: string
          description: The first line of the address.
          example: 1234 First Ave
        address_line_2:
          type: string
          description: The second line of the address.
          example: Suite 2
        address_line_3:
          type: string
          description: The third line of the address.
        address_line_4:
          type: string
          description: The fourth line of the address.
        city:
          type: string
          description: The city the location is in.
          example: Eau Claire
        state:
          type: string
          description: The state the location is in.
          example: WI
        zip:
          type: string
          description: The zipcode of the location.
          example: 54703
        zip_ext:
          type: string
          description: The zipcode extension of the lcoation.
        country:
          type: string
          description: The country the location is in.
          example: US
        primary_phone:
          type: string
          description: The internationally formatted phone number.
          example: +12213246534
        other_phones:
          type: array
          items:
            type: string
            example: ["+112345678904", "+19876543210"]
        primary_email:
          type: string
          description: The primary email address.
          example: support@eliteextra.com
        latitude:
          type: number
          description: The latitude of the location as a decimal number.
          example: 44.885582
        longitude:
          type: number
          description: The longitude of the location as a decimal number.
          example: -91.552109
        priority_code:
          type: string
          description: The priority code of the customer record.
          example: A
        zone:
          type: string
          description: Similar to shipvia.
          example: North
        email_eta:
          type: boolean
          description: Set to true when ETA must be emailed.
        email_proof_of_delivery:
          type: boolean
          description: Set to true when proof of deliveries must be emailed.
        email_return:
          type: boolean
          description: Set to true when returns must be emailed.
        text_eta:
          type: boolean
          description: Set to true when ETA text message must be sent to phone
        stop_duration:
          type: integar
          description: The stop duration in minutes.
        delivery_window:
          type: integer
          description: The delivery window in minutes.
    SalesPerson:
      properties:
        first_name:
          type: string
          description: The first name of the person who sold the order.
          example: John
        last_name:
          type: string
          description: The last name of the person who sold the order.
          example: Doe
    Vehicle:
      properties:
        description:
          type: string
          description: The vehicle description.
          example: truck
    Item:
      properties:
        id:
          type: string
          description: The ID.
        number:
          type: string
          description: The main item product/part number.
          example: 1234abcd
        line_code:
          type: string
          description: The line code
        order_quantity:
          type: number
          description: The quantity of items.
          example: 1.23
        backorder_quantity:
          type: number
          description: The back order quantity.
        ship_quantity:
          type: number
          description: The ship quantity.
          example: 1.23
        returned_quantity:
          type: number
          description: The amount of items returned
        sales_person:
          type: string
          description: The sales person.
        sale_price:
          type: number
          description: The total sale price of the total quantity of items.
          example: 99.99
        unit_sale_price:
          type: number
          description: The price per item.
        unit_core_sale_price:
          type: number
          description: The core sale price per item.
        cost:
          type: number
          description: The cost of the total quantity of items
          example: 75.99
        unit_cost:
          type: number
          description: The unit cost per item.
        unit_core_cost:
          type: number
          description: The unit core cost per item.
        unit_service_charge:
          type: number
          description: The unit service charge per item.
        unit_size:
          type: number
          description: The unit size.
        notes:
          type: string
          description: The notes is a free text note field about the item.
        verified:
          type: boolean
          description: True when the item has neen verified.
        weight:
          type: number
          description: The weight of the item.
          example: 100
        voided:
          type: boolean
          description: Set to true when voided.
        list_price:
          type: number
          description: The list price per item.
        uom:
          type: string
          description: The unit of measure (meters or feet, etc.)
        description:
          type: string
          description: A free text description of what the item is.
          example: brake pads
        line_abbreviation:
          type: string
          description: The line abbreviation.
        stock_location:
          type: string
          description: The stock location.
        bin:
          type: string
          description: The bin
        employee:
          type: string
          description: The employee.
        employee_number:
          type: string
          description: The employee number.
        return_reason:
          $ref: "#/components/schemas/ReturnReason"
          description: The return reason.
    ReturnReason:
      properties:
        name:
          type: string
          description: The name.
        description:
          type: string
          description: The description.
