Stitch Labs Public API: Sales Orders

Table of Contents


Definitions

Sales Orders

Entry - Description


Read Actions

Sales Orders

Sales Order Listing

Retrieves a paginated unfiltered list of all account sales orders

POST https://api-pub.stitchlabs.com/api2/v2/SalesOrders
{
  "action": "read"
}

Sales Order Listing Pagination

Retrieves a paginated unfiltered list of all account sales orders beginning at a specified page offset

POST https://api-pub.stitchlabs.com/api2/v2/SalesOrders
{
    "action": "read",
    "page_size": 15,
    "page_num": 1
}

Sales Order Listing Sorting

Retrieves a paginated unfiltered list of all account sales orders sorted by a set of request criteria

POST https://api-pub.stitchlabs.com/api2/v2/SalesOrders
{
    "action": "read",
    "sort": [
        {
            "created_at": "desc"
        }
    ]
}
Sortable Attributes for Products

Sales Order Listing Filters

Retrieves a paginated list of all account sales orders filtered by a set of request criteria. Applying a filter allows your application to limit listing requests by object values.

POST https://api-pub.stitchlabs.com/api2/v2/SalesOrders
{
    "action": "read",
    "filter": {
        "and": [
            {
                "archived": "0"
            },
            {
                "created_at": "2015-01-01",
                "operation": ">="
            }
        ]
    }
}

Note There can only be one filter per request. There should only be at most 2 AND/OR conditionals in each filter statement. Each conditional can have as many sub-filters as necessary.

Filterable Attributes for Sales Orders
  • archived
  • cancel_date
  • complete
  • complete_date
  • created_at
  • currency_iso
  • discount
  • draft
  • exclude_stock_tracking
  • external_connector_order_id
  • external_fulfill
  • force_channel_push
  • force_ship_sync
  • historical_import
  • id
  • limbo
  • local_id
  • notes
  • order_date
  • po_num
  • qb_export
  • s_and_h
  • ship_date
  • ship_method_complete
  • sku_subtotal

Sales Order Detail

Retrieves a detailed sales order record

POST https://api-pub.stitchlabs.com/api2/v2/SalesOrders/detail
{
    "action": "read",
    "SalesOrders": [
        {
            "id": 374457604
        }
    ]
}

Write Actions

Creating a Simple Sales Order (without Line Items)

Creates a sales order record with no line items

POST https://api-pub.stitchlabs.com/api2/v1/SalesOrders
{
    "action": "write",
    "SalesOrders": [
        {
            "links": {
                "Contacts": [
                    {
                        "id": "489"
                    }
                ]
            }
        }
    ]
}

Creating a Detailed Sales Order (without Line Items)

Creates a sales order record with no line items

POST https://api-pub.stitchlabs.com/api2/v1/SalesOrders
{
    "action": "write",
    "SalesOrders": [
        {
            "order_date": "2015-02-28T01:07:10.207Z",
            "ship_date": "2015-03-07T12:00:00-0800",
            "cancel_date": "2015-03-14T12:00:00-0700",
            "po_num": "9687948",
            "tax_percent": "9",
            "notes": "order notes",
            "links": {
                "Contacts": [
                    {
                        "id": "489"
                    }
                ],
                "People": [
                    {
                        "id": "44897"
                    }
                ],
                "Addresses": [
                    {
                        "id": "44359",
                        "type": "billing"
                    },
                    {
                        "id": "44358",
                        "type": "shipping"
                    }
                ],
                "ProductPriceTypes": [
                    {
                        "id": "1058"
                    }
                ]

            }
        }
    ]
}

Creating a Sales Order (with Line Items)

Creates a sales order record with multiple line items

POST https://api-pub.stitchlabs.com/api2/v1/SalesOrders
{
    "action": "write",
    "SalesOrders": [
        {
            "links": {
                "Contacts": [
                    {
                        "id": "49971"
                    }
                ],
                "LineItems": [
                    {
                        "description": "Women's Tank Top (Blue Grey, Medium)",
                        "quantity": "5",
                        "price": "30.00",
                        "tax": "9",
                        "links": {
                            "Variants": [
                                {
                                    "id": "5621"
                                }
                            ]
                        }
                    },
                    {
                        "description": "Men's Shirt from Friday (Green, Medium)",
                        "quantity": "4",
                        "price": "55.00",
                        "tax": "9",
                        "links": {
                            "Variants": [
                                {
                                    "id": "3463"
                                }
                            ]
                        }
                    }
                ]
            }
        }
    ]
}

Creating a Sales Order (with a Custom Line Item)

Creates a sales order record with a single custom line item

POST https://api-pub.stitchlabs.com/api2/v1/SalesOrders
{
    "action": "write",
    "SalesOrders": [
        {
            "links": {
                "Contacts": [
                    {
                        "id": "49971"
                    }
                ],
                "CustomLineItems": [
                    {
                        "description": "test description",
                        "quantity": 1,
                        "price": "100",
                        "price_per": "",
                        "tax": "9",
                        "shippable": true
                    }
                ]
            }
        }
    ]
}

