Newstore routing API

Routing

OpenAPI Specification

newstore-routing-api-openapi.yml Raw ↑
swagger: '2.0'
info:
  version: '1.0'
  title: NewStore address routing API
  description: NewStore public APIs
  contact:
    email: support@newstore.com
    name: NewStore API Support
    url: https://developer.newstore.com
host: dodici-demo.p.newstore.net
basePath: /
schemes:
- https
consumes:
- application/json
produces:
- application/json
security: []
tags:
- name: routing
  description: Routing
paths:
  /v0/routing/insights/order/{order_id}:
    get:
      description: 'Get insights on routing and shipment details for orders being processed in the NewStore platform.

        This includes details such as:


        - Items in the order

        - The fulfillment location that is assigned to fulfill orders

        - The time when the shipment was dispatched from the fulfillment location

        - Order routing strategies

        - Service levels


        Data is retained up to 45 days for successfully routed order items. Until order items have been successfully routed, related data is retained indefinitely.

        '
      summary: listOrderRoutingInsights
      tags:
      - routing
      operationId: listOrderRoutingInsights
      deprecated: false
      produces:
      - application/json
      - application/problem+json
      parameters:
      - name: order_id
        in: path
        required: true
        type: string
        description: A sales order UUID or external order ID
      responses:
        default:
          description: Default response
          headers: {}
        '200':
          description: Successfully returning routing insights for the specified order
          schema:
            $ref: '#/definitions/RoutingInsights'
          headers: {}
        '404':
          description: 'Not found

            * No path parameter'
          headers: {}
        '429':
          description: Too Many Requests
          schema:
            $ref: '#/definitions/Problem'
          headers:
            Retry-After:
              type: string
        '500':
          description: An internal error occurred.
          schema:
            $ref: '#/definitions/Problem'
          headers: {}
        '502':
          description: Bad Gateway
          schema:
            $ref: '#/definitions/Problem'
          headers: {}
        '503':
          description: Service Unavailable
          schema:
            $ref: '#/definitions/Problem'
          headers: {}
      security:
      - oauth: []
