# Update a draft

`POST https://morzepay.com/v1/invoices/{invoice_id}`

POST`/v1/invoices/{invoice_id}`

Changes a draft. Send only the fields you want to change; they take the same values as in [Create an invoice](https://morzepay.com/docs/api/create-invoice). Once an invoice is finalized, only `metadata` can change: to change anything else, void it and create a new one.

Permission`invoices:write`

### Path parameters

`invoice_id`stringrequired

The invoice, such as `inv_UfwyBh1W4Jfa6iG2u2AVT3`.

### Body

JSON, with `Content-Type: application/json`.

`customer`object

Replaces the customer.

Show child attributes

`name`stringrequired

The customer’s name.

`email`string

Needed to email the invoice and the receipt.

`phone`string

Needed to text the invoice. It also fills in the payment page.

`address`string

Printed on the invoice.

`items`array

Replaces all the lines.

Show child attributes

`description`stringrequired

What the line is for.

`quantity`integerrequired

How many.

`unit_amount`integerrequired

The price of one, in whole UGX.

`tax_percent`number

`due_date`string

`days_until_due`integer

`wallet_id`string

`fee_bearer`string

`memo`string

`footer`string

`reference`string

`metadata`object

Up to 20 keys of your own, with simple values. Returned on the object and in webhooks.

### Returns

The updated invoice.

### Errors

| Status | Code | When |
| 409 | INVOICE_NOT_DRAFT | Only drafts can be edited (except metadata). |

The common codes, such as `UNAUTHENTICATED` and `RATE_LIMITED`, can come from any endpoint. See [Errors](https://morzepay.com/docs/api#errors).



## Example request

```bash
curl -X POST "https://morzepay.com/v1/invoices/inv_UfwyBh1W4Jfa6iG2u2AVT3" \
  -H "Authorization: Bearer $MORZEPAY_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "memo": "Thank you for your business.",
  "days_until_due": 30
}'
```

## Example response (200)

```json
{
  "success": true,
  "data": {
    "id": "inv_UfwyBh1W4Jfa6iG2u2AVT3",
    "object": "invoice",
    "livemode": true,
    "number": null,
    "status": "draft",
    "past_due": false,
    "wallet_id": "wal_8fK2mQx7RtP4nVb9LcHs2w",
    "currency": "UGX",
    "customer": {
      "name": "Sarah Namuli",
      "email": "sarah@example.com",
      "phone": "+256772418905",
      "address": null
    },
    "lines": [
      {
        "description": "Website design (5 pages)",
        "quantity": 1,
        "unit_amount": "450000.00",
        "amount": "450000.00"
      },
      {
        "description": "Hosting, 12 months",
        "quantity": 2,
        "unit_amount": "75000.00",
        "amount": "150000.00"
      }
    ],
    "subtotal": "600000.00",
    "tax_percent": 18,
    "tax": "108000.00",
    "total": "708000.00",
    "amount_paid": "0.00",
    "amount_due": "708000.00",
    "fee_bearer": "wallet",
    "due_date": "2026-11-03",
    "memo": "Thank you for your business.",
    "footer": null,
    "reference": "order-1001",
    "metadata": null,
    "hosted_invoice_url": null,
    "invoice_pdf": null,
    "receipt_id": null,
    "receipt_url": null,
    "transaction_id": null,
    "paid_out_of_band": false,
    "created_at": "2026-10-04T10:00:12+03:00",
    "finalized_at": null,
    "sent_at": null,
    "paid_at": null,
    "voided_at": null
  }
}
```
