Returns the contacts that meet the given conditions.
Admin SDKAdmin.api('commerce.contacts.find', request, function(response) { … });
HTTP POST/api/v10/commerce.contacts.find
{
"conditions" : { // returns the contacts of this …
"customer" : 37091, // … customer (id) - int(1…)
"after" : 59068 // … with identifier after this value - int(0…)
},
"fields" : [ "id", "customer", … ], // fields to return - string
"order" : [ "id" ], // sort order of returned contacts, can contain "id", "-id", "customer", "-customer", "name", "-name",
// "phone", "-phone", "email", "-email", "note" and "-note" - string
"limit" : 10, // maximum number of contacts to return - int(1…)
"first": 0 // index of the first contact to return - int(0…)
}
{
"status" : "ok",
"contacts" : [ {
"id" : 59068, // identifier - int(1…)
"customer" : 37091, // customer (id) - int(1…)
"name" : "John Smith", // name - string(1…50)
"phone" : "", // phone number - string(0…15)
"email" : "", // Email address - string(3…120)
"note" : "" // note - string(0…255)
}, … ]
}
Returns a contact given its identifier.
Admin SDKAdmin.api('commerce.contacts.get', request, function(response) { … });
HTTP POST/api/v10/commerce.contacts.get
{
"id" : 59068, // identifier (required) - int(1…)
"fields" : [ "id", "customer", … ] // fields to return - string
}
{
"status" : "ok",
"contact" : { // (can be null)
"id" : 59068, // identifier - int(1…)
"customer" : 37091, // customer (id) - int(1…)
"name" : "John Smith", // name - string(1…50)
"phone" : "", // phone number - string(0…15)
"email" : "", // Email address - string(3…120)
"note" : "" // note - string(0…255)
}
}
Number of contacts that meet the given conditions.
Admin SDKAdmin.api('commerce.contacts.count', request, function(response) { … });
HTTP POST/api/v10/commerce.contacts.count
{
"conditions" : { // counts the contacts of this … (can be null)
"customer" : 37091, // … customer (id) - int(1…)
"after" : 59068 // … with identifier after this value - int(0…)
}
}
{
"status" : "ok",
"count" : 67 // number of contacts - int(0…)
}
Create a new contact.
Admin SDKAdmin.api('commerce.contacts.create', request, function(response) { … });
HTTP POST/api/v10/commerce.contacts.create
{
"contact" : { // contact to create (required)
"customer" : 37091, // customer (id) (required) - int(1…)
"name" : "John Smith", // name (required) - string(1…50)
"phone" : "", // phone number - string(0…15)
"email" : "", // Email address (can be null) - string(3…120)
"note" : "" // note - string(0…255)
}
}
{
"status" : "ok",
"id" : 59068 // identifier of the new contact - int(1…)
}
Field | Type | Description |
---|---|---|
customer | NotFound | Customer <customer> does not exist |
InvalidValue | '<email> ' is not a well formed email address |
Updates a contact. Any fields left out of the request will remain unchanged.
Admin SDKAdmin.api('commerce.contacts.update', request, function(response) { … });
HTTP POST/api/v10/commerce.contacts.update
{
"id" : 59068, // identifier of the contact to update (required)
"contact" : { // contact's fields to update (required)
"customer" : 37091, // customer (id) - int(1…)
"name" : "John Smith", // name - string(1…50)
"phone" : "", // phone number - string(0…15)
"email" : "", // Email address (can be null) - string(3…120)
"note" : "" // note - string(0…255)
}
}
{
"status" : "ok"
}
Field | Type | Description |
---|---|---|
customer | NotFound | Customer <customer> does not exist |
InvalidValue | '<email> ' is not a well formed email address |
|
id | NotFound | Contact <id> does not exist |
Deletes one or more contacts.
Admin SDKAdmin.api('commerce.contacts.delete', request, function(response) { … });
HTTP POST/api/v10/commerce.contacts.delete
{
"ids" : [ 59068, 12078, 23939, … ] // identifiers of the contacts to delete (required) - int(1…)
}
{
"status" : "ok"
}