PUT /invoices/{id}
Creates or updates (upserts) an invoice with a specified ID.
Servers
- https://api-sandbox.rebilly.com/organizations/{organizationId}
- https://api.rebilly.com/organizations/{organizationId}
Request headers
| Name | Type | Required | Description |
|---|---|---|---|
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/json" |
Request body fields
| Name | Type | Required | Description |
|---|---|---|---|
discounts[] |
Array | No |
Discounts applied. |
discounts[].context |
String | No |
Context in which the discount applies. Valid values:
Default value: "items" |
discounts[].description |
String | No |
Description of the discount. |
discounts[].redemptionId |
String | No |
ID of the redemption. |
discounts[].amount |
Number | No |
Total amount discounted by this coupon. |
discounts[].couponId |
String | No |
ID of the coupon. |
delinquencyTime |
String | No |
Date and time when the related order is considered delinquent, and is canceled.
If this value is If an invoice is not related to an order, this field can only be |
dueReminderNumber |
Integer | No |
Number of past due reminder events that have been triggered. |
invoiceNumber |
Integer | No |
Auto-incrementing number based on the sequence of invoices for any particular customer. |
voidedTime |
String | No |
Date and time when the invoice is voided. |
createdTime |
String | No |
Date and time when the resource is created. This value is set automatically when the resource is created. |
creditMemoAllocations[] |
Array | No |
Credit memo allocations to an invoice. |
creditMemoAllocations[].updatedTime |
String | No |
Date and time when the resource is updated. This value is set automatically when the resource is updated. |
creditMemoAllocations[].createdTime |
String | No |
Date and time at which a credit memo is allocated. |
creditMemoAllocations[].amount |
Number | No |
Amount of credit that is allocated from the credit memo to the invoice.
If the
|
creditMemoAllocations[].currency |
String | No |
Merchant's reporting currency. |
creditMemoAllocations[].invoiceId |
String | No |
ID of invoice to which the credit memo is allocated. |
poNumber |
String | No |
Purchase order number that is displayed on the invoice. |
items[] |
Array | No |
Invoice items array. |
items[].price |
Number | No |
Total price of the invoice item. |
items[].tax |
No |
Invoice item tax. |
|
items[]._embedded |
Object | No |
Embedded objects that are requested by the |
items[]._embedded.product |
Object | No | |
items[]._embedded.plan |
Object | No | |
items[].description |
String | No |
Description of the invoice item. |
items[].createdTime |
String | No |
Date and time when the resource is created. This value is set automatically when the resource is created. |
items[].planId |
String | No |
ID of the plan. |
items[].quantity |
Integer | No |
Quantity of the invoice item. |
items[].subscriptionId |
String | No |
ID of the order. |
items[].id |
String | No |
ID of the invoice item. |
items[]._links[] |
Array | No |
Related links. |
items[]._links[].href |
String | No |
Link URL. |
items[]._links[].rel |
String | No |
Type of link. Valid values:
|
items[].productId |
String | No |
ID of the product. |
items[].periodEndTime |
String | No |
Date and time when the billing period ends. |
items[].updatedTime |
String | No |
Date and time when the resource is updated. This value is set automatically when the resource is updated. |
items[].periodStartTime |
String | No |
Date and time when the billing period starts. |
items[].periodNumber |
Integer | No |
Billing period number that is associated with the invoice item. For example, an invoice item for a service is included in billing period number 3. The invoice item is only applied to billing period number 3. |
items[].type |
String | Yes |
Type of invoice item. Valid values:
|
items[].discountAmount |
Number | No |
Discount amount applied to the invoice item. |
items[].unitPrice |
Number | Yes |
Unit price of the invoice item. |
retryInstruction |
Object | No |
Invoice payment retry instruction. This object specifies how to proceed if a payment related to the invoice fails. |
retryInstruction.attempts[] |
Array | Yes |
Describes the retry instruction. |
retryInstruction.attempts[].amountAdjustmentInstruction |
Object | No |
Specifies if the payment amount must be adjusted for the retry. |
retryInstruction.attempts[].scheduleInstruction |
Object | Yes |
Specifies when the payment retry instruction is performed. |
retryInstruction.attempts[].tryBackupInstruments |
Boolean | No |
Specifies whether to use backup payment instruments on an invoice payment retry. Default value: false |
retryInstruction.afterRetryEndPolicies[] |
Array | Yes |
Describes the action to take when all scheduled payment retries, in a retry instruction, have concluded and payment is not collected. |
retryInstruction.afterAttemptPolicies[] |
Array | Yes |
Describes the action to take when a payment attempt concludes, and payment is not collected. |
currency |
String | Yes |
Merchant's reporting currency. |
delinquentCollectionPeriod |
Integer | No |
Length of time, in days, between when the invoice is due and when the invoice is paid. |
websiteId |
String | Yes |
ID of the website. A website is where an organization obtains a customer. For more information, see Obtain an organization ID and website ID. |
customerId |
Object | Yes | |
id |
String | No |
ID of the invoice. |
_links[] |
Array | No |
Related links. |
_links[].href |
String | No |
Link URL. |
_links[].rel |
String | No |
Type of link. Valid values:
|
updatedTime |
String | No |
Date and time when the resource is updated. This value is set automatically when the resource is updated. |
shipping |
Object | No |
Shipping settings. |
type |
String | No |
Type of invoice. Valid values:
|
dueTime |
String | No |
Date and time when the invoice is due for payment. |
abandonedTime |
String | No |
Date and time when the invoice is abandoned. |
paymentFormUrl |
String | No |
URL where the customer is redirected to pay the invoice
using one of the methods which are available to the customer.
This is an alternative to creating a new transaction with empty
|
dueReminderTime |
String | No |
Date and time when a past due reminder event is triggered. |
organizationId |
Object | No | |
discountAmount |
Number | No |
Discount amount that is applied to the invoice. |
organizationTaxIdNumber |
Object | No |
Organization tax ID number that is displayed on the invoice. |
organizationTaxIdNumber.type |
String | Yes |
Type of the tax ID number. Valid values:
|
organizationTaxIdNumber.value |
String | Yes |
Value of the tax ID number. |
deliveryAddress |
Object | No |
Delivery address of the invoice. |
deliveryAddress.region |
String | No |
Contact's region of residence. |
deliveryAddress.phoneNumbers[] |
Array | No |
List of phone numbers associated with the contact. |
deliveryAddress.phoneNumbers[].label |
String | Yes |
Phone number label or name. |
deliveryAddress.phoneNumbers[].value |
String | Yes |
Phone number value. |
deliveryAddress.phoneNumbers[].primary |
Boolean | No |
Specifies if the phone number is the contact's primary phone number. |
deliveryAddress.address2 |
String | No |
Second line of the contact's street address. |
deliveryAddress.emails[] |
Array | No |
List of email addresses associated with the contact. |
deliveryAddress.emails[].label |
String | Yes |
Email label or name. |
deliveryAddress.emails[].value |
String | Yes |
Email address value. |
deliveryAddress.emails[].primary |
Boolean | No |
Specifies if the email address is the contact's primary email address. |
deliveryAddress.organization |
String | No |
Contact's organization. |
deliveryAddress.jobTitle |
String | No |
Contact's job title. |
deliveryAddress.dob |
String | No |
Contact's date of birth in ISO-8601 |
deliveryAddress.city |
String | No |
Contact's city of residence. |
deliveryAddress.postalCode |
String | No |
Contact's postal code. |
deliveryAddress.hash |
String | No |
Hash value for the contact. Use this value to compare contacts for identical attribute values. |
deliveryAddress.lastName |
String | No |
Contact's last name. |
deliveryAddress.firstName |
String | No |
Contact's first name. |
deliveryAddress.country |
String | No |
Contact's country of residence in ISO 3166 alpha-2 country code. For examples, see ISO.org. |
deliveryAddress.address |
String | No |
First line of the contact's street address. |
tax |
Object | No |
Taxes. |
_embedded |
Object | No |
Embedded objects that are requested by the |
_embedded.customer |
Object | No | |
_embedded.website |
Object | No | |
_embedded.organization |
Object | No | |
_embedded.shippingRate |
Object | No | |
_embedded.leadSource |
Object | No | |
subtotalAmount |
Number | No |
Subtotal amount of the invoice. |
revision |
Integer | No |
Number of times the invoice data has been modified. Use the revision number when analyzing webhook data to determine if a change should take precedence over the current representation. |
autopayScheduledTime |
String | No |
Date and time when an automatic payment (autopay) is scheduled. |
collectionPeriod |
Integer | No |
Length of time, in days, between when the invoice is issued and when the invoice is paid. |
subscriptionId |
String | No |
ID of the related subscription order, if available.
This field is |
status |
String | No |
Status of the invoice. Valid values:
|
billingAddress |
Object | No |
Billing address of the invoice. After the first payment is made for an invoice, this value cannot be changed. |
billingAddress.region |
String | No |
Contact's region of residence. |
billingAddress.phoneNumbers[] |
Array | No |
List of phone numbers associated with the contact. |
billingAddress.phoneNumbers[].label |
String | Yes |
Phone number label or name. |
billingAddress.phoneNumbers[].value |
String | Yes |
Phone number value. |
billingAddress.phoneNumbers[].primary |
Boolean | No |
Specifies if the phone number is the contact's primary phone number. |
billingAddress.address2 |
String | No |
Second line of the contact's street address. |
billingAddress.emails[] |
Array | No |
List of email addresses associated with the contact. |
billingAddress.emails[].label |
String | Yes |
Email label or name. |
billingAddress.emails[].value |
String | Yes |
Email address value. |
billingAddress.emails[].primary |
Boolean | No |
Specifies if the email address is the contact's primary email address. |
billingAddress.organization |
String | No |
Contact's organization. |
billingAddress.jobTitle |
String | No |
Contact's job title. |
billingAddress.dob |
String | No |
Contact's date of birth in ISO-8601 |
billingAddress.city |
String | No |
Contact's city of residence. |
billingAddress.postalCode |
String | No |
Contact's postal code. |
billingAddress.hash |
String | No |
Hash value for the contact. Use this value to compare contacts for identical attribute values. |
billingAddress.lastName |
String | No |
Contact's last name. |
billingAddress.firstName |
String | No |
Contact's first name. |
billingAddress.country |
String | No |
Contact's country of residence in ISO 3166 alpha-2 country code. For examples, see ISO.org. |
billingAddress.address |
String | No |
First line of the contact's street address. |
customerTaxIdNumber |
Object | No |
Customer tax ID number that is displayed on the invoice. |
customerTaxIdNumber.type |
String | Yes |
Type of the tax ID number. Valid values:
|
customerTaxIdNumber.value |
String | Yes |
Value of the tax ID number. |
autopayRetryNumber |
Integer | No |
Number of times that an automatic payment (autopay) has been attempted on an invoice. Default value: 0 |
orderId |
String | No |
ID of the order (experimental). |
issuedTime |
String | No |
Date and time when the invoice is issued. |
transactions[] |
Array | No |
Invoice transactions array. |
transactions[].gateway |
Object | No |
Related gateway information. |
transactions[].gateway.response |
Object | No |
Gateway response. |
transactions[].gateway.response.originalMessage |
String | No |
Raw, unmapped gateway response message. |
transactions[].gateway.response.originalCode |
String | No |
Raw, unmapped gateway response code. |
transactions[].gateway.response.message |
String | No |
Gateway response message. |
transactions[].gateway.response.type |
String | No |
Gateway response type. |
transactions[].gateway.response.code |
String | No |
Gateway response code. |
transactions[].gateway.avsResponse |
Object | No |
Gateway Address Verification System (AVS) response. |
transactions[].gateway.avsResponse.originalMessage |
String | No |
Raw response message. |
transactions[].gateway.avsResponse.originalCode |
String | No |
Raw response code. |
transactions[].gateway.avsResponse.message |
String | No |
Response message. |
transactions[].gateway.avsResponse.code |
String | No |
Response code. |
transactions[].gateway.cvvResponse |
Object | No |
Gateway Card Verification Value (CVV) response. |
transactions[].gateway.cvvResponse.originalMessage |
String | No |
Raw response message. |
transactions[].gateway.cvvResponse.originalCode |
String | No |
Raw response code. |
transactions[].gateway.cvvResponse.message |
String | No |
Response message. |
transactions[].gateway.cvvResponse.code |
String | No |
Response code. |
transactions[].createdTime |
String | No |
Date and time when the resource is created. This value is set automatically when the resource is created. |
transactions[].isRebill |
Boolean | No |
Specifies if the transaction is one of a number of recurring payments in a subscription, excluding trials or setup fees. |
transactions[].disputeStatus |
String | No |
Status of the dispute. Valid values:
|
transactions[].websiteId |
No | ||
transactions[].id |
String | No |
ID of the transaction. |
transactions[]._links[] |
Array | No |
Related links. |
transactions[]._links[].href |
String | No |
Link URL. |
transactions[]._links[].rel |
String | No |
Type of link. Valid values:
|
transactions[].method |
No |
Payment method.
|
|
transactions[].updatedTime |
String | No |
Date and time when the resource is updated. This value is set automatically when the resource is updated. |
transactions[].depositRequestId |
String | No |
ID of the deposit request if applicable. The created transaction is based on the properties of this deposit request. |
transactions[].redirectUrl |
String | No |
URL where the end-user is redirected to when an offsite transaction is completed. The default value is the website URL. |
transactions[].type |
String | No |
Type of transaction. Valid values:
|
transactions[].riskMetadata |
No | ||
transactions[].organizationId |
No | ||
transactions[].has3ds |
Boolean | No |
Specifies if the transaction uses 3D Secure. |
transactions[].requestId |
String | No |
Request ID of the transaction. This ID must be unique within a 24-hour period. Use this field to prevent duplicate transactions. |
transactions[].parentTransactionId |
String | No |
ID of the parent transaction. |
transactions[].processedTime |
String | No |
Date and time when the transaction is processed. |
transactions[].revision |
Integer | No |
Number of times the transaction data has been modified. This revision number is useful when analyzing webhook data to determine if the change takes precedence over the current representation. |
transactions[].requestCurrency |
String | No |
Merchant's reporting currency. |
transactions[].status |
String | No |
Status of the transaction. Valid values:
|
transactions[].retryNumber |
Integer | No |
Position of the transaction in the sequence of retries. |
transactions[].customFields |
Object | No |
Use custom fields to extend a resource scheme to include custom data that is not provided as a common field. For more information, see Custom fields. |
transactions[].invoiceIds[] |
Array | No |
Related invoice IDs. |
transactions[].requestAmount |
Number | No |
Amount of the payment request. If an adjustment occurs, the purchase amount may differ from the billing amount. |
transactions[].dcc |
Object | No |
Detailed Dynamic currency conversion (DCC).
If DCC is not applied to the transaction, this value is |
transactions[].dcc.base |
Object | No |
Initial amount and currency to convert from. |
transactions[].dcc.base.amount |
Number | Yes |
Markup amount converted to USD. |
transactions[].dcc.base.currency |
String | Yes |
Merchant's reporting currency. |
transactions[].dcc.outcome |
String | No |
Dynamic currency conversion outcome. Valid values:
|
transactions[].dcc.usdMarkup |
Number | No |
Markup amount converted to USD. |
transactions[].dcc.quote |
Object | No |
Suggested amount and currency to convert to. |
transactions[].dcc.quote.amount |
Number | Yes |
Markup amount converted to USD. |
transactions[].dcc.quote.currency |
String | Yes |
Merchant's reporting currency. |
transactions[].hadDiscrepancy |
Boolean | No |
Specifies if the transaction is updated due to a discrepancy with its source of truth. |
transactions[].gatewayAccountId |
String | No |
ID of the gateway account that processed the transaction. |
transactions[].hasDcc |
Boolean | No |
Specifies if Dynamic Currency Conversion (DCC) applies to the transaction. |
transactions[].subscriptionIds[] |
Array | No |
Subscription IDs of invoices that are related to the transaction. |
transactions[].disputeTime |
String | No |
Date and time when the dispute is created.
If the transaction is not disputed, this value is |
transactions[].description |
String | No |
Description of the payment. |
transactions[].planIds[] |
Array | No |
Plan IDs of orders that are related to the transaction. |
transactions[].limits |
Object | No |
Transaction amount limit information. |
transactions[].limits.resetTime |
String | No |
Date and time in which the limit amount resets. This value may be used for user interfaces. |
transactions[].limits.amount |
Number | No |
Limit amount. |
transactions[].limits.currency |
String | No |
Merchant's reporting currency. |
transactions[].currency |
String | No |
Merchant's reporting currency. |
transactions[].isRetry |
Boolean | No |
Specifies if a transaction is a retry. |
transactions[].gatewayTransactionId |
String | No |
ID of the gateway transaction. |
transactions[].customerId |
No | ||
transactions[].transferId |
String | No |
ID of the ledger transfer if applicable. The transaction is linked to this transfer when processed in the wallet ledger. |
transactions[].arn |
String | No |
Acquirer reference number. |
transactions[].discrepancyTime |
String | No |
Date and time of the most recent discrepancy on the transaction. |
transactions[].isMerchantInitiated |
Boolean | No |
Specifies if the transaction is initiated by the merchant. |
transactions[].purchaseCurrency |
String | No |
Merchant's reporting currency. |
transactions[].result |
String | No |
Result of the transaction. Valid values:
|
transactions[].riskScore |
Integer | No |
Risk score for the transaction. |
transactions[].isProcessedOutside |
Boolean | No |
Specifies if the transaction is processed outside of Rebilly. |
transactions[].payoutRequestId |
String | No |
ID of the payout request if applicable. The created transaction is based on the properties of this payout request. |
transactions[]._embedded |
Object | No |
Embedded objects that are requested by the |
transactions[]._embedded.childTransactions[] |
Array | No |
Most recent child transactions. |
transactions[]._embedded.customer |
Object | No | |
transactions[]._embedded.bankAccount |
Object | No | |
transactions[]._embedded.gatewayAccount |
Object | No | |
transactions[]._embedded.website |
Object | No | |
transactions[]._embedded.invoices[] |
Array | No |
Most recent related invoices. |
transactions[]._embedded.parentTransaction |
Object | No | |
transactions[]._embedded.organization |
Object | No | |
transactions[]._embedded.dispute |
Object | No | |
transactions[]._embedded.paymentCard |
Object | No | |
transactions[]._embedded.leadSource |
Object | No | |
transactions[].paymentInstrument |
Object | No | |
transactions[].velocity |
Integer | No |
Number of transactions by the same customer in the past 24 hours. |
transactions[].acquirerName |
No |
Acquirer name.
This value is only available when a transaction uses a payment gateway.
If a transaction does not use a payment gateway, this value is |
|
transactions[].isDisputed |
Boolean | No |
Specifies if a transaction is disputed. |
transactions[].settlementTime |
String | No |
Date and time when the transaction is settled by the banking institution. |
transactions[].billingAddress |
Object | No |
Billing address. |
transactions[].billingAddress.region |
String | No |
Contact's region of residence. |
transactions[].billingAddress.phoneNumbers[] |
Array | No |
List of phone numbers associated with the contact. |
transactions[].billingAddress.phoneNumbers[].label |
String | Yes |
Phone number label or name. |
transactions[].billingAddress.phoneNumbers[].value |
String | Yes |
Phone number value. |
transactions[].billingAddress.phoneNumbers[].primary |
Boolean | No |
Specifies if the phone number is the contact's primary phone number. |
transactions[].billingAddress.address2 |
String | No |
Second line of the contact's street address. |
transactions[].billingAddress.emails[] |
Array | No |
List of email addresses associated with the contact. |
transactions[].billingAddress.emails[].label |
String | Yes |
Email label or name. |
transactions[].billingAddress.emails[].value |
String | Yes |
Email address value. |
transactions[].billingAddress.emails[].primary |
Boolean | No |
Specifies if the email address is the contact's primary email address. |
transactions[].billingAddress.organization |
String | No |
Contact's organization. |
transactions[].billingAddress.jobTitle |
String | No |
Contact's job title. |
transactions[].billingAddress.dob |
String | No |
Contact's date of birth in ISO-8601 |
transactions[].billingAddress.city |
String | No |
Contact's city of residence. |
transactions[].billingAddress.postalCode |
String | No |
Contact's postal code. |
transactions[].billingAddress.hash |
String | No |
Hash value for the contact. Use this value to compare contacts for identical attribute values. |
transactions[].billingAddress.lastName |
String | No |
Contact's last name. |
transactions[].billingAddress.firstName |
String | No |
Contact's first name. |
transactions[].billingAddress.country |
String | No |
Contact's country of residence in ISO 3166 alpha-2 country code. For examples, see ISO.org. |
transactions[].billingAddress.address |
String | No |
First line of the contact's street address. |
transactions[].gatewayName |
No |
Name of the payment gateway that processed, or is selected to process, the transaction. This value is only available after a gateway is selected for the transaction. |
|
transactions[].reportCurrency |
String | No |
Merchant's reporting currency. |
transactions[].referenceData |
Object | No |
Transaction reference data. |
transactions[].childTransactions[] |
Array | No |
IDs of child transactions. |
transactions[].orderId |
String | No |
Order ID of the transaction. This ID must be unique within a 24 hour period.
|
transactions[].billingDescriptor |
String | No |
Billing descriptor that appears on the periodic billing statement. For a credit card statement, this field commonly contains 12 or fewer characters. |
transactions[].isReconciled |
Boolean | No |
Specifies if the transaction is verified with gateway batch data. |
transactions[].amount |
Number | No |
Total amount of the transaction. |
transactions[].3ds |
Object | No |
Authentication object. For more information, see 3D Secure (3DS). |
transactions[].3ds.enrolled |
String | No |
Specifies if the cardholder is enrolled in 3D Secure. Valid values:
|
transactions[].3ds.flow |
String | No |
Authentication flow for 3D Secure 2. Valid values:
|
transactions[].3ds.version |
String | No |
Version of 3D Secure. Valid values:
|
transactions[].3ds.liability |
String | No |
Valid values:
|
transactions[].3ds.isDowngraded |
Boolean | No |
Specifies if 3D Secure 2 is attempted and downgraded to 3D Secure 1. Default value: false |
transactions[].3ds.server |
String | No |
Name of the 3D Secure server. |
transactions[].3ds.authenticated |
String | No |
Authentication response status for 3D Secure. Valid values:
|
transactions[].purchaseAmount |
Number | No |
Amount by which the purchase is completed. If an adjustment occurs, the purchased amount may differ from the requested amount. |
transactions[].rebillNumber |
Integer | No |
Rebill number of the transaction. A rebill number is the number of recurring payments in a subscription, excluding trials or setup fees. |
transactions[].hasAmountAdjustment |
Boolean | No |
Specifies if the transaction has amount adjustment. |
transactions[].reportAmount |
Number | No |
Transaction amount converted to the report currency of the organization. |
transactions[].bin |
String | No |
Payment card Bank Identification Number (BIN). |
transactions[].notificationUrl |
String | No |
URL where a server-to-server POST notification is sent. This notification is sent when the transaction result is finalized after a timeout or an offsite interaction. Do not interpret this notification as a confirmation,
complete a The following placeholders are available to use in this URI: |
notes |
String | No |
Notes for the customer that are displayed on the invoice. |
quoteId |
String | No |
ID of the related quote, if available.
This field is |
amount |
Number | No |
Amount of the invoice. |
paidTime |
String | No |
Date and time when the invoice is paid. |
amountDue |
Number | No |
Amount that is due on the invoice. |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.