Account & Auth
Confirm OAuth app authorization
Developer API operation for POST /dev/v1/oauth/authorize.
POST
/
dev
/
v1
/
oauth
/
authorize
Confirm OAuth app authorization
curl --request POST \
--url https://api.shoppex.io/dev/v1/oauth/authorize \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"response_type": "code",
"client_id": "shoc_demo",
"redirect_uri": "https://erp.example.com/callback",
"scope": "orders.read",
"state": "state_1"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
response_type: 'code',
client_id: 'shoc_demo',
redirect_uri: 'https://erp.example.com/callback',
scope: 'orders.read',
state: 'state_1'
})
};
fetch('https://api.shoppex.io/dev/v1/oauth/authorize', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.shoppex.io/dev/v1/oauth/authorize"
payload = {
"response_type": "code",
"client_id": "shoc_demo",
"redirect_uri": "https://erp.example.com/callback",
"scope": "orders.read",
"state": "state_1"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.shoppex.io/dev/v1/oauth/authorize",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'response_type' => 'code',
'client_id' => 'shoc_demo',
'redirect_uri' => 'https://erp.example.com/callback',
'scope' => 'orders.read',
'state' => 'state_1'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.shoppex.io/dev/v1/oauth/authorize"
payload := strings.NewReader("{\n \"response_type\": \"code\",\n \"client_id\": \"shoc_demo\",\n \"redirect_uri\": \"https://erp.example.com/callback\",\n \"scope\": \"orders.read\",\n \"state\": \"state_1\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"redirect_url": "https://erp.example.com/callback?code=shoa_code_1&state=state_1"
}Authorizations
Use your Shoppex API key in the Authorization header.
Body
application/jsonmultipart/form-datatext/plain
Response
200 - application/json
Successful response
Previous
Exchange an OAuth code or refresh tokenDeveloper API operation for POST /dev/v1/oauth/token.
Next
⌘I
Confirm OAuth app authorization
curl --request POST \
--url https://api.shoppex.io/dev/v1/oauth/authorize \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"response_type": "code",
"client_id": "shoc_demo",
"redirect_uri": "https://erp.example.com/callback",
"scope": "orders.read",
"state": "state_1"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
response_type: 'code',
client_id: 'shoc_demo',
redirect_uri: 'https://erp.example.com/callback',
scope: 'orders.read',
state: 'state_1'
})
};
fetch('https://api.shoppex.io/dev/v1/oauth/authorize', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.shoppex.io/dev/v1/oauth/authorize"
payload = {
"response_type": "code",
"client_id": "shoc_demo",
"redirect_uri": "https://erp.example.com/callback",
"scope": "orders.read",
"state": "state_1"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.shoppex.io/dev/v1/oauth/authorize",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'response_type' => 'code',
'client_id' => 'shoc_demo',
'redirect_uri' => 'https://erp.example.com/callback',
'scope' => 'orders.read',
'state' => 'state_1'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.shoppex.io/dev/v1/oauth/authorize"
payload := strings.NewReader("{\n \"response_type\": \"code\",\n \"client_id\": \"shoc_demo\",\n \"redirect_uri\": \"https://erp.example.com/callback\",\n \"scope\": \"orders.read\",\n \"state\": \"state_1\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"redirect_url": "https://erp.example.com/callback?code=shoa_code_1&state=state_1"
}