Skip to content

Import from a service

POST
/api/v1/imports
curl --request POST \
--url https://digize.com/api/v1/imports \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: 5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69' \
--header 'x-api-key: <x-api-key>' \
--data '{ "source": "shopify", "kinds": [ "products" ], "options": { "emailGiftCardCodes": true, "sinceDays": 1 } }'

Imports the chosen kinds from a connected service in the background: Shopify, WooCommerce and Square’s products, customers, orders and gift cards into Commerce; PayPal’s transactions into Payments as records; HubSpot’s and Salesforce’s companies, contacts, deals and notes into the CRM; Calendly’s event types and bookings into Calendars. Records are matched by the service’s own ids, so importing again updates what changed and duplicates nothing. Orders come in as history: no stock moves, emails or automations.

Needs the settings:write permission.

Idempotency-Key
string
>= 1 characters <= 255 characters

Makes the request safe to send again: for 24 hours the same key and request answer the first response without repeating the change.

Example

5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69
Media typeapplication/json
object
source
required
string
Allowed values: shopify woocommerce square paypal hubspot salesforce calendly
kinds
required

Kinds the service brings, such as products and orders.

Array<string>
>= 1 items
Allowed values: products customers orders gift_cards companies contacts deals notes transactions event_types bookings
options
object
emailGiftCardCodes

Shopify: bring gift cards over with new codes emailed to their customers, since Shopify doesn’t show codes.

boolean
sinceDays

PayPal: how many days back to read; a year when left out.

integer
>= 1 <= 1095

Done

Media typeapplication/json
object
id
required
string
source
required
string
Allowed values: shopify woocommerce square paypal hubspot salesforce calendly
kinds
required
Array<string>
Allowed values: products customers orders gift_cards companies contacts deals notes transactions event_types bookings
options
required
object
emailGiftCardCodes
boolean
sinceDays
number
status
required
string
Allowed values: running completed failed cancelled
counts
required
object
key
additional properties
object
read
required

Records read from the service.

number
created
required
number
updated
required
number
unchanged
required

Records already imported that hadn’t changed since.

number
failed
required

Records it couldn’t take, each in problems.

number
done
required

Whether every page of this kind is in.

boolean
current
required
Any of:
string
Allowed values: products customers orders gift_cards companies contacts deals notes transactions event_types bookings
problems
required

The first 200 records it couldn’t take, and warnings.

Array<object>
object
kind
required
string
externalId
required

The service’s id for it.

string
label
required
string
message
required
string
warning

It came in, with something left out.

boolean
error
required

Why the run stopped.

string | null
actorName
required
string
startedAt
required
string format: date-time
finishedAt
required
Any of:
string format: date-time

Example

{
"source": "shopify",
"kinds": [
"products"
],
"status": "running",
"current": "products"
}

What was sent isn’t valid (invalid).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

No key, or one that’s unknown, off or expired.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

The key doesn’t have the permission this needs.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

Nothing has that id (not_found).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

A request with the same Idempotency-Key is still running (conflict).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

The Idempotency-Key was used with a different request.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

Over the rate limit; see retry-after.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}