anchor.diff:  = Overdue System
   
   [[intro]]
  -== Introduction
  -
  -In this tutorial, we look a little bit deeper into the overdue system. The main subscription userguide already provides a section explaining the basics about the overdue system and in particular goes through the schema of the `overdue.xml` configuration file. This tutorial will show you how it works in practice.
  -
  -This document assumes the following:
  -
  -* The reader already knows how to http://docs.killbill.io/latest/getting_started.html[setup the system], upload a catalog or overdue configuration file (either though API or using KAUI).
  -* The system was installed with the KPM OSGI bundle (required for installing payment-test plugin)
  -* The system was started with the system property  `org.killbill.server.test.mode=true` which allows to move the clock through time
  +
  +== Pre-requisites
  +
  +* Ensure that you have configured Kill Bill, Kaui and the database as explained in the http://docs.killbill.io/latest/getting_started.html[Getting Started] document.
  +* Ensure that you have set up a tenant configured with API key `bob` and API secret `lazar`.
  +* Ensure that the `org.killbill.server.test.mode=true` property is set which allows to move the clock through time
  +* Ensure that you have gone through the https://docs.killbill.io/latest/userguide_subscription.html[Subscription UserGuide] and are familiar with catalogs/invoices,etc.
  +* Ensure that you have https://curl.haxx.se/[cURL] installed. If you are on Windows, we recommend that you use https://git-scm.com/download/win[Git Bash] to run the `cURL` commands.
   
   === Scenario
   
  
positive.code: "http://127.0.0.1:8080/1.0/kb/catalog/xml"
  ----
  
  
  === Overdue configuration
  
  The overdue configuration will define the three states the account will go through:
  
  1. The account will enter the WARNING state 10 days after the first unpaid invoice (i.e. 20 days after the subscription creation)
  2. 4 days later, the account will move to the BLOCKED state
  3. 7 days later, the account will move to the CANCELLATION state
  
  [source,xml]
  ----
  
negative.code: -H "Content-Type: application/json" \
  -H 'X-Killbill-CreatedBy: demo' \
  -X POST \
  "http://127.0.0.1:8080/1.0/kb/test/clock?requestedDate=2021-09-06"
  ----
  
  [start = 8]
  . Move clock +1 day (2021-09-07) and observe first payment retry
  
  [source,bash]
  ----
  