IDI version 26.11 is now available.  Click here for details: IDI Updates.

Using the TMForum API for Customers, BIlls, and Invoice Documents

Prev Next

This article describes each operation in the TMForum API, why you would use it, and which characteristics each operation accepts and returns. The TMForum API is an adapter that exposes IDI Billing customer accounts, invoices, and invoice documents using TM Forum Open API resource models:

  • TMF629 Customer Management v5 – Customers, which map to IDI Billing customer accounts.

  • TMF678 Customer Bill Management v5 – Customer bills and their applied billing rates, which map to IDI Billing invoices and their line items.

  • TMF667 Document Management v4 – Documents, such as the rendered invoice for a customer bill.

Any system that already speaks TMF (a CRM, a self-care portal, or an OSS/BSS integration layer) can use this API to read and maintain IDI Billing data without learning the native IDI Billing APIs.

Prerequisites

This article assumes that the developer understands how to obtain a Simple Web Token for use in requests to the IDI APIs. The token is passed in the Authorization header in the format WRAP access_token="mytoken".

All operations use the base URL https://api.idibilling.com/TMForum/2x/{environment}/api , where {environment} is replaced with the name of your own IDI platform environment.

NOTE:

It is imperative to understand that all requests to the IDI APIs have the potential to return errors in their responses back to the caller. These can occur for various reasons and require different actions to be taken, but generally the cause of any business rule validations (sometimes based on system configuration) will need to be addressed in the caller before the request is able to be successfully tried again. The TMForum API returns errors using the TMF630 Error structure (code, reason, message, status), except for request body validation failures, which return a standard validation problem response listing each invalid property. The TMForum API documentation contains more specific details about what values are valid under various circumstances.

How Characteristics Work

TMF resources carry product-specific values as a list of characteristics. Each characteristic is a name/value pair with a @type that identifies the type of the value. The TMForum API uses characteristics named idi.* to carry IDI Billing values that have no standard TMF property, such as the market or bill cycle of an account.

@type

Value type

StringCharacteristic

Text

IntegerCharacteristic

Whole number

NumberCharacteristic

Decimal number

FloatCharacteristic

Floating point number

BooleanCharacteristic

true / false

NOTE:

The type of a characteristic matters. Each idi.* characteristic is only recognized when it is sent as the type listed in the tables below. For example, idi.billing.billCycleID sent as the string "3" is treated as a StringCharacteristic and is ignored. Always include @type. When @type is omitted, the type is inferred from valueType, and then from the JSON value itself (a JSON number becomes an IntegerCharacteristic, true/false becomes a BooleanCharacteristic, and anything else becomes a StringCharacteristic).

Characteristics not listed in this article are accepted without error but are not applied.

Creating a New Customer Account

The Customer Management CreateCustomer operation is used when a new subscriber needs a billing account in IDI Billing, for example at the end of a sign-up flow in a CRM or self-care portal. It creates a billable, active customer account together with its primary customer contact, and returns the new customer. The returned customer id is the IDI Billing account number, which is used by every other customer operation.

During creation the following happens automatically:

  • The address in the first GeographicAddressContactMedium is validated using the address validation type configured for the primary customer contact type, and the standardized address is stored. If address validation fails, the customer is not created.

  • The receivable group, aging group, finance group, and invoice format are defaulted from the Field Configuration "Can Default" rules for the account type. If a rule cannot be resolved for any of these, the customer is not created and a 400 error names the missing field code.

  • engagedParty.name (or name when engagedParty.name is omitted) is split on the first space into the primary contact's first and last name.

  • engagedParty.id and engagedParty.@referredType are stored on the account as extended information so the customer can be linked back to the party in the calling system. @referredType defaults to Individual.

CreateCustomer Characteristics

Characteristic

@type

Required

IDI Billing field

Notes

idi.billing.market

StringCharacteristic

Yes

Market

The market name. It is looked up and stored as the Market ID. The customer is not created if the market is not found.

idi.customer.accountType

StringCharacteristic

No

Account Type

RESIDENTIAL, BUSINESS, or WHOLESALE (not case-sensitive). Defaults to RESIDENTIAL, as does any other value.

idi.billing.billCycleID

IntegerCharacteristic

No

Bill Cycle

When omitted, the default bill cycle for the account type and market as of today is used.

idi.billing.billingAccountNumber

StringCharacteristic

No

Account Number

The account number to assign. It must not be empty when provided. When omitted, IDI Billing assigns the account number.

CreateCustomer Property Mapping

TMF property

IDI Billing field

name (required)

Customer Name

engagedParty.id (required)

Extended information tmf.engagedParty.id

engagedParty.@referredType

Extended information tmf.engagedParty.referredType

engagedParty.name

Primary contact first and last name

First PhoneContactMedium.phoneNumber

Primary contact phone number 1

First EmailContactMedium.emailAddress

Primary contact email address 1

First GeographicAddressContactMedium

Primary contact address (standardized by address validation)

The properties description, role, account, agreement, paymentMethod, creditProfile, relatedParty, status, statusReason, and validFor are accepted but not currently applied.

