JSON API » customers » customers/get
Gets the fields of a customer.
Input parameters
Requires authentication and the user role privilege, unless check=1. If you don't have the callshop or commerce role privileges, you may only get your own customer.
| Name | Type | Description | Required | Default value |
|---|---|---|---|---|
| auth_username | String | Authentication username. | Yes, unless check=1. | |
| auth_password | String | Authentication password. | Yes, unless check=1. | |
| check | Integer | 1 to just check if the customer exists, 0 to return full data. | No | 0 |
| String | Email address of customer to get. | No | Empty string. | |
| id | Integer | ID of customer to get. | No | 0 |
| name | String | Name of customer to get. | No | Empty string. |
| payment | Integer | 1 to get payment settings, 0 to get fields of customer. | No | 0 |
One of email, id, or name must be specified. If the system is not configured to require unique email addresses, use of the email parameter is not recommended.
Responses
| Code | Description |
|---|---|
| 200 | Success. |
| 400 | Invalid input parameters specified. Check the key and message fields for more details. |
| 401 | The authentication details provided are invalid. |
| 402 | Your role does not allow this. |
| 404 | The customer does not exist, or you do not have permission to view it. |
Data returned
Fields of customer.
Example: With required parameters
http://enswitch.example.com/api/json/customers/get/?auth_username=user;auth_password=password;id=123{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":{ "id":123, "name":"example", ... } }
Change history
| Version | Changes |
|---|---|
| 3.13 | Function added. |
