---
title: "Prepare subscription authorization"
method: POST
path: "/v1/payments/subscriptions/{subscriptionId}/prepare-authorization"
tags: ["Payments"]
---

# Prepare subscription authorization

`POST /v1/payments/subscriptions/{subscriptionId}/prepare-authorization`

Prepares the subscriber-signed Solana transaction that initializes the subscription authority and subscribes to the plan. The transaction must still be signed and submitted by the client.

## Path parameters

- `subscriptionId` string, required — SDP subscription record ID.

## Headers

- `x-project-id` string — 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

- object — Inputs for preparing the subscriber-signed Solana subscription authorization transaction.
  - `subscriberTokenAccount` string, required — Subscriber token account that authorizes the subscription authority delegation.
  - `expectedPlanCreatedAt` string, required — Unsigned 64-bit created-at timestamp from the on-chain plan terms that the subscriber consents to.
  - `expectedSubscriptionAuthorityInitId` string, required — Signed 64-bit init id from the on-chain subscription authority that the subscriber consents to.

## Response `200`

Subscription authorization prepared

- object — Standard success response envelope.
  - `data` object, required — Prepared subscription authorization response payload.
    - `subscription` object, required — Recurring payment subscription record.
      - `id` string, required — SDP subscription ID.
      - `organizationId` string, required — Organization identifier.
      - `projectId` string, required — Project identifier.
      - `planId` string, required — SDP subscription plan ID.
      - `counterpartyId` string, required — Counterparty ID.
      - `subscriberAddress` string, required — Base58-encoded Solana address.
      - `subscriberTokenAccount` string, nullable, required — Subscriber token account address.
      - `subscriptionPda` string, nullable, required — On-chain subscription PDA.
      - `subscriptionAuthorityAddress` string, nullable, required — On-chain subscription authority address.
      - `authorizationSignature` string, nullable, required — Customer authorization transaction signature.
      - `status` 'pending_authorization' | 'active' | 'paused' | 'canceling' | 'canceled' | 'expired', required — Subscription status.
      - `currentPeriodStartAt` string, date-time, nullable, required — ISO 8601 timestamp.
      - `nextCollectionDueAt` string, date-time, nullable, required — ISO 8601 timestamp.
      - `cancelAt` string, date-time, nullable, required — ISO 8601 timestamp.
      - `canceledAt` string, date-time, nullable, required — ISO 8601 timestamp.
      - `createdBy` string, nullable, required
      - `createdAt` string, date-time, required — ISO 8601 timestamp.
      - `updatedAt` string, date-time, required — ISO 8601 timestamp.
    - `subscriptionPda` string, required — Derived subscription delegation PDA.
    - `subscriptionAuthorityAddress` string, required — Derived subscription authority PDA.
    - `preparedTransaction` object, required — Unsigned Solana subscriptions transaction payload for client-side signing.
      - `serialized` string, required — Base64-encoded unsigned transaction.
      - `blockhash` string, required — Blockhash for the transaction.
      - `lastValidBlockHeight` string, required — Last valid block height.
      - `requiredSigners` string[], required — Addresses that must sign the prepared transaction. This includes the sponsored fee payer when the transaction uses one.
  - `meta` object, required — Response metadata.
    - `requestId` string, required — Request identifier for tracing.
    - `timestamp` string, date-time, required — ISO 8601 timestamp.

## Other responses

- `400` — Error
- `401` — Error
- `403` — Error
- `404` — Error
- `500` — Error

---

[API](https://skmtc.net/solana/apis/solana-developer-platform-api.md) · [All operations](https://skmtc.net/solana/apis/solana-developer-platform-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/solana/solana-developer-platform-api/revisions/672b1916ba61/schema)
