Retrieve global state
curl --request GET \
--url https://staging.api.commercengine.io/api/v1/{store_id}/admin/store/sse/global-state \
--header 'Authorization: Bearer <token>'import requests
url = "https://staging.api.commercengine.io/api/v1/{store_id}/admin/store/sse/global-state"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://staging.api.commercengine.io/api/v1/{store_id}/admin/store/sse/global-state', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging.api.commercengine.io/api/v1/{store_id}/admin/store/sse/global-state",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://staging.api.commercengine.io/api/v1/{store_id}/admin/store/sse/global-state"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://staging.api.commercengine.io/api/v1/{store_id}/admin/store/sse/global-state")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.api.commercengine.io/api/v1/{store_id}/admin/store/sse/global-state")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"event_name": "<string>",
"data": {
"is_kyc_enabled": false,
"is_customer_group_enabled": false,
"is_loyalty_program_enabled": false,
"tax": {
"tax_type": "GST",
"taxable_location": "shipping-address",
"is_product_price_include_tax": true,
"is_shipping_price_include_tax": true,
"is_tax_apply_after_discount": true,
"is_discount_apply_after_tax": true,
"shipping_tax_rate": 123,
"handling_charge_tax_rate": 123
},
"shipping": {
"packaging_optimisation_logic": "cost",
"location_priority": "manual",
"warehouse_id": [
"<string>"
],
"approval_option": "auto",
"shipping_option": "auto",
"default_weight": 123
},
"customer_groups": [
{
"name": "<string>",
"id": "<string>",
"slug": "<string>",
"description": "<string>",
"is_default": true,
"active": true
}
],
"kyc_documents": [
{
"document_type": "gst",
"title": "<string>",
"is_mandatory": true,
"is_attachment_required": true,
"verification_type": "auto",
"id": "<string>",
"description": "<string>",
"active": true
}
],
"brand": {
"name": "<string>",
"logo_url": "<string>",
"social_media_links": {}
},
"subscription": {
"charge_automatically": true,
"retry_and_dunning": true,
"pause_during_trial": true,
"pause_when_past_due": true,
"pause_indefinitely": true,
"skip_next_interval": true,
"retry_and_dunning_rules": [
{
"days": 123,
"retry_payment": true,
"send_notification": true
}
],
"retry_final_step_action": "mark-as-unpaid",
"skip_next_interval_threshold": 0
},
"general": {
"order_number_prefix": "<string>",
"currency_code": "<string>"
},
"currency": {
"name": "<string>",
"code": "<string>",
"symbol": "<string>"
},
"credit_line": {
"is_enabled": false,
"customer_eligibility": "specific",
"total_credit_limit": 123,
"mandate_per_order_limit": 123,
"credit_period": 21,
"payment_methods": [
{
"name": "<string>",
"description": "<string>",
"payment_instructions": "<string>",
"id": "<string>",
"slug": "<string>",
"used_in_credit_line": true,
"is_connected": true,
"status": "active",
"created_at": "<string>",
"modified_at": "<string>"
}
]
},
"payout": {
"payment_option": "auto",
"payment_methods": [
{
"slug": "<string>",
"id": "<string>",
"name": "<string>",
"description": "<string>",
"status": "active",
"type": "auto",
"used_in_payout": true,
"is_default": false,
"logo_dark": "<string>",
"logo_light": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z"
}
]
}
}
}SSE
Retrieve global state
Retrieve server sent events for global state
GET
/
store
/
sse
/
global-state
Retrieve global state
curl --request GET \
--url https://staging.api.commercengine.io/api/v1/{store_id}/admin/store/sse/global-state \
--header 'Authorization: Bearer <token>'import requests
url = "https://staging.api.commercengine.io/api/v1/{store_id}/admin/store/sse/global-state"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://staging.api.commercengine.io/api/v1/{store_id}/admin/store/sse/global-state', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging.api.commercengine.io/api/v1/{store_id}/admin/store/sse/global-state",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://staging.api.commercengine.io/api/v1/{store_id}/admin/store/sse/global-state"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://staging.api.commercengine.io/api/v1/{store_id}/admin/store/sse/global-state")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.api.commercengine.io/api/v1/{store_id}/admin/store/sse/global-state")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"event_name": "<string>",
"data": {
"is_kyc_enabled": false,
"is_customer_group_enabled": false,
"is_loyalty_program_enabled": false,
"tax": {
"tax_type": "GST",
"taxable_location": "shipping-address",
"is_product_price_include_tax": true,
"is_shipping_price_include_tax": true,
"is_tax_apply_after_discount": true,
"is_discount_apply_after_tax": true,
"shipping_tax_rate": 123,
"handling_charge_tax_rate": 123
},
"shipping": {
"packaging_optimisation_logic": "cost",
"location_priority": "manual",
"warehouse_id": [
"<string>"
],
"approval_option": "auto",
"shipping_option": "auto",
"default_weight": 123
},
"customer_groups": [
{
"name": "<string>",
"id": "<string>",
"slug": "<string>",
"description": "<string>",
"is_default": true,
"active": true
}
],
"kyc_documents": [
{
"document_type": "gst",
"title": "<string>",
"is_mandatory": true,
"is_attachment_required": true,
"verification_type": "auto",
"id": "<string>",
"description": "<string>",
"active": true
}
],
"brand": {
"name": "<string>",
"logo_url": "<string>",
"social_media_links": {}
},
"subscription": {
"charge_automatically": true,
"retry_and_dunning": true,
"pause_during_trial": true,
"pause_when_past_due": true,
"pause_indefinitely": true,
"skip_next_interval": true,
"retry_and_dunning_rules": [
{
"days": 123,
"retry_payment": true,
"send_notification": true
}
],
"retry_final_step_action": "mark-as-unpaid",
"skip_next_interval_threshold": 0
},
"general": {
"order_number_prefix": "<string>",
"currency_code": "<string>"
},
"currency": {
"name": "<string>",
"code": "<string>",
"symbol": "<string>"
},
"credit_line": {
"is_enabled": false,
"customer_eligibility": "specific",
"total_credit_limit": 123,
"mandate_per_order_limit": 123,
"credit_period": 21,
"payment_methods": [
{
"name": "<string>",
"description": "<string>",
"payment_instructions": "<string>",
"id": "<string>",
"slug": "<string>",
"used_in_credit_line": true,
"is_connected": true,
"status": "active",
"created_at": "<string>",
"modified_at": "<string>"
}
]
},
"payout": {
"payment_option": "auto",
"payment_methods": [
{
"slug": "<string>",
"id": "<string>",
"name": "<string>",
"description": "<string>",
"status": "active",
"type": "auto",
"used_in_payout": true,
"is_default": false,
"logo_dark": "<string>",
"logo_light": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z"
}
]
}
}
}Was this page helpful?
⌘I