SolKnife Customer subscriptions API
The Customer subscriptions API from SolKnife — 7 operation(s) for customer subscriptions.
The Customer subscriptions API from SolKnife — 7 operation(s) for customer subscriptions.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/solknife-xyz:solknife-xyz-customer-subscriptions-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
description: 'Merchant API for SolKnife Gateway: Solana payment intents, subscription plans, customer subscriptions, and signed callbacks. Every response is a JSON envelope: { ok: true, data } on success, { ok: false, error: { code, message } } on failure.'
title: SolKnife Gateway Customer subscriptions API
version: 1.0.0
servers:
- url: https://gate.solknife.xyz
tags:
- name: Customer subscriptions
paths:
/api/subscriptions:
post:
description: Creates a customer subscription on an ACTIVE plan and returns a hosted subscription checkout URL. customerReference is idempotent per plan.
operationId: post/api/subscriptions
responses:
'200':
content:
application/json:
schema:
properties:
data:
description: The customer subscription with its checkoutUrl.
type: object
ok:
const: true
type: boolean
required:
- ok
- data
type: object
description: Success.
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
description: VALIDATION_ERROR or another request error.
'401':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
description: 'UNAUTHENTICATED: missing or invalid x-gateway-key.'
'409':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
description: 'CONFLICT: the request conflicts with an existing record. SUBSCRIPTION_STATE_CHANGED: another request changed the subscription first; read it again and retry.'
'500':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
description: 'INTERNAL_ERROR: unexpected server error.'
security:
- gatewayKey: []
summary: Create customer subscription
tags:
- Customer subscriptions
requestBody:
content:
application/json:
schema:
type: object
properties:
customerReference:
type: string
minLength: 3
maxLength: 120
customerTelegramChatId:
type: string
pattern: ^-?[0-9]{3,32}$
planId:
type: string
format: uuid
pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
subscriberWallet:
type: string
required:
- customerReference
- customerTelegramChatId
- planId
- subscriberWallet
required: true
x-operation-id-source: normalized
x-operation-id-original: post /api/subscriptions
/api/subscriptions/{subscriptionId}/transactions/init-authority:
post:
description: Returns an unsigned base64 transaction that prepares the customer's wallet for recurring Solana payments.
operationId: post/api/subscriptions/{subscriptionId}/transactions/init-authority
responses:
'200':
content:
application/json:
schema:
properties:
data:
type: object
properties:
message:
type: string
transaction:
type: string
description: Unsigned base64 Solana transaction for the wallet to sign.
required:
- message
- transaction
ok:
const: true
type: boolean
required:
- ok
- data
type: object
description: Success.
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
description: VALIDATION_ERROR or another request error.
'401':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
description: 'UNAUTHENTICATED: missing or invalid x-gateway-key.'
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
description: The resource does not exist for this merchant.
'409':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
description: 'CONFLICT: the request conflicts with an existing record. SUBSCRIPTION_STATE_CHANGED: another request changed the subscription first; read it again and retry.'
'500':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
description: 'INTERNAL_ERROR: unexpected server error.'
security:
- gatewayKey: []
summary: Prepare customer wallet transaction
tags:
- Customer subscriptions
parameters:
- in: path
name: subscriptionId
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
type: object
properties:
account:
type: string
required:
- account
required: true
x-operation-id-source: normalized
x-operation-id-original: post /api/subscriptions/{subscriptionId}/transactions/init-authority
/api/subscriptions/{subscriptionId}/transactions/subscribe:
post:
description: Returns an unsigned base64 transaction for the customer wallet to subscribe.
operationId: post/api/subscriptions/{subscriptionId}/transactions/subscribe
responses:
'200':
content:
application/json:
schema:
properties:
data:
type: object
properties:
message:
type: string
transaction:
type: string
description: Unsigned base64 Solana transaction for the wallet to sign.
required:
- message
- transaction
ok:
const: true
type: boolean
required:
- ok
- data
type: object
description: Success.
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
description: VALIDATION_ERROR or another request error.
'401':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
description: 'UNAUTHENTICATED: missing or invalid x-gateway-key.'
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
description: The resource does not exist for this merchant.
'409':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
description: 'CONFLICT: the request conflicts with an existing record. SUBSCRIPTION_STATE_CHANGED: another request changed the subscription first; read it again and retry.'
'500':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
description: 'INTERNAL_ERROR: unexpected server error.'
security:
- gatewayKey: []
summary: Create customer subscribe transaction
tags:
- Customer subscriptions
parameters:
- in: path
name: subscriptionId
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
type: object
properties:
account:
type: string
expectedSubscriptionAuthorityInitId:
type: string
pattern: ^[0-9]+$
required:
- account
required: true
x-operation-id-source: normalized
x-operation-id-original: post /api/subscriptions/{subscriptionId}/transactions/subscribe
/api/subscriptions/{subscriptionId}/transactions/cancel:
post:
description: Returns an unsigned base64 transaction that lets the customer cancel the subscription on Solana.
operationId: post/api/subscriptions/{subscriptionId}/transactions/cancel
responses:
'200':
content:
application/json:
schema:
properties:
data:
type: object
properties:
message:
type: string
transaction:
type: string
description: Unsigned base64 Solana transaction for the wallet to sign.
required:
- message
- transaction
ok:
const: true
type: boolean
required:
- ok
- data
type: object
description: Success.
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
description: VALIDATION_ERROR or another request error.
'401':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
description: 'UNAUTHENTICATED: missing or invalid x-gateway-key.'
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
description: The resource does not exist for this merchant.
'409':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
description: 'CONFLICT: the request conflicts with an existing record. SUBSCRIPTION_STATE_CHANGED: another request changed the subscription first; read it again and retry.'
'500':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
description: 'INTERNAL_ERROR: unexpected server error.'
security:
- gatewayKey: []
summary: Cancel customer subscription transaction
tags:
- Customer subscriptions
parameters:
- in: path
name: subscriptionId
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
type: object
properties:
account:
type: string
required:
- account
required: true
x-operation-id-source: normalized
x-operation-id-original: post /api/subscriptions/{subscriptionId}/transactions/cancel
/api/subscriptions/{subscriptionId}/transactions/resume:
post:
description: Returns an unsigned base64 transaction that lets the customer resume a canceled subscription before the current period ends.
operationId: post/api/subscriptions/{subscriptionId}/transactions/resume
responses:
'200':
content:
application/json:
schema:
properties:
data:
type: object
properties:
message:
type: string
transaction:
type: string
description: Unsigned base64 Solana transaction for the wallet to sign.
required:
- message
- transaction
ok:
const: true
type: boolean
required:
- ok
- data
type: object
description: Success.
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
description: VALIDATION_ERROR or another request error.
'401':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
description: 'UNAUTHENTICATED: missing or invalid x-gateway-key.'
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
description: The resource does not exist for this merchant.
'409':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
description: 'CONFLICT: the request conflicts with an existing record. SUBSCRIPTION_STATE_CHANGED: another request changed the subscription first; read it again and retry.'
'500':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
description: 'INTERNAL_ERROR: unexpected server error.'
security:
- gatewayKey: []
summary: Resume customer subscription transaction
tags:
- Customer subscriptions
parameters:
- in: path
name: subscriptionId
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
type: object
properties:
account:
type: string
required:
- account
required: true
x-operation-id-source: normalized
x-operation-id-original: post /api/subscriptions/{subscriptionId}/transactions/resume
/api/subscriptions/{subscriptionId}/confirm:
post:
description: Verifies the matching subscription transaction, updates the subscription status or next billing date, sends a signed subscription callback, and notifies the customer in Telegram. Gateway reads the transaction at finalized commitment, about 13 seconds after it is sent; before that the request fails with a not-found error and should be retried.
operationId: post/api/subscriptions/{subscriptionId}/confirm
responses:
'200':
content:
application/json:
schema:
properties:
data:
description: The updated customer subscription.
type: object
ok:
const: true
type: boolean
required:
- ok
- data
type: object
description: Success.
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
description: VALIDATION_ERROR or another request error.
'401':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
description: 'UNAUTHENTICATED: missing or invalid x-gateway-key.'
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
description: The resource does not exist for this merchant.
'409':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
description: 'CONFLICT: the request conflicts with an existing record. SUBSCRIPTION_STATE_CHANGED: another request changed the subscription first; read it again and retry.'
'500':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
description: 'INTERNAL_ERROR: unexpected server error.'
security:
- gatewayKey: []
summary: Confirm subscription action
tags:
- Customer subscriptions
parameters:
- in: path
name: subscriptionId
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
type: object
properties:
action:
type: string
enum:
- subscribe
- collect
- cancel
- resume
signature:
type: string
required:
- action
- signature
required: true
x-operation-id-source: normalized
x-operation-id-original: post /api/subscriptions/{subscriptionId}/confirm
/api/subscriptions/{subscriptionId}/expire:
post:
description: Expires a canceled customer subscription after the current period ends and sends a subscription.expired callback.
operationId: post/api/subscriptions/{subscriptionId}/expire
responses:
'200':
content:
application/json:
schema:
properties:
data:
description: The expired customer subscription.
type: object
ok:
const: true
type: boolean
required:
- ok
- data
type: object
description: Success.
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
description: VALIDATION_ERROR or another request error.
'401':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
description: 'UNAUTHENTICATED: missing or invalid x-gateway-key.'
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
description: The resource does not exist for this merchant.
'409':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
description: 'CONFLICT: the request conflicts with an existing record. SUBSCRIPTION_STATE_CHANGED: another request changed the subscription first; read it again and retry.'
'500':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
description: 'INTERNAL_ERROR: unexpected server error.'
security:
- gatewayKey: []
summary: Expire canceled subscription
tags:
- Customer subscriptions
parameters:
- in: path
name: subscriptionId
required: true
schema:
type: string
x-operation-id-source: normalized
x-operation-id-original: post /api/subscriptions/{subscriptionId}/expire
webhooks:
gatewayCallback:
post:
description: Gateway posts a signed callback to the merchant callbackUrl for payment.confirmed, subscription_plan.confirmed, subscription_plan.updated_onchain, subscription.subscribe, subscription.collect, subscription.cancel, subscription.resume, subscription.past_due, subscription.expired, and gateway.test (sent by the test callback endpoint). Verify x-solknife-signature as the hex HMAC-SHA256 of "." with the webhook secret, reject a timestamp more than 300 seconds from your clock, and drop any x-solknife-delivery-id you already processed.
parameters:
- description: The callback event type.
in: header
name: x-solknife-event
required: true
schema:
type: string
- description: Unique id of this delivery. Drop a callback whose delivery id you already processed.
in: header
name: x-solknife-delivery-id
required: true
schema:
format: uuid
type: string
- description: Hex HMAC-SHA256 of "<x-solknife-timestamp>.<raw body>", keyed with the webhook secret.
in: header
name: x-solknife-signature
required: true
schema:
type: string
- description: Unix time in seconds when Gateway signed the delivery. Reject it when it is more than 300 seconds from your clock.
in: header
name: x-solknife-timestamp
required: true
schema:
pattern: ^[0-9]+$
type: string
requestBody:
content:
application/json:
schema:
properties:
eventType:
type: string
required:
- eventType
type: object
required: true
responses:
'200':
description: Return any 2xx status to acknowledge.
summary: Callback verification
tags:
- Customer subscriptions
components:
schemas:
ErrorEnvelope:
properties:
error:
properties:
code:
type: string
message:
type: string
required:
- code
- message
type: object
ok:
const: false
type: boolean
required:
- ok
- error
type: object
securitySchemes:
gatewayKey:
description: The Gateway API key returned by POST /api/merchants/register.
in: header
name: x-gateway-key
type: apiKey
externalDocs:
description: Integration docs
url: https://gate.solknife.xyz/docs