Recurring Templates

Recurring templates are used to generate invoices automatically on a recurring basis.

Create Recurring Profiles

recurring.create

The method arguments are similar to invoice.create, though the following fields are present: recurring_title - template title

  • recurring_start_date_from - recurring start date
  • recurring_frequency - recurring frequency
  • recurring_period - recurring period

Recurring templates have also a list of associated clients.

Request

<?xml version="1.0" encoding="UTF-8"?>
<request method="recurring.create">
	<recurring>	
		<currency>USD</currency>		//mandatory
		<tax>8.75%</tax>			//percent
		<freight>3.45</freight>										
		<terms>NET 60</terms>//mandatory possible values: NET 15, NET 30, NET 45, NET 60, or date: e.g. 2007-09-28
		<late_fee>1.5%</late_fee>		//mandatory possible values: 1%, 1.5%, 2% or amount: e.g. 1.45
		<recurring_title>Recurring 1</recurring_title>
		<recurring_start_date_from>2007-11-30</recurring_start_date_from>
		<recurring_frequency>2</recurring_frequency> //mandatory
		<recurring_period>month</recurring_period>   //mandatory possible values: day, week, month, year
		<tags>tag1 tag2 tag3</tags>
		<lines>
			<line>				//must have at least 1 line
				<quantity>2</quantity>								
				<kind>Hours</kind>	//mandatory possible values: Hours, Days, Product, Expense
				<description>description1</description>
				<tax>1</tax>		//possible values: 1 (have tax) or 0
				<price>1.00</price>	//must be numeric value
			</line>
			<line>
				<quantity>2</quantity>
				<kind>Days</kind>
				<description>description2</description>
				<tax>0</tax>
				<price>2.00</price>
			</line>
			<line>
				<quantity>2</quantity>
				<kind>Product</kind>
				<description>descr3</description>
				<tax>1</tax>
				<price>3.00</price>
			</line>
		</lines>
		<clients>
			<client>
				<client_id>1</client_id>
			</client>
			<client>
				<client_id>2</client_id>
			</client>
		</clients>
	</recurring>
</request>

Response

<?xml version="1.0" encoding="UTF-8"?>
<response status="ok">
  <recurring_id>1</recurring_id>
</response>

Update Recurring Templates

recurring.update

Update an existing recurring with the given recurring_id. Any recurring template fields left out of the request will remain unchanged.

  • If you do not specify a <lines> element, the existing lines will remain unchanged.
  • If you do not specify a <clients> element, the existing associated clients will remain unchanged.

Request

<?xml version="1.0" encoding="UTF-8"?>
<request method="recurring.update">
  <recurring>
    <recurring_id>1</recurring_id>                 # Recurring template to update
                                                   # Remaining arguments same as recurring.create
  </recurring>
</request>

Response

<?xml version="1.0" encoding="UTF-8"?>
<response status="ok"/>

Get Recurring Templates

reccuring.get Return the complete recurring template details associated with the given recurring_id.

Request

<?xml version="1.0" encoding="UTF-8"?>
<request method="recurring.get">
  <recurring_id>1</recurring_id>
</request>

Response

<?xml version="1.0"?>
<response status="ok">
	<recurring>	
		<currency>USD</currency>
		<tax>8.75%</tax>
		<freight>3.45</freight>										
		<terms>NET 60</terms>
		<late_fee>1.5%</late_fee>
		<recurring_title>Recurring 1</recurring_title>
		<recurring_start_date_from>2007-11-30</recurring_start_date_from>
		<recurring_frequency>2</recurring_frequency>
		<recurring_period>month</recurring_period>
		<tags>tag1 tag2 tag3</tags>
		<lines>
			<line>												
				<quantity>2</quantity>								
				<kind>Hours</kind>									
				<description>description1</description>
				<tax>1</tax>
				<price>1.00</price>
			</line>
			<line>
				<quantity>2</quantity>
				<kind>Days</kind>
				<description>description2</description>
				<tax>0</tax>
				<price>2.00</price>
			</line>
			<line>
				<quantity>2</quantity>
				<kind>Product</kind>
				<description>descr3</description>
				<tax>1</tax>
				<price>3.00</price>
			</line>
		</lines>
		<clients>
			<client>
				<client_id>1</client_id>
			</client>
			<client>
				<client_id>2</client_id>
			</client>
		</clients>
	</recurring>
</response>

Delete Recurring Template

recurring.delete Delete an existing recurring template.

Request

<?xml version="1.0" encoding="UTF-8"?>
<request method="recurring.delete">
  <recurring_id>1</recurring_id>
</request>

Response

<?xml version="1.0" encoding="UTF-8"?>
<response status="ok"/>

List Recurring Templates

recurring.list Returns a list of recurring template summaries.

Request

<?xml version="1.0" encoding="UTF-8"?>
<request method="recurring.list">
  <page>1</page>                      # Page number to return, default is 1 (Optional)
  <per_page>10</per_page>             # Number of results per page, default is 25 (Optional)
</request>

Response

<?xml version="1.0" encoding="UTF-8"?>
<request method="recurring.create">
	<recurring>	
		<currency>USD</currency>
		<tax>8.75%</tax>
		<freight>3.45</freight>										
		<terms>NET 60</terms>
		<late_fee>1.5%</late_fee>
		<recurring_title>Recurring 1</recurring_title>
		<recurring_start_date_from>2007-11-30</recurring_start_date_from>
		<recurring_frequency>2</recurring_frequency>
		<recurring_period>month</recurring_period>
		<tags>tag1 tag2 tag3</tags>
		<lines>
			<line>												
				<quantity>2</quantity>								
				<kind>Hours</kind>									
				<description>description1</description>
				<tax>1</tax>
				<price>1.00</price>
			</line>
			<line>
				<quantity>2</quantity>
				<kind>Days</kind>
				<description>description2</description>
				<tax>0</tax>
				<price>2.00</price>
			</line>
			<line>
				<quantity>2</quantity>
				<kind>Product</kind>
				<description>descr3</description>
				<tax>1</tax>
				<price>3.00</price>
			</line>
		</lines>
		<clients>
			<client>
				<client_id>1</client_id>
			</client>
			<client>
				<client_id>2</client_id>
			</client>
		</clients>
	</recurring>
</request>
 
acuinvoice_api/recurring.txt · Last modified: 2008/03/17 11:35 by admin
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki