Working with Users/Customers
In the context of WebCommander, a “customer” refers to an individual who purchases goods or services from the platform. This section explains how you can interact with customer data using webhooks and APIs specifically designed for customer-related operations. Below is a list of customer-related operations that you can perform using WebCommander’s APIs:
Get Customer Data
To retrieve customer data using a token, you can use the following API endpoint.
curl --location 'http://yourapp.com/external/app/access/customer-details-with-token?token=0e35317d7dfcabad2a4b9e06d8df168c' \
--header 'uuid: F8A3-A88E-C6EF-B1CB' \
--header 'accessToken: 11b4ec017714ef095b8e115545467fcb'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'http://yourapp.com/external/app/access/customer-details-with-token?token=0e35317d7dfcabad2a4b9e06d8df168c',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'uuid: F8A3-A88E-C6EF-B1CB',
'accessToken: 11b4ec017714ef095b8e115545467fcb'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import http.client
conn = http.client.HTTPSConnection("yourapp.com")
payload = ''
headers = {
'uuid': 'F8A3-A88E-C6EF-B1CB',
'accessToken': '11b4ec017714ef095b8e115545467fcb'
}
conn.request("GET", "/external/app/access/customer-details-with-token?token=0e35317d7dfcabad2a4b9e06d8df168c", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.get("http://yourapp.com/external/app/access/customer-details-with-token?token=0e35317d7dfcabad2a4b9e06d8df168c")
.header("uuid", "F8A3-A88E-C6EF-B1CB")
.header("accessToken", "11b4ec017714ef095b8e115545467fcb")
.asString();
var options = new RestClientOptions("")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("http://yourapp.com/external/app/access/customer-details-with-token?token=0e35317d7dfcabad2a4b9e06d8df168c", Method.Get);
request.AddHeader("uuid", "F8A3-A88E-C6EF-B1CB");
request.AddHeader("accessToken", "11b4ec017714ef095b8e115545467fcb");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
Request Details
- Request URL:
http://yourapp.com/external/app/access/customer-details-with-token?token=0e35317d7dfcabad2a4b9e06d8df168c
- Request Type:
GET
Get Customer List
Retrieve a comprehensive list of all customers or users. An example is provided below:
curl --location 'http://yourapp.com/external/app/access/customers?max=-1&offset=0&type=active' \
--header 'accessToken: 11b4ec017714ef095b8e115545467fcb' \
--header 'uuid: F8A3-A88E-C6EF-B1CB'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'http://yourapp.com/external/app/access/customers?max=-1&offset=0&type=active',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'accessToken: 11b4ec017714ef095b8e115545467fcb',
'uuid: F8A3-A88E-C6EF-B1CB'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import http.client
conn = http.client.HTTPSConnection("yourapp.com")
payload = ''
headers = {
'accessToken': '11b4ec017714ef095b8e115545467fcb',
'uuid': 'F8A3-A88E-C6EF-B1CB'
}
conn.request("GET", "/external/app/access/customers?max=-1&offset=0&type=active", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.get("http://yourapp.com/external/app/access/customers?max=-1&offset=0&type=active")
.header("accessToken", "11b4ec017714ef095b8e115545467fcb")
.header("uuid", "F8A3-A88E-C6EF-B1CB")
.asString();
var options = new RestClientOptions("")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("http://yourapp.com/external/app/access/customers?max=-1&offset=0&type=active", Method.Get);
request.AddHeader("accessToken", "11b4ec017714ef095b8e115545467fcb");
request.AddHeader("uuid", "F8A3-A88E-C6EF-B1CB");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
Request Details
Request URL: http://yourapp.com/external/app/access/customers
Request type: GET
Request Parameters
"max": "-1",
"offset": "0",
"type": "active"
Response
{
"customers": [
{
"countReferralCodeUsed": 0,
"cloudConfig": null,
"lastName": "Islam",
"parent": null,
"backgroundImage": null,
"companyName": null,
"billingAddresses": [
{
"lastName": "Doe",
"country": 236,
"city": "Dhaka",
"companyName": null,
"mobile": null,
"firstName": "John",
"phone": null,
"addressLine1": "Dhaka",
"addressLine2": "",
"postCode": null,
"id": 4191,
"state": 10,
"fax": null,
"email": "john@0040gmail.com"
}
],
"source": null,
"shippingProfile": null,
"activeBillingAddress": {
"lastName": "Doe",
"country": 236,
"city": "Dhaka",
"companyName": null,
"mobile": null,
"firstName": "John",
"phone": null,
"addressLine1": "Dhaka",
"addressLine2": "",
"postCode": null,
"id": 4191,
"state": 10,
"fax": null,
"email": "john@0040gmail.com"
},
"abnBranch": null,
"referralCode": null,
"id": 310,
"howDoYouKnow": null,
"activeShippingAddress": {
"lastName": "Doe",
"country": 236,
"city": "Dhaka",
"companyName": null,
"mobile": null,
"firstName": "John",
"phone": null,
"addressLine1": "Dhaka",
"addressLine2": "",
"postCode": null,
"id": 4192,
"state": 10,
"fax": null,
"email": "john@0040gmail.com"
},
"address": {
"lastName": "Doe",
"country": 236,
"city": "Dhaka",
"companyName": null,
"mobile": null,
"firstName": "John",
"phone": null,
"addressLine1": "Dhaka",
"addressLine2": "",
"postCode": null,
"id": 4190,
"state": 10,
"fax": null,
"email": "john@0040gmail.com"
},
"sex": "Male",
"isCompany": false,
"userName": "john@40gmail.com",
"abn": null,
"version": null,
"storeCredit": 0.0,
"firstName": "John",
"baseUrl": "\u002f",
"usedReferralCode": null,
"displayId": 102,
"defaultTaxCode": null,
"status": "A",
"shippingAddresses": [
{
"lastName": "Doe",
"country": 236,
"city": "Dhaka",
"companyName": null,
"mobile": null,
"firstName": "John",
"phone": null,
"addressLine1": "Dhaka",
"addressLine2": "",
"postCode": null,
"id": 4192,
"state": 10,
"fax": null,
"email": "johndoe0040gmail.com"
}
]
}
]
}
Create a Customer
Responsible for customer creation. An example is provided below:
curl --location 'http://yourapp.com/external/app/access/customer-create' \
--header 'uuid: F8A3-A88E-C6EF-B1CB' \
--header 'accessToken: 11b4ec017714ef095b8e115545467fcb' \
--header 'Content-Type: application/json' \
--data-raw '{
"firstName": "John",
"lastName": "Doe",
"password":"123213",
"abnBranch": null,
"source": "",
"country": 236,
"city": "Dhaka",
"companyName": null,
"mobile": null,
"phone": null,
"addressLine1": "Dhaka",
"addressLine2": "",
"postCode": null,
"state": 10,
"fax": null,
"email": "john@0040gmail.com",
"sex": "Male",
"isCompany": false,
"userName": "john@0040gmail.com",
"abn": null
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'http://yourapp.com/external/app/access/customer-create',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"firstName": "John",
"lastName": "Doe",
"password":"123213",
"abnBranch": null,
"source": "",
"country": 236,
"city": "Dhaka",
"companyName": null,
"mobile": null,
"phone": null,
"addressLine1": "Dhaka",
"addressLine2": "",
"postCode": null,
"state": 10,
"fax": null,
"email": "john@0040gmail.com",
"sex": "Male",
"isCompany": false,
"userName": "john@0040gmail.com",
"abn": null
}',
CURLOPT_HTTPHEADER => array(
'uuid: F8A3-A88E-C6EF-B1CB',
'accessToken: 11b4ec017714ef095b8e115545467fcb',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import http.client
import json
conn = http.client.HTTPSConnection("yourapp.com")
payload = json.dumps({
"firstName": "John",
"lastName": "Doe",
"password": "123213",
"abnBranch": None,
"source": "",
"country": 236,
"city": "Dhaka",
"companyName": None,
"mobile": None,
"phone": None,
"addressLine1": "Dhaka",
"addressLine2": "",
"postCode": None,
"state": 10,
"fax": None,
"email": "john@0040gmail.com",
"sex": "Male",
"isCompany": False,
"userName": "john@0040gmail.com",
"abn": None
})
headers = {
'uuid': 'F8A3-A88E-C6EF-B1CB',
'accessToken': '11b4ec017714ef095b8e115545467fcb',
'Content-Type': 'application/json'
}
conn.request("POST", "/external/app/access/customer-create", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("http://yourapp.com/external/app/access/customer-create")
.header("uuid", "F8A3-A88E-C6EF-B1CB")
.header("accessToken", "11b4ec017714ef095b8e115545467fcb")
.header("Content-Type", "application/json")
.body("{\r\n \"firstName\": \"John\",\r\n \"lastName\": \"Doe\",\r\n \"password\":\"123213\",\r\n \"abnBranch\": null,\r\n \"source\": \"\",\r\n \"country\": 236,\r\n \"city\": \"Dhaka\",\r\n \"companyName\": null,\r\n \"mobile\": null,\r\n \"phone\": null,\r\n \"addressLine1\": \"Dhaka\",\r\n \"addressLine2\": \"\",\r\n \"postCode\": null,\r\n \"state\": 10,\r\n \"fax\": null,\r\n \"email\": \"john@0040gmail.com\",\r\n \"sex\": \"Male\",\r\n \"isCompany\": false,\r\n \"userName\": \"john@0040gmail.com\",\r\n \"abn\": null\r\n}")
.asString();
var options = new RestClientOptions("")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("http://yourapp.com/external/app/access/customer-create", Method.Post);
request.AddHeader("uuid", "F8A3-A88E-C6EF-B1CB");
request.AddHeader("accessToken", "11b4ec017714ef095b8e115545467fcb");
request.AddHeader("Content-Type", "application/json");
var body = @"{
" + "\n" +
@" ""firstName"": ""John"",
" + "\n" +
@" ""lastName"": ""Doe"",
" + "\n" +
@" ""password"":""123213"",
" + "\n" +
@" ""abnBranch"": null,
" + "\n" +
@" ""source"": """",
" + "\n" +
@" ""country"": 236,
" + "\n" +
@" ""city"": ""Dhaka"",
" + "\n" +
@" ""companyName"": null,
" + "\n" +
@" ""mobile"": null,
" + "\n" +
@" ""phone"": null,
" + "\n" +
@" ""addressLine1"": ""Dhaka"",
" + "\n" +
@" ""addressLine2"": """",
" + "\n" +
@" ""postCode"": null,
" + "\n" +
@" ""state"": 10,
" + "\n" +
@" ""fax"": null,
" + "\n" +
@" ""email"": ""john@0040gmail.com"",
" + "\n" +
@" ""sex"": ""Male"",
" + "\n" +
@" ""isCompany"": false,
" + "\n" +
@" ""userName"": ""john@0040gmail.com"",
" + "\n" +
@" ""abn"": null
" + "\n" +
@"}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
Request Details
- Request URL:
http://yourapp.com/external/app/access/customer-create
- Request Type:
POST
Request Parameters
{
"firstName": "John",
"lastName": "Doe",
"password":"123213",
"abnBranch": null,
"source": "",
"country": 236,
"city": "Dhaka",
"companyName": null,
"mobile": null,
"phone": null,
"addressLine1": "Dhaka",
"addressLine2": "",
"postCode": null,
"state": 10,
"fax": null,
"email": "john@0040gmail.com",
"sex": "Male",
"isCompany": false,
"userName": "john@0040gmail.com",
"abn": null
}
Response
{
"customers": {
"countReferralCodeUsed": 0,
"cloudConfig": null,
"lastName": "Doe",
"parent": null,
"backgroundImage": null,
"companyName": null,
"billingAddresses": [
{
"lastName": "Doe",
"country": 236,
"city": "Dhaka",
"companyName": null,
"mobile": null,
"firstName": "John",
"phone": null,
"addressLine1": "Dhaka",
"addressLine2": "",
"postCode": null,
"id": 4191,
"state": 10,
"fax": null,
"email": "john@0040gmail.com"
}
],
"source": null,
"shippingProfile": null,
"activeBillingAddress": {
"lastName": "Doe",
"country": 236,
"city": "Dhaka",
"companyName": null,
"mobile": null,
"firstName": "John",
"phone": null,
"addressLine1": "Dhaka",
"addressLine2": "",
"postCode": null,
"id": 4191,
"state": 10,
"fax": null,
"email": "john@0040gmail.com"
},
"abnBranch": null,
"referralCode": null,
"id": 310,
"howDoYouKnow": null,
"activeShippingAddress": {
"lastName": "Doe",
"country": 236,
"city": "Dhaka",
"companyName": null,
"mobile": null,
"firstName": "John",
"phone": null,
"addressLine1": "Dhaka",
"addressLine2": "",
"postCode": null,
"id": 4192,
"state": 10,
"fax": null,
"email": "john@0040gmail.com"
},
"address": {
"lastName": "Doe",
"country": 236,
"city": "Dhaka",
"companyName": null,
"mobile": null,
"firstName": "John",
"phone": null,
"addressLine1": "Dhaka",
"addressLine2": "",
"postCode": null,
"id": 4190,
"state": 10,
"fax": null,
"email": "john@0040gmail.com"
},
"sex": "Male",
"isCompany": false,
"userName": "john@0040gmail.com",
"abn": null,
"version": null,
"storeCredit": 0.0,
"firstName": "John",
"baseUrl": "\u002f",
"usedReferralCode": null,
"displayId": 102,
"defaultTaxCode": null,
"status": "A",
"shippingAddresses": [
{
"lastName": "Doe",
"country": 236,
"city": "Dhaka",
"companyName": null,
"mobile": null,
"firstName": "John",
"phone": null,
"addressLine1": "Dhaka",
"addressLine2": "",
"postCode": null,
"id": 4192,
"state": 10,
"fax": null,
"email": "john@0040gmail.com"
}
]
}
}
Customer Delete
Responsible for customer deletion. An example is provided below:
curl --location --request DELETE 'http://yourapp.com/external/app/access/customer-delete' \
--header 'uuid: F8A3-A88E-C6EF-B1CB' \
--header 'accessToken: 11b4ec017714ef095b8e115545467fcb' \
--header 'Content-Type: application/json' \
--data '{"customerId": 229956}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'http://yourapp.com/external/app/access/customer-delete',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_POSTFIELDS =>'{"customerId": 229956}',
CURLOPT_HTTPHEADER => array(
'uuid: F8A3-A88E-C6EF-B1CB',
'accessToken: 11b4ec017714ef095b8e115545467fcb',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import http.client
import json
conn = http.client.HTTPSConnection("yourapp.com")
payload = json.dumps({
"customerId": 229956
})
headers = {
'uuid': 'F8A3-A88E-C6EF-B1CB',
'accessToken': '11b4ec017714ef095b8e115545467fcb',
'Content-Type': 'application/json'
}
conn.request("DELETE", "/external/app/access/customer-delete", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.delete("http://yourapp.com/external/app/access/customer-delete")
.header("uuid", "F8A3-A88E-C6EF-B1CB")
.header("accessToken", "11b4ec017714ef095b8e115545467fcb")
.header("Content-Type", "application/json")
.body("{\"customerId\": 229956}")
.asString();
var options = new RestClientOptions("")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("http://yourapp.com/external/app/access/customer-delete", Method.Delete);
request.AddHeader("uuid", "F8A3-A88E-C6EF-B1CB");
request.AddHeader("accessToken", "11b4ec017714ef095b8e115545467fcb");
request.AddHeader("Content-Type", "application/json");
var body = @"{""customerId"": 229956}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
Request Details
- Request URL:
http://yourapp.com/external/app/access/customer-delete
- Request type:
DELETE
Request Parameter
"email":"abc@gmail.com"
or
"customerId": 123
Customer Update
Responsible for customer data updates. An example is provided below:
curl --location 'http://yourapp.com/external/app/access/customer-update' \
--header 'uuid: F8A3-A88E-C6EF-B1CB' \
--header 'accessToken: 11b4ec017714ef095b8e115545467fcb' \
--header 'Content-Type: application/json' \
--data-raw '{
"firstName": "John",
"lastName": "Doe",
"status": "active",
"country": 236,
"city": "Dhaka",
"mobile": null,
"phone": null,
"addressLine1": "Dhaka",
"addressLine2": "",
"postCode": null,
"state": 10,
"fax": null,
"email": "john@0040gmail.com",
"sex": "Male"
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'http://yourapp.com/external/app/access/customer-update',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"firstName": "John",
"lastName": "Doe",
"status": "active",
"country": 236,
"city": "Dhaka",
"mobile": null,
"phone": null,
"addressLine1": "Dhaka",
"addressLine2": "",
"postCode": null,
"state": 10,
"fax": null,
"email": "john@0040gmail.com",
"sex": "Male"
}',
CURLOPT_HTTPHEADER => array(
'uuid: F8A3-A88E-C6EF-B1CB',
'accessToken: 11b4ec017714ef095b8e115545467fcb',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import http.client
import json
conn = http.client.HTTPSConnection("yourapp.com")
payload = json.dumps({
"firstName": "John",
"lastName": "Doe",
"status": "active",
"country": 236,
"city": "Dhaka",
"mobile": None,
"phone": None,
"addressLine1": "Dhaka",
"addressLine2": "",
"postCode": None,
"state": 10,
"fax": None,
"email": "john@0040gmail.com",
"sex": "Male"
})
headers = {
'uuid': 'F8A3-A88E-C6EF-B1CB',
'accessToken': '11b4ec017714ef095b8e115545467fcb',
'Content-Type': 'application/json'
}
conn.request("POST", "/external/app/access/customer-update", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("http://yourapp.com/external/app/access/customer-update")
.header("uuid", "F8A3-A88E-C6EF-B1CB")
.header("accessToken", "11b4ec017714ef095b8e115545467fcb")
.header("Content-Type", "application/json")
.body("{\r\n \"firstName\": \"John\",\r\n \"lastName\": \"Doe\",\r\n \"status\": \"active\",\r\n \"country\": 236,\r\n \"city\": \"Dhaka\",\r\n \"mobile\": null,\r\n \"phone\": null,\r\n \"addressLine1\": \"Dhaka\",\r\n \"addressLine2\": \"\",\r\n \"postCode\": null,\r\n \"state\": 10,\r\n \"fax\": null,\r\n \"email\": \"john@0040gmail.com\",\r\n \"sex\": \"Male\"\r\n}")
.asString();
var options = new RestClientOptions("")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("http://yourapp.com/external/app/access/customer-update", Method.Post);
request.AddHeader("uuid", "F8A3-A88E-C6EF-B1CB");
request.AddHeader("accessToken", "11b4ec017714ef095b8e115545467fcb");
request.AddHeader("Content-Type", "application/json");
var body = @"{
" + "\n" +
@" ""firstName"": ""John"",
" + "\n" +
@" ""lastName"": ""Doe"",
" + "\n" +
@" ""status"": ""active"",
" + "\n" +
@" ""country"": 236,
" + "\n" +
@" ""city"": ""Dhaka"",
" + "\n" +
@" ""mobile"": null,
" + "\n" +
@" ""phone"": null,
" + "\n" +
@" ""addressLine1"": ""Dhaka"",
" + "\n" +
@" ""addressLine2"": """",
" + "\n" +
@" ""postCode"": null,
" + "\n" +
@" ""state"": 10,
" + "\n" +
@" ""fax"": null,
" + "\n" +
@" ""email"": ""john@0040gmail.com"",
" + "\n" +
@" ""sex"": ""Male""
" + "\n" +
@"}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
Request Details
- Request URL:
http://yourapp.com/external/app/access/customer-update
- Request type:
POST
Request Parameter
{
"firstName": "John",
"lastName": "Doe",
"status": "active",
"country": 236,
"city": "Dhaka",
"mobile": null,
"phone": null,
"addressLine1": "Dhaka",
"addressLine2": "",
"postCode": null,
"state": 10,
"fax": null,
"email": "john@0040gmail.com",
"sex": "Male"
}
Response
{
"customers": {
"countReferralCodeUsed": 0,
"cloudConfig": null,
"lastName": "Doe",
"parent": null,
"backgroundImage": null,
"companyName": null,
"billingAddresses": [
{
"lastName": "Doe",
"country": 236,
"city": "Dhaka",
"companyName": null,
"mobile": null,
"firstName": "John",
"phone": null,
"addressLine1": "Dhaka",
"addressLine2": "",
"postCode": null,
"id": 4191,
"state": 10,
"fax": null,
"email": "john@0040gmail.com"
}
],
"source": null,
"shippingProfile": null,
"activeBillingAddress": {
"lastName": "Doe",
"country": 236,
"city": "Dhaka",
"companyName": null,
"mobile": null,
"firstName": "John",
"phone": null,
"addressLine1": "Dhaka",
"addressLine2": "",
"postCode": null,
"id": 4191,
"state": 10,
"fax": null,
"email": "john@0040gmail.com"
},
"abnBranch": null,
"referralCode": null,
"id": 310,
"howDoYouKnow": null,
"activeShippingAddress": {
"lastName": "Doe",
"country": 236,
"city": "Dhaka",
"companyName": null,
"mobile": null,
"firstName": "John",
"phone": null,
"addressLine1": "Dhaka",
"addressLine2": "",
"postCode": null,
"id": 4192,
"state": 10,
"fax": null,
"email": "john@0040gmail.com"
},
"address": {
"lastName": "Doe",
"country": 236,
"city": "Dhaka",
"companyName": null,
"mobile": null,
"firstName": "John",
"phone": null,
"addressLine1": "Dhaka",
"addressLine2": "",
"postCode": null,
"id": 4190,
"state": 10,
"fax": null,
"email": "john@0040gmail.com"
},
"sex": "Male",
"isCompany": false,
"userName": "john@0040gmail.com",
"abn": null,
"version": null,
"storeCredit": 0.0,
"firstName": "John",
"baseUrl": "\u002f",
"usedReferralCode": null,
"displayId": 102,
"defaultTaxCode": null,
"status": "A",
"shippingAddresses": [
{
"lastName": "Doe",
"country": 236,
"city": "Dhaka",
"companyName": null,
"mobile": null,
"firstName": "John",
"phone": null,
"addressLine1": "Dhaka",
"addressLine2": "",
"postCode": null,
"id": 4192,
"state": 10,
"fax": null,
"email": "john@0040gmail.com"
}
]
}
}
Customer Payments
List of payments initiated by a customer. An example is provided below:
curl --location 'http://yourapp.com/external/app/access/customer-payments?customerId=2299563456' \
--header 'uuid: F8A3-A88E-C6EF-B1CB' \
--header 'accessToken: 11b4ec017714ef095b8e115545467fcb'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'http://yourapp.com/external/app/access/customer-payments?customerId=2299563456',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'uuid: F8A3-A88E-C6EF-B1CB',
'accessToken: 11b4ec017714ef095b8e115545467fcb'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import http.client
conn = http.client.HTTPSConnection("yourapp.com")
payload = ''
headers = {
'uuid': 'F8A3-A88E-C6EF-B1CB',
'accessToken': '11b4ec017714ef095b8e115545467fcb'
}
conn.request("GET", "/external/app/access/customer-payments?customerId=2299563456", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.get("http://yourapp.com/external/app/access/customer-payments?customerId=2299563456")
.header("uuid", "F8A3-A88E-C6EF-B1CB")
.header("accessToken", "11b4ec017714ef095b8e115545467fcb")
.asString();
var options = new RestClientOptions("")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("http://yourapp.com/external/app/access/customer-payments?customerId=2299563456", Method.Get);
request.AddHeader("uuid", "F8A3-A88E-C6EF-B1CB");
request.AddHeader("accessToken", "11b4ec017714ef095b8e115545467fcb");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
Request Details
Request URL: http://yourapp.com/external/app/access/customer-payments
Request type: GET
Request Parameter
"email": "john@gmail.com"
or
"customerId": "667785555"
Response
{
"payments": [
[
{
"surcharge": 0.0,
"amount": 110.0,
"trackInfo": null,
"payingDate": "2023-03-21T11:09:25",
"gatewayName": null,
"created": "2023-03-21T11:09:25",
"version": null,
"payerInfo": null,
"gatewayCode": "CRD",
"gatewayResponse": null,
"id": 1586,
"updated": "2023-03-21T11:09:25",
"refundId": null,
"order": {
"orderComment": [],
"payments": [
1586,
1591
],
"lastReminderTime": "2023-03-21T11:09:24",
"totalSurcharge": 0.0,
"orderStatus": "pending",
"orderChannel": null,
"billing": 3866,
"shippingStatus": "awaiting",
"shippingTax": 0.0,
"shipping": 3871,
"discountOnOrder": 0.0,
"additionalInfo": null,
"customerId": 296,
"handlingCost": 0.0,
"discountOnShippingTax": 0.0,
"id": 1446,
"paymentStatus": "paid",
"handlingTax": 0.0,
"orderNo": 457,
"shippingCost": 0.0,
"discountOnOrderTotalTax": 0.0,
"ipAddress": "127.0.0.1",
"deliveryType": "shipping",
"shipments": [],
"customerName": "Dimitrius Sideris",
"reminderCount": 0,
"createdBy": null,
"actualTax": 10.0,
"discountOnShipping": 0.0,
"items": [
2611,
2616,
2621
]
},
"status": "awaiting"
}
]
]
}
Get Single Customer
Retrieve the details of a single customer based on their ID or email. Here is an example:
curl --location 'http://yourapp.com/external/app/access/customer?customerId=667785555' \
--header 'uuid: F8A3-A88E-C6EF-B1CB' \
--header 'accessToken: 11b4ec017714ef095b8e115545467fcb'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'http://yourapp.com/external/app/access/customer?customerId=667785555',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'uuid: F8A3-A88E-C6EF-B1CB',
'accessToken: 11b4ec017714ef095b8e115545467fcb'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import http.client
conn = http.client.HTTPSConnection("yourapp.com")
payload = ''
headers = {
'uuid': 'F8A3-A88E-C6EF-B1CB',
'accessToken': '11b4ec017714ef095b8e115545467fcb'
}
conn.request("GET", "/external/app/access/customer?customerId=667785555", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.get("http://yourapp.com/external/app/access/customer?customerId=667785555")
.header("uuid", "F8A3-A88E-C6EF-B1CB")
.header("accessToken", "11b4ec017714ef095b8e115545467fcb")
.asString();
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.get("http://yourapp.com/external/app/access/customer?customerId=667785555")
.header("uuid", "F8A3-A88E-C6EF-B1CB")
.header("accessToken", "11b4ec017714ef095b8e115545467fcb")
.asString();
Request Details
- Request URL:
http://yourapp.com/external/app/access/customer
- Request type:
GET
Request Parameter
"email": "john@gmail.com"
or
"customerId": "667785555"
Response
{
"customers": {
"countReferralCodeUsed": 0,
"cloudConfig": null,
"lastName": "Doe",
"parent": null,
"backgroundImage": null,
"companyName": null,
"billingAddresses": [
{
"lastName": "Doe",
"country": 236,
"city": "Dhaka",
"companyName": null,
"mobile": null,
"firstName": "John",
"phone": null,
"addressLine1": "Dhaka",
"addressLine2": "",
"postCode": null,
"id": 4191,
"state": 10,
"fax": null,
"email": "john@0040gmail.com"
}
],
"source": null,
"shippingProfile": null,
"activeBillingAddress": {
"lastName": "Doe",
"country": 236,
"city": "Dhaka",
"companyName": null,
"mobile": null,
"firstName": "John",
"phone": null,
"addressLine1": "Dhaka",
"addressLine2": "",
"postCode": null,
"id": 4191,
"state": 10,
"fax": null,
"email": "john@0040gmail.com"
},
"abnBranch": null,
"referralCode": null,
"id": 310,
"howDoYouKnow": null,
"activeShippingAddress": {
"lastName": "Doe",
"country": 236,
"city": "Dhaka",
"companyName": null,
"mobile": null,
"firstName": "John",
"phone": null,
"addressLine1": "Dhaka",
"addressLine2": "",
"postCode": null,
"id": 4192,
"state": 10,
"fax": null,
"email": "john@0040gmail.com"
},
"address": {
"lastName": "Doe",
"country": 236,
"city": "Dhaka",
"companyName": null,
"mobile": null,
"firstName": "John",
"phone": null,
"addressLine1": "Dhaka",
"addressLine2": "",
"postCode": null,
"id": 4190,
"state": 10,
"fax": null,
"email": "john@0040gmail.com"
},
"sex": "Male",
"isCompany": false,
"userName": "john@0040gmail.com",
"abn": null,
"version": null,
"storeCredit": 0.0,
"firstName": "John",
"baseUrl": "\u002f",
"usedReferralCode": null,
"displayId": 102,
"defaultTaxCode": null,
"status": "A",
"shippingAddresses": [
{
"lastName": "Doe",
"country": 236,
"city": "Dhaka",
"companyName": null,
"mobile": null,
"firstName": "John",
"phone": null,
"addressLine1": "Dhaka",
"addressLine2": "",
"postCode": null,
"id": 4192,
"state": 10,
"fax": null,
"email": "john@0040gmail.com"
}
]
}
}
Customer Orders
Retrieve the list of all orders placed by a customer. Here is an example:
curl --location 'http://yourapp.com/external/app/access/customer-orders?customerId=667785555' \
--header 'uuid: F8A3-A88E-C6EF-B1CB' \
--header 'accessToken: 11b4ec017714ef095b8e115545467fcb'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'http://yourapp.com/external/app/access/customer-orders?customerId=667785555',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'uuid: F8A3-A88E-C6EF-B1CB',
'accessToken: 11b4ec017714ef095b8e115545467fcb'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import http.client
conn = http.client.HTTPSConnection("yourapp.com")
payload = ''
headers = {
'uuid': 'F8A3-A88E-C6EF-B1CB',
'accessToken': '11b4ec017714ef095b8e115545467fcb'
}
conn.request("GET", "/external/app/access/customer-orders?customerId=667785555", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.get("http://yourapp.com/external/app/access/customer-orders?customerId=667785555")
.header("uuid", "F8A3-A88E-C6EF-B1CB")
.header("accessToken", "11b4ec017714ef095b8e115545467fcb")
.asString();
var options = new RestClientOptions("")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("http://yourapp.com/external/app/access/customer-orders?customerId=667785555", Method.Get);
request.AddHeader("uuid", "F8A3-A88E-C6EF-B1CB");
request.AddHeader("accessToken", "11b4ec017714ef095b8e115545467fcb");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
Request Details
- Request URL:
http://yourapp.com/external/app/access/customer-orders
- Request type:
GET
Request Parameter
"email": "john@gmail.com"
or
"customerId": "667785555"
Response
{
"orders": [
{
"orderComment": [],
"payments": [
{
"surcharge": 0.0,
"amount": 110.0,
"trackInfo": null,
"payerInfo": null,
"gatewayCode": "CRD",
"payingDate": "2023-03-21T11:09:25",
"gatewayName": null,
"gatewayResponse": null,
"id": 1586,
"refundId": null,
"order": 1446,
"status": "awaiting"
},
{
"surcharge": 0.0,
"amount": 110.0,
"trackInfo": "684084",
"payerInfo": "Customer#92",
"gatewayCode": "CRD",
"payingDate": "2023-03-21T11:10:47",
"gatewayName": "securePay",
"gatewayResponse": "Code 08 - Approved",
"id": 1591,
"refundId": "ca644b7c-00457-559",
"order": 1446,
"status": "success"
}
],
"lastReminderTime": "2023-03-21T11: 09: 24",
"totalSurcharge": 0.0,
"orderStatus": "pending",
"orderChannel": null,
"billing": {
"lastName": "Tom",
"country": 12,
"city": "Wheelers Hill",
"companyName": null,
"mobile": "123456789",
"firstName": "Jarry",
"phone": "12345",
"addressLine1": "Address Line 1",
"addressLine2": null,
"postCode": "3150",
"id": 3866,
"state": 72,
"fax": "fax",
"email": "3866\u0040noemail.loc"
},
"shippingStatus": "awaiting",
"shippingTax": 0.0,
"shipping": {
"lastName": "Tom",
"country": 12,
"city": "Wheelers Hill",
"companyName": null,
"mobile": "123456789",
"firstName": "Jarry",
"phone": "12345",
"addressLine1": "Address Line 1",
"addressLine2": null,
"postCode": "3150",
"id": 3871,
"state": 72,
"fax": "fax",
"email": "3871\u0040noemail.loc"
},
"discountOnOrder": 0.0,
"additionalInfo": null,
"customerId": 296,
"handlingCost": 0.0,
"discountOnShippingTax": 0.0,
"id": 1446,
"paymentStatus": "paid",
"handlingTax": 0.0,
"orderNo": 457,
"shippingCost": 0.0,
"discountOnOrderTotalTax": 0.0,
"created": "2023-03-21T11: 09: 24",
"ipAddress": "127.0.0.1",
"deliveryType": "shipping",
"version": null,
"shipments": [],
"customerName": "Dimitrius Sideris",
"reminderCount": 0,
"createdBy": null,
"actualTax": 10.0,
"discountOnShipping": 0.0,
"updated": "2023-03-21T11: 11: 31",
"items": [
{
"actualDiscount": 0.0,
"quantity": 1,
"productId": 38,
"productVariationId": 305,
"actualPrice": 45.0,
"shippingClassName": null,
"taxDiscount": 0.0,
"isTaxable": true,
"discount": 0.0,
"tax": 4.09,
"storeId": null,
"shippingClassId": null,
"productName": "ON FIELD SHORTS - AWAY",
"price": 40.91,
"variations": [
"Size: M - Adult Medium"
],
"id": 2611,
"productType": "product",
"isShippable": true,
"order": 1446
},
{
"actualDiscount": 0.0,
"quantity": 1,
"productId": 32,
"productVariationId": 308,
"actualPrice": 45.0,
"shippingClassName": null,
"taxDiscount": 0.0,
"isTaxable": true,
"discount": 0.0,
"tax": 4.09,
"storeId": null,
"shippingClassId": null,
"productName": "ON FIELD SHORTS - HOME",
"price": 40.91,
"variations": [
"Size: M - Adult Medium"
],
"id": 2616,
"productType": "product",
"isShippable": true,
"order": 1446
},
{
"actualDiscount": 0.0,
"quantity": 1,
"productId": 101,
"productVariationId": 487,
"actualPrice": 20.0,
"shippingClassName": null,
"taxDiscount": 0.0,
"isTaxable": true,
"discount": 0.0,
"tax": 1.82,
"storeId": null,
"shippingClassId": null,
"productName": "ON FIELD SOCKS - TRADITIONAL LENGTH",
"price": 18.18,
"variations": [
"Size: 8 - 11"
],
"id": 2621,
"productType": "product",
"isShippable": true,
"order": 1446
}
]
}
]
Update Customer Billing Address
Responsible for updating the billing addresses of a customer. Here is an example:
curl --location 'http://yourapp.com/external/app/access/update-customer-billing-address' \
--header 'uuid: F8A3-A88E-C6EF-B1CB' \
--header 'accessToken: 11b4ec017714ef095b8e115545467fcb' \
--header 'Content-Type: application/json' \
--data-raw '{
"firstName": "John",
"lastName": "Doe",
"status": "active",
"country": 236,
"city": "Dhaka",
"mobile": null,
"phone": null,
"addressLine1": "Dhaka",
"addressLine2": "AU",
"postCode": null,
"state": 10,
"fax": null,
"email": "name@gmail.com"
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'http://yourapp.com/external/app/access/update-customer-billing-address',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"firstName": "John",
"lastName": "Doe",
"status": "active",
"country": 236,
"city": "Dhaka",
"mobile": null,
"phone": null,
"addressLine1": "Dhaka",
"addressLine2": "AU",
"postCode": null,
"state": 10,
"fax": null,
"email": "name@gmail.com"
}',
CURLOPT_HTTPHEADER => array(
'uuid: F8A3-A88E-C6EF-B1CB',
'accessToken: 11b4ec017714ef095b8e115545467fcb',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import http.client
import json
conn = http.client.HTTPSConnection("yourapp.com")
payload = json.dumps({
"firstName": "John",
"lastName": "Doe",
"status": "active",
"country": 236,
"city": "Dhaka",
"mobile": None,
"phone": None,
"addressLine1": "Dhaka",
"addressLine2": "AU",
"postCode": None,
"state": 10,
"fax": None,
"email": "name@gmail.com"
})
headers = {
'uuid': 'F8A3-A88E-C6EF-B1CB',
'accessToken': '11b4ec017714ef095b8e115545467fcb',
'Content-Type': 'application/json'
}
conn.request("POST", "/external/app/access/update-customer-billing-address", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("http://yourapp.com/external/app/access/update-customer-billing-address")
.header("uuid", "F8A3-A88E-C6EF-B1CB")
.header("accessToken", "11b4ec017714ef095b8e115545467fcb")
.header("Content-Type", "application/json")
.body("{\r\n \"firstName\": \"John\",\r\n \"lastName\": \"Doe\",\r\n \"status\": \"active\",\r\n \"country\": 236,\r\n \"city\": \"Dhaka\",\r\n \"mobile\": null,\r\n \"phone\": null,\r\n \"addressLine1\": \"Dhaka\",\r\n \"addressLine2\": \"AU\",\r\n \"postCode\": null,\r\n \"state\": 10,\r\n \"fax\": null,\r\n \"email\": \"name@gmail.com\"\r\n}")
.asString();
var options = new RestClientOptions("")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("http://yourapp.com/external/app/access/update-customer-billing-address", Method.Post);
request.AddHeader("uuid", "F8A3-A88E-C6EF-B1CB");
request.AddHeader("accessToken", "11b4ec017714ef095b8e115545467fcb");
request.AddHeader("Content-Type", "application/json");
var body = @"{
" + "\n" +
@" ""firstName"": ""John"",
" + "\n" +
@" ""lastName"": ""Doe"",
" + "\n" +
@" ""status"": ""active"",
" + "\n" +
@" ""country"": 236,
" + "\n" +
@" ""city"": ""Dhaka"",
" + "\n" +
@" ""mobile"": null,
" + "\n" +
@" ""phone"": null,
" + "\n" +
@" ""addressLine1"": ""Dhaka"",
" + "\n" +
@" ""addressLine2"": ""AU"",
" + "\n" +
@" ""postCode"": null,
" + "\n" +
@" ""state"": 10,
" + "\n" +
@" ""fax"": null,
" + "\n" +
@" ""email"": ""name@gmail.com""
" + "\n" +
@"}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
Request Details
- Request URL:
http://yourapp.com/external/app/access/update-customer-billing-address
- Request type:
POS
Request Parameter
{
"firstName": "John",
"lastName": "Doe",
"status": "active",
"country": 236,
"city": "Dhaka",
"mobile": null,
"phone": null,
"addressLine1": "Dhaka",
"addressLine2": "AU",
"postCode": null,
"state": 10,
"fax": null,
"email": "name@gmail.com"
}
Response
{
"address": {
"firstName": "John",
"lastName": "Doe",
"status": "active",
"country": 236,
"city": "Dhaka",
"mobile": null,
"phone": null,
"addressLine1": "Dhaka",
"addressLine2": "AU",
"postCode": null,
"state": 10,
"fax": null,
"email": "name@gmail.com"
}
}
Update Customer Shipping Address
curl --location 'http://yourapp.com/external/app/access/update-customer-shipping-address' \
--header 'uuid: F8A3-A88E-C6EF-B1CB' \
--header 'accessToken: 11b4ec017714ef095b8e115545467fcb' \
--header 'Content-Type: application/json' \
--data-raw '{
"firstName": "John",
"lastName": "Doe",
"status": "active",
"country": 236,
"city": "Dhaka",
"mobile": null,
"phone": null,
"addressLine1": "Dhaka",
"addressLine2": "AU",
"postCode": null,
"state": 10,
"fax": null,
"email": "name@gmail.com"
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'http://yourapp.com/external/app/access/update-customer-shipping-address',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"firstName": "John",
"lastName": "Doe",
"status": "active",
"country": 236,
"city": "Dhaka",
"mobile": null,
"phone": null,
"addressLine1": "Dhaka",
"addressLine2": "AU",
"postCode": null,
"state": 10,
"fax": null,
"email": "name@gmail.com"
}',
CURLOPT_HTTPHEADER => array(
'uuid: F8A3-A88E-C6EF-B1CB',
'accessToken: 11b4ec017714ef095b8e115545467fcb',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import http.client
import json
conn = http.client.HTTPSConnection("yourapp.com")
payload = json.dumps({
"firstName": "John",
"lastName": "Doe",
"status": "active",
"country": 236,
"city": "Dhaka",
"mobile": None,
"phone": None,
"addressLine1": "Dhaka",
"addressLine2": "AU",
"postCode": None,
"state": 10,
"fax": None,
"email": "name@gmail.com"
})
headers = {
'uuid': 'F8A3-A88E-C6EF-B1CB',
'accessToken': '11b4ec017714ef095b8e115545467fcb',
'Content-Type': 'application/json'
}
conn.request("POST", "/external/app/access/update-customer-shipping-address", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("http://yourapp.com/external/app/access/update-customer-shipping-address")
.header("uuid", "F8A3-A88E-C6EF-B1CB")
.header("accessToken", "11b4ec017714ef095b8e115545467fcb")
.header("Content-Type", "application/json")
.body("{\r\n \"firstName\": \"John\",\r\n \"lastName\": \"Doe\",\r\n \"status\": \"active\",\r\n \"country\": 236,\r\n \"city\": \"Dhaka\",\r\n \"mobile\": null,\r\n \"phone\": null,\r\n \"addressLine1\": \"Dhaka\",\r\n \"addressLine2\": \"AU\",\r\n \"postCode\": null,\r\n \"state\": 10,\r\n \"fax\": null,\r\n \"email\": \"name@gmail.com\"\r\n}")
.asString();
var options = new RestClientOptions("")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("http://yourapp.com/external/app/access/update-customer-shipping-address", Method.Post);
request.AddHeader("uuid", "F8A3-A88E-C6EF-B1CB");
request.AddHeader("accessToken", "11b4ec017714ef095b8e115545467fcb");
request.AddHeader("Content-Type", "application/json");
var body = @"{
" + "\n" +
@" ""firstName"": ""John"",
" + "\n" +
@" ""lastName"": ""Doe"",
" + "\n" +
@" ""status"": ""active"",
" + "\n" +
@" ""country"": 236,
" + "\n" +
@" ""city"": ""Dhaka"",
" + "\n" +
@" ""mobile"": null,
" + "\n" +
@" ""phone"": null,
" + "\n" +
@" ""addressLine1"": ""Dhaka"",
" + "\n" +
@" ""addressLine2"": ""AU"",
" + "\n" +
@" ""postCode"": null,
" + "\n" +
@" ""state"": 10,
" + "\n" +
@" ""fax"": null,
" + "\n" +
@" ""email"": ""name@gmail.com""
" + "\n" +
@"}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
Request Details
- Request URL:
http://yourapp.com/external/app/access/update-customer-shipping-address
- Request type:
POST
Request Parameter
{
"firstName": "John",
"lastName": "Doe",
"status": "active",
"country": 236,
"city": "Dhaka",
"mobile": null,
"phone": null,
"addressLine1": "Dhaka",
"addressLine2": "AU",
"postCode": null,
"state": 10,
"fax": null,
"email": "name@gmail.com"
}
Response
{
"address": {
"firstName": "John",
"lastName": "Doe",
"status": "active",
"country": 236,
"city": "Dhaka",
"mobile": null,
"phone": null,
"addressLine1": "Dhaka",
"addressLine2": "AU",
"postCode": null,
"state": 10,
"fax": null,
"email": "name@gmail.com"
}
}
Update Customer Store Credit
Responsible for updating a customer’s store credit. Here is an example:
curl --location 'http://yourapp.com/external/app/access/update-customer-store-credit' \
--header 'uuid: F8A3-A88E-C6EF-B1CB' \
--header 'accessToken: 11b4ec017714ef095b8e115545467fcb' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "name@gmail.com",
"add": "true",
"deltaAmount": 50,
"adjustNote": "50 dollar added"
}'
curl --location 'http://yourapp.com/external/app/access/update-customer-store-credit' \
--header 'uuid: F8A3-A88E-C6EF-B1CB' \
--header 'accessToken: 11b4ec017714ef095b8e115545467fcb' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "name@gmail.com",
"add": "true",
"deltaAmount": 50,
"adjustNote": "50 dollar added"
}'
import http.client
import json
conn = http.client.HTTPSConnection("yourapp.com")
payload = json.dumps({
"email": "name@gmail.com",
"add": "true",
"deltaAmount": 50,
"adjustNote": "50 dollar added"
})
headers = {
'uuid': 'F8A3-A88E-C6EF-B1CB',
'accessToken': '11b4ec017714ef095b8e115545467fcb',
'Content-Type': 'application/json'
}
conn.request("POST", "/external/app/access/update-customer-store-credit", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("http://yourapp.com/external/app/access/update-customer-store-credit")
.header("uuid", "F8A3-A88E-C6EF-B1CB")
.header("accessToken", "11b4ec017714ef095b8e115545467fcb")
.header("Content-Type", "application/json")
.body("{\r\n \"email\": \"name@gmail.com\",\r\n \"add\": \"true\",\r\n \"deltaAmount\": 50,\r\n \"adjustNote\": \"50 dollar added\"\r\n}")
.asString();
var options = new RestClientOptions("")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("http://yourapp.com/external/app/access/update-customer-store-credit", Method.Post);
request.AddHeader("uuid", "F8A3-A88E-C6EF-B1CB");
request.AddHeader("accessToken", "11b4ec017714ef095b8e115545467fcb");
request.AddHeader("Content-Type", "application/json");
var body = @"{
" + "\n" +
@" ""email"": ""name@gmail.com"",
" + "\n" +
@" ""add"": ""true"",
" + "\n" +
@" ""deltaAmount"": 50,
" + "\n" +
@" ""adjustNote"": ""50 dollar added""
" + "\n" +
@"}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
Request Details
- Request URL:
http://yourapp.com/external/app/access/update-customer-store-credit
- Request type:
POST
Request Parameter
{
"email": "name@gmail.com",
"add": "true",
"deltaAmount": 50,
"adjustNote": "50 dollar added"
}
Response
{
"status": "true",
"isMaxCreditExceed": "false",
"storeCredit": 100
}