Info
Welcome to the generated API reference. Get Postman Collection
Orders
Endpoint for creating orders
api/order/create
Requires authentication
Example request:
curl -X POST \
"http://sistrack.test/api/order/create" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-d '{"sender_id":5,"recipient_id":10,"description":"Batch of books","weight":5,"price_per_weight":1000,"declared_value":5000,"observations":"Handle with care"}'
const url = new URL(
"http://sistrack.test/api/order/create"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
let body = {
"sender_id": 5,
"recipient_id": 10,
"description": "Batch of books",
"weight": 5,
"price_per_weight": 1000,
"declared_value": 5000,
"observations": "Handle with care"
}
fetch(url, {
method: "POST",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->post(
'http://sistrack.test/api/order/create',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
'json' => [
'sender_id' => 5,
'recipient_id' => 10,
'description' => 'Batch of books',
'weight' => 5.0,
'price_per_weight' => 1000.0,
'declared_value' => 5000.0,
'observations' => 'Handle with care',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
HTTP Request
POST api/order/create
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
sender_id |
integer | required | Sender id. |
recipient_id |
integer | required | Recipient id. |
description |
string | required | The description of the shipping. |
weight |
number | required | How much the shipping weights |
price_per_weight |
number | required | How much per it cost per weight to transport. |
declared_value |
number | required | Declared value of the item. |
observations |
string | required | Additional information. |
api/order/{id}
Example request:
curl -X GET \
-G "http://sistrack.test/api/order/1" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"http://sistrack.test/api/order/1"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'http://sistrack.test/api/order/1',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"id": "62",
"order_id": "1232",
"sender": "Matias Bret",
"sender_phone": "+56 953476669",
"recipient": "Marta Bret",
"recipient_phone": "+56 953476661",
"recipient_address": "Travessera Camacho, 694, 8º A, 73389, Los Paz,85º D,del Mirador,Los Nieto Baja,Palencia",
"description": "Libros",
"weight": "10.00 kg",
"price_per_kg": "500.00",
"tax": "19",
"additional_cost": "{Estacionamiento:900,Servicio especial:800}",
"price": 7650,
"payment_status": "Paid",
"payment_type": "TDC",
"observations": "Handle with care",
"created_at": "2021-03-09T12:25:56.000000Z",
"updated_at": "2021-03-09T12:40:10.000000Z"
}
HTTP Request
GET api/order/{id}
Recipients
Endpoint for creating recipients
api/recipient/create
Requires authentication
Example request:
curl -X POST \
"http://sistrack.test/api/recipient/create" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-d '{"name":"Luis Mata","telephone":"+56954235443","email":"[email protected]","id_number":"14345432","address_line_1_order":"La capitania 10","address_line_2_order":"office 13","suburb_order":"Las Condes","city_order":"Santiago","state_order":"RM","postal_code_order":"10304","country_order":"CL"}'
const url = new URL(
"http://sistrack.test/api/recipient/create"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
let body = {
"name": "Luis Mata",
"telephone": "+56954235443",
"email": "[email protected]",
"id_number": "14345432",
"address_line_1_order": "La capitania 10",
"address_line_2_order": "office 13",
"suburb_order": "Las Condes",
"city_order": "Santiago",
"state_order": "RM",
"postal_code_order": "10304",
"country_order": "CL"
}
fetch(url, {
method: "POST",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->post(
'http://sistrack.test/api/recipient/create',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
'json' => [
'name' => 'Luis Mata',
'telephone' => '+56954235443',
'email' => '[email protected]',
'id_number' => '14345432',
'address_line_1_order' => 'La capitania 10',
'address_line_2_order' => 'office 13',
'suburb_order' => 'Las Condes',
'city_order' => 'Santiago',
'state_order' => 'RM',
'postal_code_order' => '10304',
'country_order' => 'CL',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
HTTP Request
POST api/recipient/create
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
name |
string | required | Full name of recipient. |
telephone |
string | required | Phone with international code. |
email |
required | Phone with international code. | |
id_number |
string | required | Recipient national id. |
address_line_1_order |
string | required | Main shipping address. |
address_line_2_order |
string | required | Second shipping address. |
suburb_order |
string | required | Address Suburb. |
city_order |
string | required | Address City. |
state_order |
string | required | Address State. |
postal_code_order |
string | required | Address postal code. |
country_order |
string | required | ISO 3166 Country code. |
Senders
Endpoint for creating senders
api/sender/create
Requires authentication
Example request:
curl -X POST \
"http://sistrack.test/api/sender/create" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-d '{"name":"Luis Mata","telephone":"+56954235443","email":"[email protected]","id_number":"14345432","address_line_1_order":"La capitania 10","address_line_2_order":"office 13","suburb_order":"Las Condes","city_order":"Santiago","state_order":"RM","postal_code_order":"10304","country_order":"CL"}'
const url = new URL(
"http://sistrack.test/api/sender/create"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
let body = {
"name": "Luis Mata",
"telephone": "+56954235443",
"email": "[email protected]",
"id_number": "14345432",
"address_line_1_order": "La capitania 10",
"address_line_2_order": "office 13",
"suburb_order": "Las Condes",
"city_order": "Santiago",
"state_order": "RM",
"postal_code_order": "10304",
"country_order": "CL"
}
fetch(url, {
method: "POST",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->post(
'http://sistrack.test/api/sender/create',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
'json' => [
'name' => 'Luis Mata',
'telephone' => '+56954235443',
'email' => '[email protected]',
'id_number' => '14345432',
'address_line_1_order' => 'La capitania 10',
'address_line_2_order' => 'office 13',
'suburb_order' => 'Las Condes',
'city_order' => 'Santiago',
'state_order' => 'RM',
'postal_code_order' => '10304',
'country_order' => 'CL',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
HTTP Request
POST api/sender/create
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
name |
string | required | Full name of recipient. |
telephone |
string | required | Phone with international code. |
email |
required | Phone with international code. | |
id_number |
string | required | Recipient national id. |
address_line_1_order |
string | required | Main shipping address. |
address_line_2_order |
string | required | Second shipping address. |
suburb_order |
string | required | Address Suburb. |
city_order |
string | required | Address City. |
state_order |
string | required | Address State. |
postal_code_order |
string | required | Address postal code. |
country_order |
string | required | ISO 3166 Country code. |
general
Handle the incoming request.
Example request:
curl -X GET \
-G "http://sistrack.test/api/check/sender/1" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"http://sistrack.test/api/check/sender/1"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'http://sistrack.test/api/check/sender/1',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (500):
{
"message": "Server Error"
}
HTTP Request
GET api/check/sender/{id}
Handle the incoming request.
Example request:
curl -X GET \
-G "http://sistrack.test/api/zones" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"http://sistrack.test/api/zones"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'http://sistrack.test/api/zones',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (500):
{
"message": "Server Error"
}
HTTP Request
GET api/zones
Handle the incoming request.
Example request:
curl -X GET \
-G "http://sistrack.test/api/zones-available" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"http://sistrack.test/api/zones-available"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'http://sistrack.test/api/zones-available',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (500):
{
"message": "Server Error"
}
HTTP Request
GET api/zones-available