Update an invoice

Updates an invoice.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/invoices.write scope.

PATCH
/accounts/{accountID}/invoices/{invoiceID}
cURL Java TypeScript Python PHP Ruby
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
curl -X PATCH "https://api.moov.io/accounts/{accountID}/invoices/{invoiceID}" \
  -H "Authorization: Bearer {token}" \
  --data '{
    "description": "string",
    "lineItems": {
      "items": [
        {
          "name": "string",
          "basePrice": {
            "currency": "USD",
            "valueDecimal": "13.987654321"
          },
          "quantity": 2,
          "options": [
            {
              "name": "string",
              "quantity": 1,
              "priceModifier": {
                "currency": "USD",
                "valueDecimal": "1.00"
              },
              "group": "string"
            }
          ],
          "productID": "dbb08e34-cbbb-47d7-824b-bc71f5b00e6c"
        }
      ]
    },
    "dueDate": "2025-08-24T14:15:22Z",
    "invoiceDate": "2025-08-24T14:15:22Z",
    "status": "draft",
    "taxAmount": {
      "currency": "USD",
      "valueDecimal": "12.987654321"
    }
  }'\
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package hello.world;

import java.lang.Exception;
import java.util.List;
import org.openapis.openapi.Moov;
import org.openapis.openapi.models.components.*;
import org.openapis.openapi.models.errors.GenericError;
import org.openapis.openapi.models.errors.UpdateInvoiceError;
import org.openapis.openapi.models.operations.UpdateInvoiceResponse;

public class Application {

    public static void main(String[] args) throws GenericError, UpdateInvoiceError, Exception {

        Moov sdk = Moov.builder()
                .xMoovVersion("<value>")
                .security(Security.builder()
                    .username("")
                    .password("")
                    .build())
            .build();

        UpdateInvoiceResponse res = sdk.invoices().updateInvoice()
                .accountID("ce46d65a-8504-4afa-b3f7-303401bd08b3")
                .invoiceID("ef510999-370a-4350-87d5-bc81fc02a2ea")
                .updateInvoice(UpdateInvoice.builder()
                    .lineItems(CreateInvoiceLineItemsUpdate.builder()
                        .items(List.of(
                            CreateInvoiceLineItem.builder()
                                .name("<value>")
                                .basePrice(AmountDecimal.builder()
                                    .currency("USD")
                                    .valueDecimal("12.987654321")
                                    .build())
                                .quantity(984515)
                                .options(List.of(
                                    CreateInvoiceLineItemOption.builder()
                                        .name("<value>")
                                        .quantity(761923)
                                        .priceModifier(AmountDecimal.builder()
                                            .currency("USD")
                                            .valueDecimal("12.987654321")
                                            .build())
                                        .build()))
                                .build()))
                        .build())
                    .taxAmount(AmountDecimalUpdate.builder()
                        .currency("USD")
                        .valueDecimal("12.987654321")
                        .build())
                    .build())
                .call();

        if (res.invoice().isPresent()) {
            // handle response
        }
    }
}
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { Moov } from "@moovio/sdk";

const moov = new Moov({
  xMoovVersion: "<value>",
  security: {
    username: "",
    password: "",
  },
});

async function run() {
  const result = await moov.invoices.updateInvoice({
    accountID: "ce46d65a-8504-4afa-b3f7-303401bd08b3",
    invoiceID: "ef510999-370a-4350-87d5-bc81fc02a2ea",
    updateInvoice: {
      lineItems: {
        items: [
          {
            name: "<value>",
            basePrice: {
              currency: "USD",
              valueDecimal: "12.987654321",
            },
            quantity: 984515,
            options: [
              {
                name: "<value>",
                quantity: 761923,
                priceModifier: {
                  currency: "USD",
                  valueDecimal: "12.987654321",
                },
              },
            ],
          },
        ],
      },
      taxAmount: {
        currency: "USD",
        valueDecimal: "12.987654321",
      },
    },
  });

  console.log(result);
}

run();
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from moovio_sdk import Moov
from moovio_sdk.models import components


