Create OCS Invoice On-Demand

The CreateOcsOnDemandInvoice API is used to create invoices on demand for deactivated accounts in OCS.io.

API Overview

Fields Required for Creating OCS Invoice On-Demand

The following table lists and describes the fields required to create an OCS invoice on-demand through the CreateOcsOnDemandInvoice API:

Field Description

account

ID (Ref ID/ External ID) of the Account.

invoiceType

Type of the Invoice. If not provided, default is generated.

billCycleType

Type of the Billing Cycle. Allowed values - 'PERIODICAL', 'INITIAL', 'ADJUSTMENT', 'FINAL'.

billingPeriodStartDate

Start Date of the Billing Period (truncated time). If not provided, Invoice will be generated for Billing Cycle in which Account was active.

Detailed API documentation and endpoint specifics are available here.

Request Validations

The following validations are performed when creating an OCS invoice on-demand:

  • Account must be provided in the request, it must be already created in the system and must be in Deactivated State.

  • Payer must be already created in the system.

Create OCS Invoice On-Demand Example

Use the following request’s body to create an OCS invoice on-demand:

{
  "requestId": "{{$guid}}",
  "account": {
    "externalId": "account_external_id"
  },
  "invoiceType": "invoice_type_code",
  "billCycleType": "PERIODICAL",
  "billingPeriodStartDate": "2023-09-01T00:00:00Z"
}

The outcome of the API call is as follows:

  • It is validated that the account with External ID account_external_id exists.

  • The invoice is created as per the provided values.