Cordial Productimports API

The productimports API from Cordial — 2 operation(s) for productimports.

OpenAPI Specification

cordial-productimports-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Cordial Productimports API
  termsOfService: https://cordial.zendesk.com
  version: '1.0'
  description: 'Operations tagged productimports across 2 of this provider''s published API definitions: cordial-v1-openapi-original.json, cordial-v2-openapi-original.json. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.cordial.io/
tags:
- name: productimports
paths:
  /v1/productimports:
    post:
      security:
      - basicAuth: []
      summary: Create a product import job
      tags:
      - productimports
      operationId: productimport
      responses:
        '200':
          description: successful operation
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JobPI'
        description: Import new products
        required: true
  /v2/productimports:
    post:
      security:
      - basicAuth: []
      summary: Create a product import job
      description: Creates an import job to batch load a file of products into the Cordial database from an external location. Supported import file types include CSV and JSONL. Column headers need to be the product attribute field names. First row column headers describe the data for that column. Column headers are not required in CSV. They can be included as an array within the API call in the "columns" field.
      tags:
      - productimports
      operationId: productimport
      responses:
        '201':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductImportsResponse'
        '400':
          description: bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductImportsError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JobPI_2'
        description: JSON body information to create the import job.
        required: true
components:
  schemas:
    JobPI:
      title: Job
      type: object
      required:
      - source
      properties:
        importName:
          type: string
          description: If field provided, will be shown in Job Widget
        source:
          $ref: '#/components/schemas/SourceSup'
        confirmEmail:
          type: string
        hasHeader:
          type: boolean
          description: required, if 'columns' is not included, if imported file 'jsonl' hasHeader will be ignored
        columns:
          type: array
          items:
            type: string
          description: required, if 'hasHeader' is not explicitly set to 'true', if imported file 'jsonl' columns will be ignored
        nullMarker:
          type: string
    JobPI_2:
      title: Job
      type: object
      required:
      - source
      properties:
        importName:
          type: string
          description: If provided, this value will be displayed next to the job ID on the Jobs status page.
        source:
          $ref: '#/components/schemas/SourceObject'
        confirmEmail:
          type: string
        hasHeader:
          type: boolean
          description: Determines if the first row column headers will be present. Default is `false`. Required if `columns` parameter is <b>not</b> included. If import file type is <b>JSONL</b>, `hasHeader` will be ignored.
        columns:
          type: array
          items:
            type: string
          description: An array of import file column headers, arranged from left to right by column position. Using "" will ignore the entire column. Required if `hasHeader` is not explicitly set to `true`. If imported file type is <b>JSONL</b>, `columns` will be ignored.
        nullMarker:
          type: string
          description: Defines the value to use for ignoring or skipping attribute updates. Upon import, if an attribute contains the nullMarker value (i.e. ignore), then the attribute will be skipped or ignored.
    ProductImportsResponse:
      title: ProductImports
      type: object
      required:
      - jobId
      properties:
        jobId:
          type: string
    SourceObject:
      title: Source
      type: object
      required:
      - transport
      - url
      - path
      properties:
        transport:
          type: string
          description: Transport options include HTTP, HTTPS, FTP, SFTP, S3, GCS, AZUREBLOB, SNOWFLAKE .
        aws_access_key_id:
          type: string
          description: Defines the public AWS access key ID. Required if transport is S3 and IAM role is not configured.
          example: WIfdavFHS8adsfhad98df
        aws_secret_access_key:
          type: string
          description: Defines the secret AWS access key. Required if transport is S3 and IAM role is not configured.
          example: dudhKDDHE476383kdsdhdka
        aws_bucket:
          type: string
          description: Defines the AWS bucket name. Required if transport is S3.
          example: my_bucket
        aws_region:
          type: string
          description: Defines the AWS region (e.g. us-west-2). Required if transport is S3.
          example: us-west-2
        url:
          type: string
          description: URL or location of the import file (e.g. http://files.example.com/file.csv).
          example: http://files.example.com/file.csv
        server:
          type: string
          description: Domain or IP address for the FTP/SFTP server (e.g. sftp.example.com). Required for FTP and SFTP transports.
          example: example.com
        port:
          type: integer
          description: Defines the port number for the FTP or SFTP server (e.g. 22). Required for FTP and SFTP transports.
        username:
          type: string
          description: Defines the username for FTP or SFTP authentication. Required for FTP and SFTP transports.
          example: myusername
        password:
          type: string
          description: Defines the password for FTP or SFTP authentication. Required for FTP and SFTP transports.
          example: Msm1th$99!
        savedKey:
          type: string
          description: SFTP public authentication key name if using SFTP public key authentication instead of password.
        path:
          type: string
          description: Path to folder where the import file is located. Required if transport is FTP, SFTP, S3, GCS, or AZUREBLOB.
          example: files/file.csv
        buket:
          type: string
          description: Defines the GCS bucket name. Required if transport is GCS.
          example: name_used_in_marketplace_setup
        account:
          type: string
          description: Defines the Azure Blob Storage or Snowflake account name. Required if destination is AZUREBLOB or SNOWFLAKE.
        container:
          type: string
          description: Defines the Azure Blob Storage container name. Required if destination is AZUREBLOB.
        database:
          type: string
          description: Defines the Snowflake database. Required if destination is SNOWFLAKE.
        schema:
          type: string
          description: Defines the Snowflake schema. Required if destination is SNOWFLAKE.
        source:
          type: string
          description: Defines the Snowflake table or view. Required if destination is SNOWFLAKE.
    ProductImportsError:
      title: ProductImportsError
      required:
      - error
      - errorKey
      - message
      type: object
      properties:
        error:
          type: boolean
          example: true
        errorKey:
          type: string
          example: GENERIC_ERROR_KEY
        message:
          type: string
          example: Error validation message
          description: 'Error explanation. Possible errors: [''Store type not supported'', ''Transport is not set or invalid format'', ''Job could not be created'', etc.]'
    SourceSup:
      title: Source
      type: object
      required:
      - transport
      - url
      - path
      properties:
        transport:
          type: string
          enum:
          - ftp
          - http
          - sftp
          - s3
        aws_access_key_id:
          type: string
          description: (required for s3)
        aws_secret_access_key:
          type: string
          description: (required for s3)
        aws_bucket:
          type: string
          description: (required for s3)
        aws_region:
          type: string
          description: (required for s3)
        url:
          type: string
        server:
          type: string
          enum:
          - ftp
          - sftp
        port:
          type: integer
        username:
          type: string
          description: (optional for http basic auth)
        password:
          type: string
          description: (optional for http basic auth)
        path:
          type: string
          description: (filepath only for s3)
          enum:
          - ftp
          - sftp
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: HTTP Basic Authentication. Works over HTTPS
x-refined-from:
- cordial-v1-openapi-original.json
- cordial-v2-openapi-original.json