Comin API documentation
An example of using Comin API for authorization and order creation

Comin Test environment

Indice

1. Auth

1. Auth

Endpoint:
1
Method: POST
2
Type: URLENCODED
3
URL: https://comin.co/system/api/auth/login
Copied!
Body:
Key
Value
Description
password
12345678q
post
URL: https://comin.co/system/api/auth/login
Auth

Auth code cURL

1
curl --request POST 'https://comin.co/system/api/auth/login' \
2
--header 'Content-Type: application/x-www-form-urlencoded' \
3
--data-urlencode '[email protected]' \
4
--data-urlencode 'password=12345678q'
Copied!

Auth code PHP

1
<?php
2
3
$curl = curl_init();
4
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => 'https://comin.co/system/api/auth/login',
7
CURLOPT_RETURNTRANSFER => true,
8
CURLOPT_ENCODING => '',
9
CURLOPT_MAXREDIRS => 10,
10
CURLOPT_TIMEOUT => 0,
11
CURLOPT_FOLLOWLOCATION => true,
12
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13
CURLOPT_CUSTOMREQUEST => 'POST',
14
CURLOPT_POSTFIELDS => 'email=test_api%40comin.co&password=12345678q',
15
CURLOPT_HTTPHEADER => array(
16
'Content-Type: application/x-www-form-urlencoded'
17
),
18
));
19
20
$response = curl_exec($curl);
21
22
curl_close($curl);
23
echo $response;
24
Copied!

Auth code NodeJS

1
var request = require('request');
2
var options = {
3
'method': 'POST',
4
'url': 'https://comin.co/system/api/auth/login',
5
'headers': {
6
'Content-Type': 'application/x-www-form-urlencoded'
7
},
8
form: {
9
'email': '[email protected]',
10
'password': '12345678q'
11
}
12
};
13
request(options, function (error, response) {
14
if (error) throw new Error(error);
15
console.log(response.body);
16
});
17
Copied!

2. Create Order

Endpoint:
1
Method: POST
2
Type: URLENCODED
3
URL: https://comin.co/system/api/order/create
Copied!
Body:
Key
Value
Description
affiliateCode
realAffiliateCode
!Important
id
1817090
Product Id in Comin System !required
origin
https://comin.cosystem/popup?productid=P1817090U73V2
quantity
1
comment
1321312
Your comment
status
1
{ PENDING: '0', SHIPPED: '1', CANCELLED: '2', OVERDUE: '3' }
post
https://comin.co/system/api/order/create
Create Order

Create order cURL

1
curl --location --request POST 'https://comin.co/system/api/order/create' \
2
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTQwMSwidG9rZW4iOiJnNE81RzQyMjZnQ0pjUHJQIiwicm9sZSI6IjMiLCJzdGF0dXMiOiIxIiwiaWF0IjoxNjExMDA2MzAyLCJleHAiOjE2MTEwMDk5MDJ9.ZQdRIykqMj2epSiDfFuZdF81Tc454TAW6WS7QMWJ6GQ' \
3
--header 'Content-Type: application/x-www-form-urlencoded' \
4
--data-urlencode 'affiliateCode=realAffiliateCode' \
5
--data-urlencode 'id=4' \
6
--data-urlencode 'origin=https://comin.co/system/popup?productid=P1817090U73V2' \
7
--data-urlencode 'quantity=1' \
8
--data-urlencode 'comment=1321312' \
9
--data-urlencode 'status=1'
Copied!

Create order PHP

1
<?php
2
3
$curl = curl_init();
4
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => 'https://comin.co/system/api/order/create',
7
CURLOPT_RETURNTRANSFER => true,
8
CURLOPT_ENCODING => '',
9
CURLOPT_MAXREDIRS => 10,
10
CURLOPT_TIMEOUT => 0,
11
CURLOPT_FOLLOWLOCATION => true,
12
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13
CURLOPT_CUSTOMREQUEST => 'POST',
14
CURLOPT_POSTFIELDS => 'affiliateCode=realAffiliateCode&id=4&origin=https%3A%2F%2Fcomin.co%2Fsystem%2Fpopup%3Fproductid%3DP1817090U73V2&quantity=1&comment=1321312&status=1',
15
CURLOPT_HTTPHEADER => array(
16
'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTQwMSwidG9rZW4iOiJnNE81RzQyMjZnQ0pjUHJQIiwicm9sZSI6IjMiLCJzdGF0dXMiOiIxIiwiaWF0IjoxNjExMDA2MzAyLCJleHAiOjE2MTEwMDk5MDJ9.ZQdRIykqMj2epSiDfFuZdF81Tc454TAW6WS7QMWJ6GQ',
17
'Content-Type: application/x-www-form-urlencoded'
18
),
19
));
20
21
$response = curl_exec($curl);
22
23
curl_close($curl);
24
echo $response;
Copied!

