POST
/
v1
/
payment_intents
/
{id}
/
cancel
Cancel Payment Intent
curl --request POST \
  --url https://api.withflex.com/v1/payment_intents/{id}/cancel \
  --header 'Authorization: Bearer <token>'
{
  "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>"
      },
      "metadata": {},
      "created_at": "<string>",
      "test_mode": true
    },
    "transfer_data": {
      "amount": 123,
      "destination": "<string>"
    },
    "status": "canceled",
    "latest_charge": "<string>",
    "created_at": "<string>",
    "invoice": {
      "invoice_id": "<string>",
      "total": 123,
      "amount_due": 123,
      "amount_paid": 123,
      "payment_intent": {},
      "charge": "<string>",
      "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>"
        },
        "metadata": {},
        "created_at": "<string>",
        "test_mode": true
      },
      "period_end": "<string>",
      "period_start": "<string>",
      "subscription": {
        "subscription_id": "<string>",
        "created_at": "<string>",
        "items": [
          {
            "subscription_item_id": "<string>",
            "price": {
              "price_id": "<string>",
              "description": "<string>",
              "trial_period_days": 123,
              "unit_amount": 123,
              "recurring": {
                "interval": "daily",
                "interval_count": 1,
                "trial_period_days": 1
              },
              "active": true,
              "product": {},
              "created_at": "<string>",
              "type": "one_time",
              "metadata": {},
              "hsa_fsa_eligibility": "not_eligible",
              "test_mode": true
            },
            "quantity": 123,
            "created_at": "<string>",
            "updated_at": "<string>",
            "test_mode": true
          }
        ],
        "latest_invoice": {},
        "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>"
          },
          "metadata": {},
          "created_at": "<string>",
          "test_mode": true
        },
        "status": "incomplete",
        "cancel_at_period_end": true,
        "current_period_end": "<string>",
        "current_period_start": "<string>",
        "metadata": {},
        "test_mode": true,
        "client_secret": {
          "setup_secret": "<string>",
          "payment_secret": "<string>"
        },
        "proration_behavior": "always_invoice",
        "trial_start": "<string>",
        "trial_end": "<string>",
        "cancel_at": "<string>"
      },
      "status": "draft",
      "collection_method": "charge_automatically",
      "test_mode": true,
      "metadata": {}
    },
    "capture_method": "automatic",
    "client_secret": "<string>",
    "metadata": {},
    "payment_method": "<string>",
    "test_mode": true,
    "transfer_group": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Use a Bearer token to access this API.

Response

200
application/json

The response is of type object.