Definitions

Contacts and Addresses

Contact - Contacts are objects used to store customers, suppliers, wholesalers, and internal reps all in one place. Contacts are categorized by type attribute

Person - The individuals who are associated with a particular contact. For instance, if you work with multiple individuals at a company, the main contact would be the company name, and the people you interact with at the company would be the people in the contact record. There is no limit to the number of people you can associate to a particular contact.

Address - Addresses area lets you associate multiple addresses to a single contact. Set primary shipping and billing addresses, and these will correspond to what appears on a contact’s invoices.

Read Actions

Contacts

Contact Listing

Retrieves a paginated unfiltered list of all account contacts

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

Contact Listing Pagination

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

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

Contact Listing Sorting

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

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

Contact Listing Filters

Retrieves a paginated list of all account contacts 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/v2/Contacts
{
    "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 Contact
  • archived
  • created_at
  • deleted
  • id
  • name
  • nature
  • notes
  • reseller
  • taxid
  • updated_at
  • website

Contact Detail

Retrieves a detailed contacts record

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

Write Actions

Creating a Simple Contact

Creates a contact record for an account

    POST https://api-pub.stitchlabs.com/v1/Contacts
    {
        "action": "write",
        "Contacts": [
            {
                "name": "Robin Brown",
                "links": {
                    "Addresses": [],
                    "People": [],
                    "ContactTags": [],
                    "ContactFiles": []
                }
            }
        ]
    }

Creating a Complex Contact

Creates a contact record for an account

    POST https://api-pub.stitchlabs.com/v1/Contacts
    {
        "action": "write",
        "Contacts": [
            {
                "name": "Robin Brown",
                "taxid": "taxid",
                "reseller": "resale",
                "website": "website",
                "nature": "nature of bus",
                "notes": "notes go here",
                "links": {
                    "Addresses": [
                        {
                            "contact": "Bill Hill",
                            "company": "Robin Brown",
                            "street1": "123 No Street",
                            "street2": "Suite 720",
                            "city": "SF",
                            "state": "CA",
                            "zip": "37043",
                            "country": "UNITED STATES",
                            "country_iso": "US",
                            "notes": "Notes go here",
                            "billing": 1,
                            "shipping": 1
                        }
                    ],
                    "People": [
                        {
                            "first_name": "John",
                            "last_name": "Doe",
                            "title": "title",
                            "dept": "dept",
                            "notes": "notes",
                            "primary": 1,
                            "links": {
                                "PeopleFields": [
                                    {
                                        "value": "home_email",
                                        "links": {
                                            "PeopleFieldTypes": [
                                                {
                                                    "id": "4",
                                                    "type": "email"
                                                }
                                            ]
                                        }
                                    },
                                    {
                                        "value": "custom_email",
                                        "links": {
                                            "PeopleFieldTypes": [
                                                {
                                                    "value": "custom",
                                                    "type": "email"
                                                }
                                            ]
                                        }
                                    },
                                    {
                                        "value": "home_phone",
                                        "links": {
                                            "PeopleFieldTypes": [
                                                {
                                                    "id": "6",
                                                    "type": "phone"
                                                }
                                            ]
                                        }
                                    },
                                    {
                                        "value": "custom_phone",
                                        "links": {
                                            "PeopleFieldTypes": [
                                                {
                                                    "value": "custom",
                                                    "type": "phone"
                                                }
                                            ]
                                        }
                                    }
                                ]
                            }
                        }
                    ],
                    "ContactTags": [
                        {
                            "id": "6"
                        },
                        {
                            "id": "7"
                        },
                        {
                            "id": "8"
                        },
                        {
                            "name": "New Contact Tag"
                        }
                    ]
                }
            }
        ]
    }

Editing Contacts

Update contact record attributes

POST https://api-pub.stitchlabs.com/v1/Contacts
{
    "action": "write",
    "Contacts": [
        {
          "id": "50332",
            "name": "Robin Brown Edited"
        }
    ]
}

Archiving Contacts

Archiving a Contact

Archive a contact record

POST https://api-pub.stitchlabs.com/v1/Contacts
{
  "action": "write",
  "Contacts": [
    {
      "id": 40124152,
      "archive": 1
    }
  ]
}

Deleting a Contact

Mark a contacts record as deleted

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

Contact 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

Contact Tag Listing

Retrieves a paginated list of all account contact tags

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

Contact Tag Detail

Retrieves a detailed contact tag record

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

Creating a Contact Tag

Creates a contact tag record

POST https://api-pub.stitchlabs.com/v1/ContactTags/detail
{
    "action": "write",
    "ContactTags": [
        {
            "name": "VIP"
        }
    ]
}

Tagging a Contact

Apply a contact tag to a contact and/or Generate a contact tag in a contact update request

POST https://api-pub.stitchlabs.com/v1/Contacts
{
    "action": "write",
    "Contacts": [
        {
          "id": "32924",
          links:{
                "ContactTags": [
                    {
                        "id": "32924"
                    },
                    {
                        "name": "New Tag Name"
                    }
                ]
            }
        }
    ]
}

Delete a Contact Tag

Mark a contact tag record as deleted

POST https://api-pub.stitchlabs.com/v1/ContactTags/detail
{
    "action": "write",
    "ContactTags": [
        {
            "id": 32924,
            "delete": 1
        }
    ]
}