Zoey REST API reference ยท Interactive version: apidocs.zoey.com
GET https://container-url.zoeysite.com/api/rest/companyAccounts/list
Query parameters:
| Name | Example | Notes |
|---|---|---|
limit | 1 | Limit the response. |
page | 2 | Paginate the response. |
filters[updated_at][gt] | 2021-07-30 | Updated At Filter |
filters[status][eq] | 0 | Is Active Filter. |
filters | {"updated_at":{"gt":"2021-07-30"}} | Filters as json |
GET https://container-url.zoeysite.com/api/rest/companyAccounts/count?filters[updated_at][gt]=2022-01-31&filters[status][eq]=0
Count all accounts.
Query parameters:
| Name | Example | Notes |
|---|---|---|
filters[updated_at][gt] | 2022-01-31 | Updated At filter. |
filters[status][eq] | 0 | Is Active filter. |
GET https://container-url.zoeysite.com/api/rest/companyAccounts/account/?id=1
Query parameters:
| Name | Example | Notes |
|---|---|---|
id | 1 | ID of account to fetch info. ( Required ) |
GET https://container-url.zoeysite.com/api/rest/companyAccounts/account/:account_id/ordered-items?limit=1&page=2&filter[0][attribute]=created_at&filter[0][lt]=2022-01-31
Query parameters:
| Name | Example | Notes |
|---|---|---|
limit | 1 | Limit the response. |
page | 2 | Paginate the response. |
filter[0][attribute] | created_at | Filter the response. |
filter[0][lt] | 2022-01-31 |
POST https://container-url.zoeysite.com/api/rest/companyAccounts/account/
/** JavaScript Post Data Example **/
const accountName = "Test Account6"; // needs to be different every time you post.
const locationId = "_tempLocationId1";
const locationName = "Test Account";
const customerId = "586"; // Customer ID
const customerRoleId = "466"; // Role ID
const address = {
"address_type": "billing,shipping",
"firstname": "John",
"lastname": "Doe",
"street": [ "1234 Park Ave" ],
"city": "New York",
"region": "New York",
"region_id": "43",
"postcode": "12345",
"country_id": "US",
"telephone": "1234567890",
"location_ids": [ locationId ]
}
const customer = {
"customer_id": customerId,
"is_main_contact": 1,
"role_id": customerRoleId,
// customer_data is optional
"customer_data": {
"firstname": "first",
"lastname": "last"
}
}
const location = {
"id": locationId,
"name": locationName,
"status": 1,
"enable_all_shipping_methods": 1,
"enable_all_payment_methods": 1,
"enable_all_invoice_payment_methods": 1,
"payment_methods": [],
"customers": [ customer ]
};
const netterms = {
"enabled": "1",
"term": "net30",
"credit": "1500",
"detail": "[store_name] has offered [customer_name] payment terms of [term_name]. Payment is due within [term_period] days for this order"
}
const postData = {
"companyData": {
"name": accountName,
"external_id": "TEST 123",
"enable_all_shipping_methods": 1,
"enable_all_payment_methods": 1,
"enable_all_invoice_payment_methods": 1,
"status": 1,
"addresses": [ address ],
"customers": [ customer ],
"locations": [ location ],
"netterm": netterm,
"customer_email_receive_as_cc_setting": 0,
"customer_email_receive_own_setting": 1,
"customer_email_setting": 1,
"customer_manage_address_setting": 1,
"customer_manage_customer_setting": 1,
"customer_manage_location_setting": 1,
}
}
console.log(JSON.stringify(postData));
Example request body:
{
"companyData": {
"name": "New Account Name",
"external_id": "TEST 123",
"enable_all_shipping_methods": 1,
"enable_all_payment_methods": 1,
"enable_all_invoice_payment_methods": 1,
"status": 1,
"addresses": [
{
"address_type": "billing,shipping",
"firstname": "John",
"lastname": "Doe",
"street": [
"1234 Park Ave"
],
"city": "New York",
"region": "New York",
"region_id": "43",
"postcode": "12345",
"country_id": "US",
"telephone": "1234567890",
"location_ids": [
"_tempLocationId1"
]
}
],
"customers": [
{
"customer_id": "4",
"is_main_contact": 1,
"role_id": "6"
}
],
"locations": [
{
"id": "_tempLocationId1",
"name": "New Account Location Name",
"status": 1,
"enable_all_shipping_methods": 1,
"enable_all_payment_methods": 1,
"enable_all_invoice_payment_methods": 1,
"payment_methods": [],
"netterm": [],
"storecredit": [],
"customers": [
{
"customer_id": "4",
"is_main_contact": 1,
"role_id": "6"
}
]
}
],
"netterm": {
"enabled": "1",
"term": "net30",
"credit": "1500",
"detail": "[store_name] has offered [customer_name] payment terms of [term_name]. Payment is due within [term_period] days for this order"
},
"customer_email_receive_as_cc_setting": 0,
"customer_email_receive_own_setting": 1,
"customer_email_setting": 1,
"customer_manage_address_setting": 1,
"customer_manage_customer_setting": 1,
"customer_manage_location_setting": 1
}
}
Example response (Create), HTTP 200:
{
"company_id": "2"
}
Example response (Location Address), HTTP 200:
{
"company_id": "21"
}
PUT https://container-url.zoeysite.com/api/rest/companyAccounts/account/
Data to update set on an account.
Example request body:
{
"companyId": "4",
"companyData" : {
"name": "New Company Name",
"status": "1",
"type": "0", // (0 - Account, 1 - Opportunity, 2 - Lead)
"new_customer_group_id": "1",
"sales_rep_user_ids": ["13058631632732613440", "10932762742589794610"],
"customer_manage_customer_setting": "1",
"customer_manage_location_setting": "1",
"customer_manage_address_setting": "1",
"shipping_methods": [ "flatrate_flatrate" ],
"payment_methods": [ "checkmo", "purchaseorder" ],
"invoice_payment_methods": [ "authorizenet" ],
"netterm": {
"enabled": "1",
"term": "net10",
"credit": 10000,
"detail": "[store_name] has offered [customer_name] payment terms of [term_name]. Payment is due within [term_period] days for this order, after-which interest may be due. Invoices may be paid via Check, Wire Transfer, Cache or Credit Card by call customer support at [store_phone]."
},
"enable_all_shipping_methods": "1",
"enable_all_payment_methods": "1",
"enable_all_invoice_payment_methods": "1"
}
}