Get invoice line items for customers

Prev Next

Retrieves invoice line items for a specified billing period. The API returns detailed invoice records including subscription information, customer details, pricing, taxes, discounts, billing metadata, and ownership hierarchy information.

Endpoint

POST {{apiUrl}}/api/invoices/Download/v3/BillingPeriods/{{billingperiodid}}

Endpoint Parameters

ParameterRequiredDescription
{{apiUrl}}YesC3 Portal API URL.
{{billingperiodid}}NoBilling period identifier. Specify a value to retrieve invoice details for a particular billing period. Omit this parameter to retrieve details for the current billing period.

Request Headers

HeaderValue
AuthorizationBearer <access_token>
Content-Typeapplication/json

Request Body

Payload

Description

{

"TenantId":"<tenantids-as-comma-separated-values>"

}

The body for this request is optional. If the body is left blank, the API would return the invoice line items for all the active customers.

Successful Response

A successful request returns invoice line items for the specified billing period.

Sample Response

{
    "OperationType": null,
    "Status": "Success",
    "RequestCorrelationID": "fb56cfb8-5a3a-4368-af9a-80aa81f1ebdb",
    "ErrorMessage": null,
    "ErrorDetail": null,
    "Data": [
        {
            "CustomerBillingType": null,
            "ERPCustomerID": null,
            "CRMOpportunityID": null,
            "CouponDiscountPercentage": null,
            "ProviderOfferId": "US:CFQ7TTC0LH34:0001:P3Y:Annual",
            "SubscriptionStartDate": "2026-09-15T00:00:00",
            "SubscriptionEndDate": "2029-08-31T00:00:00",
            "ProviderCategory": "commercial",
            "Category": "OnlineServicesNCE",
            "ProductSKUId": "2880026b-2b0c-4251-8656-5d41ff11e3aa",
            "UniqueProviderOfferId": "US:CFQ7TTC0LH34:0001:P3Y:Annual:commercial",
            "UnitPriceOfProduct": 719.04000000,
            "ReservationOrderId": null,
            "InvoiceEntity": "Customer",
            "ResellerName": null,
            "ProviderInvoiceNumber": null,
            "MSUnitListPriceToDistributor": null,
            "MSEffectiveUnitListPriceToDistributor": null,
            "MSEffectiveCostToDistributor": null,
            "MSUnitRetailPrice": null,
            "MSEffectiveUnitRetailPriceForCustomer": null,
            "MSEffectiveRetailTotalForCustomer": null,
            "DistributorTotalMargin": null,
            "ResellerTotalMargin": null,
            "CustomerC3Id": "C0486975-C579-400D-88DC-BA2CBDB596A6",
            "CustomerSourceSystemReferenceId": null,
            "ResellerC3Id": null,
            "ResellerSourceSystemReferenceId": null,
            "ProductTags": null,
            "TenantID": "9f7f543a-93fd-4fae-b31c-8baf37da008b",
            "SubscriptionID": "79b2a45a-9809-4687-ceca-1fb31b5e8a1a",
            "CurrencyCode": "USD",
            "AlternateId": null,
            "ItemCode": "",
            "CustomerName": "Contoso Ltd",
            "InvoiceNumber": "Invoice_Contoso_20261001_USD_NCEUpfrontInvoice",
            "InvoiceGeneratedDate": "2026-09-15T00:00:00",
            "InvoiceDueDate": "2026-10-28T00:00:00",
            "SubscriptionName": "Dynamics 365 Business Central Essentials",
            "ChargeStartDate": "2026-09-15T00:00:00",
            "ChargeEndDate": "2029-08-31T00:00:00",
            "LineItemType": "NCE line item charges New",
            "Quantity": 3.00000000,
            "UnitPrice": 2129.58000000,
            "InvoiceLineAmount": 6388.74000000,
            "DiscountAmount": 1916.64000000,
            "TaxAmount": 89.44000000,
            "PreTaxAmount": 4472.10000000,
            "PostTaxAmount": 4561.54000000,
            "TaxPercentage": 2.00000000,
            "SubscriptionType": "OnlineServicesNCE",
            "OfferCode": "MS-CSPLicense",
            "TaxCode": null,
            "OfferID": "US:CFQ7TTC0LH34:0001",
            "InternalBillingID": null,
            "CostOnPartner": 4179.51000000,
            "PONumber": null,
            "Notes": null,
            "OwnerEntity": "Department",
            "OwnerName": "Finance",        
            "ConversionRate": 1.00000000,
            "InvoiceNumberFromExternalService": null
        }
    ]
}

Response Properties

