Stitch Labs Standard API

All the tools you need to customize and automate your operational workflows


Getting Started

New to the Stitch Labs API? Use these guides to start building apps with the API

Standard API Overview
Provisioning
Authentication


Endpoints and Collections

Postman is a powerful API testing and development suite used to help developers explore our Standard API. We’ve created example calls for the exhaustive list of Standard endpoints into a Postman collection, grouped around similar Stitch objects. Please note this collection is only for the Standard API

See our Postman Overview for more details.


API Reference


Read Requests

NOTE: Read Requests must have the action of read

Example:

{
    "action": "read"
}

The example above it the simplest read request that can be made. The response will be automatically paginated to 15 objects.

Pagination

NOTE: Pagination parameters can only be used in read requests.

By adding the key value pair page_size : integer and page_num : integer, you can specify pagination information.

Example:

{
    "action": "read",
    "page_size": 10,
    "page_num": 2
}

Filter

NOTE: Filters can only be used on read actions.

NOTE: There can only be one filter per request.

Applying a filter enables data filtering by object values. For example, Sales Orders can be filtered by archived, connector_id, order_date, etc…

Filters are broken into 2 distinct parts: Conditionals The allowed conditionals are and / or. There should only be at most 2 conditionals in each filter statement. Each conditional can have as many sub-filters as necessary.

Sub-filters Inside of each sub-filter consists of two key value pairs. The first key value pair consists of the key you wish to filter by and the value of which you want this key filtered. The second key value pair must have a key of 'operation’ and a value of ['=', '>=', '<=' '>’, '<', '!=']. If no operation is specified, a default operation of '=' will be assumed.

Examples:

{
    "action": "read",
    "filter": {
        "and": [
            {
                "order_date": "2015-01-01",
                "operation": ">="
            },
            {
                "order_date": "2015-01-30",
                "operation": "<="
            }
        ]
    }
}

Sort

