Skip to main content

Invoice webhook payload

The resource:url for an Invoice webhook payload uses this basic format:

https://marketplace_url/api/appmarket/v1/invoices/invoice_uuid

Here marketplace_url is the main URL for the marketplace (for example, mycompany.byappdirect.com ), and invoice_uuid is a universally unique identifier that the marketplace has generated for this invoice (for example, 69baef3c-57de-4846-becf-5d74489d68e7).

When an Invoice:Added or Invoice:Changed webhook is triggered, the content payload includes the following attributes:

AttributeTypeDescription
idStringAn ID number assigned to the invoice.
uuidStringThe universally unique identifier (uuid) that identifies the invoice.
localeStringThe invoice locale in the standard ISO 639-1 language code + ISO 3166-1 country code format. For example: 'en_US' or 'fr_CA'.
localizedStringWhether the invoice is localized (true), or uses the default marketplace language (false).

In some cases, the default language may depend on the individual product.
invoiceNumberStringThe invoice display ID. By default, this matches the billingRelationshipOwnerInvoiceNumber.

Deprecated.
billingRelationship
OwnerInvoice
Number
StringA customizable sequenced ID number which is displayed on the invoice.
partnerStringA code that identifies the marketplace owner.
statusEnumThe status assigned to the invoice. Must be one of PAID, UNPAID, CARRIED, or VOIDED.
currencyEnumThe currency used for amounts on the invoice. See the Currency definition for a list of possible values.
invoiceDateDateThe date on which the invoice was issued.
paymentTerms:
dueDate
DateThe date by which the customer must pay the invoice. Failure to pay by this date may result in penalties such as interest charges, or even subscription suspension or cancellation.
sellerObjectIf the original order was placed on behalf of the customer by a reseller or sales agent, information about the user who made the original purchase (the uuid of the user and company).
customerObjectInformation about the user who receives the products or services in the invoices (the uuid of the user and company).
linesObjectA collection of the individual items in the invoice. Each item in the invoice is represented with a separate InvoiceLine.

See Invoice lines below.
amountDueNumberThe amount of money that the customer currently owes for this invoice.
amountPaidNumberThe amount of money that the customer has already paid on this invoice.
subtotalNumberThe sum of the "total" values for all invoice lines in the invoice. See Invoice lines below.
totalTaxNumberThe amount of tax added to the invoice.
carriedBalanceNumberIf applicable, the credit balance for this customer at the time of the invoice.
creditNoteBooleanWhether the invoice results in a credit to the customer.
totalNumberThe total amount to be paid by the customer on this invoice.
taxReportObjectA report that details the taxes that were calculated on each line in the invoice.

See the Tax report section below.
taxSummaryObjectA list of TaxDetail objects that summarize the taxes on the invoice. Deprecated.
refundInvoiceBooleanWhether the invoice represents a refund to the customer.
refundedInvoiceStringIf refundInvoice is true, the ID for the invoice with the charges that are being refunded.
delegatedToInvoiceStringIf applicable, the ID of an invoice to which balances from this invoice have been carried.
carriedInvoicesObjectA list of IDs for the invoices with balances that have been carried forward to this invoice.
usersObjectA list of IDs and other information for all users represented in the invoice lines.
companiesObjectA list of IDs and other information for all companies represented in the invoice lines.
marketplacesObjectA list of IDs and other information for all marketplaces represented in the invoice lines.
subscriptionsObjectA list of IDs and other information for all subscriptions represented in the invoice lines.
ordersObjectA list of IDs and other information for all orders represented in the invoice lines.
productsObjectA list of IDs and other information for all products represented in the invoice lines.
editionsObjectA list of IDs and other information for all editions represented in the invoice lines.
pricingPlansObjectA list of IDs and other information for all pricing plans represented in the invoice lines.
discountsObjectA list of IDs and other information for all discounts represented in the invoice lines.
costTypesObjectA list of all cost types represented in the invoice lines. For a list of possible values, see the CostType definition.
costPeriodsObjectA list of all period types represented in the invoice lines. For a list of possible values, see the PricingPeriod definition.
costUnitsObjectIf any items are priced by unit, a list of all cost units represented in the invoice lines.

Invoice lines

The line object section of the payload matches the REST API InvoiceLine definition, and also includes the following attributes:

