Newstore provider-rates API

Provider Rates

OpenAPI Specification

newstore-provider-rates-api-openapi.yml Raw ↑
swagger: '2.0'
info:
  version: '1.0'
  title: NewStore address provider-rates 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: provider-rates
  description: Provider Rates
  externalDocs:
    url: https://docs.newstore.com/docs/tutorial-setting-up-a-fulfillment-configuration#provider-rates
    description: Endpoints for configuring provider rates and their priorities
paths:
  /fulfillment/provider-rate-priorities:
    get:
      description: ''
      summary: showProviderRatePriorities
      tags:
      - provider-rates
      operationId: showProviderRatePriorities
      deprecated: false
      produces:
      - application/problem+json
      - application/json
      parameters: []
      responses:
        default:
          description: Unexpected Error
          schema:
            $ref: '#/definitions/Problem'
          headers: {}
        '200':
          description: Successful Response
          schema:
            type: object
            additionalProperties: {}
          headers: {}
        '400':
          description: Validation Error
          schema:
            $ref: '#/definitions/Problem'
          headers: {}
        '429':
          description: Too Many Requests
          schema:
            $ref: '#/definitions/Problem'
          headers:
            Retry-After:
              type: string
        '500':
          description: Internal Server Error
          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:
        - newstore:configuration:read
    put:
      description: ''
      summary: replaceProviderRatePriorities
      tags:
      - provider-rates
      operationId: replaceProviderRatePriorities
      deprecated: false
      produces:
      - application/problem+json
      - application/json
      consumes:
      - application/json
      parameters:
      - name: Content-Type
        in: header
        required: false
        enum:
        - application/json
        type: string
        description: ''
      - name: body
        in: body
        required: true
        description: ''
        schema:
          type: object
          additionalProperties: {}
      responses:
        default:
          description: Unexpected Error
          schema:
            $ref: '#/definitions/Problem'
          headers: {}
        '200':
          description: Successful Response
          schema:
            type: object
            additionalProperties: {}
          headers: {}
        '400':
          description: Validation Error
          schema:
            $ref: '#/definitions/Problem'
          headers: {}
        '429':
          description: Too Many Requests
          schema:
            $ref: '#/definitions/Problem'
          headers:
            Retry-After:
              type: string
        '500':
          description: Internal Server Error
          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:
        - newstore:configuration:write
  /fulfillment/provider-rates:
    get:
      description: ''
      summary: listProviderRates
      tags:
      - provider-rates
      operationId: listProviderRates
      deprecated: false
      produces:
      - application/problem+json
      - application/json
      parameters: []
      responses:
        default:
          description: Unexpected Error
          schema:
            $ref: '#/definitions/Problem'
          headers: {}
        '200':
          description: Successful Response
          schema:
            $ref: '#/definitions/ShowProviderRatesSchema'
          headers: {}
        '400':
          description: Validation Error
          schema:
            $ref: '#/definitions/Problem'
          headers: {}
        '429':
          description: Too Many Requests
          schema:
            $ref: '#/definitions/Problem'
          headers:
            Retry-After:
              type: string
        '500':
          description: Internal Server Error
          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:
        - newstore:configuration:read
  /fulfillment/provider-rates/{provider_rate_id}:
    delete:
      description: ''
      summary: destroyProviderRate
      tags:
      - provider-rates
      operationId: destroyProviderRate
      deprecated: false
      produces:
      - application/problem+json
      - application/json
      parameters:
      - name: provider_rate_id
        in: path
        required: true
        type: string
        description: ''
      responses:
        default:
          description: Unexpected Error
          schema:
            $ref: '#/definitions/Problem'
          headers: {}
        '200':
          description: Successful Response
          schema: {}
          headers: {}
        '400':
          description: Validation Error
          schema:
            $ref: '#/definitions/Problem'
          headers: {}
        '429':
          description: Too Many Requests
          schema:
            $ref: '#/definitions/Problem'
          headers:
            Retry-After:
              type: string
        '500':
          description: Internal Server Error
          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:
        - newstore:configuration:write
    get:
      description: ''
      summary: showProviderRate
      tags:
      - provider-rates
      operationId: showProviderRate
      deprecated: false
      produces:
      - application/problem+json
      - application/json
      parameters:
      - name: provider_rate_id
        in: path
        required: true
        type: string
        description: ''
      responses:
        default:
          description: Unexpected Error
          schema:
            $ref: '#/definitions/Problem'
          headers: {}
        '200':
          description: Successful Response
          schema:
            $ref: '#/definitions/ProviderRateSchema'
          headers: {}
        '400':
          description: Validation Error
          schema:
            $ref: '#/definitions/Problem'
          headers: {}
        '429':
          description: Too Many Requests
          schema:
            $ref: '#/definitions/Problem'
          headers:
            Retry-After:
              type: string
        '500':
          description: Internal Server Error
          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:
        - newstore:configuration:read
    put:
      description: ''
      summary: replaceProviderRate
      tags:
      - provider-rates
      operationId: replaceProviderRate
      deprecated: false
      produces:
      - application/problem+json
      - application/json
      consumes:
      - application/json
      parameters:
      - name: provider_rate_id
        in: path
        required: true
        type: string
        description: ''
      - name: Content-Type
        in: header
        required: false
        enum:
        - application/json
        type: string
        description: ''
      - name: body
        in: body
        required: true
        description: ''
        schema:
          $ref: '#/definitions/ReplaceProviderRateSchema'
      responses:
        default:
          description: Unexpected Error
          schema:
            $ref: '#/definitions/Problem'
          headers: {}
        '200':
          description: Successful Response
          schema:
            $ref: '#/definitions/ProviderRateSchema'
          headers: {}
        '400':
          description: Validation Error
          schema:
            $ref: '#/definitions/Problem'
          headers: {}
        '429':
          description: Too Many Requests
          schema:
            $ref: '#/definitions/Problem'
          headers:
            Retry-After:
              type: string
        '500':
          description: Internal Server Error
          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:
        - newstore:configuration:write