Editing a Sales Order (Order Details)

Update sales order record attributes

POST https://api-pub.stitchlabs.com/api2/v1/SalesOrders
{
    "action": "write",
    "SalesOrders": [
        {
            "id": 3879,
            "order_date": "2015-03-11T07:00:00+0000"
        }
    ]
}

Editing a Sales Order (Line Items)

Update sales order record attributes

POST https://api-pub.stitchlabs.com/api2/v1/SalesOrders
{
  "action": "write",
  "SalesOrders": [
    {
      "id": 3879,
      "links": {
        "LineItems": [
          {
            "description": "Women's Tank Top (Blue Grey, Medium)",
            "quantity": "5",
            "price": "30.00",
            "tax": "9",
            "links": {
              "Variants": [
                {
                  "id": "5621"
                }
              ]
            }
          },
          {
            "description": "Men's Shirt from Friday (Green, Medium)",
            "quantity": "4",
            "price": "55.00",
            "tax": "9",
            "links": {
              "Variants": [
                {
                  "id": "3463"
                }
              ]
            }
          }
        ]
      }
    }
  ]
}

Completing / Closing a Sales Order

Update sales order status to closed

POST https://api-pub.stitchlabs.com/api2/v1/SalesOrders
{
    "action": "write",
    "SalesOrders": [
        {
            "id": 3879,
            "complete": 1
        }
    ]
}

Deleting a Sales Order

Mark a sales order record as deleted

POST https://api-pub.stitchlabs.com/api2/v1/SalesOrders
{
    "action": "write",
    "SalesOrders": [
        {
            "id": 45652,
            "delete": 1
        }
    ]
}

Sales Order Tags

Tagging is a great way to categorize and organize your records in Stitch. By creating a tag, you can search for all items associated with the tag, run reports, and automate your API workflows

Tagging a Sales Order

Apply a sales order tag to a product and/or Generate a sales order tag in a order update request

POST https://api-pub.stitchlabs.com/api2/v1/SalesOrders
{
  "action": "write",
  "SalesOrders": [
    {
      "id": "514892326",
      "links": {
        "Tags": [
          {
            "id": "32094"
          },
          {
            "name": "New Tag 2"
          }
        ]
      }
    }
  ]
}

Bulk Tagging a Sales Order

Apply a collection of sales order tags to a collection of sales orders

POST https://api-pub.stitchlabs.com/api2/v1/SalesOrders
{
  "action": "write",
  "bulk_action": {
    "Tags": [
      {
        "id": "32094",
        "assign": 1
      }
    ]
  },
  "SalesOrders": [
    {
      "id": "514892326"
    },
    {
      "id": "514899242"
    }
  ]
}

The Sales Order Object

Sales Order

