Invoice Generation

Learn about required fields and additional requirements for invoices.

The service generates an invoice for a request with saleMessageType set to INVOICE.

Invoice generation requires Vertex Invoice IQ. Vertex for e-Commerce and Vertex for Marketplaces also enable customer location determination, which can be useful for invoices.

Request

See Mandatory Fields for more information about required fields, additional requirements, and restrictions.

FieldValueNotes
customer.customerEmailThe customer's email address.If provided and invoice delivery is enabled, the service uses this value to send the invoice.
customer.customerNameThe customer's name displayed on the invoice.
lineItems[].lineItemDescriptionThe line item's name or description displayed on the invoice.
saleMessageTypeINVOICERequired to trigger invoice generation.
seller.businessNameThe seller's business name displayed on the invoice.

Response

The following fields are added to the response when invoice generation is triggered:

FieldValueNotes
lineItems[].documentImageUrlThe URL to the invoice document containing this lineItem.If provided and invoice delivery is enabled, the service uses this value to send the invoice.
lineItems[].documentImageUrlSecretThe secret used to access the invoice image URL. Provided by the service; you can ignore it.

Invoice customization

Invoice customization—including the invoice number format, logo, footer, and email subject when email delivery is enabled—can be configured through settings or the user interface. You can also override or define these settings on a per-request basis.

The following request fields can affect the invoice format and output:

FieldValueNotes
seller.invoicing.invoiceCustomizationInvoice customization.Can be used to override configured settings.
seller.invoicing.invoiceNumberFormatThe format string used to generate the invoice number.Can be used to override the default numbering format or the format configured in settings.
seller.invoicing.invoiceSignatureUrlThe URL to an image of a signature that appears on invoices in some regions, such as India.Ignored in most countries but may be required for invoices issued in India.
seller.marketplace.invoicing.invoiceCustomization.invoiceCustomizationCodeThe identifier for the invoice customization configured in settings.Used for marketplace-derived invoice details in a three-party sale.
seller.taxRegistrations[].fiscalRepresentativeThe details about the appointed fiscal representative.Used when an invoice is generated, and the invoice country matches the registration.

The following request fields apply to seller.invoicing.invoiceCustomization:

FieldValueNotes
invoiceCustomizationCodeThe identifier for the invoice customization configured in settings.
invoiceDeliveryEmailAddressThe email address used in the From field when sending an invoice or credit note to the buyer.
invoiceDeliveryReplyToAddressThe email address used in the Reply-To field when sending an invoice or credit note to the buyer.
invoiceEmailSubjectThe format string used to generate the email subject for an invoice.
refundEmailSubjectThe format string used to generate the email subject for a credit note.
invoiceLogoUrlThe URL to the image file containing the logo used when generating an invoice.
invoiceFooterTextThe custom text placed in the footer of the generated invoice.

The following request fields apply to seller.taxRegistrations[].fiscalRepresentative:

FieldValueNotes
businessNameThe fiscal representative's name.
addressThe Address object from Vertex O Series Cloud.
taxRegistrationNumberThe fiscal representative's tax number.

Example

Example request:

{
  "transactionId": "64266d5fc26241b8b8b60b01ccb67b",
  "saleMessageType": "INVOICE",
  "deliveryTerm": "SUP",
  "customer": {
    // name to display and email for invoice delivery
    "customerName": "Jan Kowalski",
    "customerEmail": "[email protected]",
    "customerCode": {
      "value": "customer1"
    },
    "destination": {
      "country": "PL",
      "city": "Wroclaw",
      "postalCode": "00-010",
      "streetAddress1": "Dworcowa 4"
    }
  },
  "lineItems": [
    {
      "extendedPrice": 200,
      // line item description, to be displayed on invoice
      "lineItemDescription": "Big Expensive Book",
      "product": {
        "productClass": "book"
      }
    }
  ],
  "currency": {
    "isoCurrencyCodeAlpha": "EUR"
  },
  "transactionType": "SALE",
  "seller": {
    "administrativeOrigin": {
      "country": "PL",
      "city": "Warszawa",
      "streetAddress1": "Pocztowa 2",
      "postalCode": "00-003"
    },
    // seller name to display on the invoice
    "businessName": "ACME S.A.",
    "company": "ROOT",
    "division": "seller_1",
    // additional invoicing customization, on request
    "invoicing": {
      "invoiceCustomization": {
        "invoiceLogoUrl": "https://upload.wikimedia.org/wikipedia/commons/8/85/Logo-Test.png?20171228163613",
        "invoiceFooterText": "Customer Invoice Footer"
      },
      "invoiceNumberFormat": "CUSTOM-INVOICE-{{year}}"
    },
    "physicalOrigin": {
      "country": "PL",
      "city": "Warszawa",
      "postalCode": "00-002",
      "streetAddress1": "Kolejowa 1"
    },
    "taxRegistrations": [
      {
        // additional seller fiscal representative in the invoice country 
        "fiscalRepresentative": {
          "businessName": "Ignacy Rzecki",
          "address": {
            "country": "PL",
            "city": "Warszawa",
            "postalCode": "01-234",
            "streetAddress1": "Krakowskie Przedmiescie 7"
          },
          "taxRegistrationNumber": "PL0002"
        },
        "isoCountryCode": "PL",
        "taxRegistrationNumber": "PL00001"
      }
    ]
  }
}

Example response:

{
  "data": {
    ...
    "lineItems": [
      {
        ...
        // added invoice URL 
        "documentImageUrl": "http://localhost:3008/html/v3/invoices/PNjQyNgAAAAY2ZDVmAAAAAGMyNjIAAAgfNDFiODY0MjY2ZDVmYzI2MjQxYjhiOGI2MGIwMWNjYjY3Yg/0/aXgR4PTdWFWXY8Do",
        "documentImageUrlSecret": "aXgR4PTdWFWXY8Do",
         ...
    },
    ...
  },
  ...
}

Did this page help you?