with Moov(
    x_moov_version="<value>",
    security=components.Security(
        username="",
        password="",
    ),
) as moov:

    res = moov.invoices.update_invoice(account_id="ce46d65a-8504-4afa-b3f7-303401bd08b3", invoice_id="ef510999-370a-4350-87d5-bc81fc02a2ea", line_items={
        "items": [
            {
                "name": "<value>",
                "base_price": {
                    "currency": "USD",
                    "value_decimal": "12.987654321",
                },
                "quantity": 984515,
                "options": [
                    {
                        "name": "<value>",
                        "quantity": 761923,
                        "price_modifier": {
                            "currency": "USD",
                            "value_decimal": "12.987654321",
                        },
                    },
                ],
            },
        ],
    }, tax_amount={
        "currency": "USD",
        "value_decimal": "12.987654321",
    })

    # Handle response
    print(res)
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using Moov.Sdk;
using Moov.Sdk.Models.Components;
using System.Collections.Generic;

var sdk = new MoovClient(xMoovVersion: "<value>");

var res = await sdk.Invoices.UpdateInvoiceAsync(
    accountID: "ce46d65a-8504-4afa-b3f7-303401bd08b3",
    invoiceID: "ef510999-370a-4350-87d5-bc81fc02a2ea",
    body: new UpdateInvoice() {
        LineItems = new CreateInvoiceLineItemsUpdate() {
            Items = new List<CreateInvoiceLineItem>() {
                new CreateInvoiceLineItem() {
                    Name = "<value>",
                    BasePrice = new AmountDecimal() {
                        Currency = "USD",
                        ValueDecimal = "12.987654321",
                    },
                    Quantity = 984515,
                    Options = new List<CreateInvoiceLineItemOption>() {
                        new CreateInvoiceLineItemOption() {
                            Name = "<value>",
                            Quantity = 761923,
                            PriceModifier = new AmountDecimal() {
                                Currency = "USD",
                                ValueDecimal = "12.987654321",
                            },
                        },
                    },
                },
            },
        },
        TaxAmount = new AmountDecimalUpdate() {
            Currency = "USD",
            ValueDecimal = "12.987654321",
        },
    }
);

// handle response
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
declare(strict_types=1);

require 'vendor/autoload.php';

use Moov\MoovPhp;
use Moov\MoovPhp\Models\Components;

$sdk = MoovPhp\Moov::builder()
    ->setXMoovVersion('<value>')
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$updateInvoice = new Components\UpdateInvoice(
    lineItems: new Components\CreateInvoiceLineItemsUpdate(
        items: [
            new Components\CreateInvoiceLineItem(
                name: '<value>',
                basePrice: new Components\AmountDecimal(
                    currency: 'USD',
                    valueDecimal: '12.987654321',
                ),
                quantity: 984515,
                options: [
                    new Components\CreateInvoiceLineItemOption(
                        name: '<value>',
                        quantity: 761923,
                        priceModifier: new Components\AmountDecimal(
                            currency: 'USD',
                            valueDecimal: '12.987654321',
                        ),
                    ),
                ],
            ),
        ],
    ),
    taxAmount: new Components\AmountDecimalUpdate(
        currency: 'USD',
        valueDecimal: '12.987654321',
    ),
);

$response = $sdk->invoices->updateInvoice(
    accountID: 'ce46d65a-8504-4afa-b3f7-303401bd08b3',
    invoiceID: 'ef510999-370a-4350-87d5-bc81fc02a2ea',
    updateInvoice: $updateInvoice

);

if ($response->invoice !== null) {
    // handle response
}
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
require 'moov_ruby'

Models = ::Moov::Models
s = ::Moov::Client.new(
      x_moov_version: '<value>',
    )

res = s.invoices.update_invoice(account_id: 'ce46d65a-8504-4afa-b3f7-303401bd08b3', invoice_id: 'ef510999-370a-4350-87d5-bc81fc02a2ea', update_invoice: Models::Components::UpdateInvoice.new(
  line_items: Models::Components::CreateInvoiceLineItemsUpdate.new(
    items: [
      Models::Components::CreateInvoiceLineItem.new(
        name: '<value>',
        base_price: Models::Components::AmountDecimal.new(
          currency: 'USD',
          value_decimal: '12.987654321',
        ),
        quantity: 984_515,
        options: [
          Models::Components::CreateInvoiceLineItemOption.new(
            name: '<value>',
            quantity: 761_923,
            price_modifier: Models::Components::AmountDecimal.new(
              currency: 'USD',
              value_decimal: '12.987654321',
            ),
          ),
        ],
      ),
    ],
  ),
  tax_amount: Models::Components::AmountDecimalUpdate.new(
    currency: 'USD',
    value_decimal: '12.987654321',
  ),
))

unless res.invoice.nil?
  # handle response