PropertyDescription
OperationTypeReserved for internal use. Can be ignored.
StatusIndicates the result of the request. Possible values: Success, Error.
RequestCorrelationIDUnique identifier generated by C3 for request tracking and troubleshooting.
ErrorMessageContains the error message if request processing fails.
ErrorDetailContains additional error information.
DataCollection of invoice line item records.

Invoice Line Item Attributes

AttributeDescription
CustomerBillingTypeCustom billing type configured for the customer.
ERPCustomerIDERP customer identifier configured for the customer.
CRMOpportunityIDCRM opportunity identifier configured for the customer.
CouponDiscountPercentageDiscount percentage applied through a coupon.
ProviderOfferIdProvider offer identifier in the format Market:Product:SKU:Term:BillingPlan.
SubscriptionStartDateSubscription start date.
SubscriptionEndDateSubscription end date.
ProviderCategoryProvider category of the offer, such as commercial. Returns null for custom products.
CategoryCategory of the offer, such as OnlineServicesNCE, AzurePlan, Azure, PerpetualSoftware, Custom, or Bundles.
ProductSKUIdUnique Microsoft product SKU identifier.
UniqueProviderOfferIdUnique combination of ProviderOfferId and ProviderCategory.
UnitPriceOfProductPublished unit price of the product.
ReservationOrderIdAzure Reservation or Savings Plan order identifier.
InvoiceEntityEntity receiving the invoice. Possible values include Customer and Reseller.
ResellerNameName of the reseller when applicable.
ProviderInvoiceNumberInvoice number provided by Microsoft.
CustomerC3Id
Unique identifier of the customer in C3.
CustomerSourceSystemReferenceId
Customer reference identifier from the source system, supplied when the customer was onboarded through the API.
ResellerC3Id
Unique identifier of the reseller in C3. Populated for customers managed through a reseller.
ResellerSourceSystemReferenceId
Reseller reference identifier from the source system, supplied when the reseller was onboarded through the API.
ProductTags
Tags configured for the product in C3.
TenantIDMicrosoft tenant identifier.
SubscriptionIDSubscription identifier.
CurrencyCodeCurrency used for invoicing.
AlternateIdAlternative order identifier provided by Microsoft.
ItemCodePartner-defined product identifier.
CustomerNameName of the customer.
InvoiceNumberUnique invoice number.
InvoiceGeneratedDateDate on which the invoice was generated.
InvoiceDueDateInvoice payment due date.
SubscriptionNameName of the subscription.
ChargeStartDateStart date of the billed period.
ChargeEndDateEnd date of the billed period.
LineItemTypeType of charge associated with the invoice line item, for example NCE line item charges New or PurchaseFee.
QuantityQuantity billed.
UnitPricePrice per unit.
InvoiceLineAmountTotal amount for the line item before discounts and taxes (Quantity × UnitPrice).
DiscountAmountDiscount amount applied. Returns null if no discount is applicable.
PreTaxAmountAmount after discount and before tax.
TaxAmountTax amount applied.
PostTaxAmountTotal amount including taxes.
TaxPercentageApplied tax percentage.
SubscriptionTypeSubscription category such as OnlineServices, AzurePlan, Azure, Bundles, or Custom.
OfferCodeInternal offer classification code.
TaxCodeTax rule applied.
OfferIDOffer identifier associated with the subscription.
InternalBillingIDInternal billing reference configured for the customer.
CostOnPartnerCost charged to the partner.
PONumberPurchase order number.
NotesCustom invoice notes configured for the customer.
OwnerEntityOwner of the invoice line item. Possible values: Customer, Site, Department.
OwnerNameName of the owning entity.
ConversionRateCurrency conversion rate applied.
InvoiceNumberFromExternalServiceInvoice number from external systems such as Xero or QuickBooks.

Error Response

The API validates the supplied billing period identifier and tenant identifiers before processing the request. If validation fails, an error response is returned.

Sample Error Response

{
    "OperationType": null,
    "Status": "Error",
    "RequestCorrelationID": "74b25ac2-aa76-456b-b5b4-3106a489fc89",
    "ErrorMessage": "ERROR_DESC_BAD_INPUT",
    "ErrorDetail": null,
    "Data": [
        {
            "Atribute": "BillingPeriodId",
            "AtributeKey": "BILLING_PERIOD_ID",
            "Message": "Invalid Billing Period. Should be one of the 9 most recent billing periods",
            "DefaultMessage": "INVALID_BILLING_PERIOD_ID",
            "Value": "4"
        }
    ]
}

Validation Error Properties

PropertyDescription
AttributeName of the invalid input parameter.
AttributeKeyInternal validation key.
MessageHuman-readable validation error message.
DefaultMessageValidation failure code.
ValueInvalid value supplied in the request.