curl --request POST \
--url https://qwoty.app/api/tokens \
--header 'Content-Type: application/json' \
--data '{
"name": "Production API Token",
"expires_at": "2025-12-31T23:59:59Z"
}'
const response = await fetch('https://qwoty.app/api/tokens', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Production API Token',
expires_at: '2025-12-31T23:59:59Z',
}),
})
const data = await response.json()
import requests
response = requests.post(
'https://qwoty.app/api/tokens',
json={
'name': 'Production API Token',
'expires_at': '2025-12-31T23:59:59Z'
}
)
data = response.json()
{
"success": true,
"data": {
"id": "tok_123abc",
"name": "Production API Token",
"token": "qwoty_live_abc123def456...",
"expires_at": "2025-12-31T23:59:59Z",
"created_at": "2024-01-15T10:30:00Z"
}
}
{
"error": "Invalid request data",
"details": {
"name": ["Required field"]
}
}
Jetons
Créer un token API
Créer un nouveau token API pour l’authentification
POST
/
api
/
tokens
curl --request POST \
--url https://qwoty.app/api/tokens \
--header 'Content-Type: application/json' \
--data '{
"name": "Production API Token",
"expires_at": "2025-12-31T23:59:59Z"
}'
const response = await fetch('https://qwoty.app/api/tokens', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Production API Token',
expires_at: '2025-12-31T23:59:59Z',
}),
})
const data = await response.json()
import requests
response = requests.post(
'https://qwoty.app/api/tokens',
json={
'name': 'Production API Token',
'expires_at': '2025-12-31T23:59:59Z'
}
)
data = response.json()
{
"success": true,
"data": {
"id": "tok_123abc",
"name": "Production API Token",
"token": "qwoty_live_abc123def456...",
"expires_at": "2025-12-31T23:59:59Z",
"created_at": "2024-01-15T10:30:00Z"
}
}
{
"error": "Invalid request data",
"details": {
"name": ["Required field"]
}
}
Autorisation
string
requis
Token Bearer pour l’authentification. Format :
Bearer qwoty_your_tokenCorps de la requête
string
requis
Un nom descriptif pour le token API
string
Date d’expiration optionnelle au format ISO 8601 (ex. : “2024-12-31T23:59:59Z”)
object
Configuration optionnelle des permissions pour le token
Droits des endpoints d’écriture
Un token agit avec les droits de son rôle. Les endpoints de lecture (GET) demandent seulement un token valide. Les endpoints d’écriture vérifient le rôle et répondent 403 si le droit manque :
| Endpoints | Droit requis |
|---|---|
POST / PATCH sur /catalogs, /categories, /prices, /products, /product-parents, /payment-terms | product_pricing:write |
DELETE /categories/{id} | product_pricing:delete |
POST / PATCH sur /customers, /contacts, /addresses | customer:write |
403 Forbidden
{ "error": "Insufficient permissions. Requires product_pricing:write" }
Réponse
boolean
Indique si l’opération s’est déroulée avec succès
object
curl --request POST \
--url https://qwoty.app/api/tokens \
--header 'Content-Type: application/json' \
--data '{
"name": "Production API Token",
"expires_at": "2025-12-31T23:59:59Z"
}'
const response = await fetch('https://qwoty.app/api/tokens', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Production API Token',
expires_at: '2025-12-31T23:59:59Z',
}),
})
const data = await response.json()
import requests
response = requests.post(
'https://qwoty.app/api/tokens',
json={
'name': 'Production API Token',
'expires_at': '2025-12-31T23:59:59Z'
}
)
data = response.json()
{
"success": true,
"data": {
"id": "tok_123abc",
"name": "Production API Token",
"token": "qwoty_live_abc123def456...",
"expires_at": "2025-12-31T23:59:59Z",
"created_at": "2024-01-15T10:30:00Z"
}
}
{
"error": "Invalid request data",
"details": {
"name": ["Required field"]
}
}
Dernière modification le 28 octobre 2026
Cette page vous a-t-elle été utile ?

