Payment Intents
Cancel Payment Intent
Cancels a PaymentIntent
POST
/
v1
/
payment_intents
/
{id}
/
cancel
Copy
curl --request POST \
--url https://api.withflex.com/v1/payment_intents/{id}/cancel \
--header 'Authorization: Bearer <token>'
Copy
{
"payment_intent": {
"payment_intent_id": "<string>",
"amount": 123,
"amount_capturable": 123,
"amount_received": 123,
"application_fee_amount": 123,
"customer": {
"customer_id": "fcus_01HACM7FZ1084XB1GB6053VM0D",
"first_name": "John",
"last_name": "Doe",
"email": "joh.doe@example.com",
"phone": "+15555555555",
"employer": "Flex",
"shipping": {
"shipping_address_id": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"created_at": "<string>",
"test_mode": true
},
"transfer_data": {
"amount": 123,
"destination": "<string>"
},
"status": "canceled",
"latest_charge": "<string>",
"created_at": "<string>",
"invoice": "<string>",
"capture_method": "automatic",
"client_secret": "<string>",
"metadata": {},
"payment_method": "<string>",
"test_mode": true,
"transfer_group": "<string>"
}
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Response
200
application/json
The response is of type object
.
Copy
curl --request POST \
--url https://api.withflex.com/v1/payment_intents/{id}/cancel \
--header 'Authorization: Bearer <token>'
Copy
{
"payment_intent": {
"payment_intent_id": "<string>",
"amount": 123,
"amount_capturable": 123,
"amount_received": 123,
"application_fee_amount": 123,
"customer": {
"customer_id": "fcus_01HACM7FZ1084XB1GB6053VM0D",
"first_name": "John",
"last_name": "Doe",
"email": "joh.doe@example.com",
"phone": "+15555555555",
"employer": "Flex",
"shipping": {
"shipping_address_id": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"created_at": "<string>",
"test_mode": true
},
"transfer_data": {
"amount": 123,
"destination": "<string>"
},
"status": "canceled",
"latest_charge": "<string>",
"created_at": "<string>",
"invoice": "<string>",
"capture_method": "automatic",
"client_secret": "<string>",
"metadata": {},
"payment_method": "<string>",
"test_mode": true,
"transfer_group": "<string>"
}
}
Assistant
Responses are generated using AI and may contain mistakes.