0

Closed

Support recurring.create

description

http://developers.freshbooks.com/docs/recurring/
 
recurring.create
 
Create a new recurring profile. The method arguments are nearly identical to invoice.create, but include five additional fields:
 
  • occurrences
    Number of invoices to generate, with zero (0) being infinite
  • frequency
    Rate at which to generate invoices – can be one of ‘weekly’, ’2 weeks’, ’4 weeks’, ‘monthly’, ’2 months’, ’3 months’, ’6 months’, ‘yearly’, ’2 years’
  • stopped
    This profile is no longer generating invoices (1 – stopped, 0 – active)
  • send_email
    Notify client by email each time a new invoice is generated (1 or 0)
    send_snail_mail
    Send a copy of your invoice by snail mail, each time it’s generated (1 or 0)
  • autobill
    Enable credit card auto-billing for this recurring profile.
     
    Other Notes
     
  • New profiles that start today will be sent immediately.
  • The method supports two placeholders in return_uri:
    Placeholder Replaced With
    ::invoice id:: The generated invoice ID (used for invoice.get)
    ::invoice number:: The generated invoice number (used in the user interface)
    These placeholders are case-sensitive.
  • More information about the return_uri element is available on the blog.
     
    Request
     
    view plaincopy to clipboardprint?
     
  • <?xml version="1.0" encoding="utf-8"?> 
  • <request method="recurring.create"> 
  •   <recurring> 
  •     <client_id>40</client_id>    <!-- Client to generate invoices for --> 
  •  
  •     <!-- Contacts are optional --> 
  •     <contacts> 
  •         <contact> 
  •             <contact_id>23</contact_id> 
  •         </contact> 
  •     </contacts> 
  •  
  •     <date>2007-09-23</date> 
  •             <po_number>2314</po_number> <!-- Purchase order number (Optional) --> 
  •     <discount>10</discount> <!-- Percent discount (Optional) --> 
  •     <occurrences>1</occurrences> 
  •     <!-- Number of invoices to generate; 0 infinite (default 0) --> 
  •     <frequency>monthly</frequency> 
  •     <!-- One of 'weekly', '2 weeks', '4 weeks', 'monthly', '2 months', --> 
  •     <!-- '3 months', '6 months', 'yearly', '2 years' --> 
  •  
  •     <send_email>1</send_email> <!-- Send email notification(Default 1) --> 
  •     <send_snail_mail>0</send_snail_mail>  <!-- Send copy by snail mail (Default 0) --> 
  •  
  •     <currency_code>CAD</currency_code> <!-- Defaults to systems base currency (Optional) --> 
  •     <language>en</language> <!-- Defaults to the client's language  --> 
  •  
  •     <notes>Due upon receipt.</notes>       <!-- (Optional) --> 
  •     <terms>Payment due in 30 days.</terms> <!-- (Optional) --> 
  •  
  •     <first_name>John</first_name>           <!-- (Optional) --> 
  •     <last_name>Smith</last_name>            <!-- (Optional) --> 
  •     <organization>ABC Corp</organization>   <!-- (Optional) --> 
  •     <p_street1></p_street1>                 <!-- (Optional) --> 
  •     <p_street2></p_street2>                 <!-- (Optional) --> 
  •     <p_city></p_city>                       <!-- (Optional) --> 
  •     <p_state></p_state>                     <!-- (Optional) --> 
  •     <p_country></p_country>                 <!-- (Optional) --> 
  •     <p_code></p_code>                       <!-- (Optional) --> 
  •     <vat_name></vat_name>                   <!-- e.g. 'VAT Number' (Optional) --> 
  •     <vat_number></vat_number>               <!-- If set, shown with vat_name under client address (Optional) --> 
  •     <return_uri></return_uri>               <!-- (Optional) --> 
  •     <autobill>                              <!-- (Optional) --> 
  •       <!-- Case insensitive gateway name from gateway.list (Must be auto-bill capable) --> 
  •       <gateway_name>Authorize.net</gateway_name> 
  •       <card> 
  •         <!-- Can include spaces, hyphens and other punctuation marks --> 
  •         <number>4111 1111 1111 1111</number> 
  •         <name>John Smith</name> 
  •         <expiration> 
  •           <month>3</month> 
  •           <year>2012</year> 
  •         </expiration> 
  •       </card> 
  •     </autobill> 
  •     <lines> 
  •       <line> 
  •         <name>Yard Work</name> 
  •         <description>Mowed the lawn.</description> 
  •         <unit_cost>10</unit_cost> 
  •         <quantity>4</quantity> 
  •         <tax1_name>GST</tax1_name> 
  •         <tax2_name>PST</tax2_name> 
  •         <tax1_percent>8</tax1_percent> 
  •         <tax2_percent>6</tax2_percent> 
  •         <type>Time</type>                            <!-- (Optional) --> 
  •    <!-- One of 'Item' or 'Time'. If omitted, the line's type defaults to 'Item' --> 
  •       </line> 
  •     </lines> 
  •   </recurring> 
  • </request> 
     
    Response
     
    view plaincopy to clipboardprint?
     
  • <?xml version="1.0" encoding="utf-8"?> 
  • <response xmlns="http://www.freshbooks.com/api/" status="ok"> 
  •   <recurring_id>21</recurring_id> 
  • </response>
Closed Jul 23, 2012 at 5:18 PM by stemarie

comments

wrote Jul 23, 2012 at 5:18 PM

Resolved with changeset 94086.

wrote Jan 31, 2013 at 11:24 PM

wrote May 13, 2013 at 6:24 PM