definitions:
  RoutingInsightsRoutingStrategy1:
    title: RoutingInsightsRoutingStrategy1
    type: object
    properties:
      fulfillment_node_id:
        type: string
        minLength: 1
      strategy:
        $ref: '#/definitions/RoutingInsightsStrategyType'
    required:
    - strategy
  Current:
    title: Current
    description: The current routing strategy
    type: object
    properties:
      fulfillment_node_id:
        type: string
        minLength: 1
      strategy:
        $ref: '#/definitions/RoutingInsightsStrategyType'
    required:
    - strategy
  Problem:
    title: Problem
    type: object
    properties:
      detail:
        description: A human readable explanation specific to this occurrence of the problem that is helpful to locate the problem and give advice on how to proceed. Written in English and readable for engineers, usually not suited for non technical stakeholders and not localized.
        example: some description for the error situation
        type: string
      error_code:
        type: string
      instance:
        description: A URI reference that identifies the specific occurrence of the problem, e.g. by adding a fragment identifier or sub-path to the problem type. May be used to locate the root of this problem in the source code.
        example: /some/uri-reference#specific-occurrence-context
        type: string
      message:
        type: string
      messages:
        type: array
        items:
          type: string
      request_id:
        type: string
      status:
        description: The HTTP status code generated by the origin server for this occurrence of the problem.
        type: integer
        minimum: 100.0
        maximum: 600.0
        exclusiveMaximum: true
        format: int32
      title:
        description: A short summary of the problem type. Written in English and readable for engineers, usually not suited for non technical stakeholders and not localized.
        example: some title for the error situation
        type: string
      type:
        description: A URI reference that uniquely identifies the problem type only in the context of the provided API. Opposed to the specification in RFC-7807, it is neither recommended to be dereferenceable and point to a human-readable documentation nor globally unique for the problem type.
        example: /some/uri-reference
        type: string
        default: about:blank
  RoutingInsightsStrategyType:
    title: RoutingInsightsStrategyType
    type: string
    enum:
    - external
    - prerouted
    - default
    - manual
  RoutingInsightsRoutingStrategies:
    title: RoutingInsightsRoutingStrategies
    type: object
    properties:
      current:
        description: The routing strategy for each item id in this LO
        example:
          6ba7b810-9dad-11d1-80b4-00c04fd430c8:
            fulfillment_node_id: dc-456
            strategy: prerouted
          550e8400-e29b-41d4-a716-446655440000:
            fulfillment_node_id: store-123
            strategy: default
        type: object
        additionalProperties:
          $ref: '#/definitions/RoutingInsightsRoutingStrategy1'
      original:
        description: The routing strategy for each item id in this LO
        example:
          6ba7b810-9dad-11d1-80b4-00c04fd430c8:
            fulfillment_node_id: dc-456
            strategy: prerouted
          550e8400-e29b-41d4-a716-446655440000:
            fulfillment_node_id: store-123
            strategy: default
        type: object
        additionalProperties:
          $ref: '#/definitions/RoutingInsightsRoutingStrategy1'
  RoutingStatus:
    title: RoutingStatus
    type: string
    enum:
    - open
    - processed
    - cancelled
    - conflict
    - dispatched
    - ready_for_routing
    - ready_for_rerouting
    - rerouting_initiated
    - voided
    - recalculating_shipments
    - swapped
  RoutingInsightsServiceLevels:
    title: RoutingInsightsServiceLevels
    type: object
    properties:
      current:
        description: Service level with which the order was fulfilled
        type: string
        minLength: 1
      original:
        description: Service level with which the order was created
        type: string
        minLength: 1
  RoutingInsightsFulfillmentRequests:
    title: RoutingInsightsFulfillmentRequests
    description: Any fulfillment request identifiers for this LO uuid
    type: object
    properties:
      dispatched_at:
        type: string
        format: date-time
      fulfillment_node_id:
        type: string
      fulfillment_request_id:
        type: string
        format: uuid
  Salesorderitems1:
    title: Salesorderitems1
    description: Routing insights data for the current sales order item uuid
    type: object
    properties:
      conflict_reason:
        description: Current conflict reason for this sales order item. Empty, if item is not in a conflict state
        type: string
        minLength: 1
      correlation:
        type: object
        allOf:
        - $ref: '#/definitions/Correlation'
        - description: Correlation information used to interpret routing attempts by LO uuids
      product_id:
        type: string
        minLength: 1
      routing_status:
        $ref: '#/definitions/RoutingStatus'
      service_levels:
        $ref: '#/definitions/ServiceLevels'
      strategies:
        $ref: '#/definitions/Strategies'
      updated_at:
        type: string
        format: date-time
    required:
    - conflict_reason
    - correlation
    - product_id
    - routing_status
    - service_levels
    - strategies
    - updated_at
  ServiceLevels:
    title: ServiceLevels
    type: object
    properties:
      current:
        description: Service level with which the order was fulfilled
        type: string
        minLength: 1
      original:
        description: Service level with which the order was created
        type: string
        minLength: 1
  RoutingInsights:
    title: RoutingInsights
    description: Routing insights data by sales_order_uuid or external_id
    type: object
    properties:
      insights:
        type: object
        allOf:
        - $ref: '#/definitions/RoutingInsightsData'
        - description: Routing insights information for an order
    required:
    - insights
  Original:
    title: Original
    description: The original routing strategy on order creation
    type: object
    properties:
      fulfillment_node_id:
        type: string
        minLength: 1
      strategy:
        $ref: '#/definitions/RoutingInsightsStrategyType'
    required:
    - strategy
  Correlation:
    title: Correlation
    description: Correlation information used to interpret routing attempts by LO uuids
    type: object
    properties:
      current_fulfillment_request_id:
        description: The current fulfillment request ID to which this item belongs to
        type: string
        format: uuid
      current_logistic_order_id:
        description: The current LO uuid with which this sales order item is being routed
        type: string
        format: uuid
      logistic_order_ids:
        description: All LO uuids that this item was a part of
        type: array
        items:
          type: string
          format: uuid
    required:
    - current_fulfillment_request_id
    - current_logistic_order_id
    - logistic_order_ids
  RoutingInsightsData:
    title: RoutingInsightsData
    description: Routing insights information for an order
    type: object
    properties:
      activities:
        type: array
        items:
          $ref: '#/definitions/RoutingInsightsActivity'
      created_at:
        type: string
        format: date-time
      external_id:
        type: string
        minLength: 1
      sales_order_id:
        type: string
        format: uuid
      sales_order_item_ids:
        type: array
        items:
          type: string
          format: uuid
        minItems: 1
      sales_order_items:
        description: A mapping of sales order item uuid to routing insights for this item
        type: object
        additionalProperties:
          $ref: '#/definitions/Salesorderitems1'
    required:
    - activities
    - created_at
    - external_id
    - sales_order_id
    - sales_order_item_ids
    - sales_order_items
  Strategies:
    title: Strategies
    type: object
    properties:
      current:
        type: object
        allOf:
        - $ref: '#/definitions/Current'
        - description: The current routing strategy
      original:
        type: object
        allOf:
        - $ref: '#/definitions/Original'
        - description: The original routing strategy on order creation
  RoutingInsightsCorrelation:
    title: RoutingInsightsCorrelation
    description: Information regarding which entities were affected by this event
    type: object
    properties:
      ancestor_logistic_order_uuid:
        type: string
        format: uuid
      fulfillment_request:
        type: object
        allOf:
        - $ref: '#/definitions/RoutingInsightsFulfillmentRequests'
        - description: Any fulfillment request identifiers for this LO uuid
      logistic_order_uuid:
        type: string
        format: uuid
      routing_strategies:
        $ref: '#/definitions/RoutingInsightsRoutingStrategies'
      sales_order_item_ids:
        type: array
        items:
          type: string
          format: uuid
      service_levels:
        $ref: '#/definitions/RoutingInsightsServiceLevels'
    required:
    - ancestor_logistic_order_uuid
    - fulfillment_request
    - logistic_order_uuid
    - routing_strategies
    - sales_order_item_ids
    - service_levels
  RoutingInsightsActivity:
    title: RoutingInsightsActivity
    type: object
    properties:
      correlation:
        type: object
        allOf:
        - $ref: '#/definitions/RoutingInsightsCorrelation'
        - description: Information regarding which entities were affected by this event
      summary:
        description: Information regarding the event type
        type: string
      timestamp:
        type: string
        format: date-time
      type:
        description: Event type
        type: string
      value: {}
    required:
    - correlation
    - summary
    - timestamp
    - type
    - value
