Skip to main content
POST
/
v2
/
payment-links
/
{id}
/
cancel
Cancel Payment Link
curl --request POST \
  --url https://api.example.com/v2/payment-links/{id}/cancel

Cancel Payment Link

Cancel an active payment link to prevent it from being used. Only links with active status can be cancelled.

Authentication

Authorization: Bearer glm_test_YOUR_API_KEY

Path Parameters

ParameterTypeRequiredDescription
idstringYesPayment link ID (e.g., plink_abc123xyz)

Request Body

{
  "reason": "Customer requested cancellation"
}
ParameterTypeRequiredDescription
reasonstringNoReason for cancellation (max 500 chars)

Response

All monetary amounts are integers in cents (e.g., 4995 = $49.95).
{
  "id": "plink_abc123xyz",
  "amount": 4995,
  "currency": "USD",
  "description": "Premium Blood Pressure Monitor",
  "status": "cancelled",
  "cancelled_at": "2026-02-25T16:00:00Z",
  "cancellation_reason": "Customer requested cancellation"
}

Example

curl -X POST https://api.withgale.com/v2/payment-links/plink_abc123xyz/cancel \
  -H "Authorization: Bearer glm_test_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "reason": "Order cancelled by customer" }'

Cancellation Rules

Current StatusCan Cancel?Notes
activeYesStatus changes to cancelled
paidNoUse Create Refund instead
expiredNoAlready expired
cancelledNoAlready cancelled
Cancelled links cannot be reactivated. Create a new link if needed.

Webhooks

Cancelling a link triggers a payment_link.cancelled webhook event. See Webhooks Reference for details.

Errors

Status CodeError CodeDescription
400invalid_stateLink is not in cancellable state
401unauthorizedInvalid or missing API key
404not_foundPayment link not found