A sort must at least one sub-sort-object. Each sub-sort-object must contain exactly one key value pair where the key is the desired sort parameter and the value is ['asc’, ’desc’].

Example:

{
    "action": "read",
    "sort": [
        {
            "order_date": "desc"
        }
    ],
}

Filter Counts

NOTE: Filter Counts use the full data set, not the filtered dataset.

Filter Counts follow the same conventions as Filters. Each Filter count must be keyed with the key you want returned.

Example:

{
    "action": "read",
    "filter_counts": {
        "open_order_count": {
            "and": [
                {
                    "complete": 0
                }
            ]
        }
    }
}

Aggregate Read Requests

NOTE: Not all read endpoints have an aggregate endpoint

Aggregate endpoints exist to allow for fast calculations of information. These endpoints do not return objects. Instead they return aggregate information about the objects.

Along with filter and sort these endpoints require once of the following:

aggregate_fields Currently only the sum conditional is implemented. Within the sum conditional, each sub field must only contain one key value pair where the key is the what you want to aggregate (must be of a numeric type) and the value is what you want to key the returned value.

aggregate_by_date

  • date_field must have the value of a date field from the object being queried.
  • aggregate_per must be ['DAY’, 'MONTH’, 'YEAR’]
  • aggregate_fields must follow the conventions of the above aggregate_fields section.

Example:

{
    "action": "read",
    "filter": {
        "and": [
            {
                "order_date": "2015-01-01",
                "operation": ">="
            },
            {
                "order_date": "2015-01-30",
                "operation": "<="
            }
        ]
    },
    "sort": [
        {
            "order_date": "desc"
        }
    ],
    "aggregate_by_date": {
        "date_field": "order_date",
        "aggregate_per": "DAY",
        "aggregate_fields": {
            "sum": [
                {
                    "total": "daily_total"
                }
            ]
        }
    },
    "aggregate_fields": {
        "sum": [
            {
                "total": "sum_total"
            }
        ]
    }
}

Linking

The links attribute is a top level attribute that specifies what links will be returned in the response.

NOTE: Using this attribute allows for faster responses.

NOTE: This attribute is not available on all endpoints.

Example Request:

{
    "action": "read",
    "links" : ["productTags"],
    "Products": [
        {
            "id": 7789
        }
    ]
}

Contacts/detail Links:

createdByUser, addresses, shippingAddress, billingAddress, contactTags, contactType, contactPaymentType, contactFile, people.personFields.personFieldType, primaryPerson.personFields.personFieldType, invoices, invoicePayments, salesOrders, purchaseOrders

Products/detail Links:

createdByUser, attributes, channel, productFiles, productTags, variants.attributeOptions.attribute, variants.variantPrices.pricingTier, variants.variantCustomIds.customIdType, variants.productFile, variants.warehouseStockLevels.accountAddress

Variants/detail Links:

channelListing.channel.channelType, attributeOptions.attribute, product.attributes, product.productFiles, variantPrices.pricingTier, variantCustomIds.customIdType, warehouseStockLevels.accountAddress, productFile, bundleLineItems.bundleVariants, bundleLineItems.bundleVariants.productFile, bundleLineItems.bundleVariants.product.productFiles, bundleLineItems.bundleVariants.variantCustomIds.customIdType, contacts.primaryPerson.personFields.personFieldType, contactWarehouses

SalesOrder/detail Links:

connectorFlagFbaOrders, fulfillmentOrders, tags, createdByUser, accountOrderInfo, billingAddress, shippingAddress, accountAddress, pricingTier, creditMemos, creditMemos.creditMemoOrderSku, creditMemos.creditMemoOrderSku.orderSku, creditMemos.creditMemoOrderSku.creditMemoReturnReason, creditMemos.creditMemoOrderService, creditMemos.creditMemoOrderService.orderService, creditMemos.creditMemoOrderService.creditMemoReturnReason, creditMemos.creditMemoCustomLineItem, creditMemos.creditMemoPayment, creditMemos.accountAddress, creditMemos.person, creditMemos.shippingAddress, creditMemos.billingAddress, person.personFields.personFieldType, person.contact.contactType, contact.contactType, salesOrderLineItems.variant.productFile, salesOrderLineItems.variant.variantCustomIds.customIdType, salesOrderLineItems.variant.product.productFiles, salesOrderLineItems.variant.warehouseStockLevels, salesOrderLineItems.variant.warehouseStockLevels.accountAddress, salesOrderLineItems.invoiceLineItems, salesOrderLineItems.packingSlipLineItems, salesOrderCustomLineItems.invoiceCustomLineItems, salesOrderCustomLineItems.packingSlipCustomLineItems, invoices.billingAddress, invoices.shippingAddress, invoices.contactPaymentType, invoices.person.personFields.personFieldType, invoices.person.contact.contactType, invoices.invoiceLineItems, invoices.invoiceCustomLineItems, invoicePayments.invoicePaymentType, invoicePayments.invoice, packingSlips.billingAddress, packingSlips.shippingAddress, packingSlips.person.personFields.personFieldType, packingSlips.person.contact.contactType, packingSlips.packingSlipLineItems, packingSlips.packingSlipCustomLineItems, packages.packageCarrierType, packages.packingSlip, channel.channelType, completedBillingAddress.address, completedShippingAddress.address, completedContact.contact, completedPerson.person, invoices.contactPaymentType, invoices.completedPerson.person, invoices.completedBillingAddress.address, invoices.completedShippingAddress.address, packingSlips.completedPerson.person, packingSlips.completedBillingAddress.address, packingSlips.completedShippingAddress.address, completedSalesOrderLineItems.variant, completedSalesOrderLineItems.completedVariant, completedSalesOrderLineItems.completedVariantCustomId, completedSalesOrderLineItems.completedAttributeOption, completedSalesOrderLineItems.completedInvoiceLineItems.invoice, completedSalesOrderLineItems.completedPackingSlipLineItems.packingSlip, completedSalesOrderCustomLineItems.completedInvoiceCustomLineItems.invoice, completedSalesOrderCustomLineItems.completedPackingSlipCustomLineItems.packingSlip

PurchaseOrder/detail Links:

tags, createdByUser, accountOrderInfo, supplierAddress, dropShippingAccountAddress, dropShippingBillingAddress, dropShippingContact, contact.contactType, person.contact.contactType, person.contact.billingAddress, person.personFields.personFieldType, billingAccountAddress, shippingAccountAddress, warehouseAccountAddress, purchaseOrderLineItems.variant.product.productFiles, purchaseOrderLineItems.variant.contacts, purchaseOrderLineItems.variant.productFile, purchaseOrderLineItems.variant.variantCustomIds.customIdType, purchaseOrderLineItems.variant.variantPrices.pricingTier, purchaseOrderPaymentType, purchaseOrderCarrierType, channel