Create order NodeJS

1
var request = require('request');
2
var options = {
3
'method': 'POST',
4
'url': 'https://comin.co/system/api/order/create',
5
'headers': {
6
'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTQwMSwidG9rZW4iOiJnNE81RzQyMjZnQ0pjUHJQIiwicm9sZSI6IjMiLCJzdGF0dXMiOiIxIiwiaWF0IjoxNjExMDA2MzAyLCJleHAiOjE2MTEwMDk5MDJ9.ZQdRIykqMj2epSiDfFuZdF81Tc454TAW6WS7QMWJ6GQ',
7
'Content-Type': 'application/x-www-form-urlencoded'
8
},
9
form: {
10
'affiliateCode': 'realAffiliateCode',
11
'id': '4',
12
'origin': 'https://comin.co/system/popup?productid=P1817090U73V2',
13
'quantity': '1',
14
'comment': '1321312',
15
'status': '1'
16
}
17
};
18
request(options, function (error, response) {
19
if (error) throw new Error(error);
20
console.log(response.body);
21
});
22
Copied!

3. Get All Orders

Endpoint:
1
Method: POST
2
Type: URLENCODED
3
URL: https://comin.co/order/getOrders
Copied!
post
https://comin.co/order/getOrders
GetOrders

getOrders code cURL

1
curl --location --request POST '{{host}}/system/api/order/getOrders' \
2
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTQwMSwidG9rZW4iOiJnNE81RzQyMjZnQ0pjUHJQIiwicm9sZSI6IjMiLCJzdGF0dXMiOiIxIiwiaWF0IjoxNjExMDA3NDk4LCJleHAiOjE2MTEwMTEwOTh9.6TtT8wdZKtP1vxFqkDt4MyF-hlyj55cjq9TxNl7gEmA'
Copied!

getOrders code PHP

1
<?php
2
3
$curl = curl_init();
4
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => '{{host}}/system/api/order/getOrders',
7
CURLOPT_RETURNTRANSFER => true,
8
CURLOPT_ENCODING => '',
9
CURLOPT_MAXREDIRS => 10,
10
CURLOPT_TIMEOUT => 0,
11
CURLOPT_FOLLOWLOCATION => true,
12
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13
CURLOPT_CUSTOMREQUEST => 'POST',
14
CURLOPT_HTTPHEADER => array(
15
'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTQwMSwidG9rZW4iOiJnNE81RzQyMjZnQ0pjUHJQIiwicm9sZSI6IjMiLCJzdGF0dXMiOiIxIiwiaWF0IjoxNjExMDA3NDk4LCJleHAiOjE2MTEwMTEwOTh9.6TtT8wdZKtP1vxFqkDt4MyF-hlyj55cjq9TxNl7gEmA'
16
),
17
));
18
19
$response = curl_exec($curl);
20
21
curl_close($curl);
22
echo $response;
23
Copied!

getOrders code NodeJS

1
var request = require('request');
2
var options = {
3
'method': 'POST',
4
'url': 'https://comin.co/system/api/order/getOrders',
5
'headers': {
6
'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTQwMSwidG9rZW4iOiJnNE81RzQyMjZnQ0pjUHJQIiwicm9sZSI6IjMiLCJzdGF0dXMiOiIxIiwiaWF0IjoxNjExMDA3NDk4LCJleHAiOjE2MTEwMTEwOTh9.6TtT8wdZKtP1vxFqkDt4MyF-hlyj55cjq9TxNl7gEmA'
7
},
8
form: {
9
10
}
11
};
12
request(options, function (error, response) {
13
if (error) throw new Error(error);
14
console.log(response.body);
15
});
16
Copied!

4. Get Order Status

Endpoint:
1
Method: POST
2
Type: URLENCODED
3
URL: https://comin.co/order/status
Copied!
Body:
Key
Value
Description
id
2435
post
https://comin.co/order/status
Order Status

Order status code cURL

1
curl --location --request POST 'https://comin.co/system/api/order/status' \
2
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTQwMSwidG9rZW4iOiJnNE81RzQyMjZnQ0pjUHJQIiwicm9sZSI6IjMiLCJzdGF0dXMiOiIxIiwiaWF0IjoxNjExMDA4NDU1LCJleHAiOjE2MTEwMTIwNTV9.q_2QuPQVTb-yOtD5k-6y_s4KBopyBL6X1P5NPNIzafY' \
3
--header 'Content-Type: application/x-www-form-urlencoded' \
4
--header 'Cookie: rt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTQwMSwidG9rZW4iOiJnNE81RzQyMjZnQ0pjUHJQIiwicm9sZSI6IjMiLCJzdGF0dXMiOiIxIiwiR2VuZW91c19SZWZyZXNoX1Rva2VuIjp0cnVlLCJpYXQiOjE2MTEwMDg0NTUsImV4cCI6MTYxOTY0ODQ1NX0.px5SxmGHt4cR-V8ii_xq2sYJhv5IOeH1AtjCEpZpJQY' \
5
--data-urlencode 'id=2435'
Copied!

