WuBook services generate a cost. Such costs are generally monitored and managed on the Auth Factory Area ( ).

We also provide a way to programmatically manage them.

Filter params

For each group of collected costs (balances), we provide the following status:

  • current : services costs not yet claimable;
  • waiting : services waiting for a payment;
  • paid : paid services;

Anatomy of the datas

Every response is bult with a self-explanatory fields:

Field Type/(default value) Description
balance_id integer/(0) The balance id (as show on Auth Factory), in current search the value is 0 (mean no transaction)
services array of service/[] service container, a empty array mean no services

Below there are a description of the service object (struct):

Field Type Description
service_name string name of service
on_date string date (%d/%m/%Y %H:%M, e.g: 30/12/1970 10:57)
description string Description
cost float service cost
discounted_cost float discounted cost (or empty)

XML Example

+ show/hide code

Available functions

All functions return a common data scheme as described above

get_balance(token, lcode, status)

That function returns, if present, the trasactions of a specific property based by the status filter argument. The use of get_balance is available both for corporates and direct customers, except for account belonging to a corporate.

get_crp_balance(token, status)

The use of get_crp_balance is allowed only for corporates customers. That function returns, if present, the account level trasactions.

Working with waiting balances

That section is for corporates only.

Field Type
balance_ids ArrayOf balance_id
pay_balance(token, balance_ids)

The pay_balance function provides an on-demand payment, It is possible to pay waiting balances. This call will charge your registered credit card.

detach_balance(token, balance_ids)

The detach_balance function marks the selected balances as insolvent. It is possible to detach only waiting balances.

pay_balance_with_credit(token, lcode, balance_ids)

The pay_balance_with_credit function provides an on-demand payment, filtered by lodging code (lcode) It is possible to pay waiting balances. This call will use your credit.

Old functions (DEPRECATED)

balance_details(token, transaction_id)

The first function will return the list of your transactions. Notice that a transaction is a container of atomic costs. The result of such function is an array, each item having the following meaning:

  • id: guess what! the transaction id!! Surprise :)
  • closed_at: if frozen, this is the date of the transaction closure
  • details: the anatomy of the transaction
  • paid: is this transaction already paid?

Few remarks: the details field does not contain atomic costs. It aggregates them. For example, if you have 2 costs of the same type, then you will receive the sum of such costs, tagged with their related type. The transaction having id==0 (zero) is the current transaction, where current costs are inserted. It’s never closed, never paid.

The function balance_details is now used to retrieve all the atomic costs of a transaction. You obviously must specify the transaction ID and you can use ID=0 to read the current costs (costs associated to the current transaction). Its return value is again an array, each item having the following meaning:

  • descr: description
  • shortdescr: description
  • embargo: we will not require a payment until this date
  • registered: the registration time
  • currency: currency
  • dtype: the type of cost
  • name: the name of the type
  • amount: the cost
  • lcode: if not null, this cost has been generated for the related property