end
200 400 401 403 404 409 422 429 500 504
The request completed successfully.
application/json
{
  "invoiceID": "4f03a727-9c4b-43a5-b699-271a3e6fdc9c",
  "invoiceNumber": "INV-1001",
  "description": "string",
  "customerAccountID": "d8b40343-5784-4096-8d40-9f3b4a834066",
  "partnerAccountID": "c197cd40-7745-4413-8f3b-ec962d1b5225",
  "status": "draft",
  "lineItems": {
    "items": [
      {
        "options": [
          {
            "images": [
              {
                "imageID": "bbdcb050-2e05-43cb-812a-e1296cd0c01a",
                "altText": "string",
                "link": "https://api.moov.io/images/q7lKWleAy9fUNhEGezQ1g",
                "publicID": "string"
              }
            ],
            "name": "string",
            "quantity": 1,
            "priceModifier": {
              "currency": "USD",
              "valueDecimal": "12.987654321"
            },
            "group": "string"
          }
        ],
        "images": [
          {
            "imageID": "bbdcb050-2e05-43cb-812a-e1296cd0c01a",
            "altText": "string",
            "link": "https://api.moov.io/images/q7lKWleAy9fUNhEGezQ1g",
            "publicID": "string"
          }
        ],
        "name": "string",
        "basePrice": {
          "currency": "USD",
          "valueDecimal": "12.987654321"
        },
        "quantity": 1,
        "productID": "dbb08e34-cbbb-47d7-824b-bc71f5b00e6c"
      }
    ]
  },
  "subtotalAmount": {
    "currency": "USD",
    "valueDecimal": "12.987654321"
  },
  "taxAmount": {
    "currency": "USD",
    "valueDecimal": "12.987654321"
  },
  "totalAmount": {
    "currency": "USD",
    "valueDecimal": "12.987654321"
  },
  "pendingAmount": {
    "currency": "USD",
    "valueDecimal": "12.987654321"
  },
  "paidAmount": {
    "currency": "USD",
    "valueDecimal": "12.987654321"
  },
  "refundedAmount": {
    "currency": "USD",
    "valueDecimal": "12.987654321"
  },
  "disputedAmount": {
    "currency": "USD",
    "valueDecimal": "12.987654321"
  },
  "paymentLinkCode": "string",
  "payments": [
    {
      "paymentType": "transfer",
      "transfer": {
        "paymentType": "transfer",
        "transferID": "e23de6dd-5168-4e1d-894d-807fa691dc80"
      },
      "external": {
        "paymentType": "external",
        "description": "string",
        "foreignID": "string",
        "paymentDate": "2019-08-24T14:15:22Z",
        "amount": {
          "currency": "USD",
          "valueDecimal": "12.987654321"
        }
      }
    }
  ],
  "createdOn": "2019-08-24T14:15:22Z",
  "invoiceDate": "2019-08-24T14:15:22Z",
  "dueDate": "2019-08-24T14:15:22Z",
  "sentOn": "2019-08-24T14:15:22Z",
  "paidOn": "2019-08-24T14:15:22Z",
  "canceledOn": "2019-08-24T14:15:22Z"
}

x-request-id

string <uuid> required
A unique identifier used to trace requests.
The server could not understand the request due to invalid syntax.
application/json
{
  "error": "string"
}

x-request-id

string <uuid> required
A unique identifier used to trace requests.
The request contained missing or expired authentication.

x-request-id

string <uuid> required
A unique identifier used to trace requests.
The user is not authorized to make the request.

x-request-id

string <uuid> required
A unique identifier used to trace requests.
The requested resource was not found.

x-request-id

string <uuid> required
A unique identifier used to trace requests.
The request conflicted with the current state of the target resource.
application/json
{
  "error": "string"
}

x-request-id

