Import from a service
const url = 'https://digize.com/api/v1/imports';const options = { method: 'POST', headers: { 'Idempotency-Key': '5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69', 'x-api-key': '<x-api-key>', 'Content-Type': 'application/json' }, body: '{"source":"shopify","kinds":["products"],"options":{"emailGiftCardCodes":true,"sinceDays":1}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”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-1f2d3c4b5a69Request Bodyrequired
Section titled “Request Bodyrequired”object
Kinds the service brings, such as products and orders.
object
Shopify: bring gift cards over with new codes emailed to their customers, since Shopify doesn’t show codes.
PayPal: how many days back to read; a year when left out.
Responses
Section titled “Responses”Done
object
object
object
object
Records read from the service.
Records already imported that hadn’t changed since.
Records it couldn’t take, each in problems.
Whether every page of this kind is in.
The first 200 records it couldn’t take, and warnings.
object
The service’s id for it.
It came in, with something left out.
Why the run stopped.
Example
{ "source": "shopify", "kinds": [ "products" ], "status": "running", "current": "products"}What was sent isn’t valid (invalid).
object
object
object
Example
{ "error": { "code": "invalid" }}No key, or one that’s unknown, off or expired.
object
object
object
Example
{ "error": { "code": "invalid" }}The key doesn’t have the permission this needs.
object
object
object
Example
{ "error": { "code": "invalid" }}Nothing has that id (not_found).
object
object
object
Example
{ "error": { "code": "invalid" }}A request with the same Idempotency-Key is still running (conflict).
object
object
object
Example
{ "error": { "code": "invalid" }}The Idempotency-Key was used with a different request.
object
object
object
Example
{ "error": { "code": "invalid" }}Over the rate limit; see retry-after.
object
object
object
Example
{ "error": { "code": "invalid" }}