API Keys
Generate Bearer Token
Obtain a bearer token for subsequent authenticated PayTo requests. Tokens are valid for 24 hours.
Send the merchant API key in Authorization (raw key or Bearer <key>).
Error Codes
| Code | Status | Reason | What to do |
|---|---|---|---|
| GN-0000 | 401 | Invalid API key | Verify the API key and retry with the correct credential. |
| GN-0000 | 401 | Merchant account is not active | Activate the merchant account before requesting a token. |
post
/api/public/authorizationGenerate Bearer Token
Obtain a bearer token for subsequent authenticated PayTo requests. Tokens are valid for 24 hours.
Send the merchant API key in Authorization (raw key or Bearer <key>).
Error Codes
| Code | Status | Reason | What to do |
|---|---|---|---|
| GN-0000 | 401 | Invalid API key | Verify the API key and retry with the correct credential. |
| GN-0000 | 401 | Merchant account is not active | Activate the merchant account before requesting a token. |
Servers
Staging: https://dev-api.shabaas.com
Production: https://api.shabaas.com
Authentication
ApiKeyAuthheader:
AuthorizationMerchant API key in Authorization header.
Responses
200Token issued
application/jsonobject
Properties
messageOptionalstringstring
Example
"Success"dataOptionalobjectobject
Properties
tokenOptionalstringstring
Example
"Bearer eyJhbGciOiJIUzI1NiJ9..."401Invalid API key or merchant not allowed to authenticate
application/jsonobject
Properties
messageRequiredstringstring
Example
"Payee account cannot receive NPP Payments"error_codeRequiredstringstring
Example
"MOV_NPP_PAYMENT_NOT_SUPPORTED"dataRequiredobjectobject
Example
{
"response_time": "2026-04-08T12:28:26.759Z"
}Additional properties are supported; see the endpoint definition for their schema.
Unknown or wrong API key
{
"message": "Invalid API Key",
"error_code": "GN-0000",
"data": {
"response_time": "2026-04-10T12:00:00.000Z"
}
}Merchant exists but is not active
{
"message": "Account not activated yet",
"error_code": "GN-0000",
"data": {
"response_time": "2026-04-10T12:00:00.000Z"
}
}408Upstream timeout
application/jsonobject
Properties
messageRequiredstringstring
Example
"Payee account cannot receive NPP Payments"error_codeRequiredstringstring
Example
"MOV_NPP_PAYMENT_NOT_SUPPORTED"dataRequiredobjectobject
Example
{
"response_time": "2026-04-08T12:28:26.759Z"
}Additional properties are supported; see the endpoint definition for their schema.
Full endpoint OpenAPI definition
{
"openapi": "3.0.3",
"info": {
"title": "ShaBaasPay Public API",
"version": "1.0.0",
"description": "Describes public REST endpoints for authorization, payment agreements, payment initiations,\nrefunds, webhooks, and PayID collection APIs.\n"
},
"servers": [
{
"url": "https://dev-api.shabaas.com",
"description": "Staging"
},
{
"url": "https://api.shabaas.com",
"description": "Production"
}
],
"tags": [
{
"name": "API Keys",
"x-displayName": "API Keys",
"description": "Authentication and key-based access controls for API usage."
}
],
"x-tagGroups": [
{
"name": "SHABAASPAY PUBLIC API",
"tags": [
"API Keys",
"Payment Agreement",
"Payment Initiation",
"Checkout",
"B2B Collections",
"Webhooks"
]
},
{
"name": "Internal",
"tags": [
"Clients"
]
}
],
"security": [
{
"BearerAuth": []
}
],
"paths": {
"/api/public/authorization": {
"post": {
"tags": [
"API Keys"
],
"summary": "Generate Bearer Token",
"description": "Obtain a bearer token for subsequent authenticated PayTo requests. Tokens are valid for 24 hours.\nSend the merchant API key in `Authorization` (raw key or `Bearer <key>`).\n\n### Error Codes\n| Code | Status | Reason | What to do |\n| ---- | ------ | ------ | ---------- |\n| GN-0000 | 401 | Invalid API key | Verify the API key and retry with the correct credential. |\n| GN-0000 | 401 | Merchant account is not active | Activate the merchant account before requesting a token. |\n",
"security": [
{
"ApiKeyAuth": []
}
],
"responses": {
"200": {
"description": "Token issued",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SuccessAuthorizationResponse"
}
}
}
},
"401": {
"description": "Invalid API key or merchant not allowed to authenticate",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
},
"examples": {
"invalid_api_key": {
"summary": "Unknown or wrong API key",
"value": {
"message": "Invalid API Key",
"error_code": "GN-0000",
"data": {
"response_time": "2026-04-10T12:00:00.000Z"
}
}
},
"account_not_active": {
"summary": "Merchant exists but is not active",
"value": {
"message": "Account not activated yet",
"error_code": "GN-0000",
"data": {
"response_time": "2026-04-10T12:00:00.000Z"
}
}
}
}
}
}
},
"408": {
"description": "Upstream timeout",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"SuccessAuthorizationResponse": {
"type": "object",
"properties": {
"message": {
"type": "string",
"example": "Success"
},
"data": {
"type": "object",
"properties": {
"token": {
"type": "string",
"example": "Bearer eyJhbGciOiJIUzI1NiJ9..."
}
}
}
}
},
"ErrorResponse": {
"type": "object",
"required": [
"message",
"error_code",
"data"
],
"properties": {
"message": {
"type": "string",
"example": "Payee account cannot receive NPP Payments"
},
"error_code": {
"type": "string",
"example": "MOV_NPP_PAYMENT_NOT_SUPPORTED"
},
"data": {
"type": "object",
"additionalProperties": true,
"example": {
"response_time": "2026-04-08T12:28:26.759Z"
}
}
}
}
},
"securitySchemes": {
"BearerAuth": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "JWT",
"description": "Bearer token returned by `/api/public/authorization`."
},
"ApiKeyAuth": {
"type": "apiKey",
"in": "header",
"name": "Authorization",
"description": "Merchant API key in `Authorization` header."
}
}
}
}