string <uuid> required
A unique identifier used to trace requests.
The request was well-formed, but the contents failed validation. Check the request for missing or invalid fields.
application/json
{
  "description": "string",
  "lineItems": {
    "items": {
      "property1": {
        "productID": "string",
        "name": "string",
        "basePrice": {
          "currency": "string",
          "valueDecimal": "string"
        },
        "options": {
          "property1": {
            "name": "string",
            "group": "string",
            "priceModifier": {
              "currency": "string",
              "valueDecimal": "string"
            },
            "quantity": "string"
          },
          "property2": {
            "name": "string",
            "group": "string",
            "priceModifier": {
              "currency": "string",
              "valueDecimal": "string"
            },
            "quantity": "string"
          }
        },
        "quantity": "string"
      },
      "property2": {
        "productID": "string",
        "name": "string",
        "basePrice": {
          "currency": "string",
          "valueDecimal": "string"
        },
        "options": {
          "property1": {
            "name": "string",
            "group": "string",
            "priceModifier": {
              "currency": "string",
              "valueDecimal": "string"
            },
            "quantity": "string"
          },
          "property2": {
            "name": "string",
            "group": "string",
            "priceModifier": {
              "currency": "string",
              "valueDecimal": "string"
            },
            "quantity": "string"
          }
        },
        "quantity": "string"
      }
    }
  },
  "invoiceDate": "string",
  "dueDate": "string",
  "status": "string",
  "taxAmount": {
    "currency": "string",
    "valueDecimal": "string"
  }
}

x-request-id

string <uuid> required
A unique identifier used to trace requests.
Request was refused due to rate limiting.

x-request-id

string <uuid> required
A unique identifier used to trace requests.
The request failed due to an unexpected error.

x-request-id

string <uuid> required
A unique identifier used to trace requests.
The request failed because a downstream service failed to respond.

x-request-id

string <uuid> required
A unique identifier used to trace requests.

Headers

X-Moov-Version

string

Specify an API version.

API versioning follows the format vYYYY.QQ.BB, where

  • YYYY is the year
  • QQ is the two-digit month for the first month of the quarter (e.g., 01, 04, 07, 10)
  • BB is the build number, starting at .01, for subsequent builds in the same quarter.
    • For example, v2024.01.00 is the initial release of the first quarter of 2024.

The latest version represents the most recent development state. It may include breaking changes and should be treated as a beta release. When no version is specified, the API defaults to v2024.01.00.

Path parameters

accountID

string <uuid> required

invoiceID

string <uuid> required

Body

application/json

description

string

dueDate

string<date-time> | null

invoiceDate

string<date-time> | null

lineItems

object
A collection of line items for an invoice.
Show child attributes

items

array<object>
The list of line items.
Show child attributes

basePrice

object required
The base price of the item before applying option modifiers.
Show child attributes

currency

string required Pattern
A 3-letter ISO 4217 currency code.

valueDecimal

string required Pattern

A decimal-formatted numerical string that represents up to 9 decimal place precision.

For example, $12.987654321 is '12.987654321'.

name

string [1 to 150] characters required
The name of the item.

quantity

integer<int32> required
The quantity of this item.

imageIDs

array<string>
Optional list of images associated with this line item.

options

array<object>
Optional list of modifiers applied to this item (e.g., toppings, upgrades, customizations).
Show child attributes

name

string [1 to 150] characters required
The name of the option or modifier.

quantity

integer<int32> required
The quantity of this option.

group

string <=100 characters
Optional group identifier to categorize related options (e.g., 'toppings').

imageIDs

array<string>
Optional list of images associated with this line item.

priceModifier

object
Optional price modification applied by this option. Can be positive, negative, or zero.
Show child attributes

currency

string required Pattern
A 3-letter ISO 4217 currency code.

valueDecimal

string required Pattern

A decimal-formatted numerical string that represents up to 9 decimal place precision.

For example, $12.987654321 is '12.987654321'.

productID

string<uuid>
Optional unique identifier associating the line item with a product.

status

string

The status can be updated to one of the following values under specific conditions:

  • canceled: Can only be set if the current status is draft, unpaid, or overdue.
  • unpaid: Can only be set if the current status is draft. Setting the status to unpaid finalizes the invoice and sends an email with a payment link to the customer.
Possible values: draft, unpaid, payment-pending, paid, overdue, canceled

taxAmount

object
Show child attributes

currency

string Pattern
A 3-letter ISO 4217 currency code.

valueDecimal

string Pattern

A decimal-formatted numerical string that represents up to 9 decimal place precision.

For example, $12.987654321 is '12.987654321'.

Response

application/json

createdOn

string<date-time> required

customerAccountID

string<uuid> required

description

string required

disputedAmount

object required
Total amount of disputes initiated against transfers paid towards the invoice
Show child attributes

currency

string required Pattern
A 3-letter ISO 4217 currency code.

valueDecimal

string required Pattern

A decimal-formatted numerical string that represents up to 9 decimal place precision.

For example, $12.987654321 is '12.987654321'.

invoiceID

