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

{
"external_account_num": "A111",
"start_date": "2020-04-01T06:00:00.000Z",
"responsible_party": {
	"party_type": "organization",
	"organization_name": "Company Inc.",
	"addresses": [{
		"address_type": "email",
		"purpose": "PRIMARY",
		"email": "jane.example@gotransverse.com"
	},
	{
		"address_type": "postal",
		"purpose": "BILLING",
		"country": "USA",
		"city": "AUSTIN",
		"region_or_state": "TX",
		"postal_code": "78701",
		"line1": "620 CONGRESS AVE SUITE 200"
	}]
},
"bill_cycle": {
	"bill_cycle_type": "monthly",
	"id": "26686"
},
"bill_type": "EMAIL",
"billing_account_category": {
	"id": "938"
}, 
"dunning_state": {
	"enabled": true,
	"plan_code": "Standard Client #1",
	"plan_name": "Standard Client",
	"tier_code": "Tier 2",
	"tier_name": "Friendly reminder"
}
}

Response

{
"id": "1513630",
"account_num": "Dpref3533",
"external_account_num": "A111",
"bill_type": "EMAIL",
"bill_cycle": {
	"bill_cycle_type": "monthly",
	"id": "26686",
	"status": "ACTIVE",
	"name": "sample-tax-1",
	"start_date": "2020-04-02T00:00:00-05:00",
	"end_date": "2020-05-02T00:00:00-05:00",
	"internal_render": true,
	"auto_bill": false,
	"include_external_charges": false,
	"currency_code": "USD",
	"billing_account_category": {
		"id": "938",
		"name": "All Accounts"
	},
	"current_bill_cycle_run": {
		"bill_run_type": "cycle",
		"id": "1982166"
	},
	"day_of_month": 2
},
"responsible_party": {
	"party_type": "organization",
	"id": "1520522",
	"addresses": [
	{
		"address_type": "email",
		"id": "3208444",
		"purpose": "PRIMARY",
		"email": "jane.example@gotransverse.com"
	},
	{
"address_type": "postal",
"id": "3208446",
"purpose": "BILLING",
"country": "USA",
"city": "AUSTIN",
"line1": "620 CONGRESS AVE SUITE 200",
"region_or_state": "TX",
"postal_code": "78701"
}
],
"customer_num": "8794",
"organization_name": "Company Inc.",
"tax_id_validated": false
},
"recurring_payments": [],
"billing_account_category": {
	"id": "938",
	"description": "Default billing account category",
	"status": "ACTIVE",
	"name": "All Accounts",
	"payment_term": {
		"id": "1060",
		"name": "Immediate"
	},
	"auto_pay_offset": 0,
	"preferred_language_code": null,
	"minimum_invoice_thresholds": []
},
"auto_payment_authorized": false,
"status": "ACTIVE",
"pending_charges_total": 0.00,
"balance": 0.00,
"start_date": "2020-04-01T01:00:00-05:00",
"custom_field_values": [],
"contacts": [],
"tax_exempt": false,
"currency_code": "USD",
"next_invoice_date": "2019-05-02T00:00:00-05:00",
"responsible_account": {
	"id": "1513630",
	"account_num": "Dpref3533",
	"external_account_num": "A111"
},
"dunning_state": {
	"id": "850",
	"enabled": true,
	"plan_code": "Standard Client #1",
	"plan_name": "Standard Client",
	"tier_code": "Tier 2",
	"tier_name": "Friendly reminder"
},
"background_allocation": false,
"preferred_language_code": null,
"minimum_invoice_amount": null,
"billing_schedules": []
				}

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.