TABLE OF CONTENTS
List Customers
GET /v2/b2b/customers
List all customers matching the search criteria. The search looks for matching names or emails. When the search criteria is null, it returns all the customers.
Input
- search: Optional. The string(s) you are looking for.
- page: Optional. The page that you want returned, default is 1.
- pageSize: Optional. The number of items you want returned in a page. Default is 100.
- sortField: Optional. The filed that you want to sort by
- updatedAfter: Optional, ISO8601 date string, Only returns customers that were updated after the specified date.
- ignoreMyUpdates: Optional, boolean, defaults to false. When set to true, ignores the customers that were last updated by the current user.
- includeAddress: Optional, boolean, defaults to false. When set to true, include customer address in the response.
- includeAttrs: Optional, boolean, default to false. When set to true, include customer attrs if available.
Returns
a paginated list of Customer objects. A sample paginated list response is attached below.
Sample Request:
HEADERS:
x-acme-session: XXXX
x-acme-api-version: 1
Content-Type: application/json
Advanced Search
GET /v2/b2b/customers/advancedsearch
List all customers matching the search criteria. The search looks for matching names or emails. When the search criteria is null, it returns all the customers.
Input
- page: Optional. The page that you want returned, default is 1.
- pageSize: Optional. The number of items you want returned in a page. Default is 100.
- sortField: Optional. The filed that you want to sort by
- sortDirection: Optional
- firstName: Optional
- lastName: Optional
- email: Optional
- phone: Optional
- address: Optional
- zip: Optional
Returns
a paginated list of Customer objects. A sample paginated list response is attached below.
Note: Doesn't include customer Attributes
Sample Request:
Sample Response:
{ "success" : true , "payload" : { "list" : [ { "id" : 135434 , "customerSource" : "acme" , "customerId" : "A257534987" , "externalCustomerImportId" : "ACMEA257534987" , "externalCustomerId" : "A257534987" , "externalId" : "001am00000JnC9xAAF" , "firstName" : "Daario" , "lastName" : "Naaharis" , "prefix" : "" , "suffix" : "" , "orgName" : "The Second Sons" , "deceased" : false , "solicitationCodes" : [], "address" : [ { "id" : 120909 , "streetAddress1" : "123 Dusty Road" , "city" : "Yunkhai" , "state" : "AA" , "zipCode" : "55555" , "country" : "United States" , "type" : "primary" , "isPrimary" : false , "version" : 0 } ], "attributes" : [], "version" : 0,
}, { "id" : 135445 , "customerSource" : "acme" , "customerId" : "A224506446" , "externalCustomerImportId" : "ACMEA224506446" , "externalCustomerId" : "A224506446" , "firstName" : "Daario" , "lastName" : "Naaharis" , "prefix" : "" , "suffix" : "" , "orgName" : "The Second Sons" , "deceased" : false , "solicitationCodes" : [], "address" : [ { "id" : 120951 , "streetAddress1" : "123 Dusty Road" , "city" : "Yunkhai" , "state" : "AA" , "zipCode" : "55555" , "country" : "United States" , "type" : "primary" , "isPrimary" : false , "version" : 0 } ], "attributes" : [], "version" : 2,
}, { "id" : 135475 , "customerSource" : "acme" , "customerId" : "A226060956" , "externalCustomerImportId" : "ACMEA226060956" , "externalCustomerId" : "A226060956" , "firstName" : "Daario" , "lastName" : "Naaharis" , "prefix" : "" , "suffix" : "" , "orgName" : "The Second Sons" , "deceased" : false , "solicitationCodes" : [], "address" : [ { "id" : 120989 , "streetAddress1" : "123 Dusty Road" , "city" : "Yunkhai" , "state" : "AA" , "zipCode" : "55555" , "country" : "United States" , "type" : "primary" , "isPrimary" : false , "version" : 0 } ], "attributes" : [], "version" : 0,
}, { "id" : 135484 , "customerSource" : "RE" , "customerId" : "72251" , "externalCustomerImportId" : "00001-593-0000055940" , "externalCustomerId" : "72251" , "firstName" : "Daario" , "lastName" : "Naaharis" , "deceased" : false , "solicitationCodes" : [], "address" : [ { "id" : 121006 , "streetAddress1" : "123 Dusty Road" , "city" : "Yunkhai" , "state" : "AA" , "zipCode" : "55555" , "country" : "United States" , "suburb" : "" , "type" : "primary" , "isPrimary" : false , "version" : 0 } ], "attributes" : [], "version" : 0 ,
"memberships" : [ { "membershipMethod" : null , "id" : 15686 , "importId" : "00001-567-0000016324" , "program" : "Corporate" , "category" : "Corporate Partner" , "membershipTypeId" : 232 , "externalMembershipId" : "1000058023" , "membershipJoinedDate" : "2016-09-25T22:00:00-06:00" , "membershipStartDate" : "2016-09-25T22:00:00-06:00" , "membershipExpirationDate" : "2017-09-29T22:00:00-06:00" , "membershipStanding" : "active" , "cardholders" : [ { "id" : 112128 , "membershipId" : 15686 , "cardImportId" : "00001-570-0000030032" , "cardType" : "secondary" , "name" : "(72251) Daario Naaharis" , "barcode" : "1000058023" , "acmeBarcode" : "1000058023" , "deceased" : "no" , "primaryCard" : "no" , "solicitationCodes" : "" , "startDate" : "2016-09-25T22:00:00-06:00" , "expirationDate" : "2017-09-29T22:00:00-06:00" , "cardStatus" : "active" , "printCount" : 0 , "printStatus" : "notPrinted" } ], "organizationId" : 1602 , "orgImportId" : "00001-593-0000055939" , "acmeMembershipNumber" : "1000058023" , "isGift" : false } ] } ], "pagination" : { "page" : 1 , "pageSize" : 50 , "sortDirection" : "desc" , "sortField" : "createdOn" , "count" : 4 } } } |
Get Customer (By Import ID)
GET /v2/b2b/customers/external/{importId}
Get a customer. Tenant specific.
Input
- importId, Path variable. String, the customer import Id.
- includeAssociatedMemberships. optional. boolean. When set to true, includes all associated memberships for this customer.
Returns
The customer object.
Note: Doesn't include customer Attributes
Get Customer (By ID)
GET /v2/b2b/customers/{id}
Get a customer. Tenant specific.
Input
Input | Type | Description | Required? |
id | String | The Customer's ID | Yes |
includeAssociatedMemberships | Boolean | When set to true, the Customer's associated memberships will be returned. | No |
includeMergeHistory * | Boolean | When set to true, the Customer's merge history will be returned. | No |
includeAttributes | Boolean | When set to true, the Customer's attributes will be returned. | No |
Returns: The customer object.
* Available with the 11.37.0 Release in July 2024
Update Customer (By ID)
PUT /v2/b2b/customers
To make a brand *new* customer with this API, then you must send:
firstName
lastName
and one of email, phoneNumber, address
and do *NOT* send a value for id, customerId, or externalCustomerId
To update an existing customer, then you must send:
externalCustomerImportId
Be very careful with this API. If ACME has a value for a field and you do not send it in the API call, then ACME will remove whatever value we previously had. For example, if the Customer has an email but in the PUT API call, the email is not included, then ACME will remove the email on the Customer Record.
Example Payload:
{
"id":7239363,
"firstName":"Comet",
"lastName":"Bright",
"email":"comet@bright.com",
"phoneNumber":"33998585",
"externalCustomerImportId":"ACME202559303",
"address":[
{
"id":19154531,
"streetAddress1":"9383 W 34th St",
"city":"Philadelphia",
"state":"Pennsylvania",
"zipCode":"83898",
"country":"United States",
"type":"primary",
"isPrimary":true
}
]
}
Example Response:
{ "id": 15722551, "customerSource": "acme", "customerId": "281240759", "externalCustomerImportId": "ACME202559303", "email": "comet@bright.com", "firstName": "Comet", "lastName": "Bright", "phoneNumber": "33998585", "solicitationCodes": [], "address": [], "attributes": [], "version": 1, "createdOn": "2024-08-13T17:49:33-07:00", "updatedOn": "2024-08-14T08:48:21-07:00", "updatedBy": 340, "obfuscated": false }
Customer Object
Field | Type | Description |
---|---|---|
id | Long | Auto-increment ID. Used as the seed for the customerId. Generated by the database. |
customerSource | String(SourceEnum) | When generated in Raiser's Edge, this should contain "RE". For Salesforce, "SF". When generated in ACME, it will contain "Acme". |
customerId | String | Acme customer ID. Should only be generated by Acme, will never be modified. Tenant specific Prefix + A unique 10 digit random number. |
externalCustomerId | String | The External customer ID. This is the ID of the customer in an external system. |
externalCustomerImportId | String | Required. Generated by Acme or External System. When generated by ACME, this field will contain "ACME" + customerId. When Generated by an external system, this should be a unique ID for the customer. |
externalId | String | Optional ID from an external system (e.g. CRM system). |
firstName | String | |
lastName | String | |
middleName | String | |
String | ||
phoneNumber | String | |
phoneNotes | String | This data does not surface in the ACME application. |
prefix | String | |
suffix | String | This data does not surface in the ACME application. |
orgName | String | the organization name of the customer. |
deceased | boolean | This data does not surface in the ACME application. |
solicitationCodes | List<String> | Used by Raiser's Edge. For customer communication preferences. This data does not surface in the ACME application. |
address | List<Address> | A list of addresses for the customer. |
address[x].streetAddress1 | String | |
address[x].streetAddress2 | String | |
address[x].city | String | |
address[x].state | String | |
address[x].zipCode | String | |
address[x].country | String | |
address[x].suburb | String | Used by Raiser's Edge. This data does not surface in the ACME application. |
address[x].type | String(AddressTypeEnum) | Should either contain "primary" or "billing" |
address[x].isPrimary | boolean | Used in case of multiple primary aka shipping addresses / billing addresses. We are not using this right now. Will default to false. |
attributes | List<CustomerAttribute> | Used by Raiser's Edge. The special attributes of this customer. This data does not surface in the ACME application. |
attributes[x].category | String | Used by Raiser's Edge. This data does not surface in the ACME application. |
attributes[x].description | String | Used by Raiser's Edge. This data does not surface in the ACME application. |
attributes[x].notes | String | Used by Raiser's Edge. This data does not surface in the ACME application. |
attributes[x].date | String | Should be in ISO8601 format |
errors | Used by Raiser's Edge. List of errors that happened attempting to sync. READ ONLY, Returned as part of bulk update and bulk create response. | |
errors[x].error | String of the error that happened. | |
errors[x].membershipImportId | The id of the membership that had an error. | |
errors[x].cardImportId | The import id of the card holder that had an error, in cases of partial success. | |
errors[x].customerImportId | The id of the customer that had an error. | |
errors[x].benefitImportId | The import id of the benefit that had an error, in cases of partial success. | |
createdOn | dateTime | Date the customer was created. |
createdBy | integer | ID of the user that created the Customer. Note: Customers created via online checkout will not have a value. |
updatedOn | dateTime | Date the customer was last updated. |
updatedBy | integer | ID of the user that edited the Customer. |