---
title: "Updates an existing invoice"
method: POST
path: "/invoices/{id}"
tags: ["Invoices"]
---

# Updates an existing invoice

`POST /invoices/{id}`

Updates an existing invoice.

## Path parameters

- `id` string, required

## Request body

- UpdateInvoiceRequest
  - `metadata` Metadata — Key-value pairs used to store additional data. Value can be string, boolean or integer types.

## Response `200`

200 OK

- Invoice
  - `id` string — The unique identifier of the invoice.
  - `createdTime` string, date-time — The time at which the invoice was created.
  - `updatedTime` string, date-time — The time at which the invoice was last updated.
  - `customerId` string — The identifier of the invoiced customer.
  - `email` string, email — The email address of the invoiced customer.
  - `currency` string — A three-letter ISO 4217 currency code.
  - `description` string — An arbitrary string attached to the invoice.
  - `locale` string — A designator that combines the two-letter ISO 639-1 language code with the ISO 3166-1 alpha-2 country code.
  - `discount` Discount — The applied discount.
    - `amountOff` number, double — The discount expressed as an amount.
    - `percentOff` number, double — The discount expressed as a percentage.
  - `customerType` 'business' | 'individual' — The type of customer.
  - `sellingEntity` SellingEntity — Represents the local selling entity.
    - `id` string — The identifier of the selling entity.
    - `name` string — The name of the selling entity.
  - `taxIdentifiers` TaxIdentifier[]
    - `id` string — The identifier of the tax identifier.
    - `createdTime` string, date-time — The time when the tax identifier was created.
    - `customerId` string, nullable — The identifier of an existing customer.
    - `type` string — Type of tax identifier.
    - `value` string — The tax identifier.
    - `state` 'pending' | 'not_valid' | 'verified' — The verification state.
    - `stateTransitions` TaxIdentifierStateTransitions, nullable — A timestamp of when the state was updated.
      - `pending` string, date-time, nullable
      - `verified` string, date-time, nullable
      - `not_valid` string, date-time, nullable
    - `verifiedName` string, nullable — The registered name of the customer with this tax identifier.
    - `verifiedAddress` string, nullable — The registered address of the customer with this tax identifier.
    - `updatedTime` string, date-time — The time when the tax identifier was updated.
  - `subtotal` number, double — Represents the total amount of the order exclusive of tax.
  - `totalTax` number, double — Represents the total tax amount.
  - `totalFees` number, double — Represents the total fee amount.
  - `totalDuty` number, double — Represents the total duty amount.
  - `totalImporterTax` number, double — Represents the total tax amount from the importer of record.
  - `importerOfRecordTax` boolean, nullable — If <code>true</code>, indicates that the tax amount is paid by the importer of record.
  - `totalDiscount` number, double — Represents the total discount amount.
  - `totalShipping` number, double — Represents the total shipping amount.
  - `totalAmount` number, double — Represents the total charge amount.
  - `collectionPeriodDays` integer — The number of days that Digital River attempts to collect payment if <code>billingOptimization</code> is set to <code>true</code>. The default is 30 days.
  - `items` InvoiceItem[]
    - `id` string — The identifier of the item.
    - `skuId` string — The identifier of the stock keeping unit (SKU).
    - `productDetails` ProductDetails
      - `id` string — The identifier of the product in the upstream system.
      - `skuGroupId` string — The identifier of the SKU group.
      - `name` string — The name of the product.
      - `description` string — The description of the product.
      - `itemBreadcrumb` string — The full path to the category where item is included. Categories should be separated by “ > “.
      - `url` string — The product url.
      - `countryOfOrigin` string — The country of origin of the product.
      - `image` string — The image of the product.
      - `weight` number, double — The weight of the product measured in the unit specified by weightUnit.
      - `weightUnit` 'oz' | 'lb' | 'g' | 'kg' — The unit of measurement applied to the weight.
      - `partNumber` string — The manufacturer's part number.
      - `partnerAccountId` string — The unique, Digital River identifier (account Id) of the partner associated with the sku.
    - `subscriptionInfo` SubscriptionInfo — The subscription information of the item.
      - `freeTrial` boolean — If <code>true</code>, indicates that this is a free trial.
      - `autoRenewal` boolean — If <code>true</code>, indicates that renewals for this subscription are automatic rather than manual.
      - `terms` string — For auto renewal subscriptions, the terms displayed to the customer at acquisition.
      - `planId` string — The unique identifier of the plan
      - `subscriptionId` string — The subscription identifier.
      - `billingAgreementId` string — The Digital River billing agreement identifier.
      - `startTime` string, date-time — The start date and time of the subscription.
      - `endTime` string, date-time — The <code>startTime</code> plus the subscription duration.
    - `fees` Fees
      - `details` FeeDetails[]
        - `type` 'battery' | 'weee' | 'copyright' | 'e_waste' | 'packaging'
        - `amount` number, double — The <code>details[].perUnitAmount</code> multiplied by the <code>quantity</code> of the line item.
        - `perUnitAmount` number, double — The fee amount per unit.
        - `id` string — The Fee's unique identifier.
      - `amount` number, double — Total fee amount.
      - `taxAmount` number, double — Total fee tax amount
    - `quantity` integer — The number of items.
    - `amount` number, double
    - `duties` Duties
      - `amount` number, double — The duty amount for the item.
    - `importerTax` ImporterTax
      - `amount` number, double — The tax amount from the importer of record.
    - `discount` Discount — The applied discount.
      - `amountOff` number, double — The discount expressed as an amount.
      - `percentOff` number, double — The discount expressed as a percentage.
    - `tax` Tax
      - `rate` number, double — The tax rate percentage.
      - `amount` number, double — The tax amount.
    - `metadata` Metadata — Key-value pairs used to store additional data. Value can be string, boolean or integer types.
  - `shipTo` Shipping
    - `address` Address — Represents basic address information.
      - `line1` string, nullable — The first line of the address.
      - `line2` string — The second line of the address.
      - `city` string, nullable — The city of the address.
      - `postalCode` string, nullable — The postal code of the address.
      - `state` string, nullable — The state, county, province, or region.
      - `country` string, required — A [two-letter Alpha-2 country code](https://www.iban.com/country-codes) as described in the [ISO 3166](https://www.iso.org/iso-3166-country-codes.html) international standard.
    - `name` string, nullable — The recipient’s name.
    - `phone` string, nullable — The recipient’s phone number.
    - `email` string, email, nullable — The recipient’s email address.
    - `organization` string, nullable — The recipient’s organization.
    - `additionalAddressInfo` AdditionalAddressInfo — Captures any information that's not included in the basic address.
      - `neighborhood` string, nullable — The neighborhood of the address.
      - `division` string, nullable — A division within an organization.
      - `phoneticName` string, nullable — The phonetic spelling of a name.
  - `billTo` Billing — Customer billing information.
    - `address` Address, required — Represents basic address information.
      - `line1` string, nullable — The first line of the address.
      - `line2` string — The second line of the address.
      - `city` string, nullable — The city of the address.
      - `postalCode` string, nullable — The postal code of the address.
      - `state` string, nullable — The state, county, province, or region.
      - `country` string, required — A [two-letter Alpha-2 country code](https://www.iban.com/country-codes) as described in the [ISO 3166](https://www.iso.org/iso-3166-country-codes.html) international standard.
    - `name` string, nullable
    - `phone` string, nullable
    - `email` string, email, nullable
    - `organization` string, nullable
    - `additionalAddressInfo` AdditionalBillingAddressInfo — Captures any information that's not included in the basic address.
      - `neighborhood` string, nullable — The neighborhood of the address.
      - `division` string, nullable — A division within an organization.
      - `phoneticName` string, nullable — The phonetic spelling of a name.
      - `title` 'M' | 'Mme' | 'Mlle', nullable
  - `state` 'draft' | 'open' | 'void' | 'paid' | 'uncollectible' — The current state of the invoice.
  - `stateTransitions` InvoiceStateTransitions — The timestamps at the which the invoice state was updated
    - `open` string, date-time, nullable
    - `paid` string, date-time, nullable
    - `uncollectible` string, date-time, nullable
  - `payment` Payments
    - `sources` Source[]
      - `id` string — Unique identifier for the source.
      - `clientSecret` string — Used for client-side retrieval using a public key.
      - `createdTime` string, date-time — Time when the source was created.
      - `type` 'creditCard' | 'directDebit' | 'googlePay' | 'applePay' | 'payPal' | 'payPalBilling' | 'payPalCredit' | 'wireTransfer' | 'customerCredit' | 'alipay' | 'bPay' | 'onlineBanking' | 'codJapan' | 'klarnaCredit' | 'klarnaCreditRecurring' | 'konbini' | 'bankTransfer' | 'msts' | 'bancontact' | 'giftCard' | 'ideal' | 'amazonPay' | 'afterPay' | 'ccAvenue' — The payment type of the source. The payment type will correspond to another element in the source response that contains detailed information specific to the type. For example, a type of creditCard indicates that there is an object in the response named creditCard.
      - `currency` string — Three-letter ISO currency code.
      - `amount` number, double — Amount associated with the source. Once ready, the source will be charged this amount. Required for single_use sources.
      - `reusable` boolean — If true, you can reuse this source, if false, only once.
      - `owner` Owner — The owner of the payment source.
        - `firstName` string
        - `lastName` string
        - `email` string
        - `organization` string, nullable — The organization of the payment source owner.
        - `upstreamId` string
        - `address` Address, required — Represents basic address information.
          - `line1` string, nullable — The first line of the address.
          - `line2` string — The second line of the address.
          - `city` string, nullable — The city of the address.
          - `postalCode` string, nullable — The postal code of the address.
          - `state` string, nullable — The state, county, province, or region.
          - `country` string, required — A [two-letter Alpha-2 country code](https://www.iban.com/country-codes) as described in the [ISO 3166](https://www.iso.org/iso-3166-country-codes.html) international standard.
        - `additionalAddressInfo` AdditionalAddressInfo — Captures any information that's not included in the basic address.
          - `neighborhood` string, nullable — The neighborhood of the address.
          - `division` string, nullable — A division within an organization.
          - `phoneticName` string, nullable — The phonetic spelling of a name.
      - `creditCard` CreditCard
        - `lastFourDigits` string — The last four digits of the card number.
        - `expirationMonth` number — One to two digits representing the expiration month.
        - `expirationYear` number — Four digits representing the expiration year.
        - `brand` string — The card brand.
      - `googlePay` GooglePay
        - `lastFourDigits` string — The last four digits of the card number.
        - `expirationMonth` number — One to two digits representing the expiration month.
        - `expirationYear` number — Four digits representing the expiration year.
        - `brand` string — The card brand.
      - `payPal` PayPal
        - `redirect` Redirect
          - `redirectUrl` string
          - `returnUrl` string
          - `cancelUrl` string
        - `directDebit` PayPalToken
          - `token` string
      - `payPalBilling` PayPal
        - `redirect` Redirect
          - `redirectUrl` string
          - `returnUrl` string
          - `cancelUrl` string
        - `directDebit` PayPalToken
          - `token` string
      - `payPalCredit` PayPal
        - `redirect` Redirect
          - `redirectUrl` string
          - `returnUrl` string
          - `cancelUrl` string
        - `directDebit` PayPalToken
          - `token` string
      - `directDebit` DirectDebit
        - `redirect` DirectDebitRedirect
          - `redirectUrl` string
          - `returnUrl` string
      - `wireTransfer` WireTransfer
        - `accountHolder` string — .
        - `bankName` string — .
        - `city` string — .
        - `country` string — .
        - `referenceId` string — .
        - `accountNumber` string — .
        - `additionalBankInformation` string — .
        - `iban` string — .
        - `swiftCode` string — .
      - `payCo` PaycoResponse
        - `redirectUrl` string
        - `returnUrl` string
        - `payCo` Payco
      - `alipay` Alipay
      - `applePay` ApplePay
      - `bPay` BPay
        - `accountHolder` string
        - `bankName` string
        - `city` string
        - `country` string
        - `referenceId` string
        - `accountNumber` string
        - `billId` string
        - `customerPaymentReference` string
        - `swiftCode` string
      - `onlineBanking` InternetBankPayment
        - `bankCode` string
      - `codJapan` JapanCOD
      - `klarnaCredit` Klarna
        - `shipping` KlarnaShipping
          - `recipient` string
          - `phoneNumber` string
          - `address` KlarnaAddress
            - `line1` string
            - `city` string
            - `state` string
            - `country` string
            - `postalCode` string
          - `email` string
        - `token` string
      - `klarnaCreditRecurring` KlarnaRecurring
        - `returnUrl` string
        - `cancelUrl` string
      - `konbini` Konbini
        - `storeId` string
        - `receiptNumber` string
        - `printableInvoiceUrl` string
        - `storeName` string
        - `localizedStoreName` string
        - `storeLogoUrl` string
      - `bankTransfer` BankTransfer
      - `msts` MSTS
      - `bancontact` Bancontact
      - `ideal` Ideal
      - `giftCard` GiftCard
        - `cardCurrency` string — The currency used by the card.
        - `conversionRate` number — The conversion rate of the currency.
        - `lastFourDigits` integer — The last four digits of the card.
      - `amazonPay` AmazonPay
      - `afterPay` AfterPay
      - `ccAvenue` CCAvenue
      - `flow` 'standard' | 'redirect' | 'receiver' — The authentication flow of the source.
      - `state` 'pending_funds' | 'pending_redirect' | 'requires_action' | 'chargeable' | 'consumed' | 'cancelled' | 'failed' — The status of the source, one of pending_funds, pending_redirect, requires_action, cancelled, chargeable, consumed or failed. You can only use chargeable sources to create a charge.
      - `metadata` Metadata — Key-value pairs used to store additional data. Value can be string, boolean or integer types.
      - `customerId` string — Unique identifier of a customer.
      - `paymentSessionId` string — Tracks the process of collecting a payment.
      - `liveMode` boolean — Has the value true if the object exists in live mode or the value false if the object exists in test mode.
    - `charges` Charge[]
      - `id` string — The unique identifier of the charge.
      - `createdTime` string, date-time — The time when the charge was created.
      - `currency` string — A three-letter ISO 4217 currency code.
      - `amount` number, double — An amount representing how much is to be to charged.
      - `state` 'pending' | 'capturable' | 'processing' | 'complete' | 'cancelled' | 'failed' — The state of the charge.
      - `orderId` string — The identifier of the associated order.
      - `sourceId` string — The identifier of the source.
      - `failureCode` string — Error code identifying reason for charge failure.
      - `failureMessage` string — Error message describing reason for charge failure.
      - `paymentSessionId` string — Tracks the process of collecting a payment.
      - `cancels` Cancel[]
        - `id` string — The unique identifier of the cancel.
        - `createdTime` string, date-time — The time when the cancel was created.
        - `updatedTime` string, date-time — The time when the cancel was updated.
        - `amount` number, double — An amount representing how much was cancelled.
        - `state` 'pending' | 'pending_information' | 'complete' | 'failed' — The state of the cancel.
        - `failureCode` string — An error code that identifies the reason for the cancel failure.
        - `failureMessage` string — An error message that describes the reason for the cancel failure.
      - `captures` Capture[]
        - `id` string — The unique identifier of the capture.
        - `createdTime` string, date-time — The time when the capture was created.
        - `updatedTime` string, date-time — The time when the capture was updated.
        - `amount` number, double — An amount representing how much was captured.
        - `state` 'pending' | 'complete' | 'failed' — The state of the capture.
        - `failureCode` string — An error code that identifies the reason for the capture failure.
        - `failureMessage` string — An error message that describes the reason for the capture failure.
      - `captured` boolean — Indicates if the charge has been captured.
      - `refunds` Refund[]
        - `id` string — The unique identifier of the refund.
        - `createdTime` string, date-time — The time when the refund was created.
        - `updatedTime` string, date-time — The time when the refund was updated.
        - `amount` number, double — An amount representing how much was refunded.
        - `state` 'pending' | 'complete' | 'failed' — The state of the refund.
        - `failureCode` string — An error code that identifies the reason for the refund failure.
        - `failureMessage` string — An error message that describes the reason for the refund failure.
      - `refunded` boolean — Indicates if the charge has been refunded.
      - `type` 'customer_initiated' | 'merchant_initiated' | 'moto' — The type of charge.
      - `liveMode` boolean — Has the value <code>true</code> if the object exists in live mode and the value <code>false</code> if the object exists in test mode.
    - `session` Session
      - `id` string — The unique identifier for the session
      - `amountContributed` number, double — Represents the amount contributed for the transaction
      - `amountRemainingToBeContributed` number, double — Represents the amount needed to fully fund the transaction
      - `clientSecret` string — The client secret to be used by DR.js
      - `state` 'requires_source' | 'requires_confirmation' | 'confirmed' | 'pending' | 'pending_funds' | 'pending_redirect' | 'chargeable' | 'complete' | 'cancelled' | 'processing' | 'failed' | 'requires_action' — The state of session.
      - `nextAction` object — If this object exists, it contains the next actions that must be taken to complete payment.
        - `action` 'redirect' | 'show_payment_instructions' | 'sca_required' — The specific action that must be taken.
        - `data` object
          - `redirectUrl` string — If <code>action</code> is <code>redirect</code> then redirect to this resource.
          - `sourceId` string — The identifier of the payment source. If <code>action</code> is <code>show_payment_instructions</code>, then use this identifier to configure the delayed payment instructions element.
          - `sourceClientSecret` string — The client secret of the payment source. If <code>action</code> is <code>show_payment_instructions</code>, then use this identifier to configure the delayed payment instructions element.
          - `sessionId` string — The identifier of the payment session
          - `fingerprintToken` string
          - `challengeToken` string
          - `originKey` string
  - `attemptCount` integer — The number of times Digital River has attempted to collect payment.
  - `metadata` Metadata — Key-value pairs used to store additional data. Value can be string, boolean or integer types.
  - `chargeType` 'customer_initiated' | 'merchant_initiated' | 'moto' — Represents the charge type.
  - `applicationId` string — The identifier of the client application that created the checkout.
  - `liveMode` boolean — Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
  - `orderId` string — The unique identifier of the order for this invoice.
  - `upstreamId` string — The upstream identifier.

## Other responses

- `400` — 400 Bad Request
- `401` — 401 Unauthorized
- `403` — 403 Forbidden
- `404` — 401 Not Found
- `405` — 405 Method Not Allowed
- `406` — 406 Not Acceptable
- `408` — 408 Request Timeout
- `409` — 409 Conflict
- `429` — 429 Too Many Requests
- `500` — 500 Internal Server Error
- `502` — 502 Bad Gateway Error
- `503` — 503 Service Unavailable Error
- `504` — 504 Gateway Timeout Error

---

[API](https://skmtc.net/digitalriver/apis/digital-river-api-reference.md) · [All operations](https://skmtc.net/digitalriver/apis/digital-river-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/digitalriver/digital-river-api-reference/revisions/f21981db32be/schema)
