Skip to content
API reference/Client billing

Mark an invoice unpaid

Try it

Puts a PAID invoice back to waiting for payment. Refused when it was paid by card — refund that in your Stripe account.

POST/api/v1/invoices/{invoice_id}/mark-unpaid

Authentication

An API key as Authorization: Bearer or x-api-key. It needs the invoices:write scope — write, send, mark paid and void client invoices; run monthly invoices; start and stop card autopay.

invoices:writeChanges the draft or a recordIdempotency-Key requiredMCP tool: mark_invoice_unpaid

Parameters

Named placeholders go in the path; the rest in a JSON body.

invoice_idstringPath · required
The invoice's id.1 to 100 characters

Response

200 with JSON on success (schema on the right). Errors use the standard envelope; a retry with the same Idempotency-Key gets the first answer back (how retries work).

curl
curl -X POST 'https://websites.workflowcorp.com/api/v1/invoices/INVOICE_ID/mark-unpaid' \
  -H "Authorization: Bearer $WEBSITEBUDDY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
Example arguments
{
  "invoice_id": "INVOICE_ID"
}
Response schema
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "number": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "label": {
      "type": "string",
      "description": "\"INV-1001\"."
    },
    "status": {
      "type": "string",
      "enum": [
        "draft",
        "sent",
        "paid",
        "void"
      ]
    },
    "client_id": {
      "type": "string"
    },
    "client_name": {
      "type": "string"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "site_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "period": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "YYYY-MM the invoice is for, if any."
    },
    "lines": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string"
          },
          "quantity": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "unit_cents": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "total_cents": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "description",
          "quantity",
          "unit_cents",
          "total_cents"
        ],
        "additionalProperties": false
      }
    },
    "total_cents": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "currency": {
      "type": "string"
    },
    "issued_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "due_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "paid_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "note": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "monthly": {
      "type": "boolean",
      "description": "Made by the monthly run (one per site per month)."
    },
    "on_autopay": {
      "type": "boolean",
      "description": "Charged to the client's card on file — it marks itself paid; mark_invoice_paid is refused."
    },
    "paid_by_card": {
      "type": "boolean"
    },
    "pay_link": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "The client's card payment page, while it waits for payment and cards are on."
    },
    "emailed_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "is_sample": {
      "type": "boolean"
    },
    "created_at": {
      "type": "string"
    },
    "updated_at": {
      "type": "string"
    },
    "message": {
      "type": "string",
      "description": "What happened, in plain words."
    }
  },
  "required": [
    "id",
    "number",
    "label",
    "status",
    "client_id",
    "client_name",
    "site_id",
    "site_name",
    "period",
    "lines",
    "total_cents",
    "currency",
    "issued_at",
    "due_at",
    "paid_at",
    "note",
    "monthly",
    "on_autopay",
    "paid_by_card",
    "pay_link",
    "emailed_at",
    "is_sample",
    "created_at",
    "updated_at",
    "message"
  ],
  "additionalProperties": false
}