Create Customer Example URL: https://api.idibilling.com/TMForum/2x/{environment}/api/customerManagement/v5/customer

POST

{

  "@type": "Customer",

  "name": "Jane Doe",

  "engagedParty": {

    "id": "IND-12345",

    "name": "Jane Doe",

    "@referredType": "Individual"

  },

  "characteristic": [

    { "@type": "StringCharacteristic", "name": "idi.billing.market", "value": "Des Moines" },

    { "@type": "StringCharacteristic", "name": "idi.customer.accountType", "value": "RESIDENTIAL" }

  ],

  "contactMedium": [

    { "@type": "PhoneContactMedium", "phoneNumber": "5155550100" },

    { "@type": "EmailContactMedium", "emailAddress": "jane.doe@example.com" },

    {

      "@type": "GeographicAddressContactMedium",

      "street1": "123 Main St",

      "city": "Des Moines",

      "stateOrProvince": "IA",

      "postCode": "50309",

      "country": "US"

    }

  ]

}

NOTE:

A successful request returns 201 Created with the new customer in the response body and its URL in the Location header. The id shown here is the account number that will be used in any subsequent operations on the customer.

{

  "@type": "Customer",

  "id": "100200300",

  "href": "https://api.idibilling.com/TMForum/2x/{environment}/api/customerManagement/v5/customer/100200300",

  "name": "Jane Doe",

  "status": "active"

}

Retrieving a Customer

The Customer Management GetCustomer operation is used when you already know the account number and need the current state of the account, for example to display an account summary, to confirm a customer before taking an action on the account, or to read the current balance. It returns the account details, primary contact information, and the current amount due.

Returned Customer Characteristics

The following characteristics are returned by GetCustomer, as well as by GetCustomerList, CreateCustomer, and PatchCustomer.

Characteristic

@type

IDI Billing field

Notes

idi.billing.billingAccountNumber

StringCharacteristic

Account Number

Also used as the customer id.

idi.billing.billCycleID

IntegerCharacteristic

Bill Cycle ID

idi.customer.accountType

StringCharacteristic

Account Type

The account type name.

idi.customer.marketID

IntegerCharacteristic

Market ID

Returned as the market ID, while requests send the market name in idi.billing.market.

idi.billing.currentAmountDue

NumberCharacteristic

Total balance

The current total balance of the account.

idi.billing.currentAmountDueAsOf

StringCharacteristic

—

The UTC date and time the balance was read.

Returned Customer Property Mapping

TMF property

IDI Billing field

id

Account Number (Customer ID when the account has no account number)

name

Customer Name

status

Account Status: active, inactive, or suspended

statusReason

Change Reason

engagedParty.id / @referredType

Extended information stored when the customer was created or last updated

engagedParty.name

Primary contact first and last name

contactMedium

Primary contact phone number 1 (preferred), phone number 2, email address 1, and address

validFor.startDateTime / endDateTime

Establish Date / Disconnect Date

Get Customer Example URL: https://api.idibilling.com/TMForum/2x/{environment}/api/customerManagement/v5/customer/ {account number}

GET

Listing Customers

The Customer Management GetCustomerList operation is used to page through customer accounts, for example for an initial synchronization of accounts into a calling system. Prospect customers and customers whose disconnect date has passed are excluded, and results are ordered by customer ID. Use limit and offset to page through the results. Each customer in the list contains the same characteristics as GetCustomer.

List Customers Example URL: https://api.idibilling.com/TMForum/2x/{environment}/api/customerManagement/v5/customer?limit=50&offset=0

GET

Updating a Customer

The Customer Management PatchCustomer operation is used when details of an existing account change, for example when a subscriber updates their contact information, moves to a new address, changes account type or market, or when the account status needs to change. Only the properties you include are changed, and the updated customer is returned.

During the update the following happens automatically:

  • The address in the first GeographicAddressContactMedium is compared to the current primary contact address. The address is only validated when it has changed, and the standardized address is stored. When the address is unchanged or omitted, the existing address is kept.

  • engagedParty is required. engagedParty.id and engagedParty.@referredType always overwrite the values stored on the account, and @referredType defaults to Individual.

PatchCustomer Characteristics

Characteristic

@type

IDI Billing field

Notes

idi.billing.market

StringCharacteristic

Market

The market name. It is looked up and stored as the Market ID. The request fails if the market is not found.

idi.customer.accountType

StringCharacteristic

Account Type

RESIDENTIAL, BUSINESS, or WHOLESALE (not case-sensitive). Any other value is treated as RESIDENTIAL.

idi.billing.billCycleID

IntegerCharacteristic

Bill Cycle

Must be a positive integer. It is only applied when the customer is a Prospect; for any other customer it is ignored.

idi.billing.billingAccountNumber

StringCharacteristic

—

Must not be empty when provided, but the account number is not changed by this operation.

PatchCustomer Property Mapping

TMF property

IDI Billing field

name

Customer Name

status

Account Status: active, inactive, or suspended. Any other value is treated as inactive.

engagedParty.id (required)

Extended information tmf.engagedParty.id

engagedParty.@referredType

Extended information tmf.engagedParty.referredType

