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

Comin Test environment

Indice

1. Auth

1. Auth

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

Auth code cURL

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

Auth code PHP

<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://comin.co/system/api/auth/login',
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 => 'email=test_api%40comin.co&password=12345678q',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/x-www-form-urlencoded'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

Auth code NodeJS

var request = require('request');
var options = {
'method': 'POST',
'url': 'https://comin.co/system/api/auth/login',
'headers': {
'Content-Type': 'application/x-www-form-urlencoded'
},
form: {
'email': '[email protected]',
'password': '12345678q'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});

2. Create Order

Endpoint:
Method: POST
Type: URLENCODED
URL: https://comin.co/system/api/order/create
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

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

Create order PHP

<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://comin.co/system/api/order/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 => 'affiliateCode=realAffiliateCode&id=4&origin=https%3A%2F%2Fcomin.co%2Fsystem%2Fpopup%3Fproductid%3DP1817090U73V2&quantity=1&comment=1321312&status=1',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTQwMSwidG9rZW4iOiJnNE81RzQyMjZnQ0pjUHJQIiwicm9sZSI6IjMiLCJzdGF0dXMiOiIxIiwiaWF0IjoxNjExMDA2MzAyLCJleHAiOjE2MTEwMDk5MDJ9.ZQdRIykqMj2epSiDfFuZdF81Tc454TAW6WS7QMWJ6GQ',
'Content-Type: application/x-www-form-urlencoded'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

Create order NodeJS

var request = require('request');
var options = {
'method': 'POST',
'url': 'https://comin.co/system/api/order/create',
'headers': {
'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTQwMSwidG9rZW4iOiJnNE81RzQyMjZnQ0pjUHJQIiwicm9sZSI6IjMiLCJzdGF0dXMiOiIxIiwiaWF0IjoxNjExMDA2MzAyLCJleHAiOjE2MTEwMDk5MDJ9.ZQdRIykqMj2epSiDfFuZdF81Tc454TAW6WS7QMWJ6GQ',
'Content-Type': 'application/x-www-form-urlencoded'
},
form: {
'affiliateCode': 'realAffiliateCode',
'id': '4',
'origin': 'https://comin.co/system/popup?productid=P1817090U73V2',
'quantity': '1',
'comment': '1321312',
'status': '1'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});

3. Get All Orders

Endpoint:
Method: POST
Type: URLENCODED
URL: https://comin.co/order/getOrders
post
https://comin.co/order/getOrders
GetOrders

getOrders code cURL

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

getOrders code PHP

<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '{{host}}/system/api/order/getOrders',
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_HTTPHEADER => array(
'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTQwMSwidG9rZW4iOiJnNE81RzQyMjZnQ0pjUHJQIiwicm9sZSI6IjMiLCJzdGF0dXMiOiIxIiwiaWF0IjoxNjExMDA3NDk4LCJleHAiOjE2MTEwMTEwOTh9.6TtT8wdZKtP1vxFqkDt4MyF-hlyj55cjq9TxNl7gEmA'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

getOrders code NodeJS

var request = require('request');
var options = {
'method': 'POST',
'url': 'https://comin.co/system/api/order/getOrders',
'headers': {
'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTQwMSwidG9rZW4iOiJnNE81RzQyMjZnQ0pjUHJQIiwicm9sZSI6IjMiLCJzdGF0dXMiOiIxIiwiaWF0IjoxNjExMDA3NDk4LCJleHAiOjE2MTEwMTEwOTh9.6TtT8wdZKtP1vxFqkDt4MyF-hlyj55cjq9TxNl7gEmA'
},
form: {
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});

4. Get Order Status

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

Order status code cURL

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

Order status code PHP

<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://comin.co/system/api/order/status',
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 => 'id=2435',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTQwMSwidG9rZW4iOiJnNE81RzQyMjZnQ0pjUHJQIiwicm9sZSI6IjMiLCJzdGF0dXMiOiIxIiwiaWF0IjoxNjExMDA4NDU1LCJleHAiOjE2MTEwMTIwNTV9.q_2QuPQVTb-yOtD5k-6y_s4KBopyBL6X1P5NPNIzafY',
'Content-Type: application/x-www-form-urlencoded'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

Order status code NodeJS

var request = require('request');
var options = {
'method': 'POST',
'url': 'https://comin.co/system/api/order/status',
'headers': {
'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTQwMSwidG9rZW4iOiJnNE81RzQyMjZnQ0pjUHJQIiwicm9sZSI6IjMiLCJzdGF0dXMiOiIxIiwiaWF0IjoxNjExMDA4NDU1LCJleHAiOjE2MTEwMTIwNTV9.q_2QuPQVTb-yOtD5k-6y_s4KBopyBL6X1P5NPNIzafY',
'Content-Type': 'application/x-www-form-urlencoded'
},
form: {
'id': '2435'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});

5. Refresh Token

Endpoint:
Method: POST
Type:
URL: https://comin.co/auth/refreshToken
post
https://comin.co/system/api/auth/refreshToken
refreshToken

refreshToken code cURL

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

refreshToken code PHP

<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://comin.co/system/api/auth/refreshToken',
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_HTTPHEADER => array(
'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTQwMSwidG9rZW4iOiJnNE81RzQyMjZnQ0pjUHJQIiwicm9sZSI6IjMiLCJzdGF0dXMiOiIxIiwiaWF0IjoxNjExMDA4OTk2LCJleHAiOjE2MTEwMTI1OTZ9.Q599VtALakGUf_uPFlm4V_eUjOr7jY-GwjnXWbm_O7c'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

refreshToken NodeJS

var request = require('request');
var options = {
'method': 'POST',
'url': 'https://comin.co/system/api/auth/refreshToken',
'headers': {
'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTQwMSwidG9rZW4iOiJnNE81RzQyMjZnQ0pjUHJQIiwicm9sZSI6IjMiLCJzdGF0dXMiOiIxIiwiaWF0IjoxNjExMDA4OTk2LCJleHAiOjE2MTEwMTI1OTZ9.Q599VtALakGUf_uPFlm4V_eUjOr7jY-GwjnXWbm_O7c'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
Last modified 1yr ago
Copy link
On this page
Comin Test environment
Indice
1. Auth
post
Auth
Auth code cURL
Auth code PHP
Auth code NodeJS
2. Create Order
post
Create Order
Create order cURL
Create order PHP
Create order NodeJS
3. Get All Orders
post
GetOrders
getOrders code cURL
getOrders code PHP
getOrders code NodeJS
4. Get Order Status
post
Order Status
Order status code cURL
Order status code PHP
Order status code NodeJS
5. Refresh Token
post
refreshToken
refreshToken code cURL
refreshToken code PHP
refreshToken NodeJS