Canal shipping API

The shipping API from Canal — 1 operation(s) for shipping.

OpenAPI Specification

canal-shipping-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Rokt Catalog csv shipping API
  version: 1.0.1
  description: Integrate with Rokt Catalog
servers:
- url: https://api.shopcanal.com/platform
  description: Rokt Catalog Storefront Public API
tags:
- name: shipping
paths:
  /shipping/v1/calculate/:
    post:
      operationId: shipping_v1_calculate_create
      description: Calculate shipping rates for supplier variants identified by `supplier_variant_rid` and `supplier_id`. Requires the ROKT_ADS_SHOP feature flag.
      tags:
      - shipping
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ShippingCalculationQuery'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ShippingCalculationQuery'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ShippingCalculationQuery'
        required: true
      security:
      - platformAppId: []
        platformAppToken: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShippingCalculationResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: ''
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: ''
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: ''
components:
  schemas:
    ShippingDetailsData:
      type: object
      properties:
        price:
          type: string
        code:
          type: string
        title:
          type: string
        description:
          type: string
          nullable: true
          default: ''
      required:
      - code
      - price
      - title
    ShippingLineItemData:
      type: object
      properties:
        supplier_variant_rid:
          type: string
        supplier_id:
          type: string
          format: uuid
        quantity:
          type: integer
        shipping_amount:
          type: string
        shipping_details:
          $ref: '#/components/schemas/ShippingDetailsData'
      required:
      - quantity
      - shipping_amount
      - shipping_details
      - supplier_id
      - supplier_variant_rid
    TaxAndShippingAddress:
      type: object
      description: Address serializer for tax and shipping calculations where address1 and name are optional
      properties:
        name:
          type: string
        address1:
          type: string
        address2:
          type: string
        city:
          type: string
        province:
          type: string
        province_code:
          type: string
        country:
          type: string
        country_code:
          type: string
        zip:
          type: string
        phone:
          type: string
      required:
      - city
      - country
      - province
      - zip
    SupplierShippingLineItem:
      type: object
      properties:
        supplier_variant_rid:
          type: string
        supplier_id:
          type: string
          format: uuid
        quantity:
          type: integer
          minimum: 1
      required:
      - quantity
      - supplier_id
      - supplier_variant_rid
    ShippingCalculationResponse:
      type: object
      properties:
        line_items:
          type: array
          items:
            $ref: '#/components/schemas/ShippingLineItemData'
          description: List of shipping calculation results per line item.
        calculation_errors:
          type: array
          items:
            type: string
          description: Error messages
      required:
      - calculation_errors
      - line_items
    ShippingCalculationQuery:
      type: object
      properties:
        line_items:
          type: array
          items:
            $ref: '#/components/schemas/SupplierShippingLineItem'
        shipping_address:
          allOf:
          - $ref: '#/components/schemas/TaxAndShippingAddress'
          description: The destination address, including fields like `city`, `province_code`, `country_code`, `zip`. `address1`, `name` and `phone` are optional but recommended.
      required:
      - line_items
      - shipping_address
    Error:
      type: object
      properties:
        message:
          type: string
        detail: {}
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
    platformAppId:
      type: apiKey
      in: header
      name: X-CANAL-APP-ID
    platformAppToken:
      type: apiKey
      in: header
      name: X-CANAL-APP-TOKEN