SolKnife Subscription plans API

The Subscription plans API from SolKnife — 7 operation(s) for subscription plans.

GitHub OpenAPI

Operations 7

POST /api/subscription-plans Create subscription plan #
POST /api/subscription-plans/{planId}/transactions/create-plan Publish subscription plan transaction #
POST /api/subscription-plans/{planId}/transactions/update-plan Update on-chain plan transaction #
POST /api/subscription-plans/{planId}/confirm Confirm subscription plan or on-chain plan update #
POST /api/subscription-plans/{planId}/pause Pause subscription plan #
POST /api/subscription-plans/{planId}/resume Resume subscription plan #
POST /api/subscription-plans/{planId}/archive Archive subscription plan #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • 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.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/solknife-xyz:solknife-xyz-subscription-plans-api"
All apis
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.

Get an API 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 Specification

solknife-xyz-subscription-plans-api-openapi.yml Raw ↑
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 Subscription plans API
  version: 1.0.0
servers:
- url: https://gate.solknife.xyz
tags:
- name: Subscription plans
paths:
  /api/subscription-plans:
    post:
      description: Creates a subscription plan. Publish and confirm it on Solana before use.
      operationId: post/api/subscription-plans
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    description: The stored subscription plan.
                    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 subscription plan
      tags:
      - Subscription plans
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                amountRaw:
                  type: string
                  pattern: ^[1-9][0-9]*$
                displayName:
                  type: string
                  minLength: 2
                  maxLength: 80
                metadataUri:
                  type: string
                  maxLength: 128
                  format: uri
                periodSeconds:
                  type: integer
                  minimum: 3600
                  maximum: 31536000
                planReference:
                  type: string
                  minLength: 3
                  maxLength: 120
                pullerWallet:
                  type: string
                tokenMint:
                  type: string
              required:
              - amountRaw
              - displayName
              - periodSeconds
              - planReference
              - tokenMint
        required: true
      x-operation-id-source: normalized
      x-operation-id-original: post /api/subscription-plans
  /api/subscription-plans/{planId}/transactions/create-plan:
    post:
      description: Returns an unsigned base64 transaction for the business wallet to publish the Solana subscription plan.
      operationId: post/api/subscription-plans/{planId}/transactions/create-plan
      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: Publish subscription plan transaction
      tags:
      - Subscription plans
      parameters:
      - in: path
        name: planId
        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/subscription-plans/{planId}/transactions/create-plan
  /api/subscription-plans/{planId}/transactions/update-plan:
    post:
      description: Returns an unsigned base64 transaction for the business wallet to restore an on-chain plan or sunset it from new subscribers.
      operationId: post/api/subscription-plans/{planId}/transactions/update-plan
      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: Update on-chain plan transaction
      tags:
      - Subscription plans
      parameters:
      - in: path
        name: planId
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
              - type: object
                properties:
                  account:
                    type: string
                  endTs:
                    default: '0'
                    type: string
                    const: '0'
                  onchainStatus:
                    type: string
                    const: active
                required:
                - account
                - onchainStatus
              - type: object
                properties:
                  account:
                    type: string
                  endTs:
                    type: string
                    pattern: ^[0-9]+$
                  onchainStatus:
                    type: string
                    const: sunset
                required:
                - account
                - endTs
                - onchainStatus
        required: true
      x-operation-id-source: normalized
      x-operation-id-original: post /api/subscription-plans/{planId}/transactions/update-plan
  /api/subscription-plans/{planId}/confirm:
    post:
      description: Verifies a create-plan or update-plan transaction. A create-plan confirmation marks the plan ACTIVE and sends subscription_plan.confirmed; an update-plan confirmation sends subscription_plan.updated_onchain. 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/subscription-plans/{planId}/confirm
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    description: The confirmed subscription plan and its callback delivery.
                    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 plan or on-chain plan update
      tags:
      - Subscription plans
      parameters:
      - in: path
        name: planId
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
              - oneOf:
                - type: object
                  properties:
                    action:
                      type: string
                      const: update-plan
                    signature:
                      type: string
                    endTs:
                      default: '0'
                      type: string
                      const: '0'
                    onchainStatus:
                      type: string
                      const: active
                  required:
                  - action
                  - signature
                  - onchainStatus
                - type: object
                  properties:
                    action:
                      type: string
                      const: update-plan
                    signature:
                      type: string
                    endTs:
                      type: string
                      pattern: ^[0-9]+$
                    onchainStatus:
                      type: string
                      const: sunset
                  required:
                  - action
                  - signature
                  - endTs
                  - onchainStatus
              - type: object
                properties:
                  action:
                    default: create-plan
                    type: string
                    const: create-plan
                  signature:
                    type: string
                required:
                - signature
        required: true
      x-operation-id-source: normalized
      x-operation-id-original: post /api/subscription-plans/{planId}/confirm
  /api/subscription-plans/{planId}/pause:
    post:
      description: Pauses an ACTIVE subscription plan.
      operationId: post/api/subscription-plans/{planId}/pause
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    description: The paused subscription plan.
                    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: Pause subscription plan
      tags:
      - Subscription plans
      parameters:
      - in: path
        name: planId
        required: true
        schema:
          type: string
      x-operation-id-source: normalized
      x-operation-id-original: post /api/subscription-plans/{planId}/pause
  /api/subscription-plans/{planId}/resume:
    post:
      description: Resumes a paused subscription plan.
      operationId: post/api/subscription-plans/{planId}/resume
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    description: The resumed subscription plan.
                    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: Resume subscription plan
      tags:
      - Subscription plans
      parameters:
      - in: path
        name: planId
        required: true
        schema:
          type: string
      x-operation-id-source: normalized
      x-operation-id-original: post /api/subscription-plans/{planId}/resume
  /api/subscription-plans/{planId}/archive:
    post:
      description: Archives a subscription plan when the offer should no longer be sold.
      operationId: post/api/subscription-plans/{planId}/archive
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    description: The archived subscription plan.
                    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: Archive subscription plan
      tags:
      - Subscription plans
      parameters:
      - in: path
        name: planId
        required: true
        schema:
          type: string
      x-operation-id-source: normalized
      x-operation-id-original: post /api/subscription-plans/{planId}/archive
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