Generate API key for application
Creates a new API key for the specified application belonging to the authenticated merchant. The full key is returned only once in the response.
curl -X POST "https://api.example.com/api/v1/applications/example_string/api-keys" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN (JWT)" \
-d '{
"description": "Production API key for checkout service"
}'
import requests
import json
url = "https://api.example.com/api/v1/applications/example_string/api-keys"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN (JWT)"
}
data = {
"description": "Production API key for checkout service"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.example.com/api/v1/applications/example_string/api-keys", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN (JWT)"
},
body: JSON.stringify({
"description": "Production API key for checkout service"
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"description": "Production API key for checkout service"
}`)
req, err := http.NewRequest("POST", "https://api.example.com/api/v1/applications/example_string/api-keys", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN (JWT)")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.example.com/api/v1/applications/example_string/api-keys')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN (JWT)'
request.body = '{
"description": "Production API key for checkout service"
}'
response = http.request(request)
puts response.body
{
"id": "key_uuid_888",
"applicationId": "app_uk_store_123",
"fullKey": "ks_live_abc123xyz...",
"keyPrefix": "ks_live_abc1",
"description": "Primary Checkout Key",
"createdAt": "2026-02-23T13:30:00Z"
}
{
"error": "Bad Request",
"message": "The request contains invalid parameters or malformed data",
"code": 400,
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
{
"error": "Unauthorized",
"message": "Authentication required. Please provide a valid API token",
"code": 401
}
{
"error": "Forbidden",
"message": "You don't have permission to access this resource",
"code": 403
}
{
"error": "Not Found",
"message": "The requested resource was not found",
"code": 404
}
POST
/api/v1/applications/{id}/api-keysPOST
Base URLstring
Target server for requests. Edit to use your own host.
Bearer Token (JWT)
Bearer Tokenstring
RequiredBearer token (JWT) - just enter the token, "Bearer" prefix will be added automatically
Content-Typestring
RequiredThe media type of the request body
Options: application/json
descriptionstring
RequiredHuman readable description for the key
Max length: 50
Request Preview
Response
Response will appear here after sending the request
Authentication
header
Authorizationstring
RequiredBearer token (JWT). Authentication token required.
Path Parameters
Body
application/json
descriptionstring
RequiredHuman readable description for the key
Example:
Production API key for checkout serviceResponses
Was this page helpful?