Update a draft invoice

How to update a draft invoice

Update a Draft Invoice

If you want to update the invoice's details, you can do so through the API:

curl --request PATCH \
	-u 'ORGANIZATION_ID:API_KEY' \
	--url https://app.moderntreasury.com/api/invoices/4470104e-0921-4054-a0bc-98531262ea83 \
	--header 'content-type: application/json' \
	--data '{
	  "description": "This invoice is due at the end of the month.",
	  "invoicer_address": {
		"line1": "8480 Jerde Harbors",
		"line2": "Suite 579",
		"locality": "Carrollshire",
		"region": "MD",
		"postal_code": "21144",
		"country": "US"
	  }
	}'

To see the complete list of invoice fields you can update, visit our API reference docs.

Add additional line items to an invoice

When adding invoice line items to an existing invoice, you can use the invoice ID to add additional line items. Each line item requires a separate API request.

curl --request POST \
	-u 'ORGANIZATION_ID:API_KEY' \
	--url https://app.moderntreasury.com/api/invoices/4470104e-0921-4054-a0bc-98531262ea83/invoice_line_items \
	--header 'content-type: application/json' \
	--data '{
      "direction": "debit",
      "name": "Croissant",
      "quantity": 5,
      "unit_amount": 600
	}'

See our API reference for invoice line items here.

Share an Invoice with a Counterparty

To mark the invoice as ready-to-collect, update the invoice, indicating if you want to include the embedded payment UI and updating the invoice status to unpaid.

curl --request PATCH \
	-u 'ORGANIZATION_ID:API_KEY' \
	--url https://app.moderntreasury.com/api/invoices/4470104e-0921-4054-a0bc-98531262ea83 \
	--header 'content-type: application/json' \
	--data '{
      "status": "unpaid",
      "payment_method": "ui"
	}'

Now, the invoice is ready-to-collect and you can send the invoice's counterparty the hosted URL.