Loading...
Area: Episerver Service API
Applies to versions: 4.1 and higher

Customers

Recommendations [hide]

This topic describes how to work with RESTful operations for managing customers, organizations, and contacts in the Episerver Service API.  

In this topic

Example models

public class Contact
  {
    public Guid? PrimaryKeyId { get; set; }
    public Address[] Addresses { get; set; }
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public string Email { get; set; }
    public string RegistrationSource { get; set; }
 }
 
public class Address
  {
    public Guid? AddressId { get; set; }
    public DateTime? Modified { get; set; }
    public string Name { get; set; }
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public string CountryName { get; set; }
    public string CountryCode { get; set; }
    public string City { get; set; }
    public string PostalCode { get; set; }
    public string Line1 { get; set; }
    public string Line2 { get; set; }
    public string RegionName { get; set; }
    public string RegionCode { get; set; }
    public string Email { get; set; }
    public bool ShippingDefault { get; set; }
    public bool BillingDefault { get; set; }
    public string DaytimePhoneNumber { get; set; }
    public string EveningPhoneNumber { get; set; }
    public string Organization { get; set; }
  }
public class Organization
  {
    public Guid PrimaryKeyId { get; set; }
    public IEnumerable<Address> Addresses { get; set; }
    public IEnumerable<Organization> ChildOrganizations { get; set; }
    public IEnumerable<Contact> Contacts { get; set; }
    public string OrganizationType { get; set; }
    public string OrgCustomerGroup { get; set; } 
  }

Get contact 

/episerverapi/commerce/customers/contact/{contactId}

Client Code Media Type JSON

Response JSON

Client Code Media Type XML

Response XML

Get all contacts

/episerverapi/commerce/customers/contact

Note: This method only retrieves the first 1000 objects. To get more objects, use overload with paging.

Client Code Media Type JSON

Response JSON

Client Code Media Type XML

Response XML

Get all contacts with paging [New in Service API 5.4]

/episerverapi/commerce/customers/contact/{startIndex}/{recordsToRetrieve}

Client Code Media Type JSON

Client Code Media Type XML

Post contact 

/episerverapi/commerce/customers/contact/{userId}

Client Code Media Type JSON

Response JSON

Client Code Media Type XML

Response XML

Put contact

/episerverapi/commerce/customers/contact/{contactId}

Client Code Media Type JSON

Response JSON

Client Code Media Type XML

Response XML

Delete contact

/episerverapi/commerce/customers/contact/{contactId}

Client Code Media Type JSON

Response JSON

Client Code Media Type XML

Response XML

Get organization 

/episerverapi/commerce/customers/organization/{orgId}

Client Code Media Type JSON

Response JSON

Client Code Media Type XML

Response XML

Get all organizations

/episerverapi/commerce/customers/organization

Client Code Media Type JSON

Response JSON

Client Code Media Type XML

Response XML

Post organization

/episerverapi/commerce/customers/organization

Client Code Media Type JSON

Response JSON

Client Code Media Type XML

Response XML

Put organization

/episerverapi/commerce/customers/organization/{orgId}

Client Code Media Type JSON

Response JSON

Client Code Media Type XML

Response XML

Delete organization

/episerverapi/commerce/customers/organization/{orgId}

Client Code Media Type JSON

Response JSON

Client Code Media Type XML

Response XML

Related topics

Do you find this information helpful? Please log in to provide feedback.

Last updated: Apr 08, 2019

Recommendations [hide]