string<uuid> required

invoiceNumber

string required

lineItems

object required
A collection of line items for an invoice.
Show child attributes

items

array<object> required
The list of line items.
Show child attributes

basePrice

object required
The base price of the item before applying option modifiers.
Show child attributes

currency

string required Pattern
A 3-letter ISO 4217 currency code.

valueDecimal

string required Pattern

A decimal-formatted numerical string that represents up to 9 decimal place precision.

For example, $12.987654321 is '12.987654321'.

name

string [1 to 150] characters required
The name of the item.

quantity

integer<int32> required
The quantity of this item.

images

array<object>
Optional list of images associated with this line item.

options

array<object>
Optional list of modifiers applied to this item (e.g., toppings, upgrades, customizations).
Show child attributes

name

string [1 to 150] characters required
The name of the option or modifier.

quantity

integer<int32> required
The quantity of this option.

group

string <=100 characters
Optional group identifier to categorize related options (e.g., 'toppings').

images

array<object>
Optional list of images associated with this line item option.
Show child attributes

altText

string <=125 characters
Alternative text for the image.

imageID

string<uuid>
Unique identifier for a image resource.

link

string<uri>
The image's public URL.

publicID

string Pattern
A unique identifier for an image, used in public image links.

priceModifier

object
Optional price modification applied by this option. Can be positive, negative, or zero.
Show child attributes

currency

string required Pattern
A 3-letter ISO 4217 currency code.

valueDecimal

string required Pattern

A decimal-formatted numerical string that represents up to 9 decimal place precision.

For example, $12.987654321 is '12.987654321'.

productID

string<uuid>
Optional unique identifier associating the line item with a product.

paidAmount

object required
Total amount of completed transfers paid towards the invoice
Show child attributes

currency

string required Pattern
A 3-letter ISO 4217 currency code.

valueDecimal

string required Pattern

A decimal-formatted numerical string that represents up to 9 decimal place precision.

For example, $12.987654321 is '12.987654321'.

partnerAccountID

string<uuid> required

pendingAmount

object required
Total amount of pending transfers paid towards the invoice
Show child attributes

currency

string required Pattern
A 3-letter ISO 4217 currency code.

valueDecimal

string required Pattern

A decimal-formatted numerical string that represents up to 9 decimal place precision.

For example, $12.987654321 is '12.987654321'.

refundedAmount

object required
Total amount of refunds initiated against transfers paid towards the invoice
Show child attributes

currency

string required Pattern
A 3-letter ISO 4217 currency code.

valueDecimal

string required Pattern

A decimal-formatted numerical string that represents up to 9 decimal place precision.

For example, $12.987654321 is '12.987654321'.

status

string<enum> required
Possible values: draft, unpaid, payment-pending, paid, overdue, canceled

subtotalAmount

object required
Show child attributes

currency

string required Pattern
A 3-letter ISO 4217 currency code.

valueDecimal

string required Pattern

A decimal-formatted numerical string that represents up to 9 decimal place precision.

For example, $12.987654321 is '12.987654321'.

taxAmount

object required
Show child attributes

currency

string required Pattern
A 3-letter ISO 4217 currency code.

valueDecimal

string required Pattern

A decimal-formatted numerical string that represents up to 9 decimal place precision.

For example, $12.987654321 is '12.987654321'.

totalAmount

object required
Total amount of the invoice, sum of subTotalAmount and taxAmount
Show child attributes

currency

string required Pattern
A 3-letter ISO 4217 currency code.

valueDecimal

string required Pattern

A decimal-formatted numerical string that represents up to 9 decimal place precision.

For example, $12.987654321 is '12.987654321'.

canceledOn

string<date-time>

dueDate

string<date-time>

invoiceDate

string<date-time>

paidOn

string<date-time>

paymentLinkCode

string

payments

array<object>
Show child attributes

external

object
Show child attributes

amount

object required
Show child attributes

currency

string required Pattern
A 3-letter ISO 4217 currency code.

valueDecimal

string required Pattern

A decimal-formatted numerical string that represents up to 9 decimal place precision.

For example, $12.987654321 is '12.987654321'.

description

string required

paymentType

string<enum> required
Possible values: external

foreignID

string

paymentDate

string<date-time>

paymentType

string<enum>
Possible values: transfer, external

transfer

object
Show child attributes

paymentType

string<enum> required
Possible values: transfer

transferID

string<uuid> required

sentOn

string<date-time>