Belirtilen mağazaya ait siparişlerin yönetimi için kullanılır.
Sipariş süreci şeması:
Sipariş Durum Kodları
allesgo.com genel sipariş kodlarını elde etmek 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/order/status-codes?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/order/status-codes?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. Bu örnekte Python'un requests kütüphanesi kullanılır ama http.client gibi kütüphane kullanılabilir
import requests
url = "https://api.allesgo.com/v1.0/order/status-codes"
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/order/status-codes',
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. Bu örnekte XHR kullanılır ama jquery veya axios gibi kütüphane kullanılabilir
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/order/status-codes?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/order/status-codes?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/order/status-codes?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/order/status-codes?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("Accept-Encoding", "gzip, deflate")
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": [
{
"code": "Number",
"description": "String"
}
]
}
Sipariş Bilgilerinin Alınması
Belirtilen mağazaya ait, belli bir zaman aralığındaki tüm siparişleri listelemek 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/order/store/{STORE_ID}?days={DAYS}&status={STATUS}&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/order/store/{STORE_ID}?days={DAYS}&status={STATUS}&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. Bu örnekte Python'un requests kütüphanesi kullanılır ama http.client gibi kütüphane kullanılabilir
import requests
url = "https://api.allesgo.com/v1.0/order/store/{{STORE_ID}}"
querystring = {"access_token":"{{ACCESS_TOKEN}}", "days":"{{DAYS}}", "status":"{{STATUS}}"}
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/order/store/{STORE_ID}',
qs: { access_token: '{ACCESS_TOKEN}', days: '{DAYS}', status: '{DAYS}' },
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/order/store/{STORE_ID}?days={DAYS}&status={STATUS}&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/order/store/{STORE_ID}?days={DAYS}&status={STATUS}&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/order/store/{STORE_ID}?days={DAYS}&status={STATUS}&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/category/order/store/{STORE_ID}?days={DAYS}&status={STATUS}&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ı
Request query strings
| Parametre | Türkçe | Tür | Zorunlu | Geçerli Değerler | Varsayılan | Açıklama |
|---|---|---|---|---|---|---|
| start_date | Başlangıç Tarihi | Integer | true | Belirlenen tarihten sonraki siparişler listelenir.Format: UnixTimeStamp . | ||
| end_date | Bitiş Tarihi | Integer | true | Belirlenen tarihten önceki siparişler listelenir. start_date ile birlikte kullanılmalıdır. Format: UnixTimeStamp . | ||
| days | Günler | Integer | true | Tarih aralığına göre sipariş listelemek yerine gün sayısına göre listelemek için kullanılır. | ||
| status | Durum | Integer | true | 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 | Durumlarına göre siparişleri listelemek için kullanılır. Daha detaylı bilgi için referans sayfamızdan faydalanabilirsiniz. | |
| updates_only | Yalnızca Güncellenenler | Integer | false | 0, 1 | 0 | Şu anki tarihten, belirtilen gün önceye kadar durum değişikliği yapılmış tüm siparişleri listelemek için kullanılır. 0 => false 1 => true |
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": {
"code": "String",
"packages": [
{
"shipping": {
"shipping_discount_code": "String",
"shipping_company": "String",
"total_shipping_price": "Number",
"shipping_address": "Number"
},
"status": "Integer",
"status_explained": "String",
"items": [
{
"product_name": "String",
"product_code": "String",
"product_uid": "String",
"product_id": "String",
"count": "Integer",
"order_number": "String",
"product_price": "Number",
"paid_amount": "Number",
"store_payout_amount": "Number",
"ipsizcambaz_commission_amount": "Number",
"payment_id": "Number",
"shipping_amount": "Number",
"shipping_time_exceeded": "Boolean",
"installment_count": "Number",
"installment_commission": "Number",
"currency": "String",
"currency_rate": "Number",
"order_platform": "String",
"status": "Number",
"status_explained": "String",
"discount_amount": "Number",
"product_url": "String",
"product_images": "Array",
"variant": "Variant|null"
}
],
"package_id": "String",
"total_price": "Number",
"invoice_draft": "String"
}
],
"total_price": "Number",
"total_shipping_price": "Number",
"order_date": "String",
"payment_type": "String",
"payment_type_explained": "String",
"email": "String",
"shipping_address": "String"
}
}
Sipariş Bekletme
Mağazaya ait belirtilen siparişi bekletmek için kullanılır.
Örnekler
Curl ile istek atmak için bu örnek kullanılabilir.
curl -X POST \
https://api.allesgo.com/v1.0/order/postpone/store/{STORE_ID} \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-d '{"package_id": "{PACKAGE_ID}","reason": "{REASON}"}'
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/order/postpone/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}",
"reason" => "{REASON}",
),
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. Bu örnekte Python'un requests kütüphanesi kullanılır ama http.client gibi kütüphane kullanılabilir
import requests
url = "https://api.allesgo.com/v1.0/order/postpone/store/{{STORE_ID}}"
payload = {
'package_id': '{{PACKAGE_ID}}',
'reason': '{{REASON}}',
}
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/order/postpone/store/{STORE_ID}',
headers: {
'cache-control': 'no-cache',
'Content-Type': 'application/json',
},
body: { package_id: '{PACKAGE_ID}', reason: '{REASON}' },
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. Ö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 = JSON.stringify({
package_id: '{PACKAGE_ID}',
reason: '{REASON}',
});
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/order/postpone/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/order/postpone/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}",
reason = "{REASON}"
};
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}\",\"reason\": \"{REASON}\"}");
Request request = new Request.Builder()
.url("https://api.allesgo.com/v1.0/order/postpone/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/order/postpone/store/{STORE_ID}"
payload := strings.NewReader("{\"package_id\": \"{PACKAGE_ID}\", \"reason\": \"{REASON}\"}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
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ı
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 | ||
| reason | Sebep | String | true | Sipariş Bekletme sebebi |
Sunucudan dönecek cevabın örneği.
{
"data": {
"status": "String",
"order_discount_code": "String|undefined"
}
}
Sipariş Onaylama
Mağazaya ait belirtilen siparişi onaylamak için kullanılır.
Örnekler
Curl ile istek atmak için bu örnek kullanılabilir.
curl -X POST \
https://api.allesgo.com/v1.0/order/accept/store/{STORE_ID} \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-d '{"package_id": "{PACKAGE_ID}","reason": "{REASON}"}'
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/order/accept/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}"
),
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. Bu örnekte Python'un requests kütüphanesi kullanılır ama http.client gibi kütüphane kullanılabilir
import requests
url = "https://api.allesgo.com/v1.0/order/accept/store/{{STORE_ID}}"
payload = {
'package_id': '{{PACKAGE_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/order/accept/store/{STORE_ID}',
headers: {
'cache-control': 'no-cache',
'Content-Type': 'application/json',
},
body: { package_id: '{PACKAGE_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. Ö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 = JSON.stringify({
package_id: '{PACKAGE_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/order/accept/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/order/accept/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}"
};
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}\"}");
Request request = new Request.Builder()
.url("https://api.allesgo.com/v1.0/order/accept/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/order/accept/store/{STORE_ID}"
payload := strings.NewReader("{\"package_id\": \"{PACKAGE_ID}\"")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
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ı
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 |
Sunucudan dönecek cevabın örneği.
{
"data": {
"status": "String",
"order_discount_code": "String|undefined"
}
}
Sipariş İade Kabul
Mağazaya ait belirtilen sipariş için oluşturulmuş iade talebinin onaylanması için kullanılır.
Örnekler
Curl ile istek atmak için bu örnek kullanılabilir.
curl -X POST \
https://api.allesgo.com/v1.0/order/accept-return/store/{STORE_ID} \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-d '{"package_id": "{PACKAGE_ID}","message": "{MESSAGE}"}'
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/order/accept-return/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}",
"message" => "{MESSAGE}",
),
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. Bu örnekte Python'un requests kütüphanesi kullanılır ama http.client gibi kütüphane kullanılabilir
import requests
url = "https://api.allesgo.com/v1.0/order/accept-return/store/{{STORE_ID}}"
payload = {
'package_id': '{{PACKAGE_ID}}',
'message': '{{MESSAGE}}',
}
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/order/accept-return/store/{STORE_ID}',
headers: {
'cache-control': 'no-cache',
'Content-Type': 'application/json',
},
body: { package_id: '{PACKAGE_ID}', message: '{MESSAGE}' },
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. Ö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 = JSON.stringify({
package_id: '{PACKAGE_ID}',
message: '{MESSAGE}',
});
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/order/accept-return/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/order/accept-return/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}",
message = "{MESSAGE}"
};
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}\",\"message\": \"{MESSAGE}\"}");
Request request = new Request.Builder()
.url("https://api.allesgo.com/v1.0/order/accept-return/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/order/accept-return/store/{STORE_ID}"
payload := strings.NewReader("{\"package_id\": \"{PACKAGE_ID}\", \"message\": \"{Message}\"}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
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ı
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 | ||
| message | Mesaj | String | true | İletmek istenen mesaj |
Sunucudan dönecek cevabın örneği.
{
"data": {
"status": "String"
}
}
Sipariş İade Reddetme
Mağazaya ait belirtilen sipariş için oluşturulmuş iade talebinin reddedilmesi için kullanılır.
Örnekler
Curl ile istek atmak için bu örnek kullanılabilir.
curl -X POST \
https://api.allesgo.com/v1.0/order/reject-return/store/{STORE_ID} \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-d '{"package_id": "{PACKAGE_ID}","reason": "{REASON}"}'
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/order/reject-return/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}",
"reason" => "{REASON}"
),
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. Bu örnekte Python'un requests kütüphanesi kullanılır ama http.client gibi kütüphane kullanılabilir
import requests
url = "https://api.allesgo.com/v1.0/order/reject-return/store/{{STORE_ID}}"
payload = {
'package_id': '{{PACKAGE_ID}}',
'reason': '{{REASON}}',
}
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/order/reject-return/store/{STORE_ID}',
headers: {
'cache-control': 'no-cache',
'Content-Type': 'application/json',
},
body: { package_id: '{PACKAGE_ID}', reason: '{REASON}' },
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. Ö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 = JSON.stringify({
package_id: '{PACKAGE_ID}',
reason: '{REASON}',
});
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/order/reject-return/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/order/reject-return/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}",
reason = "{REASON}"
};
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}\",\"reason\": \"{REASON}\"}");
Request request = new Request.Builder()
.url("https://api.allesgo.com/v1.0/order/reject-return/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/order/reject-return/store/"
payload := strings.NewReader("{\"package_id\": \"{PACKAGE_ID}\",\"REASON\": \"{REASON}\"}")
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 | ||
| reason | Sebep | String | true | Red Sebebi |
Sunucudan dönecek cevabın örneği.
{
"data": {
"status": "String",
"order_discount_code": "String|undefined"
}
}
Sipariş Kargolama
Mağazaya ait belirtilen sipariş paketinin kargolaması için kullanır.
Örnekler
Curl ile istek atmak için bu örnek kullanılabilir.
curl -X POST \
https://api.allesgo.com/v1.0/order/ship/store/{STORE_ID} \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-d '{"package_id": "{PACKAGE_ID}","company_id": "{COMPANY_ID}", "shipping_code": "{SHIPPING_CODE}"}'
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/order/ship/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}",
"shipping_code" => "{SHIPPING_CODE}"
),
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. Bu örnekte Python'un requests kütüphanesi kullanılır ama http.client gibi kütüphane kullanılabilir
import requests
url = "https://api.allesgo.com/v1.0/order/ship/store/{{STORE_ID}}"
payload = {
'package_id': '{{PACKAGE_ID}}',
'company_id': '{{COMPANY_ID}}',
'shipping_code': '{{SHIPPING_CODE}}',
}
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/order/ship/store/{STORE_ID}',
headers: {
'cache-control': 'no-cache',
'Content-Type': 'application/json',
},
body: { package_id: '{PACKAGE_ID}', company_id: '{COMPANY_ID}', shipping_code: '{SHIPPING_CODE}' },
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. Ö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 = JSON.stringify({
package_id: '{PACKAGE_ID}',
company_id: '{COMPANY_ID}',
shipping_code: '{SHIPPING_CODE}',
});
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/order/ship/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/order/ship/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}",
shipping_code = "{SHIPPING_CODE}"
};
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}\", \"shipping_code\": \"{SHIPPING_CODE}\"}");
Request request = new Request.Builder()
.url("https://api.allesgo.com/v1.0/order/ship/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/order/ship/store/{STORE_ID}"
payload := strings.NewReader("{\"package_id\": \"{PACKAGE_ID}\",\"company_id\": \"{COMPANY_ID}\", \"shipping_code\": \"{SHIPPING_CODE}\"}")
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 | ||
| shipping_code | Kargo Kodu | String | true | Kargo Kodu |
Sunucudan dönecek cevabın örneği.
{
"data": {
"shipping_company": "String",
"shippingCode": "String"
}
}
Sipariş Reddetme
Mağazaya ait belirtilen siparişi reddetmek için kullanılır.
Örnekler
Curl ile istek atmak için bu örnek kullanılabilir.
curl -X POST \
https://api.allesgo.com/v1.0/order/cancel/store/{STORE_ID} \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-d '{"order_numbers": "{ORDER_NUMBERS}","reason": "{REASON}"}'
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/order/cancel/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(
"order_numbers" => "{ORDER_NUMBERS}",
"reason" => "{REASON}"
),
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. Bu örnekte Python'un requests kütüphanesi kullanılır ama http.client gibi kütüphane kullanılabilir
import requests
url = "https://api.allesgo.com/v1.0/order/cancel/store/{{STORE_ID}}"
payload = {
'order_numbers': '{{ORDER_NUMBERS}}',
'reason': '{{REASON}}',
}
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/order/cancel/store/{STORE_ID}',
headers: {
'cache-control': 'no-cache',
'Content-Type': 'application/json',
},
body: { order_numbers: '{ORDER_NUMBERS}', reason: '{REASON}' },
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. Ö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 = JSON.stringify({
order_numbers: '{ORDER_NUMBERS}',
reason: '{REASON}',
});
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/order/cancel/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/order/cancel/store/{STORE_ID}");
var request = new RestRequest(Method.POST);
request.AddHeader("cache-control", "no-cache");
request.AddHeader("Content-Type", "application/json");
var body = new
{
order_numbers = "{ORDER_NUMBERS}",
reason = "{REASON}"
};
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, "{\"order_numbers\": \"{ORDER_NUMBERS}\",\"reason\": \"{REASON}\"}");
Request request = new Request.Builder()
.url("https://api.allesgo.com/v1.0/order/cancel/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/order/cancel/store/{STORE_ID}"
payload := strings.NewReader("{\"order_numbers\": \"{ORDER_NUMBERS}\",\"reason\": \"{REASON}\"}")
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 |
|---|---|---|---|---|---|---|
| order_numbers | Siparış ID'leri | Array |
true | Sipariş ID'lere göre belirlersiniz. | ||
| reason | Sebep | String | true | Kabul Sebep |
Sunucudan dönecek cevabın örneği.
{
"data": {
"success": "Boolean",
"notice": "String|undefined",
"message": "String|undefined"
}
}
Sipariş İptal Kabul
Mağazaya ait belirtilen siparişin iptal talebini kabul etmek için kullanılır.
Örnekler
Curl ile istek atmak için bu örnek kullanılabilir.
curl -X POST \
https://api.allesgo.com/v1.0/order/accept-cancel/store/{STORE_ID} \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-d '{"order_numbers": "{ORDER_NUMBERS}","reason": "{REASON}"}'
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/order/accept-cancel/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(
"order_numbers" => "{ORDER_NUMBERS}",
"reason" => "{REASON}"
),
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. Bu örnekte Python'un requests kütüphanesi kullanılır ama http.client gibi kütüphane kullanılabilir
import requests
url = "https://api.allesgo.com/v1.0/order/accept-cancel/store/{{STORE_ID}}"
payload = {
'order_numbers': '{{ORDER_NUMBERS}}',
'reason': '{{REASON}}',
}
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/order/accept-cancel/store/{STORE_ID}',
headers: {
'cache-control': 'no-cache',
'Content-Type': 'application/json',
},
body: { order_numbers: '{ORDER_NUMBERS}', reason: '{REASON}' },
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. Ö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 = JSON.stringify({
order_numbers: '{ORDER_NUMBERS}',
reason: '{REASON}',
});
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/order/accept-cancel/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/order/accept-cancel/store/{STORE_ID}");
var request = new RestRequest(Method.POST);
request.AddHeader("cache-control", "no-cache");
request.AddHeader("Content-Type", "application/json");
var body = new
{
order_numbers = "{ORDER_NUMBERS}",
reason = "{REASON}"
};
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, "{\"order_numbers\": \"{ORDER_NUMBERS}\",\"reason\": \"{REASON}\"}");
Request request = new Request.Builder()
.url("https://api.allesgo.com/v1.0/order/accept-cancel/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/order/accept-cancel/store/{STORE_ID}"
payload := strings.NewReader("{\"order_numbers\": \"{ORDER_NUMBERS}\",\"reason\": \"{REASON}\"}")
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 |
|---|---|---|---|---|---|---|
| order_numbers | Siparış ID'leri | Array |
true | Sipariş ID'lere göre belirlersiniz. | ||
| reason | Sebep | String | true | Kabul Sebep |
Sunucudan dönecek cevabın örneği.
{
"data": {
"success": "Boolean",
"notice": "String|undefined",
"message": "String|undefined"
}
}
Sipariş İptal Reddetme
Mağazaya ait belirtilen sipariş için oluşturulmuş iptal talebinin reddedilmesi için kullanılır.
Örnekler
Curl ile istek atmak için bu örnek kullanılabilir.
curl -X POST \
https://api.allesgo.com/v1.0/order/reject-cancel/store/{STORE_ID} \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-d '{"package_id": "{PACKAGE_ID}","reason": "{REASON}"}'
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/order/reject-cancel/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}",
"reason" => "{REASON}"
),
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. Bu örnekte Python'un requests kütüphanesi kullanılır ama http.client gibi kütüphane kullanılabilir
import requests
url = "https://api.allesgo.com/v1.0/order/reject-cancel/store/{{STORE_ID}}"
payload = {
'package_id': '{{PACKAGE_ID}}',
'reason': '{{REASON}}',
}
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/order/reject-cancel/store/{STORE_ID}',
headers: {
'cache-control': 'no-cache',
'Content-Type': 'application/json',
},
body: { package_id: '{PACKAGE_ID}', reason: '{REASON}' },
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. Ö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 = JSON.stringify({
package_id: '{PACKAGE_ID}',
reason: '{REASON}',
});
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/order/reject-cancel/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/order/reject-cancel/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}",
reason = "{REASON}"
};
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}\",\"reason\": \"{REASON}\"}");
Request request = new Request.Builder()
.url("https://api.allesgo.com/v1.0/order/reject-cancel/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/order/reject-cancel/store/"
payload := strings.NewReader("{\"package_id\": \"{PACKAGE_ID}\",\"REASON\": \"{REASON}\"}")
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 | ||
| reason | Sebep | String | true | Sipariş İptal Reddetme Sebep |
Sunucudan dönecek cevabın örneği.
{
"data": {
"status": "String",
"order_discount_code": "String|undefined"
}
}