Create API Token
curl --request POST \
--url https://api.wizcommerce.com/auth/token \
--header 'Content-Type: application/json' \
--data '
{
"email": "user@example.com",
"password": "password123"
}
'import requests
url = "https://api.wizcommerce.com/auth/token"
payload = {
"email": "user@example.com",
"password": "password123"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({email: 'user@example.com', password: 'password123'})
};
fetch('https://api.wizcommerce.com/auth/token', 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://api.wizcommerce.com/auth/token",
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([
'email' => 'user@example.com',
'password' => 'password123'
]),
CURLOPT_HTTPHEADER => [
"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.wizcommerce.com/auth/token"
payload := strings.NewReader("{\n \"email\": \"user@example.com\",\n \"password\": \"password123\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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))
}HttpResponse<String> response = Unirest.post("https://api.wizcommerce.com/auth/token")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"user@example.com\",\n \"password\": \"password123\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wizcommerce.com/auth/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"user@example.com\",\n \"password\": \"password123\"\n}"
response = http.request(request)
puts response.read_body{
"access_token": "api_prod_abc123...",
"token_id": "token_123",
"token_type": "Bearer",
"expires_at": "2026-01-01T00:00:00Z",
"user": {
"id": "user_123",
"email": "user@example.com",
"first_name": "John",
"last_name": "Doe",
"tenant_id": "tenant_456"
}
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}Auth
Create API Token
Create a new API token for the authenticated user
POST
/
auth
/
token
Create API Token
curl --request POST \
--url https://api.wizcommerce.com/auth/token \
--header 'Content-Type: application/json' \
--data '
{
"email": "user@example.com",
"password": "password123"
}
'import requests
url = "https://api.wizcommerce.com/auth/token"
payload = {
"email": "user@example.com",
"password": "password123"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({email: 'user@example.com', password: 'password123'})
};
fetch('https://api.wizcommerce.com/auth/token', 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://api.wizcommerce.com/auth/token",
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([
'email' => 'user@example.com',
'password' => 'password123'
]),
CURLOPT_HTTPHEADER => [
"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.wizcommerce.com/auth/token"
payload := strings.NewReader("{\n \"email\": \"user@example.com\",\n \"password\": \"password123\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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))
}HttpResponse<String> response = Unirest.post("https://api.wizcommerce.com/auth/token")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"user@example.com\",\n \"password\": \"password123\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wizcommerce.com/auth/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"user@example.com\",\n \"password\": \"password123\"\n}"
response = http.request(request)
puts response.read_body{
"access_token": "api_prod_abc123...",
"token_id": "token_123",
"token_type": "Bearer",
"expires_at": "2026-01-01T00:00:00Z",
"user": {
"id": "user_123",
"email": "user@example.com",
"first_name": "John",
"last_name": "Doe",
"tenant_id": "tenant_456"
}
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}Please note that generated tokens will be expired after 1 year automatically. Once it is expired, please generate new token.
π Security Notice
Important: Keep your API token secure and never share it publicly.- β
Store securely: Save the
access_tokenin a secure location - β
Use in headers: Include as
X-API-Keyheader in all API requests - β Donβt commit: Never commit tokens to version control
- β Rotate regularly: Generate new tokens periodically for security
π Example Usage
curl -X GET https://api.wizcommerce.com/v1/products \
-H "X-API-Key: YOUR_ACCESS_TOKEN_HERE"
β οΈ Token Security
- Never expose your token in client-side code
- Use environment variables to store tokens
- Regenerate if you suspect itβs been compromised
Body
application/json
Login credentials
Was this page helpful?
βI
