Cancel payment request
Cancels an open payment request, so its payment link stops building and sponsoring transactions.
POST/Run in dashboard
Requires payment_requests.manage. Canceling a request that is already canceled returns it unchanged. A paid or expired request returns 409, and so does one whose fee-sponsored transaction can still land: retry once that transaction's blockhash expires. A payer who signed before the cancel can still land the payment; SDP records it as paid, with paidLate set when it landed after the cancel.
Requires an API key with the payment_requests.manage action.
Path parameters
-
paymentRequestId·string· required · min length 1 · examplepreq_exampleSDP payment request ID.
Headers
-
x-project-id·string· min length 1 · exampleprj_exampleRequired for dashboard sessions. API keys use their assigned project.
-
Idempotency-Key·stringUse a unique 1–255 printable ASCII key per operation. Reuse it with the same request on retries. An in-flight attempt returns
409; a changed request returns422. Retry and recovery rules.
Responses
-
200Payment request canceled-
data·object· requiredA payment request. Reads never carry its link token.
-
id·string· required · examplepreq_exampleSDP payment request ID.
-
organizationId·string· requiredOrganization ID.
-
projectId·string | null· requiredProject ID.
-
walletId·string· requiredReceiving custody wallet's provider ID.
-
destinationAddress·string· required · min length 32 · max length 44 · exampleSo11111111111111111111111111111111111111112Address the payment is sent to.
-
token·string· requiredToken mint address.
-
amount·string· required · example100.00Token amount in UI units (decimal string).
-
reference·string· required · min length 32 · max length 44 · exampleSo11111111111111111111111111111111111111112Solana Pay reference account that identifies the payment on chain.
-
status·string· required · one ofawaiting_payment,paid,canceled,expired· examplecanceledPayment request status.
awaiting_paymentis open;paidwas settled by an on-chain payment;canceledandexpiredclosed without one. -
expiresAt·string | null· required · formatdate-time· example2025-01-01T00:00:00.000ZExpiry, if any.
-
fulfilledByTransferId·string | null· requiredThe inbound transfer that paid the request.
-
paidLate·boolean· requiredWhether the payment landed after the request expired or was canceled. A payer who signed before then can still pay.
-
lastCheckedAt·string | null· required · formatdate-time· example2025-01-01T00:00:00.000ZWhen SDP last read the chain for the payment.
-
canceledByApiKeyId·string | null· requiredThe API key that canceled the request; null when a member did, or it is not canceled.
-
canceledByUserId·string | null· requiredUser ID of the member who canceled the request; null when an API key did, or it is not canceled.
-
canceledAt·string | null· required · formatdate-time· example2025-01-01T00:00:00.000ZWhen it was canceled.
-
lifecycle·object[]· requiredEvery status the request entered, oldest first.
-
status·string· required · one ofawaiting_payment,paid,canceled,expired· examplecanceledPayment request status.
awaiting_paymentis open;paidwas settled by an on-chain payment;canceledandexpiredclosed without one. -
at·string· required · formatdate-time· example2025-01-01T00:00:00.000ZISO 8601 timestamp.
-
-
createdBy·string | null· requiredUser ID of the member, or of the API key's creator, who created it.
-
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 thepayment_requests.manageaction: 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. -
422Unprocessable EntitySame fields as
400. -
500Internal Server ErrorSame fields as
400. -
502Bad GatewaySame fields as
400.
Example request
curl -X POST 'https://api.solana.com/v1/payments/requests/preq_example/cancel' \
-H "Authorization: Bearer $SDP_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"Example responses
{
"data": {
"id": "preq_example",
"organizationId": "organization_example",
"projectId": "project_example",
"walletId": "wallet_example",
"destinationAddress": "So11111111111111111111111111111111111111112",
"token": "example",
"amount": "100.00",
"reference": "So11111111111111111111111111111111111111112",
"status": "canceled",
"expiresAt": "2025-01-01T00:00:00.000Z",
"fulfilledByTransferId": "fulfilledbytransfer_example",
"paidLate": false,
"lastCheckedAt": "2025-01-01T00:00:00.000Z",
"canceledByApiKeyId": "canceledbyapikey_example",
"canceledByUserId": "canceledbyuser_example",
"canceledAt": "2025-01-01T00:00:00.000Z",
"lifecycle": [
{
"status": "canceled",
"at": "2025-01-01T00:00:00.000Z"
}
],
"createdBy": "example",
"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"
}
}Error responses use the standard error shape.