Order status code PHP

1
<?php
2
3
$curl = curl_init();
4
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => 'https://comin.co/system/api/order/status',
7
CURLOPT_RETURNTRANSFER => true,
8
CURLOPT_ENCODING => '',
9
CURLOPT_MAXREDIRS => 10,
10
CURLOPT_TIMEOUT => 0,
11
CURLOPT_FOLLOWLOCATION => true,
12
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13
CURLOPT_CUSTOMREQUEST => 'POST',
14
CURLOPT_POSTFIELDS => 'id=2435',
15
CURLOPT_HTTPHEADER => array(
16
'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTQwMSwidG9rZW4iOiJnNE81RzQyMjZnQ0pjUHJQIiwicm9sZSI6IjMiLCJzdGF0dXMiOiIxIiwiaWF0IjoxNjExMDA4NDU1LCJleHAiOjE2MTEwMTIwNTV9.q_2QuPQVTb-yOtD5k-6y_s4KBopyBL6X1P5NPNIzafY',
17
'Content-Type: application/x-www-form-urlencoded'
18
),
19
));
20
21
$response = curl_exec($curl);
22
23
curl_close($curl);
24
echo $response;
25
Copied!

Order status code NodeJS

1
var request = require('request');
2
var options = {
3
'method': 'POST',
4
'url': 'https://comin.co/system/api/order/status',
5
'headers': {
6
'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTQwMSwidG9rZW4iOiJnNE81RzQyMjZnQ0pjUHJQIiwicm9sZSI6IjMiLCJzdGF0dXMiOiIxIiwiaWF0IjoxNjExMDA4NDU1LCJleHAiOjE2MTEwMTIwNTV9.q_2QuPQVTb-yOtD5k-6y_s4KBopyBL6X1P5NPNIzafY',
7
'Content-Type': 'application/x-www-form-urlencoded'
8
},
9
form: {
10
'id': '2435'
11
}
12
};
13
request(options, function (error, response) {
14
if (error) throw new Error(error);
15
console.log(response.body);
16
});
17
Copied!

5. Refresh Token

Endpoint:
1
Method: POST
2
Type:
3
URL: https://comin.co/auth/refreshToken
Copied!
post
https://comin.co/system/api/auth/refreshToken
refreshToken

refreshToken code cURL

1
curl --location --request POST 'https://comin.co/system/api/auth/refreshToken' \
2
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTQwMSwidG9rZW4iOiJnNE81RzQyMjZnQ0pjUHJQIiwicm9sZSI6IjMiLCJzdGF0dXMiOiIxIiwiaWF0IjoxNjExMDA4OTk2LCJleHAiOjE2MTEwMTI1OTZ9.Q599VtALakGUf_uPFlm4V_eUjOr7jY-GwjnXWbm_O7c'
Copied!

refreshToken code PHP

1
<?php
2
3
$curl = curl_init();
4
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => 'https://comin.co/system/api/auth/refreshToken',
7
CURLOPT_RETURNTRANSFER => true,
8
CURLOPT_ENCODING => '',
9
CURLOPT_MAXREDIRS => 10,
10
CURLOPT_TIMEOUT => 0,
11
CURLOPT_FOLLOWLOCATION => true,
12
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13
CURLOPT_CUSTOMREQUEST => 'POST',
14
CURLOPT_HTTPHEADER => array(
15
'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTQwMSwidG9rZW4iOiJnNE81RzQyMjZnQ0pjUHJQIiwicm9sZSI6IjMiLCJzdGF0dXMiOiIxIiwiaWF0IjoxNjExMDA4OTk2LCJleHAiOjE2MTEwMTI1OTZ9.Q599VtALakGUf_uPFlm4V_eUjOr7jY-GwjnXWbm_O7c'
16
),
17
));
18
19
$response = curl_exec($curl);
20
21
curl_close($curl);
22
echo $response;
23
Copied!

refreshToken NodeJS

1
var request = require('request');
2
var options = {
3
'method': 'POST',
4
'url': 'https://comin.co/system/api/auth/refreshToken',
5
'headers': {
6
'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTQwMSwidG9rZW4iOiJnNE81RzQyMjZnQ0pjUHJQIiwicm9sZSI6IjMiLCJzdGF0dXMiOiIxIiwiaWF0IjoxNjExMDA4OTk2LCJleHAiOjE2MTEwMTI1OTZ9.Q599VtALakGUf_uPFlm4V_eUjOr7jY-GwjnXWbm_O7c'
7
}
8
};
9
request(options, function (error, response) {
10
if (error) throw new Error(error);
11
console.log(response.body);
12
});
13
14
Copied!
Last modified 2mo ago