In this topic:

Assigning Dunning to a Billing Account

To start using the Dunning functionality, associate your Dunning Plan and tiers with a billing account.

If you do not have a billing account yet, you can create a new one specifying your Dunning Plan in a payload. For more information about billing accounts, refer to Billing Account API examples.

Creating a billing account with Dunning Plan

With the following endpoint and sample payload, create a new billing account with the Dunning already assigned.

Note: For creating a billing account, use the URL and authentication for Billing API.

POST https://example-tract-api.com/billing/2/billing-accounts

Request

{
  "bill_type": "NONE",
  "bill_cycle": {
      "bill_cycle_type": "monthly",
      "id": "4906"
   },
  "responsible_party": {
      "party_type": "person",
      "company": "Sample Inc.",
      "addresses": [
      {
          "address_type": "postal",
	      "id": "3071804",
	      "purpose": "BILLING",
	      "country": "USA",
	      "city": "Austin",
	      "line1": "West Alley 21",
	      "region_or_state": "TX",
	      "postal_code": "78701"
       }
       ],
     "first_name": "Sample",
     "last_name": "User"
   },
  "recurring_payments": [],
  "billing_account_category": {
	 "id": "770",
	 "name": "USD Account category"
	 },
  "auto_payment_authorized": false,
  "status": "ACTIVE",
  "pending_charges_total": 0,
  "balance": 0,
  "start_date": "2018-01-01",
  "custom_field_values": [],
  "contacts": [
  {
      "party_type": "person",
	  "company": "Sample Inc.",
	  "addresses": [
	   {
	       "address_type": "postal",
		   "purpose": "BILLING",
		   "country": "USA",
		   "city": "Austin",
		   "line1": "West Alley 21",
		   "region_or_state": "TX",
		   "postal_code": "78701"
		}
	],
	"first_name": "Sample",
	"last_name": "User"
	}
],
  "tax_exempt": true,
  "currency_code": "USD",
  "next_invoice_date": "2018-02-01",
  "dunning_state": {
      "enabled": true,
	  "plan_code": "Standard Client #1",
	  "plan_name": "Standard Client",
	  "tier_code": "Tier 2",
	  "tier_name": "Friendly reminder"
},
  "background_allocation": false
}
				

Response

{
  "id": "1481916",
  "account_num": "a22",
  "external_account_num": null,
  "bill_type": "NONE",
  "bill_cycle": {
      "bill_cycle_type": "monthly",
      "id": "4906
…
}

Assigning dunning to the existing account

To assign a Dunning Plan to the already existing account, use the following command:

POST https://example-public-api.gotransverse.com/billing/2/billing-accounts/
{billing_account_id}/dunning-state

Request

{
  "enabled": "true",
  "plan_code": "Standard Client #1"
}

Response

{
  "id": "440",
  "enabled": true,
  "plan_code": "Standard Client #1",
  "plan_name": "Standard Client",
  "tier_code": "default_no_dunning",
  "tier_name": "No Dunning"
}

Next steps

Once you have enabled Dunning Plan on a billing account, proceed with creating and running the JSS job for Dunning.

Top