Apply a credit memo to an invoice

Apply a credit memo to an invoice. The invoice must be unpaid. The credit memo must have a non-zero unused amount (not fully applied to other invoices).

SecuritySecretApiKey or JWT
Request
path Parameters
id
required
string <= 50 characters ^[@~\-\.\w]+$

The resource identifier string.

creditMemoId
required
string

Credit memo ID.

Request Body schema: application/json

CreditMemoAllocation resource.

amount
required
number <double>

Amount of credit from the credit memo allocated to the given invoice.

Responses
200

Credit memo allocation was updated.

Response Schema: application/json
amount
required
number <double>

Amount of credit from the credit memo allocated to the given invoice.

invoiceId
string <= 50 characters

ID of the invoice where the credit memo is allocated to.

creditMemoId
string <= 50 characters

ID of the credit memo that was allocated.

currency
string = 3 characters

ISO 4217 alphabetic currency code.

createdTime
string <date-time>

Credit memo allocation time.

updatedTime
string <date-time> (UpdatedTime)

Read-only timestamp updates when the resource is updated.

Array of InvoiceLink (object) or CreditMemoLink (object)

The links related to the resource.

Array
Any of:
rel
required
string

The link type.

Value: "invoice"
href
required
string

The link URL.

201

Credit memo allocation was created.

Response Headers
Location
string <uri>

The location of the related resource.

Example: "https://api.rebilly.com/example"
Response Schema: application/json
amount
required
number <double>

Amount of credit from the credit memo allocated to the given invoice.

invoiceId
string <= 50 characters

ID of the invoice where the credit memo is allocated to.

creditMemoId
string <= 50 characters

ID of the credit memo that was allocated.

currency
string = 3 characters

ISO 4217 alphabetic currency code.

createdTime
string <date-time>

Credit memo allocation time.

updatedTime
string <date-time> (UpdatedTime)

Read-only timestamp updates when the resource is updated.

Array of InvoiceLink (object) or CreditMemoLink (object)

The links related to the resource.

Array
Any of:
rel
required
string

The link type.

Value: "invoice"
href
required
string

The link URL.

401

Unauthorized access, invalid credentials were used.

403

Access forbidden.

404

Resource was not found.

422

Invalid data was sent.

put/invoices/{id}/credit-memo-allocations/{creditMemoId}
Request samples
application/json
{
  • "amount": 0
}
Response samples
application/json
{
  • "invoiceId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "creditMemoId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "amount": 0,
  • "currency": "USD",
  • "createdTime": "2019-08-24T14:15:22Z",
  • "updatedTime": "2019-08-24T14:15:22Z",
  • "_links": [
    ]
}