AttributeTypeDescription
unitPriceNumberThe price per unit for the charge.
buyerObjectInformation about the customer who purchased this product or service (the uuid of the user and associated company).
providerObjectInformation about the vendor who provides this product or service (the uuid of the user and associated company).
period:startDateThe first (or starting) date for the billing period that this line represents.
period:endDateThe last (or ending) date for the billing period that this line represents.
costObjectDetailed information about the charge.

See the Cost section below.
subscriptionRefStringThe identifier (ID number or uuid) for the subscription being invoiced.
orderRefStringThe identifier (ID number or uuid) for the order associated with this invoice line.
productRefStringThe identifier (ID number or uuid) for the product or service represented in this invoice line.
editionRefStringThe identifier (ID number or uuid) for the edition of the product.
pricingPlanRefStringThe identifier (ID number or uuid) for the pricing plan associated with the edition.
discountRefStringThe identifier (ID number or uuid) for a discount that has been applied to this charge.
quantityNumberThe number of units included in the charge.
totalNumberThe total amount that the customer owes for this invoice line, not including tax (unitPrice x quantity).

Cost

The Cost object provides detailed information about a charge (or a discount). It includes the following attributes:

AttributeTypeDescription
typeEnumA brief descriptor for the charge and how it is billed. Must be one of RECURRING_FLAT, ONE_TIME_FLAT, INCLUDED, SETUP_PER_UNIT, RECURRING_PER_UNIT, ONE_TIME_PER_UNIT, SETUP_FEE, CONTRACT_FEE, DISCOUNT_PER_UNIT, DISCOUNT_FLAT, METERED_USAGE, REACTIVATION_FEE, TRANSFER_FEE, DISCOUNT_SETUP_FEE, DISCOUNT_SETUP_PER_UNIT, ADDITIONAL_FEE, TERMINATION_FEE, or CUSTOM_FEE.
typeCategoryEnumWhether the charge is RECURRING or a ONE_TIME fee.
unitStringIf the strategy uses units, this field represents the unit name. If not, this field is null.
strategyEnumA brief descriptor of how the charge is billed.

Must be one of UNIT, FREE, TIERED, FLAT, VOLUME, UNLIMITED, CUSTOM, or PERCENTAGE.
creditBooleanWhether this charge represents a credit rather than a cost.
percentageBooleanWhether this charge represents a percentage discount (as opposed to a flat amount).

Tax report

The TaxReport object provides detailed information about the taxes applied to this invoice. It includes the following attributes:

AttributeTypeDescription
idStringThe universally unique identifier (uuid) that identifies the tax report.
transactionIdStringAn identifier for the transaction on which the taxes were applied.
tenantStringThe code for the marketplace owner.
invoiceNumberStringAn identifier for the invoice to which the tax applies. Should match the invoice billingRelationshipOwnerInvoiceNumber.
consumerObjectThe user who received the products or services that were taxed.

This marches the customer in the main invoice.
{...}:userRefStringThe universally unique identifier (uuid) of the user account for the consumer.
{...}:companyRefStringThe universally unique identifier (uuid) for the user's company.
{...}:addressObjectThe billing address for the company.

This object includes a streetLine1 and streetLine2 for the address, the city, a region (state or province), country, and postalCode (postal or ZIP code).
{...}:companyTax
Exemption
ReasonCode
StringIf applicable, this it the code that describes why this company is exempt from paying tax.
strategyEnumA code that identifies the means used to determine the tax.

Must be one of FLAT, MULTI_FLAT, AVALARA, or CUSTOM.
currencyEnumThe currency in which the tax is charged. Should match the invoice currency.

See the Currency definition for a list of possible values.
chargedAmountNumberThe amount of the tax being charged on an item.
totalTaxAmountNumberThe total amount of tax for the invoice.
detailsObjectDetailed information about the tax in this line. See Tax report details below.
summaryObjectA brief summary that includes the taxableAmount, tax strategy and total tax amount.
metadataObjectAdditional information about this item.

Tax report details

The payload also includes the following additional attributes that do not appear in the REST API documentation:

AttributeTypeDescription
taxTypeObjectDetails of the method used to calculate taxes for the invoice line. May include an id, name, rate, and strategy.
taxableAmountNumberAmount of money that can be taxed for this invoice line. Typically equal to the invoice total.
taxAmountNumberAmount of tax calculated for this line.
taxCodeStringIf applicable, a code that indicates that this invoice line should use a special tax calculation (Reduced tax rate, tax exemption, etc).
metadataObjectAdditional information about this item.

Was this page helpful?