Payments
Cancel Payment Intent
Cancel an existing payment intent
Cancel an existing payment intent.
Endpoint
POST /api/intents/{intent_id}/cancel
Authentication: Required (API Key or Intent Token)
Important Restrictions
- Can only cancel intents in
selectionstatus - Intents that are
pending,success, orfailedcannot be canceled - Prevents inconsistencies with payment processors
Parameters
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
intent_id | UUID | Yes | The payment intent ID |
Example Request
curl -X POST "https://app.infinic.com/api/intents/550e8400-e29b-41d4-a716-446655440000/cancel" \
-H "Authorization: Bearer YOUR_API_KEY"
const response = await fetch(
`https://app.infinic.com/api/intents/${intentId}/cancel`,
{
method: "POST",
headers: { Authorization: `Bearer ${YOUR_API_KEY}` },
},
);
const result = await response.json();
Response
Success (200 OK)
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"status": "canceled",
"success": true,
"redirect_url": null
}
Use Cases
- Customer abandons checkout
- Merchant cancels order before payment
- Clean up stale intents