Payments

Create subscription

Creates a recurring-payment subscription record tied to a counterparty. The customer must still sign the Solana subscription authorization transaction.

post/v1/payments/subscriptions

Headers

x-project-idstring

Selects the active project for this request. Required for session/dashboard callers. Ignored when authenticating with an API key, whose scope is fixed to the key's project.

Example:prj_example

Selects the active project for this request. Required for session/dashboard callers. Ignored when authenticating with an API key, whose scope is fixed to the key's project.

Request body

planIdstring required

SDP subscription plan ID.

counterpartyIdstring required

Counterparty being billed for the recurring payment.

subscriberAddressstring required

Customer wallet address that authorizes the subscription.

subscriberTokenAccountstring

Optional subscriber token account address.

subscriptionPdastring

On-chain subscription PDA once created.

subscriptionAuthorityAddressstring

Subscription authority PDA/address once initialized.

authorizationSignaturestring

Signature for the customer authorization transaction.

status'pending_authorization' | 'active' | 'paused' | 'canceling' | 'canceled' | 'expired'

Subscription status.

currentPeriodStartAtstring date-time
nextCollectionDueAtstring date-time

Example request

{
  "planId": "psp_example",
  "counterpartyId": "counterparty_example",
  "subscriberAddress": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
  "authorizationSignature": "sig_example",
  "status": "active"
}

Response

Subscription created

Example response

{
  "data": {
    "subscription": {
      "id": "psub_example",
      "organizationId": "org_example",
      "projectId": "prj_example",
      "subscriberAddress": "So11111111111111111111111111111111111111112",
      "subscriberTokenAccount": "So11111111111111111111111111111111111111112",
      "subscriptionPda": "So11111111111111111111111111111111111111112",
      "subscriptionAuthorityAddress": "So11111111111111111111111111111111111111112",
      "status": "active",
      "currentPeriodStartAt": "2025-01-01T00:00:00.000Z",
      "nextCollectionDueAt": "2025-01-01T00:00:00.000Z",
      "cancelAt": "2025-01-01T00:00:00.000Z",
      "canceledAt": "2025-01-01T00:00:00.000Z",
      "createdAt": "2025-01-01T00:00:00.000Z",
      "updatedAt": "2025-01-01T00:00:00.000Z"
    }
  },
  "meta": {
    "requestId": "req_example",
    "timestamp": "2025-01-01T00:00:00.000Z"
  }
}

Changes