Methods


Entity Properties


import.search(null|object $filters, array $options = []) Retrieve list of imports. Filtration could be applied.

Parameters

filters
null | object
  • null - Retrieve list of all imports.
  • object - Retrieve list of imports using specified Search Filters.
options
array
  • null - No options will be applied.
  • object - Apply specified Search Options.

Return Value

An array of objects. Each object will contain Import Properties.

Example Request

Get import details for one import id:
Request
{
    "jsonrpc" : 2.0,
    "id" : 1234,
    "method" : "call",
    "params" : [
        "be1c13ed4e03f0ed7f1e4053dfff9658",
        "import.search",
        [
            {
                "task_id" : {
                    "eq" : 1
                }
            },
            []
        ]
    ]
}

Example Response

Response
{
    "jsonrpc" : 2.0,
    "id" : 1234,
    "error" : null,
    "result" : [
        {
            "task_id" : 1,
            "status" : "complete",
            "progress" : 100,
            "num_records" : 6,
            "num_parse_success" : 6,
            "num_parse_failures" : 0,
            "num_submit_success" : 1,
            "num_submit_failures" : 5
        }
    ]
}

Error Codes

codemessage
101Invalid filters given. Details in error message.

import.info

import.info (string $taskId, null|object $fields = []) Retrieve full order information.

Parameters

taskId
string
Import unique ID.
fields
null | object
  • null - Retrieve basic import properties.
  • array - Defined list of properties to retrieve. “records” will add records information which is excluded by default.

Return Value

Object which contains the specified (or default if no fields parameter was given) Import Properties.

Example Request

Get order information for the specified order:
Request
{
    "jsonrpc" : 2.0,
    "id" : 1234,
    "method" : "call",
    "params" : [
        "be1c13ed4e03f0ed7f1e4053dfff9658",
        "import.info",
        [
            3,
            [
                "records"
            ]
        ]
    ]
}

Example Response

Response
{
    "jsonrpc" : 2.0,
    "id" : 1234,
    "error" : null,
    "result" : {
        "task_id" : 1,
        "status" : "complete",
        "progress" : 100,
        "num_records" : 6,
        "num_parse_success" : 6,
        "num_parse_failures" : 0,
        "num_submit_success" : 1,
        "num_submit_failures" : 5,
        "records" : [
            {
                "entity_id" : "10000045",
                "parse_status" : "valid",
                "submit_status" : "complete"
            }
        ]
    }
}

Error Codes

codemessage
100Requested import does not exist.

import.create

import.create (string $data, string $entityType, null|object $options) Import data.

Parameters

data
string
base64 encoded string.
entityType
string
Entity type. Allowed: “product”, “order”, “delivery”, “bom”.
options
null | object
Apply specified Import Options.

Return Value

The internal import id.

Example Request

Request
{
    "jsonrpc" : 2.0,
    "id" : 1234,
    "method" : "call",
    "params" : [
        "be1c13ed4e03f0ed7f1e4053dfff9658",
        "import.create",
        [
            "base64 encoded data",
            "order",
            {
                "handle_duplicates" : "drop",
                "send_email_on_complete" : 1,
                "email" : "email@example.com",
                "hold_orders" : "hold"
            }
        ]
    ]
}

Example Response

Response
{
    "jsonrpc" : 2.0,
    "id" : 1234,
    "error" : null,
    "result" : 7
}

Error Codes

codemessage
101Invalid filters given. Details in error message.
103Invalid file type given.
104Invalid file data given.
105Internal error occurred.
106Internal error occurred while converting the import file to CSV format.
107Internal error occurred while scheduling import job.

Entity Properties

Import Options Properties

Import Properties