Using an AR Ledger

Once you have created and executed the AR Ledger, you can retrieve the charge information, accounting transactions, and the overall balance for associated billing accounts.

Retrieving charge information

To get all charge information records associated with your billing account, use the endpoint below. In the response body, you will receive all associated charge information values.

Retrieve charge information records

GET https://example.gotransverse.com/calypso/3/ledgers/chargeinfos?
billing_account={billing_account_number}

Response

{
  "id": 111,
  "created_on": "2018-08-02T13:32:11Z",
  "updated_on": "2018-08-02T13:32:11Z",
  "created_by": "ledger",
  "updated_by": "ledger",
  "ci_values": {
     "updated_on": "2018-08-02T13:32:11Z",
     "usage_created": "false",
     "prorate_on_cancel": "0",
     "product_category_name": "Default",
     "market_place_name": "Default Marketplace",
     "service_period_start_date": "2018-09-01T05:00:00Z",
     "product_id": "13040",
     "charge_category_id": "2934",
     "service_period_accrual_event_date": "2018-09-01T05:00:00Z",
     "charge_category_name": "Price category",
     "decimal_quantity": "1.00000",
     "order_type": "SALES",
     "invoice_created": "false",
     "service_activated": "false",
     "billing_account_bill_type": "NONE",
     "billing_account_num_ext": "10",
     "service_name": "First test product",
     "order_completed_event_date": "2017-07-07T06:59:44Z",
     "billing_account_category_id": "956",
     "charge_info_type": "RECURRING",
     "product_name": "First test product",
     "service_period_created": "1",
     "service_period_id": "636255294",
     "market_place_id": "628",
     "created_on": "2018-08-02T13:32:11Z",
     "prorate_on_order": "NONE",
     "order_id": "1977230",
     "service_deactivated": "false",
     "billing_account_start_date": "2016-07-01T05:00:00Z",
     "order_completed": "1",
     "service_period_end_date": "2018-10-01T05:00:00Z",
     "tenant_id": "111",
     "product_catalog_name": "Default Price List",
     "service_start_date": "2016-07-01T05:00:00Z",
     "is_credit_adjustment": "false",
     "payment_completed": "false",
     "service_period_recurrence_period": "BILLCYCLE",
     "service_id": "2083790",
     "tract_id": "create_service636255294_2083790",
     "ignore": "false",
     "currency": "ZAR",
     "service_price_id": "2342136",
     "amount": "100.0000000000",
     "service_period_service_price_id": "673864394",
     "bill_cycle_type": "MONTHLY",
     "billing_account_num": "111",
     "billing_account_id": "1415532",
     "unit_price": "100.00000",
     "adjustment_completed": "false",
     "order_item_completed": "false",
     "order_date": "2016-07-01T05:00:00Z",
     "billing_account_deactivated": "false",
     "unit_price_currency": "ZAR",
     "billing_account_category_name": "sample",
     "order_created_on_date": "2017-07-07T06:59:39Z"
},
  "charge_info_state_values": "{\"balances\":[],\"chargeInfoRelationships\":[],\"nextProcessedDate\":null,\"completed\":false,\"orderCompletedProcessed\":false,\"invoiceCreatedProcessed\":false,\"servicePeriodCreatedProcessed\":false,\"serviceDeactivatedProcessed\":false,\"billingAccountDeactivatedProcessed\":false,\"adjustmentCompletedProcessed\":false,\"usageCreatedProcessed\":false,\"revRecCompleted\":false,\"pendingProcessed\":false,\"chargeInformationEventStates\":[],\"customValues\":{},\"customListValues\":{}}",
  "billing_account_num": "NN111",
  "tract_id": "create_service636255294_2083790"
...
}

Viewing accounting transactions

Once the AR Ledger run has been executed, you can view the accounting transactions for your billing account associated with this AR Ledger.

Retrieve accounting transactions

GET https://example.gotransverse.com/calypso/3/ledgers/{ledger_id}/accounting-transactions

Response

[	
{
 "id": 111,
 "ledger_id": 7,
 "entries": [
 {
    "id": 67,
    "description": "sample description",
    "tenant_id": 111,
    "accounting_period_id": 67,
    "occurred_on": "2018-01-01T06:00:00Z",
    "event_date": "2018-07-06T16:43:43Z",
    "posted_on": "2018-01-01T06:00:00Z",
    "credit": false,
    "amount": {
       "amount": 10,
	 "currency": "USD"
  },
… [other accounting transactions]

Replicating the AR Ledger

Once you have the AR Ledger configured and ready for use, you can copy your data to the database.

POST https://example.gotransverse.com/calypso/3/replication/tract-gl

Response: 201 Created

Viewing the balance

The balance can then be viewed for associated GL Accounts.

GET https://example.gotransverse.com/calypso/3/ledgers/{ledger_id}/balance

Response

{
...
[
{
  "entity_type": "GL_ACCOUNT",
  "gl_account_number": "1115",
  "gl_account_name": "Subscription Revenue",
  "amounts": [
{
     "amount": 76550.99,
     "currency": "USD"
}
 ] 
 },
{
  "entity_type": "GL_ACCOUNT",
  "gl_account_number": "2510",
  "gl_account_name": "REVENUE",
  "amounts": [
{
	 "amount": -200,
     "currency": "EUR"
},
{
... [other balance data]
}