Prepare subscription collection
Prepares the collector-signed Solana subscriptions transfer transaction for an active subscription.
POST/Run in dashboard
The transaction must still be signed and submitted by the collector/fee-payer flow. A subscription that belongs to a recurring payment, or whose subscriber is one of the organization's SDP wallets, answers 409: SDP collects from an SDP wallet only through a recurring payment.
Requires an API key with the recurring.execute action.
Path parameters
-
subscriptionId·string· required · min length 1 · examplepsub_exampleSDP subscription record ID.
Headers
-
x-project-id·string· min length 1 · exampleprj_exampleRequired for dashboard sessions. API keys use their assigned project.
Request body
application/json · required
Inputs for preparing the collector-signed Solana subscriptions transfer transaction. The amount is always derived from the stored plan.
-
receiverTokenAccount·string· required · example7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsUReceiver token account for the pulled subscription payment. It must be allowed by the on-chain plan.
Responses
-
200Subscription collection prepared-
data·object· requiredPrepared subscription collection response payload.
-
subscription·object· requiredRecurring payment subscription record.
-
id·string· required · examplepsub_exampleSDP subscription ID.
-
organizationId·string· required · min length 1 · exampleorg_exampleOrganization identifier.
-
projectId·string· required · min length 1 · exampleprj_exampleProject identifier.
-
planId·string· requiredSDP subscription plan ID.
-
counterpartyId·string· requiredCounterparty ID.
-
subscriberAddress·string· required · min length 32 · max length 44 · exampleSo11111111111111111111111111111111111111112Base58-encoded Solana address.
-
subscriberTokenAccount·string | null· required · min length 32 · max length 44 · exampleSo11111111111111111111111111111111111111112Subscriber token account address.
-
subscriptionPda·string | null· required · min length 32 · max length 44 · exampleSo11111111111111111111111111111111111111112On-chain subscription PDA.
-
subscriptionAuthorityAddress·string | null· required · min length 32 · max length 44 · exampleSo11111111111111111111111111111111111111112On-chain subscription authority address.
-
authorizationSignature·string | null· requiredCustomer authorization transaction signature.
-
status·string· required · one ofpending_authorization,active,paused,canceling,canceled,expired· exampleactiveSubscription status.
-
currentPeriodStartAt·string | null· required · formatdate-time· example2025-01-01T00:00:00.000ZISO 8601 timestamp.
-
nextCollectionDueAt·string | null· required · formatdate-time· example2025-01-01T00:00:00.000ZISO 8601 timestamp.
-
cancelAt·string | null· required · formatdate-time· example2025-01-01T00:00:00.000ZISO 8601 timestamp.
-
canceledAt·string | null· required · formatdate-time· example2025-01-01T00:00:00.000ZISO 8601 timestamp.
-
createdBy·string | null· required -
createdAt·string· required · formatdate-time· example2025-01-01T00:00:00.000ZISO 8601 timestamp.
-
updatedAt·string· required · formatdate-time· example2025-01-01T00:00:00.000ZISO 8601 timestamp.
-
-
preparedTransaction·object· requiredUnsigned Solana subscriptions transaction payload for client-side signing.
-
serialized·string· required · min length 1 · exampleAQIDBase64-encoded unsigned transaction.
-
blockhash·string· required · exampleblockhash_exampleBlockhash for the transaction.
-
lastValidBlockHeight·string· required · example123456Last valid block height.
-
requiredSigners·string[]· required · each min length 32 · each max length 44 · each exampleSo11111111111111111111111111111111111111112Addresses that must sign the prepared transaction. This includes the sponsored fee payer when the transaction uses one.
-
-
collectionAttempt·objectRecurring payment collection attempt record.
-
id·string· required · examplepsca_exampleCollection attempt ID.
-
organizationId·string· required · min length 1 · exampleorg_exampleOrganization identifier.
-
projectId·string· required · min length 1 · exampleprj_exampleProject identifier.
-
subscriptionId·string· requiredSubscription ID.
-
transferId·string | null· required · min length 1 · examplexfr_examplePayment transfer record ID when linked.
-
token·string· requiredToken mint or normalized token identifier.
-
amount·string· required · example100.00Token amount in UI units (decimal string).
-
dueAt·string· required · formatdate-time· example2025-01-01T00:00:00.000ZISO 8601 timestamp.
-
attemptedAt·string | null· required · formatdate-time· example2025-01-01T00:00:00.000ZISO 8601 timestamp.
-
status·string· required · one ofpending,processing,confirmed,failed,skipped· examplependingCollection attempt status.
-
signature·string | null· requiredSolana transaction signature.
-
error·string | null· required · exampleThe wallet used for this payment does not have enough funds. Add funds and try again.Why the collection failed, if it did. A source wallet that cannot cover the amount records the same text the collect request returned with
400 TRANSACTION_FAILED. -
metadata·object· requiredProvider/job metadata for the attempt.
One of:
-
source: "manual"
-
recurringPaymentId·string· required -
initiatedByKeyId·string | null· required -
source·string· required · alwaysmanual
-
-
source: "automated"
-
recurringPaymentId·string· required -
initiatedByKeyId·string | null· required -
source·string· required · alwaysautomated
-
-
source: "retry"
-
recurringPaymentId·string· required -
initiatedByKeyId·string | null· required -
source·string· required · alwaysretry -
initialSource·string· required · one ofmanual,automated -
transferId·string | null· required -
error·string· required -
retryAfterAt·string· required
-
-
source: "linked_transfer"
-
recurringPaymentId·string· required -
initiatedByKeyId·string | null· required -
source·string· required · alwayslinked_transfer -
initialSource·string· required · one ofmanual,automated -
transferId·string· required
-
-
-
createdAt·string· required · formatdate-time· example2025-01-01T00:00:00.000ZISO 8601 timestamp.
-
updatedAt·string· required · formatdate-time· example2025-01-01T00:00:00.000ZISO 8601 timestamp.
-
-
-
meta·object· requiredResponse metadata.
-
requestId·string· required · min length 1 · examplereq_exampleRequest identifier for tracing.
-
timestamp·string· required · formatdate-time· example2025-01-01T00:00:00.000ZISO 8601 timestamp.
-
-
-
400Bad Request-
error·object· requiredStandard error payload.
-
code·string· requiredMachine-readable error code.
-
message·string· requiredHuman-readable error message.
-
details·objectOptional error details for debugging.
*·any
-
-
meta·object-
requestId·string· min length 1 · examplereq_exampleRequest identifier for tracing.
-
-
-
401UnauthorizedSame fields as
400. -
403Forbidden. Requires therecurring.executeaction: an API key must hold it (a module'smanageorexecutealso covers itsread), and a signed-in member's organization role must include it. Without it the error is INSUFFICIENT_PERMISSIONS anderror.details.actionnames the action. Any other 403 names its own reason.Same fields as
400. -
404Not FoundSame fields as
400. -
409ConflictSame fields as
400. -
500Internal Server ErrorSame fields as
400. -
503Service UnavailableSame fields as
400.