API – Customer

General Online Reference

http://3773519.shop51.dandomain.dk/admin/webapi/endpoints/v1_0/CustomerService/help

GetCustomer [GET]

The GetCustomer operation retrieves a customer from the shop based on a unique customer number.

Input

The operation takes the following input:

  • an authentication key (see Authentication for details)
  • a customer number (id) for the customer

Validation

The following validation will determine whether the operation succeeds:

  • the authentication key must be valid (see Authentication for details)
  • the customer number cannot be null

The customer READ permission is required to perform this operation.

Output

When successful the operation returns a customer.

Request and response format

http://4221117.shop53.dandomain.dk/admin/webapi/endpoints/v1_0/CustomerService/help/operations/GetCustomer

Code examples

C# (Console)


PHP


GetCustomerByEmail [GET]

The GetCustomerByEmail operation retrieves a customer from the shop based on an email address.

Input

The operation takes the following input:

  • an authentication key (see Authentication for details)
  • an email address

Validation

The following validation will determine whether the operation succeeds:

  • the authentication key must be valid (see Authentication for details)
  • the email address cannot be null

The customer READ permission is required to perform this operation.

Output

When successful the operation returns a customer.

The first customer record is returned (sorted by id ascending) in case of duplicates.

Request and response format
http://4221117.shop53.dandomain.dk/admin/webapi/endpoints/v1_0/CustomerService/help/operations/GetCustomerByEmail

Code examples

C# (Console)


PHP


CreateCustomer [POST]

The CreateCustomer operation creates a new customer in the shop.

Input

The operation takes the following input:

Validation

The following validation will determine whether the operation succeeds:

  • the authentication key must be valid (see Authentication for details)
  • the customer must be valid, ie.:
    • the name cannot be null
    • the address cannot be null
    • the zipcode cannot be null
    • the city cannot be null
    • the country id cannot be null
    • the email address cannot be null
    • the email address must have a valid format (see below)
    • the password cannot be null

Depending on the shop settings it may not be possible to create customers with duplicate email addresses.

The format of the email address is checked with the regular expression “[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}”.

The customer CREATE permission is required to perform this operation.

Output

When successful the operation returns a customer.

The result will contain the unique customer number assigned to the new customer.

Request and response format

http://4221117.shop53.dandomain.dk/admin/webapi/endpoints/v1_0/CustomerService/help/operations/CreateCustomer

Code examples

C# (Console)


PHP


 

UpdateCustomer [PUT]

The UpdateCustomer operation updates an existing customer in the shop.

Input

The operation takes the following input:

  • an authentication key (see Authentication for details)
  • a customer number (id) for the customer
  • a customer

Validation

The following validation will determine whether the operation succeeds:

  • the authentication key must be valid (see Authentication for details)
  • the customer number cannot be null
  • the customer must be valid, ie.:
    • the name cannot be null
    • the address cannot be null
    • the zipcode cannot be null
    • the city cannot be null
    • the country id cannot be null
    • the email address cannot be null
    • the email address must have a valid format (see below)
    • the password cannot be null

Depending on the shop settings it may not be possible to update customers with duplicate email addresses.

The format of the email address is checked with the regular expression “[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}”.

The customer UPDATE permission is required to perform this operation.

Output

When successful the operation returns true, otherwise false.

Request and response format

http://4221117.shop53.dandomain.dk/admin/webapi/endpoints/v1_0/CustomerService/help/operations/UpdateCustomer

Code examples

C# (Console)

 

PHP


 

DeleteCustomer [DELETE]

The DeleteCustomer operation deletes a customer from the shop based on a unique customer number.

Input

The operation takes the following input:

  • an authentication key (see Authentication for details)
  • a customer number (id) for the customer

Validation

The following validation will determine whether the operation succeeds:

  • the authentication key must be valid (see Authentication for details)
  • the customer number cannot be null

The customer DELETE permission is required to perform this operation.

Output

When successful the operation returns true.

Request and response format

http://4221117.shop53.dandomain.dk/admin/webapi/endpoints/v1_0/CustomerService/help/operations/DeleteCustomer

Code examples

C# (Console)

PHP


GetCustomerGroups [GET]

The GetCustomerGroups operation retrieves a complete list of customer groups from the shop.

Input

The operation takes the following input:

Validation

The following validation will determine whether the operation succeeds:

  • the authentication key must be valid (see Authentication for details)

The customer READ permission is required to perform this operation.

Output

When successful the operation returns a list of customer groups.

Request and response format

http://4221117.shop53.dandomain.dk/admin/webapi/endpoints/v1_0/CustomerService/help/operations/GetCustomerGroups

Code examples

C# (Console)


PHP


UpdateCustomerDiscount[POST]

The UpdateCustomerDiscount operation updates discount specified for the customer

Input

The operation takes the following input:

  • an authentication key (see Authentication for details)
  • a customer number (id) for the customer

Validation

The following validation will determine whether the operation succeeds:

  • the authentication key must be valid (see Authentication for details)
  • the customer number cannot be null

The customer UPDATE permission is required to perform this operation.

Output

The operation returns boolean.

Request and response format

http://4221117.shop53.dandomain.dk/admin/webapi/endpoints/v1_0/CustomerService/help/operations/UpdateCustomerDiscount


GetCustomerDiscount[GET]

The GetCustomerDiscount operation gets discount specified for the customer

Input

The operation takes the following input:

  • an authentication key (see Authentication for details)
  • a customer number (id) for the customer

Validation

The following validation will determine whether the operation succeeds:

  • the authentication key must be valid (see Authentication for details)
  • the customer number cannot be null

The customer READ permission is required to perform this operation.

Output

The operation returns details about the customer discount.

Request and response format

http://4221117.shop53.dandomain.dk/admin/webapi/endpoints/v1_0/CustomerService/help/operations/GetCustomerDiscount


Du finder dokumentationen til DanDomain Webshop her: https://webshop-help.dandomain.dk x