Skip to main content
POST
/
v1
/
invoices
/
{id}
/
mark_uncollectible
Mark Invoice Uncollectible
curl --request POST \
  --url https://api.withflex.com/v1/invoices/{id}/mark_uncollectible \
  --header 'Authorization: Bearer <token>'
{
  "invoice": {
    "invoice_id": "<string>",
    "total": 123,
    "amount_due": 123,
    "amount_paid": 123,
    "status": "draft",
    "collection_method": "charge_automatically",
    "test_mode": true,
    "payment_intent": {
      "payment_intent_id": "<string>",
      "amount": 123,
      "status": "canceled",
      "created_at": "<string>",
      "capture_method": "automatic",
      "test_mode": true,
      "amount_capturable": 123,
      "amount_received": 123,
      "application_fee_amount": 123,
      "customer": {
        "customer_id": "fcus_01HACM7FZ1084XB1GB6053VM0D",
        "first_name": "John",
        "last_name": "Doe",
        "email": "[email protected]",
        "created_at": "<string>",
        "test_mode": true,
        "phone": "+15555555555",
        "employer": "Flex",
        "shipping": {
          "shipping_address_id": "<string>",
          "line1": "<string>",
          "line2": "<string>",
          "city": "<string>",
          "state": "<string>",
          "postal_code": "<string>",
          "country": "<string>"
        },
        "metadata": {}
      },
      "transfer_data": {
        "destination": "<string>",
        "amount": 123
      },
      "latest_charge": "<string>",
      "invoice": {},
      "client_secret": "<string>",
      "metadata": {},
      "payment_method": {
        "payment_method_id": "<string>",
        "billing_details": {
          "email": 123,
          "address": {
            "line1": "<string>",
            "line2": "<string>",
            "city": "<string>",
            "state": "<string>",
            "postal_code": "<string>",
            "country": "<string>"
          },
          "name": "<string>",
          "phone": "<string>"
        },
        "customer": {
          "customer_id": "fcus_01HACM7FZ1084XB1GB6053VM0D",
          "first_name": "John",
          "last_name": "Doe",
          "email": "[email protected]",
          "created_at": "<string>",
          "test_mode": true,
          "phone": "+15555555555",
          "employer": "Flex",
          "shipping": {
            "shipping_address_id": "<string>",
            "line1": "<string>",
            "line2": "<string>",
            "city": "<string>",
            "state": "<string>",
            "postal_code": "<string>",
            "country": "<string>"
          },
          "metadata": {}
        },
        "card": {
          "brand": "american_express",
          "country": "<string>",
          "exp_month": 123,
          "exp_year": 123,
          "fingerprint": "<string>",
          "funding": "credit",
          "last4": "<string>"
        },
        "created_at": "<string>",
        "test_mode": true,
        "off_session": true,
        "metadata": {}
      },
      "transfer_group": "<string>",
      "payment_card_type": "<unknown>"
    },
    "charge": "<string>",
    "customer": {
      "customer_id": "fcus_01HACM7FZ1084XB1GB6053VM0D",
      "first_name": "John",
      "last_name": "Doe",
      "email": "[email protected]",
      "created_at": "<string>",
      "test_mode": true,
      "phone": "+15555555555",
      "employer": "Flex",
      "shipping": {
        "shipping_address_id": "<string>",
        "line1": "<string>",
        "line2": "<string>",
        "city": "<string>",
        "state": "<string>",
        "postal_code": "<string>",
        "country": "<string>"
      },
      "metadata": {}
    },
    "period_end": "<string>",
    "period_start": "<string>",
    "subscription": {
      "subscription_id": "<string>",
      "created_at": "<string>",
      "items": [
        {
          "subscription_item_id": "<string>",
          "price": {
            "price_id": "<string>",
            "unit_amount": 123,
            "active": true,
            "product": {
              "product_id": "<string>",
              "name": "<string>",
              "created_at": "<string>",
              "active": true,
              "hsa_fsa_eligibility": "not_eligible",
              "test_mode": true,
              "description": "<string>",
              "document_description": "<string>",
              "visit_type": "cbtSleep",
              "upc_code": "<string>",
              "gtin": "<string>",
              "reference_gtin": "<string>",
              "metadata": {},
              "url": "<string>"
            },
            "created_at": "<string>",
            "type": "one_time",
            "test_mode": true,
            "description": "<string>",
            "trial_period_days": 123,
            "recurring": {
              "interval": "daily",
              "interval_count": 1,
              "trial_period_days": 1
            },
            "metadata": {},
            "hsa_fsa_eligibility": "not_eligible"
          },
          "quantity": 123,
          "created_at": "<string>",
          "test_mode": true,
          "updated_at": "<string>"
        }
      ],
      "status": "incomplete",
      "cancel_at_period_end": true,
      "test_mode": true,
      "latest_invoice": {},
      "customer": {
        "customer_id": "fcus_01HACM7FZ1084XB1GB6053VM0D",
        "first_name": "John",
        "last_name": "Doe",
        "email": "[email protected]",
        "created_at": "<string>",
        "test_mode": true,
        "phone": "+15555555555",
        "employer": "Flex",
        "shipping": {
          "shipping_address_id": "<string>",
          "line1": "<string>",
          "line2": "<string>",
          "city": "<string>",
          "state": "<string>",
          "postal_code": "<string>",
          "country": "<string>"
        },
        "metadata": {}
      },
      "current_period_end": "<string>",
      "current_period_start": "<string>",
      "metadata": {},
      "client_secret": {
        "setup_secret": "<string>",
        "payment_secret": "<string>"
      },
      "proration_behavior": "always_invoice",
      "trial_start": "<string>",
      "trial_end": "<string>",
      "cancel_at": "<string>",
      "default_payment_method": {
        "payment_method_id": "<string>",
        "billing_details": {
          "email": 123,
          "address": {
            "line1": "<string>",
            "line2": "<string>",
            "city": "<string>",
            "state": "<string>",
            "postal_code": "<string>",
            "country": "<string>"
          },
          "name": "<string>",
          "phone": "<string>"
        },
        "customer": {
          "customer_id": "fcus_01HACM7FZ1084XB1GB6053VM0D",
          "first_name": "John",
          "last_name": "Doe",
          "email": "[email protected]",
          "created_at": "<string>",
          "test_mode": true,
          "phone": "+15555555555",
          "employer": "Flex",
          "shipping": {
            "shipping_address_id": "<string>",
            "line1": "<string>",
            "line2": "<string>",
            "city": "<string>",
            "state": "<string>",
            "postal_code": "<string>",
            "country": "<string>"
          },
          "metadata": {}
        },
        "card": {
          "brand": "american_express",
          "country": "<string>",
          "exp_month": 123,
          "exp_year": 123,
          "fingerprint": "<string>",
          "funding": "credit",
          "last4": "<string>"
        },
        "created_at": "<string>",
        "test_mode": true,
        "off_session": true,
        "metadata": {}
      }
    },
    "metadata": {}
  }
}

Authorizations

Authorization
string
header
required

Use a Bearer token to access this API.

Response

invoice
object
required