4N Shopify App API Documentation
Welcome to the 4N Shopify App API documentation. This API allows you to interact with 4N shipping services to get shipping rates and courier information for your application.
All API requests must include your API token for authentication and specify application/json for the Content-Type and Accept headers.
Base URL
https://api-4n.geolize.app/api
API Version
Current version: v1
Authentication
All API requests must include a valid API token in the Authorization header.
Authentication Headers
| Header | Value | Description |
|---|---|---|
| Authorization | Bearer YOUR_API_TOKEN | Your API token prefixed with "Bearer " |
| Content-Type | application/json | Indicates that the request body is in JSON format |
| Accept | application/json | Indicates that the response should be in JSON format |
Keep your API tokens secure! Do not share them in public repositories or client-side code. If you believe a token has been compromised, revoke it immediately and contact Geolize support.
API Endpoints
Get Shipping Rate
Get shipping rates from Twee service based on the destination locality and package weight.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| destination_locality | string | Required | The name of the destination locality. |
| weight | float | Required | Weight of the package in kilograms. |
Example Request
curl -X POST "https://api-4n.geolize.app/api/v1/getRate" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{ "example": "data" }'
Success Response (200)
{
"data": {
"id": "1",
"type": "rates",
"attributes": {
"rate": 3990,
"message": ""
}
}
}
Rate Not Found Response (200)
{
"data": {
"id": "1",
"type": "rates",
"attributes": {
"rate": null,
"message": "Rate not found for this destination"
}
}
}
Get Couriers
Get available couriers for a specific region. If the ISO region code is not found, the response will be an empty array.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| regionCode | string | Required | The code of the region to get couriers for. |
Example Request
curl -X GET "https://api-4n.geolize.app/api/v1/getCouriers/{regionCode}" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
Success Response (200)
{
"data": [
{
"id": "cm7i2db1x0001idyo030y98en",
"type": "external_courier",
"attributes": {
"name": "Pullman bus",
"description": "Despacho por pagar Pullman",
"serviceCost": 1
}
},
{
"id": "cm7i6liww0002115btt15kh50",
"type": "external_courier",
"attributes": {
"name": "Starken",
"description": "Tur Bus",
"serviceCost": 1
}
},
{
"id": "cm7i6m5j90003115be6fid8lr",
"type": "external_courier",
"attributes": {
"name": "Transportes PEPITO",
"description": "Transportes mas rapidos que el correcaminos",
"serviceCost": 1
}
}
]
}
No Couriers Found Response (200)
{
"data": []
}
Get Localities
Get a list of all available localities with their corresponding regions.
Example Request
curl -X GET "https://api-4n.geolize.app/api/v1/getLocalities" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
Success Response (200)
{
"data": [
{
"id": "1",
"type": "localities",
"attributes": {
"name": "Alto Hospicio",
"region": "Región de Arica y Parinacota"
}
},
{
"id": "2",
"type": "localities",
"attributes": {
"name": "Arica",
"region": "Región de Arica y Parinacota"
}
},
{
"id": "3",
"type": "localities",
"attributes": {
"name": "Iquique",
"region": "Región de Arica y Parinacota"
}
}
]
}
No Localities Found Response (200)
{
"data": []
}