Order Integrations
Order Integrations
Manage connections to external e-commerce platforms.
Connect Shopify, WooCommerce, or other platforms to automatically receive and process orders into invoices.
The Order Integration object
Attributes
{
"id": "oint_6595a27b5d35015c3ef0c3fd",
"entity_id": "ent_6595a27b5d35015c3ef0c3fd",
"name": "Horizon Launch Store",
"source": "manual",
"is_active": true,
"shop_domain": null,
"scopes": null,
"auto_process": false,
"auto_process_on": "paid",
"default_payment_type": null,
"send_invoice_email": true,
"send_estimate_email": true,
"attach_pdf_to_email": false,
"issue_invoice_for_bank": false,
"issue_invoice_on_complete": false,
"auto_process_delay_seconds": 0,
"auto_reissue_on_update": false,
"metadata": {},
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-09-01T00:00:00.000Z",
"deleted_at": null
}Resume Shopify install after app launch
/order-integrations/shopify/resume-installContinue a pending Shopify custom-app install after Shopify redirects the merchant back to the app URL.
Body parameters
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.orderIntegrations.resumeShopifyInstall({
shop: "myshop.myshopify.com"
});
console.log(response);Returns
{
"redirect_url": "https://myshop.myshopify.com/admin/oauth/authorize?client_id=...&scope=read_orders&redirect_uri=...&state=...",
"entity_id": "ent_6595a27b5d35015c3ef0c3fd",
"frontend_origin": "https://v2.getapollo.io"
}Create a new order integration
/order-integrationsCreate a new order integration for receiving orders from external platforms.
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Body parameters
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.orderIntegrations.create({
name: "Horizon Launch Store"
});
console.log(response);Returns
{
"id": "oint_6595a27b5d35015c3ef0c3fd",
"entity_id": "ent_6595a27b5d35015c3ef0c3fd",
"name": "Horizon Launch Store",
"source": "manual",
"is_active": true,
"shop_domain": null,
"scopes": null,
"auto_process": false,
"auto_process_on": "paid",
"default_payment_type": null,
"send_invoice_email": true,
"send_estimate_email": true,
"attach_pdf_to_email": false,
"issue_invoice_for_bank": false,
"issue_invoice_on_complete": false,
"auto_process_delay_seconds": 0,
"auto_reissue_on_update": false,
"metadata": {},
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-09-01T00:00:00.000Z",
"deleted_at": null
}List all order integrations
/order-integrationsRetrieve a paginated list of order integrations with optional filtering and sorting.
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Query parameters
Number of results per request.
Default: 10
Opaque cursor to fetch the next page of results. Reuse only with the same effective ordering. Use the value from pagination.next_cursor in the previous response.
Opaque cursor to fetch the previous page of results. Reuse only with the same effective ordering. Use the value from pagination.prev_cursor in the previous response.
Whether to include the total count of items in pagination.total.
Default is true.
When false, pagination.total returns -1 for better performance.
Sort by one field or provide a repeated array for multi-column ordering. Prefix a field with - for descending order. When paginating, reuse cursors only with the same effective ordering.
JSON query object for filtering results. Supports MongoDB-style operators.
Supported operators:
- equals or direct value - Exact match (default)
- gte - Greater than or equal
- lte - Less than or equal
- gt - Greater than
- lt - Less than
- in - Value in array
- notIn - Value not in array
- contains - String contains (case-insensitive)
- startsWith - String starts with
- endsWith - String ends with
- between - Value between two numbers/dates [min, max]
Allowed fields: id, name, source, is_active, created_at, updated_at
Examples:
- {"total": {"gte": 1000}} - Invoices over 1000
- {"customer.name": {"contains": "Acme"}} - Customer name contains "Acme"
- {"date": {"between": ["2025-01-01", "2025-12-31"]}} - Date range
Full-text search query to filter results across multiple fields.
Searches are case-insensitive and match partial strings.
Searches across all text fields including names, descriptions, addresses, and metadata values.
When true, returns only soft-deleted (trashed) items. Default false excludes deleted items.
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.orderIntegrations.list({ limit: 20 });
console.log(response);Returns
{
"data": [
{
"id": "oint_6595a27b5d35015c3ef0c3fd",
"entity_id": "ent_6595a27b5d35015c3ef0c3fd",
"name": "Horizon Launch Store",
"source": "manual",
"is_active": true,
"shop_domain": null,
"scopes": null,
"auto_process": false,
"auto_process_on": "paid",
"default_payment_type": null,
"send_invoice_email": true,
"send_estimate_email": true,
"attach_pdf_to_email": false,
"issue_invoice_for_bank": false,
"issue_invoice_on_complete": false,
"auto_process_delay_seconds": 0,
"auto_reissue_on_update": false,
"metadata": {},
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-09-01T00:00:00.000Z",
"deleted_at": null
}
],
"pagination": {
"total": 1,
"next_cursor": null,
"prev_cursor": null,
"has_more": false
}
}Get order integration by ID
/order-integrations/{id}Retrieve a single order integration by its unique identifier.
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Path parameters
Unique resource identifier
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.orderIntegrations.get("inv_6595a27b5d35015c3ef0c3fd");
console.log(response);Returns
{
"id": "oint_6595a27b5d35015c3ef0c3fd",
"entity_id": "ent_6595a27b5d35015c3ef0c3fd",
"name": "Horizon Launch Store",
"source": "manual",
"is_active": true,
"shop_domain": null,
"scopes": null,
"auto_process": false,
"auto_process_on": "paid",
"default_payment_type": null,
"send_invoice_email": true,
"send_estimate_email": true,
"attach_pdf_to_email": false,
"issue_invoice_for_bank": false,
"issue_invoice_on_complete": false,
"auto_process_delay_seconds": 0,
"auto_reissue_on_update": false,
"metadata": {},
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-09-01T00:00:00.000Z",
"deleted_at": null
}Update an order integration
/order-integrations/{id}Update an existing order integration. Only the provided fields will be updated. Disabling Shopify persists the inactive state before remote webhook cleanup; a 502 means cleanup remains pending and the same disable request can be retried safely. Re-enabling restores webhooks before activation and records a crash-recoverable catch-up boundary after activation commits.
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Path parameters
Unique resource identifier
Body parameters
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.orderIntegrations.update("inv_6595a27b5d35015c3ef0c3fd", {
name: "Horizon Launch Store EU"
});
console.log(response);Returns
{
"id": "oint_6595a27b5d35015c3ef0c3fd",
"entity_id": "ent_6595a27b5d35015c3ef0c3fd",
"name": "Horizon Launch Store",
"source": "manual",
"is_active": true,
"shop_domain": null,
"scopes": null,
"auto_process": false,
"auto_process_on": "paid",
"default_payment_type": null,
"send_invoice_email": true,
"send_estimate_email": true,
"attach_pdf_to_email": false,
"issue_invoice_for_bank": false,
"issue_invoice_on_complete": false,
"auto_process_delay_seconds": 0,
"auto_reissue_on_update": false,
"metadata": {},
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-09-01T00:00:00.000Z",
"deleted_at": null
}Delete an order integration
/order-integrations/{id}Soft delete an order integration. Shopify integrations are first made inactive, then their owned webhooks are removed. A 502 leaves the integration inactive with cleanup pending; repeat the delete request safely to retry cleanup.
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Path parameters
Unique resource identifier
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
await sdk.orderIntegrations.delete("inv_6595a27b5d35015c3ef0c3fd");
console.log('Deleted successfully');Sync Shopify orders
/order-integrations/{id}/sync-shopifyFetch Shopify orders updated in the selected time window and upsert them into local orders. Missing orders are imported, existing orders are refreshed, and processing is queued separately. Existing clients retain one-request completion; set resumable=true to opt into bounded chunks, then repeat completion_state=resumable responses with next_cursor. Disabled-period checkpoints are persisted so repeated safe requests durably converge. Shopify throttling is retried twice with each wait capped at five seconds; an exhausted throttle returns 429 with Retry-After. If Shopify expires a stored REST page cursor, the server safely clears that checkpoint and restarts the exact window; idempotent event IDs make the replay safe.
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Path parameters
Unique resource identifier
Body parameters
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.orderIntegrations.syncShopifyOrders("inv_6595a27b5d35015c3ef0c3fd", {});
console.log(response);Returns
{
"imported": 12,
"updated": 4,
"queued_for_processing": 6,
"total_seen": 16,
"window_start": "2026-03-20T00:00:00.000Z",
"window_end": "2026-03-21T00:00:00.000Z",
"complete": true,
"truncated": false,
"pages_fetched": 1,
"completion_state": "complete"
}Sync integration orders
/order-integrations/{id}/syncFetch a bounded historical window from the connected provider. Incomplete WooCommerce windows return a signed continuation cursor.
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Path parameters
Unique order integration identifier
Body parameters
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.orderIntegrations.syncOrderIntegration("oint_6595a27b5d35015c3ef0c3fd", {
updated_since: "2026-08-01T00:00:00.000Z",
updated_until: "2026-08-07T00:00:00.000Z",
limit: 100
});
console.log(response);Returns
{
"imported": 8,
"updated": 2,
"queued_for_processing": 4,
"total_seen": 10,
"window_start": "2026-08-01T00:00:00.000Z",
"window_end": "2026-08-07T00:00:00.000Z",
"complete": true,
"truncated": false,
"pages_fetched": 1,
"completion_state": "complete"
}