API Keys
Issue, list, rotate, and revoke Web SDK integration keys (publishable / secret).
Create API key
POST
https://api.gobtcpay.com/public/api/v1.2/merchant/api-key/createIssues a Web SDK integration key of the given type (publishable / secret), optionally scoped to a storeId. The response includes the full secret shown only once.
Authorization: merchantAuth
Body required
application/jsonlabelstringrequiredHuman-readable label for the API key.
Example:
Front desktypeenumrequiredpublishablesecretExample:
publishablestoreIdstringExample:
3fa85f64-5717-4562-b3fc-2c963f66afa6Responses
idstringrequiredExample:
3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredPOST /merchant/api-key/create
cURL
curl -X POST "$BASE_URL/merchant/api-key/create" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"label": "Front desk",
"type": "publishable",
"storeId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}'200 Successful response
JSON
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"apiKey": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"label": "Front desk",
"type": "publishable",
"prefix": "string",
"lastUsedAt": 1718012345,
"createdAt": 1718012345,
"secret": "string"
}
}
}
}List API keys
POST
https://api.gobtcpay.com/public/api/v1.2/merchant/api-key/listLists integration keys (masked, prefix only, never the full secret) with optional pagination and a storeId filter. Returns items and totalCount.
Authorization: merchantAuth
Body required
application/jsonpaginationobjectfiltersobjectResponses
idstringrequiredExample:
3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredPOST /merchant/api-key/list
cURL
curl -X POST "$BASE_URL/merchant/api-key/list" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"pagination": {
"limit": 20,
"skip": 0
},
"filters": {
"storeId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
}'200 Successful response
JSON
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"items": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"label": "Front desk",
"type": "publishable",
"prefix": "string",
"lastUsedAt": 1718012345,
"createdAt": 1718012345
}
],
"totalCount": 0
}
}
}Rotate API key
POST
https://api.gobtcpay.com/public/api/v1.2/merchant/api-key/rotateRotates the key identified by apiKeyId, invalidating the previous secret and returning a fresh secret (shown only once).
Authorization: merchantAuth
Body required
application/jsonapiKeyIdstringrequiredExample:
possk_live_3fa85f6457174562b3fc2c963f66afa6Responses
idstringrequiredExample:
3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredPOST /merchant/api-key/rotate
cURL
curl -X POST "$BASE_URL/merchant/api-key/rotate" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"apiKeyId": "possk_live_3fa85f6457174562b3fc2c963f66afa6"
}'200 Successful response
JSON
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"apiKey": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"label": "Front desk",
"type": "publishable",
"prefix": "string",
"lastUsedAt": 1718012345,
"createdAt": 1718012345,
"secret": "string"
}
}
}
}Revoke API key
POST
https://api.gobtcpay.com/public/api/v1.2/merchant/api-key/revokeRevokes the key identified by apiKeyId. Returns { ok }.
Authorization: merchantAuth
Body required
application/jsonapiKeyIdstringrequiredExample:
possk_live_3fa85f6457174562b3fc2c963f66afa6Responses
idstringrequiredExample:
3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredPOST /merchant/api-key/revoke
cURL
curl -X POST "$BASE_URL/merchant/api-key/revoke" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"apiKeyId": "possk_live_3fa85f6457174562b3fc2c963f66afa6"
}'200 Successful response
JSON
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"ok": true
}
}
}