engagedParty.name (or name when omitted)

Primary contact first and last name

PhoneContactMedium.phoneNumber

Primary contact phone number 1

EmailContactMedium.emailAddress

Primary contact email address 1

First GeographicAddressContactMedium

Primary contact address (standardized by address validation when changed)

The properties description, role, account, agreement, paymentMethod, creditProfile, relatedParty, statusReason, and validFor are accepted but not currently applied.

Update Customer Example URL: https://api.idibilling.com/TMForum/2x/{environment}/api/customerManagement/v5/customer/ {account number}

PATCH

{

  "@type": "Customer",

  "engagedParty": {

    "id": "IND-12345"

  },

  "characteristic": [

    { "@type": "StringCharacteristic", "name": "idi.customer.accountType", "value": "BUSINESS" }

  ],

  "contactMedium": [

    { "@type": "EmailContactMedium", "emailAddress": "jane.doe@example.com" }

  ]

}

Finding the Bills for an Account

The Customer Bill Management GetCustomerBillList operation is used to show a subscriber their billing history, or to find the invoice number of a specific bill. Pass the account number in the id query parameter to return the bills for one account, and use limit and offset to page through the results. When id is omitted, bills for all accounts are returned. A 404 is returned when no invoices match.

The Customer Bill Management GetCustomerBill operation is used when you already know the invoice number and need the summary of that one bill, such as the amount due and due date.

Customer bills do not carry characteristics. The following properties are populated from the IDI Billing invoice:

TMF property

IDI Billing field

id / billNo

Invoice Number

billDate

Invoice Date

paymentDueDate

Invoice Due Date

amountDue

Total Amount Due

remainingAmount

Previous invoice amount plus payments and adjustments

taxExcludedAmount

Total New Charges

taxIncludedAmount

Taxes

state

sent when the bill period has been approved; otherwise new for a prebill and validated for a final invoice

billingAccount.id / name

Account Number / Customer Name

billCycle.id

Bill Period ID

billingPeriod

Bill period start and end date

billDocument[0].href

Link to the invoice document (see Retrieving the Invoice Document)

All amounts are returned in USD.

List Customer Bills Example URL: https://api.idibilling.com/TMForum/2x/{environment}/api/customerBillManagement/v5/customerBill?id= {account number}&limit=12

GET

Get Customer Bill Example URL: https://api.idibilling.com/TMForum/2x/{environment}/api/customerBillManagement/v5/customerBill/ {invoice number}

GET

Retrieving the Line Items of a Bill

The Customer Bill Management GetAppliedCustomerBillingRateList operation is used when a subscriber needs to see what makes up a bill, for example to display an itemized bill or to explain a charge. Pass the invoice number in the bill.id query parameter. Each applied customer billing rate is one charge, credit, payment, adjustment, usage total, or tax on the invoice.

NOTE:

Always pass bill.id. When it is omitted, the line items of the most recent non-prebill invoice in the entire environment are returned, which may belong to any account. limit and offset are accepted but are not currently applied; all line items for the invoice are returned.

The appliedBillingRateType of each rate is appliedBillingCredit for discounts, payments, credit adjustments, and negative amounts; appliedPenaltyCharge for positive penalties and finance charges; and appliedBillingCharge for everything else.

Returned Applied Customer Billing Rate Characteristics

Every applied customer billing rate returns two characteristics, both of type StringCharacteristic:

  • idi.invoiceDetailType – The kind of line item.

  • idi.invoiceDetailSubType – A more specific description of the line item.

Their values depend on which part of the invoice the rate comes from:

Source

id

idi.invoiceDetailType

idi.invoiceDetailSubType

Invoice features (recurring, non-recurring, discounts, penalties, installment plans)

{invoice number}-{invoice detail ID}

Invoice detail type

Service description, or the alternate invoice description

Ledger items (payments and adjustments)

{invoice number}-{ledger item ID}

Ledger item type

Ledger item type name

Finance charge (only when non-zero)

Invoice number

Finance Charge

(empty)

Usage, one per service

Service ID

usage

Service catalog

Service-level taxes

Service ID

Taxes

Service Level

Account-level taxes not already reported at the service level

Tax ID

Taxes

Account Level

Tax rates also carry appliedTax with the tax name (taxCategory), tax percentage (taxRate), and tax amount. Rates that belong to a service carry product.id, which is the service number.

List Applied Customer Billing Rates Example URL: https://api.idibilling.com/TMForum/2x/{environment}/api/customerBillManagement/v5/appliedCustomerBillingRate?bill.id= {invoice number}

GET

Retrieving the Invoice Document

The Document Management GetDocument operation is used to download the rendered invoice so it can be displayed or emailed to the subscriber. The href in billDocument on every customer bill already points to this operation, so the simplest approach is to follow that link.

The document id is in the format {documentType}-{documentId}. For an invoice this is invoice-{invoice number}. The response body is the document file itself (for example a PDF), not a TMF Document resource. The document operation has no characteristics.

Get Document Example URL: https://api.idibilling.com/TMForum/2x/{environment}/api/documentManagement/v4/document/invoice- {invoice number}

GET