definitions:
  ProviderRateSchema:
    title: ProviderRateSchema
    type: object
    properties:
      carrier_defined_service_level:
        description: Carrier specific name that defines the service level. When defining provider rates with the same shipping provider, the value you specify here must be unique and should always match the name defined by the shipping provider API. For example, 'NextDayAirSaver' for UPS and 'GROUND_HOME_DELIVERY' for FedEx. If no value is provided, NewStore uses the unique identifier of the provider rate as the default value.
        type: string
      id:
        description: ID of the provider rate.
        type: string
      return_provider_rate_id:
        description: The ID for the provider rate used for the return shipment.
        type: string
      service_level_id:
        description: Service level that the provider rate corresponds to.
        type: string
      shipping_carrier_name:
        description: The name of shipping provider associated with this provider rate.
        type: string
      shipping_type:
        type: object
        allOf:
        - $ref: '#/definitions/ProviderRateShippingType'
        - description: Required for backwards compatibility purposes.
      use_as_customer_facing_cost:
        description: Flag to indicate if the shipping provider cost is used instead of the service level cost defined in the fulfillment configuration. If set to true, the cost quoted by the shipping provider is displayed to the customer.
        type: boolean
    required:
    - carrier_defined_service_level
    - id
    - return_provider_rate_id
    - service_level_id
    - shipping_carrier_name
    - shipping_type
    - use_as_customer_facing_cost
  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
  ProviderRateShippingType:
    title: ProviderRateShippingType
    description: Required for backwards compatibility purposes.
    type: string
    enum:
    - traditional_carrier
    - same_day_delivery
    - in_store_pick_up
  ShowProviderRatesSchema:
    title: ShowProviderRatesSchema
    type: object
    properties:
      data:
        type: array
        items:
          $ref: '#/definitions/ProviderRateSchema'
    required:
    - data
  ReplaceProviderRateSchema:
    title: ReplaceProviderRateSchema
    type: object
    properties:
      carrier_defined_service_level:
        description: Carrier specific name that defines the service level. When defining provider rates with the same shipping provider, the value you specify here must be unique and should always match the name defined by the shipping provider API. For example, 'NextDayAirSaver' for UPS and 'GROUND_HOME_DELIVERY' for FedEx. If no value is provided, NewStore uses the unique identifier of the provider rate as the default value.
        type: string
      return_provider_rate_id:
        description: The ID for the provider rate used for the return shipment.
        type: string
      service_level_id:
        description: Service level that the provider rate corresponds to.
        type: string
      shipping_carrier_name:
        description: The name of shipping provider associated with this provider rate.
        type: string
      shipping_type:
        type: object
        allOf:
        - $ref: '#/definitions/ProviderRateShippingType'
        - description: Required for backwards compatibility purposes.
      use_as_customer_facing_cost:
        description: Flag to indicate if the shipping provider cost is used instead of the service level cost defined in the fulfillment configuration. If set to true, the cost quoted by the shipping provider is displayed to the customer.
        type: boolean
    required:
    - carrier_defined_service_level
    - return_provider_rate_id
    - service_level_id
    - shipping_carrier_name
    - shipping_type
    - use_as_customer_facing_cost
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