securityDefinitions:
  oauth:
    type: oauth2
    flow: application
    tokenUrl: https://id.p.newstore.net/auth/realms/dodici-demo/protocol/openid-connect/token
    scopes:
      catalog:import-schemas:read: Grants privileges to read import schema
      catalog:import-schemas:write: Grants privileges to write import schema
      catalog:pricebook-export:read: Grants privileges to export pricebook data
      catalog:product-export:read: Grants privileges to export product data
      checkout:carts:read: Grants privileges to read cart data
      checkout:carts:write: Grants privileges to write cart data
      clienteling:profile:read: Grants privileges to read clienteling profiles
      customer:profile:read: Grants privileges to read API customer data
      customer:profile:write: Grants privileges to modify API customer data
      newstore:configuration:read: Grants privileges to read configuration
      newstore:configuration:write: Grants privileges to write configuration
      fiscalization:orders:read: View orders with fiscal transactions and signatures
      fiscalization:orders:write: Create orders with fiscal transactions and signatures
      shipments:read: Read Shipping Options and Audits
      iam:providers:read: ' Grants read privileges to provider resources'
      iam:providers:write: ' Grants write privileges to provider resources'
      iam:roles:read: ' Grants privileges to read roles data'
      iam:roles:write: ' Grants privileges to write roles data'
      iam:users:read: ' Grants privileges to read user data'
      iam:users:write: ' Grants privileges to write user data'
      inventory:reservations:read: Allows access to retrieve reservations
      inventory:reservations:write: Allows access to create and update reservations
      promotions:config:read: Grants privileges to read configuration
      promotions:config:write: Grants privileges to write into configuration
      promotions:reason-codes:read: Grants privileges to list reason codes
      promotions:reason-codes:write: Grants privileges to create and update reason codes
      audit-events:read: Grants read access to the tenant's audit events.
      taxes:preview-transactions:write: Preview tax transactions
      taxes:transactions:read: Read tax transactions