Sipariş kargolama yönetimi için kullanılır.
Kargo Firmaları Listesi
Kayıtlı tüm kargo şirketlerinin listesini getirmek için kullanılır.
Örnekler
Curl ile istek atmak için bu örnek kullanılabilir.
curl -X GET \ 'https://api.allesgo.com/v1.0/shipping/companies/all?access_token={ACCESS_TOKEN}' \ -H 'Accept: application/json' \ -H 'Cache-Control: no-cache' \ -H 'Connection: keep-alive' \ -H 'Host: api.allesgo.com' \ -H 'cache-control: no-cache'
PHP ile istek atmak için bu örnek kullanılabilir. Örnekte Curl kullanılmaktadır.
<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://api.allesgo.com/v1.0/shipping/companies/all/?access_token={ACCESS_TOKEN}", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "Accept: application/json", "Cache-Control: no-cache", "Connection: keep-alive", "Host: api.allesgo.com", "cache-control: no-cache", ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
Python ile istek atmak için bu örnek kullanılabilir. Örnekte requests kullanılmaktadır.
import requests url = "https://api.allesgo.com/v1.0/shipping/companies/all" querystring = {"access_token":"{{ACCESS_TOKEN}}"} headers = { 'Accept': "application/json", 'Cache-Control': "no-cache", 'Host': "api.allesgo.com", 'Connection': "keep-alive", 'cache-control': "no-cache" } response = requests.request("GET", url, headers=headers, params=querystring) print(response.text)
Node.js ile istek atmak için bu örnek kullanılabilir. Örnekte request kullanılmaktadır.
var request = require('request'); var options = { method: 'GET', url: 'https://api.allesgo.com/v1.0/shipping/companies/all', qs: { access_token: '{ACCESS_TOKEN}' }, headers: { 'cache-control': 'no-cache', Connection: 'keep-alive', Host: 'api.allesgo.com', Accept: 'application/json', }, }; request(options, (error, response, body) => { if (error) throw new Error(error); console.log(body); });
Javascipt ile istek atmak için bu örnek kullanılabilir. Örnekte xhr kullanılmakdır. Not: Bilgi amaçlıdır. Javascipt ile yazılan bu kod'ta Kullanıcı access token'a erişebildiğinden, kullanmanızı önermiyoruz.
var data = null; var xhr = new XMLHttpRequest(); xhr.withCredentials = true; xhr.addEventListener('readystatechange', function () { if (this.readyState === 4) { console.log(this.responseText); } }); xhr.open('GET', 'https://api.allesgo.com/v1.0/shipping/companies/all?access_token={ACCESS_TOKEN}'); xhr.setRequestHeader('Accept', 'application/json'); xhr.setRequestHeader('Cache-Control', 'no-cache'); xhr.setRequestHeader('Host', 'api.allesgo.com'); xhr.setRequestHeader('Connection', 'keep-alive'); xhr.setRequestHeader('cache-control', 'no-cache'); xhr.send(data);
C Sharp ile istek atmak için bu örnek kullanılabilir. Bu örnekte RestSharp kullanılmaktadır.
var client = new RestClient("https://api.allesgo.com/v1.0/shipping/companies/all?access_token={ACCESS_TOKEN}"); var request = new RestRequest(Method.GET); request.AddHeader("cache-control", "no-cache"); request.AddHeader("Connection", "keep-alive"); request.AddHeader("Host", "api.allesgo.com"); request.AddHeader("Cache-Control", "no-cache"); request.AddHeader("Accept", "application/json"); IRestResponse response = client.Execute(request);
Java ile istek atmak için bu örnek kullanılabilir. Örnekte Ok Http kullanılmaktadır.
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://api.allesgo.com/v1.0/shipping/companies/all?access_token={ACCESS_TOKEN}") .get() .addHeader("Accept", "application/json") .addHeader("Cache-Control", "no-cache") .addHeader("Host", "api.allesgo.com") .addHeader("Connection", "keep-alive") .addHeader("cache-control", "no-cache") .build(); Response response = client.newCall(request).execute();
Go ile istek atmak için bu örnek kullanılabilir. Örnekte net/http kullanılmaktadır.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://api.allesgo.com/v1.0/shipping/companies/all?access_token={ACCESS_TOKEN}" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Accept", "*/*") req.Header.Add("Cache-Control", "no-cache") req.Header.Add("Host", "api.allesgo.com") req.Header.Add("Connection", "keep-alive") req.Header.Add("cache-control", "no-cache") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
API Referansı
Sunucudan dönecek cevabın örneği.
{
"data": [
{
"id": "ObjectId",
"name": "String",
"has_contract_with_ipsizcambaz": "Boolean"
}
]
}
Anlaşmalı Kargo Firmaları
allesgo.com ile anlaşmalı kargo firmalarının listesini getirmek için kullanılır.
Örnekler
Curl ile istek atmak için bu örnek kullanılabilir.
curl -X GET \ 'https://api.allesgo.com/v1.0/shipping/companies/contracted?access_token={ACCESS_TOKEN}' \ -H 'Accept: application/json' \ -H 'Cache-Control: no-cache' \ -H 'Connection: keep-alive' \ -H 'Host: api.allesgo.com' \ -H 'cache-control: no-cache'
PHP ile istek atmak için bu örnek kullanılabilir. Örnekte Curl kullanılmaktadır.
<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://api.allesgo.com/v1.0/shipping/companies/contracted/?access_token={ACCESS_TOKEN}", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "Accept: application/json", "Cache-Control: no-cache", "Connection: keep-alive", "Host: api.allesgo.com", "cache-control: no-cache", ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
Python ile istek atmak için bu örnek kullanılabilir. Örnekte requests kullanılmaktadır.
import requests url = "https://api.allesgo.com/v1.0/shipping/companies/contracted" querystring = {"access_token":"{{ACCESS_TOKEN}}"} headers = { 'Accept': "application/json", 'Cache-Control': "no-cache", 'Host': "api.allesgo.com", 'Connection': "keep-alive", 'cache-control': "no-cache" } response = requests.request("GET", url, headers=headers, params=querystring) print(response.text)
Node.js ile istek atmak için bu örnek kullanılabilir. Örnekte request kullanılmaktadır.
var request = require('request'); var options = { method: 'GET', url: 'https://api.allesgo.com/v1.0/shipping/companies/contracted', qs: { access_token: '{ACCESS_TOKEN}' }, headers: { 'cache-control': 'no-cache', Connection: 'keep-alive', Host: 'api.allesgo.com', Accept: 'application/json', }, }; request(options, (error, response, body) => { if (error) throw new Error(error); console.log(body); });
Javascipt ile istek atmak için bu örnek kullanılabilir. Örnekte xhr kullanılmakdır. Not: Bilgi amaçlıdır. Javascipt ile yazılan bu kod'ta Kullanıcı access token'a erişebildiğinden, kullanmanızı önermiyoruz.
var data = null; var xhr = new XMLHttpRequest(); xhr.withCredentials = true; xhr.addEventListener('readystatechange', function () { if (this.readyState === 4) { console.log(this.responseText); } }); xhr.open('GET', 'https://api.allesgo.com/v1.0/shipping/companies/contracted?access_token={ACCESS_TOKEN}'); xhr.setRequestHeader('Accept', 'application/json'); xhr.setRequestHeader('Cache-Control', 'no-cache'); xhr.setRequestHeader('Host', 'api.allesgo.com'); xhr.setRequestHeader('Connection', 'keep-alive'); xhr.setRequestHeader('cache-control', 'no-cache'); xhr.send(data);
C Sharp ile istek atmak için bu örnek kullanılabilir. Bu örnekte RestSharp kullanılmaktadır.
var client = new RestClient("https://api.allesgo.com/v1.0/shipping/companies/contracted?access_token={ACCESS_TOKEN}"); var request = new RestRequest(Method.GET); request.AddHeader("cache-control", "no-cache"); request.AddHeader("Connection", "keep-alive"); request.AddHeader("Host", "api.allesgo.com"); request.AddHeader("Cache-Control", "no-cache"); request.AddHeader("Accept", "application/json"); IRestResponse response = client.Execute(request);
Java ile istek atmak için bu örnek kullanılabilir. Örnekte Ok Http kullanılmaktadır.
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://api.allesgo.com/v1.0/shipping/companies/contracted?access_token={ACCESS_TOKEN}") .get() .addHeader("Accept", "application/json") .addHeader("Cache-Control", "no-cache") .addHeader("Host", "api.allesgo.com") .addHeader("Connection", "keep-alive") .addHeader("cache-control", "no-cache") .build(); Response response = client.newCall(request).execute();
Go ile istek atmak için bu örnek kullanılabilir. Örnekte net/http kullanılmaktadır.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://api.allesgo.com/v1.0/shipping/companies/contracted?access_token={ACCESS_TOKEN}" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Accept", "*/*") req.Header.Add("Cache-Control", "no-cache") req.Header.Add("Host", "api.allesgo.com") req.Header.Add("Connection", "keep-alive") req.Header.Add("cache-control", "no-cache") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
API Referansı
Sunucudan dönecek cevabın örneği.
{
"data": [
{
"id": "ObjectId",
"name": "String",
"has_contract_with_ipsizcambaz": "Boolean"
}
]
}
Kargo Ücreti Sorgulama
Belirtilen bir sipariş paketi için anlaşmalı kargo firmalarından kargo ücret bilgilerini getirir.
Örnekler
Curl ile istek atmak için bu örnek kullanılabilir.
curl -X GET \ 'https://api.allesgo.com/v1.0/shipping/get-prices/store/{STORE_ID}?access_token={ACCESS_TOKEN}&package_id={PACKAGE_ID}' \ -H 'Accept: application/json' \ -H 'Cache-Control: no-cache' \ -H 'Connection: keep-alive' \ -H 'Host: api.allesgo.com'
PHP ile istek atmak için bu örnek kullanılabilir. Örnekte Curl kullanılmaktadır.
<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://api.allesgo.com/v1.0/shipping/get-prices/store/{STORE_ID}?access_token={ACCESS_TOKEN}&package_id={PACKAGE_ID}", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "Accept: application/json", "Cache-Control: no-cache", "Host: api.allesgo.com" ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
Python ile istek atmak için bu örnek kullanılabilir. Örnekte requests kullanılmaktadır.
import requests url = "https://api.allesgo.com/v1.0/shipping/get-prices/store/{{STORE_ID}}" querystring = {"access_token":"{{ACCESS_TOKEN}}", "package_id": "{{PACKAGE_ID}}"} headers = { 'Accept': "application/json", 'Cache-Control': "no-cache", 'Host': "api.allesgo.com" } response = requests.request("GET", url, headers=headers, params=querystring) print(response.text)
Node.js ile istek atmak için bu örnek kullanılabilir. Örnekte request kullanılmaktadır.
var request = require('request'); var options = { method: 'GET', url: 'https://api.allesgo.com/v1.0/shipping/get-prices/store/{STORE_ID}', qs: { access_token: '{ACCESS_TOKEN}', package_id: '{PACKAGE_ID}' }, headers: { 'cache-control': 'no-cache', Connection: 'keep-alive', Host: 'api.allesgo.com', Accept: 'application/json', }, }; request(options, (error, response, body) => { if (error) throw new Error(error); console.log(body); });
Javascipt ile istek atmak için bu örnek kullanılabilir. Örnekte xhr kullanılmakdır. Not: Bilgi amaçlıdır. Javascipt ile yazılan bu kod'ta Kullanıcı access token'a erişebildiğinden, kullanmanızı önermiyoruz.
var data = null; var xhr = new XMLHttpRequest(); xhr.withCredentials = true; xhr.addEventListener('readystatechange', function () { if (this.readyState === 4) { console.log(this.responseText); } }); xhr.open('GET', 'https://api.allesgo.com/v1.0/shipping/get-prices/store/{STORE_ID}?access_token={ACCESS_TOKEN}&package_id={PACKAGE_ID}'); xhr.setRequestHeader('Accept', 'application/json'); xhr.setRequestHeader('Cache-Control', 'no-cache'); xhr.setRequestHeader('Host', 'api.allesgo.com'); xhr.setRequestHeader('cache-control', 'no-cache'); xhr.send(data);
C Sharp ile istek atmak için bu örnek kullanılabilir. Bu örnekte RestSharp kullanılmaktadır.
var client = new RestClient("https://api.allesgo.com/v1.0/shipping/get-prices/store/{STORE_ID}?access_token={ACCESS_TOKEN}&package_id={PACKAGE_ID}"); var request = new RestRequest(Method.GET); request.AddHeader("cache-control", "no-cache"); request.AddHeader("Host", "api.allesgo.com"); request.AddHeader("Cache-Control", "no-cache"); request.AddHeader("Accept", "application/json"); IRestResponse response = client.Execute(request);
Java ile istek atmak için bu örnek kullanılabilir. Örnekte Ok Http kullanılmaktadır.
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://api.allesgo.com/v1.0/shipping/get-prices/store/{STORE_ID}?access_token={ACCESS_TOKEN}&package_id={PACKAGE_ID}") .get() .addHeader("Accept", "application/json") .addHeader("Cache-Control", "no-cache") .addHeader("Host", "api.allesgo.com") .addHeader("cache-control", "no-cache") .build(); Response response = client.newCall(request).execute();
Go ile istek atmak için bu örnek kullanılabilir. Örnekte net/http kullanılmaktadır.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://api.allesgo.com/v1.0/shipping/get-prices/store/{STORE_ID}?access_token={ACCESS_TOKEN}&package_id={PACKAGE_ID}" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Accept", "*/*") req.Header.Add("Cache-Control", "no-cache") req.Header.Add("Host", "api.allesgo.com") req.Header.Add("cache-control", "no-cache") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
API Referansı
Request query strings
Parametre | Türkçe | Tür | Zorunlu | Geçerli Değerler | Varsayılan | Açıklama |
---|---|---|---|---|---|---|
package_id | Package ID'si | String | true | Package ID'si |
Request URL parameters
Parametre | Türkçe | Tür | Zorunlu | Geçerli Değerler | Varsayılan | Açıklama |
---|---|---|---|---|---|---|
storeId | Mağaza ID'si | ObjectId | true | Mağaza ID'si |
Sunucudan dönecek cevabın örneği.
{
"data": [
{
"id": "ObjectId",
"name": "String",
"price": "Number"
}
]
}
Kargo Kodu Üretme
Belirtilen sipariş paketi için kargo kodunu üretir.
Örnekler
Curl ile istek atmak için bu örnek kullanılabilir.
curl -X POST \ https://api.allesgo.com/v1.0/shipping/generate-shipping-code/store/{STORE_ID} \ -H 'Content-Type: application/json' \ -H 'cache-control: no-cache' \ -d '{"package_id": "{PACKAGE_ID}","company_id": "{COMPANY_ID}"}'
PHP ile istek atmak için bu örnek kullanılabilir. Örnekte Curl kullanılmaktadır.
<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://api.allesgo.com/v1.0/shipping/generate-shipping-code/store/{STORE_ID}", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => array( "package_id" => "{PACKAGE_ID}", "company_id" => "{COMPANY_ID}" ), CURLOPT_HTTPHEADER => array( "Content-Type: application/json", "cache-control: no-cache" ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
Python ile istek atmak için bu örnek kullanılabilir. Örnekte requests kullanılmaktadır.
import requests url = "https://api.allesgo.com/v1.0/order/ship/store/{{STORE_ID}}" payload = { 'package_id': '{{PACKAGE_ID}}', 'company_id': '{{COMPANY_ID}}', } headers = { 'Content-Type': "application/json", 'cache-control': "no-cache" } response = requests.request("POST", url, data=payload, headers=headers) print(response.text)
Node.js ile istek atmak için bu örnek kullanılabilir. Örnekte request kullanılmaktadır.
var request = require('request'); var options = { method: 'POST', url: 'https://api.allesgo.com/v1.0/shipping/generate-shipping-code/store/{STORE_ID}', headers: { 'cache-control': 'no-cache', 'Content-Type': 'application/json', }, body: { package_id: '{PACKAGE_ID}', company_id: '{COMPANY_ID}' }, json: true, }; request(options, (error, response, body) => { if (error) throw new Error(error); console.log(body); });
Javascipt ile istek atmak için bu örnek kullanılabilir. Not: Bilgi amaçlıdır. Javascipt ile yazılan bu kodta Kullanıcı access token'a erişebildiğinden, kullanmanızı önermiyoruz.
var data = JSON.stringify({ package_id: '{PACKAGE_ID}', company_id: '{COMPANY_ID}', }); var xhr = new XMLHttpRequest(); xhr.withCredentials = true; xhr.addEventListener('readystatechange', function () { if (this.readyState === 4) { console.log(this.responseText); } }); xhr.open('POST', 'https://api.allesgo.com/v1.0/shipping/generate-shipping-code/store/{STORE_ID}'); xhr.setRequestHeader('Content-Type', 'application/json'); xhr.setRequestHeader('cache-control', 'no-cache'); xhr.send(data);
C Sharp ile istek atmak için bu örnek kullanılabilir. Bu örnekte RestSharp kullanılmaktadır.
var client = new RestClient("https://api.allesgo.com/v1.0/shipping/generate-shipping-code/store/{STORE_ID}"); var request = new RestRequest(Method.POST); request.AddHeader("cache-control", "no-cache"); request.AddHeader("Content-Type", "application/json"); var body = new { package_id = "{PACKAGE_ID}", company_id = "{COMPANY_ID}" }; request.AddJsonBody(body); IRestResponse response = client.Execute(request);
Java ile istek atmak için bu örnek kullanılabilir. Örnekte Ok Http kullanılmaktadır.
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"package_id\": \"{PACKAGE_ID}\",\"company_id\": \"{COMPANY_ID}\"}"); Request request = new Request.Builder() .url("https://api.allesgo.com/v1.0/shipping/generate-shipping-code/store/{STORE_ID}") .post(body) .addHeader("Content-Type", "application/json") .addHeader("cache-control", "no-cache") .build(); Response response = client.newCall(request).execute();
Go ile istek atmak için bu örnek kullanılabilir. Örnekte net/http kullanılmaktadır.
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://api.allesgo.com/v1.0/shipping/generate-shipping-code/store/{STORE_ID}" payload := strings.NewReader("{\"package_id\": \"{PACKAGE_ID}\",\"company_id\": \"{COMPANY_ID}\"}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Content-Type", "application/json") req.Header.Add("cache-control", "no-cache") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
API Referansı
Request URL parameters
Parametre | Türkçe | Tür | Zorunlu | Geçerli Değerler | Varsayılan | Açıklama |
---|---|---|---|---|---|---|
storeId | Mağaza ID'si | ObjectId | true | Mağaza ID'si |
POST Request Payload
Parametre | Türkçe | Tür | Zorunlu | Geçerli Değerler | Varsayılan | Açıklama |
---|---|---|---|---|---|---|
package_id | Paket ID'si | String | true | Paket ID'si | ||
company_id | Şirket ID'si | String | true | Şirket ID'si |
Sunucudan dönecek cevabın örneği.
{
"data": {
"shipping_company": "String",
"shippingCode": "String"
}
}