Attribute Value Description
Archived {"archived": "1"} Indicates whether or not the contact has been archived.
Canceled at Date {"cancel_date": null} Read Only - The date time which the sales order was Cancelled. Returned in a ISO 8601 Format
Completed Flag {"complete": "1"} Indicates whether or not the sales order has been closed. General information outlining the importance of closing orders can be found in our Support Center
Completed Date {"complete_date": "2015-06-24T20:58:47+00:00"} Read Only - The date time which the sales order was Closed. Returned in a ISO 8601 Format
Created At {"created_at": "2015-06-23T17:29:31+00:00"} Read Only - The date time which the Stitch sales order was Created. Returned in a ISO 8601 Format
Currency ISO {"currency_iso": "USD"} The three character native currency code of the order in a ISO 4217 Format
Deleted Flag {"deleted": "0"} Indicates whether or not the sales order has been Deleted.
Discount Amount {"discount": "0.00"} Order discount total for the Sales Order
Ignore Stock {"exclude_stock_tracking": "0" || "1"}, Indicates whether or not Ignore Stock should be set.
Draft {"draft": "0" || "1"} Indicates whether or not the sales order is in draft status. If a draft status is set to "1" you cannot complete an order until the draft is set back to "0". General information outlining draft orders can be found in our Support Center
Stock Tracking Flag {"exclude_stock_tracking": "0"} Indicates whether or not stock is tracked for a sales order. General information outlining stock tracking can be found in our Support Center
Sales Channel Reference {"external_connector_order_id": null} Read Only - Sales channel reference ID
Shipped by Fulfillment Partner {"external_fulfill": "0"} Read Only - Indicates the order is fulfilled by a Stitch partnered fulfillment
Force Channel Sync {"force_channel_push": "0"} Read Only - This is a Stitch Support utility field used to force updates to propagate back to sales channels
Force Ship Sync {"force_ship_sync": "0"} Read Only - This is a Stitch Support utility field used to force updates to propagate back to integrated fulfillment partners
Historical Flag {"historical_import": "0"}
ID {"id": "253375094"} A unique identifier for this sales order across all Stitch sales orders
Limbo Order {"limbo": "0"} Read Only - This field indicates whether or not there are variants on the order that are not linked to Stitch Variants. General information outlining linking can be found our Support Center
Local ID {"local_id": "O1001"} A unique identifier for this sales order across a particular Stitch account"™s sales orders
Notes {"notes": ""} Additional notes related to this order
Order Creation Date {"order_date": "2015-06-23T07:00:00+00:00"} The date time which the sales order was created on the Sales Channel. Returned in a ISO 8601 Format
PO Number {"po_num": null} Optional purchase order number related to the Sales Order
Pristine Flag {"pristine": 1} Read Only - Identifies whether or not the details of a sales order have been updated in a way that would require recalculation of subtotals and amounts. If this value is 0, the Subtotals/Totals for the order may not match what is available on the sales channel.
Quick Books Export {"qb_export": "0"} Read Only - This is a Stitch Support utility field used to force updates to propagate to Quick Books Online
Shipping and Handling {"s_and_h": "0.00"} Shipping and Handling total for the Sales Order
Ship Date {"ship_date": null} Optional Ship Date related to the Sales Order. Unrelated to packing slips and shipments.
Ship Method (at Order Close) {"ship_method_complete": ""} Read Only - Updated on Order Close to represent the name of the shipping method at time of order close.
Shipping Carrier {"ship_method_id": null} Read Only - Updated on Order Close to represent the name of the shipping carrier at time of order close.
Order Line Item Subtotal {"sku_subtotal": "40.00"} Sum total of order line items for the Sales Order
Order Line Item Non-Taxable {"sku_subtotal_non_taxable": "40.00"} Sum total of non-taxable order line items for the Sales Order
Order Line Item Taxable {"sku_subtotal_taxable": "0.00"} Sum total of taxable order line items for the Sales Order
Delivery Status {"status_deliver": "0"} Indicates whether or not a Shipment has been marked as Delivered for an order.
Invoice Status {"status_invoice": "1"} Read Only - Indicates whether or not a Invoice has been created for a Sales Order. 0 = Not ready for Invoicing, 1 = Ready to Invoice, 2 = Partial Invoice, 3 Fully Invoiced
Shipment Status {"status_package": "1"} Read Only - Indicates whether or not a shipment has been created for a Packing Slip on a Sales Order. 0 = Not ready to ship, 1 = Ready to Ship, 2 = Partially Shipped, 3 Fully Shipped
Packing Slip Status {"status_packing_slip": "3"} Read Only - Indicates whether or not a Packing Slip has been created for a Sales Order. 0 = Not ready for Packing, 1 = Ready for Packing, 2 = Partially Packed, 3 Fully Packed
Payment Status {"status_payment": "0"} Read Only - Indicates whether or not a Payment has been created for an order invoice. 0 = Not ready for payment 1 = Ready for Payment, 2 = Partial Payment, 3 Fully Paid
Subtotal {"subtotal": "40.00"} Sum total of order line items and services for the Sales Order
Subtotal Non-Taxable {"subtotal_non_taxable": "40.00"} Sum total of non-taxable order line items and services for the Sales Order
Subtotal Taxable {"subtotal_taxable": "0.00"} Sum total of taxable order line items and services for the Sales Order
Order Create Method {"sync_type": "manual"} Read Only - Identifies whether a sales order was created as a result of a channel sync, historical order, or manual/API order
Order Tax Percent {"tax_percent": "0.0000"} Sales tax percentage for the Sales Order
Order Tax Amount {"tax_total": "0.00"} Sales tax total for the Sales Order
Order Total {"total": "40.00"}Sum total for the Sales Order
Order Balance {"total_paid_balance": "0.00"} Remaining invoice balance for the Sales Order
Last Updated {"updated_at": "2015-06-24T20:59:25+00:00"} The date time which the contact was last updated. Returned in a ISO 8601 Format
Utility Processing Field {"utility": null} Read Only - This is a Stitch Support utility field used to track miscellaneous sync information
Voided Flag {"void": "0"} Indicates whether or not the sales order has been Voided.

Arrays of Stitch IDs for linking to related element data. When included in the detail request, links to related objects will return in this array and an accompanying block will be appended to the response including the base detail response (no secondary links) for those objects.

Base Detail Links

  • AccountAddresses
  • Addresses
  • Channels
  • CompletedAddresses
  • CompletedContacts
  • CompletedPeople
  • CompletedSalesOrderCustomLineItems
  • CompletedSalesOrderLineItems
  • ConnectorFlagFbaOrders
  • Contacts
  • Users
  • CreditMemos
  • FulfillmentOrders
  • InvoicePayments
  • Invoices
  • Packages
  • PackingSlips
  • People
  • PricingTiers
  • SalesOrderCustomLineItems
  • SalesOrderLineItems
  • Tags

Secondary 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