API Keys

Issue, list, rotate, and revoke Web SDK integration keys (publishable / secret).

Create API key

POSThttps://api.gobtcpay.com/public/api/v1.2/merchant/api-key/create

Issues 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/json
labelstringrequired

Human-readable label for the API key.

Example:Front desk
typeenumrequired
publishablesecret
Example:publishable
storeIdstring
Example:3fa85f64-5717-4562-b3fc-2c963f66afa6

Responses

idstringrequired
Example:3fa85f64-5717-4562-b3fc-2c963f66afa6
resultobjectrequired
POST /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

POSThttps://api.gobtcpay.com/public/api/v1.2/merchant/api-key/list

Lists 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/json
paginationobject
filtersobject

Responses

idstringrequired
Example:3fa85f64-5717-4562-b3fc-2c963f66afa6
resultobjectrequired
POST /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

POSThttps://api.gobtcpay.com/public/api/v1.2/merchant/api-key/rotate

Rotates the key identified by apiKeyId, invalidating the previous secret and returning a fresh secret (shown only once).

Authorization: merchantAuth

Body required

application/json
apiKeyIdstringrequired
Example:possk_live_3fa85f6457174562b3fc2c963f66afa6

Responses

idstringrequired
Example:3fa85f64-5717-4562-b3fc-2c963f66afa6
resultobjectrequired
POST /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

POSThttps://api.gobtcpay.com/public/api/v1.2/merchant/api-key/revoke

Revokes the key identified by apiKeyId. Returns { ok }.

Authorization: merchantAuth

Body required

application/json
apiKeyIdstringrequired
Example:possk_live_3fa85f6457174562b3fc2c963f66afa6

Responses

idstringrequired
Example:3fa85f64-5717-4562-b3fc-2c963f66afa6
resultobjectrequired
POST /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
    }
  }
}