The Balance reservations are used when some billed activity takes time and/or a billing activity takes place in several steps. The application first "reserves" a certain monetary amount, sufficient to pay for some initial stage of the billed activity. For example, it can be an amount needed to pay for the first minute of a call, or to play the first level of a game.
If the selected Balance does not have sufficient funds, the reservation request is rejected. Otherwise, a reservation (with an application-supplied or server-generated name) is created inside the Balance. The total funds available in the Balance are decreased by the reserved amount, but not charge record is created in the transaction log.
As the payment amount of the billed activity approaches the reserved amount, the application "extends" the created reservation by some additional amount. If the Balance does have enough "free funds" (i.e. funds not reserved with other reservations), the reservation amount is extended.
The application can release the created reservation. The reservation is removed from the Balance, and the reserved amount is returned to the Balance "free funds". For example, this function can be used when a phone call was not connected, as the reserved funds must be released without recording any charge transaction.
Finally, the application charges the Balance, specifying the reservation. The charge amount should not exceed the amount reserved. The transaction log record is created, and the charged amount is subtracted from the Balance and from the reservation reserved amount. Optionally, the reservation can be released, and the remaining funds returned to the Balance "free funds".
When a reservation is created or extended, the application can specify the reservation expiration time. The reservation is released automatically after the specified time. This feature can be used if the application can disconnect or quit without explicitly releasing its reservations.
When creating or extending a reservation, the application can specify the amount that should be charged if the reservation is timed-out and it is released automatically. For example, when a game application extends the reservation to cover the next game level, it can specify the amount that should be already be paid for the current game. If the application quits or disconnects without explicitly charging the Balance reservation, the reservation will be released automatically, but the specified amount will be changed first.