Method: AdvancedBilling::ProformaInvoicesController#list_proforma_invoices

Defined in:
lib/advanced_billing/controllers/proforma_invoices_controller.rb

#list_proforma_invoices(options = {}) ⇒ ListProformaInvoicesResponse

By default, proforma invoices returned on the index will only include totals, not detailed breakdowns for ‘line_items`, `discounts`, `taxes`, `credits`, `payments`, or `custom_fields`. To include breakdowns, pass the specific field as a key in the query with a value set to `true`. the subscription for the invoice’s Due Date, in the YYYY-MM-DD format. invoice’s Due Date, in the YYYY-MM-DD format. status of the invoice. Allowed Values: draft, open, paid, pending, voided pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned. Use in query ‘page=1`. many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200. Use in query `per_page=200`. returned invoices. line items data discounts data data credits data payments data custom fields data

Parameters:

  • subscription_id (Integer)

    Required parameter: The Chargify id of

  • start_date (String)

    Optional parameter: The beginning date range

  • end_date (String)

    Optional parameter: The ending date range for the

  • status (ProformaInvoiceStatus)

    Optional parameter: The current

  • page (Integer)

    Optional parameter: Result records are organized in

  • per_page (Integer)

    Optional parameter: This parameter indicates how

  • direction (Direction)

    Optional parameter: The sort direction of the

  • line_items (TrueClass | FalseClass)

    Optional parameter: Include

  • discounts (TrueClass | FalseClass)

    Optional parameter: Include

  • taxes (TrueClass | FalseClass)

    Optional parameter: Include taxes

  • credits (TrueClass | FalseClass)

    Optional parameter: Include

  • payments (TrueClass | FalseClass)

    Optional parameter: Include

  • custom_fields (TrueClass | FalseClass)

    Optional parameter: Include

Returns:



183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# File 'lib/advanced_billing/controllers/proforma_invoices_controller.rb', line 183

def list_proforma_invoices(options = {})
  new_api_call_builder
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/subscriptions/{subscription_id}/proforma_invoices.json',
                                 Server::PRODUCTION)
               .template_param(new_parameter(options['subscription_id'], key: 'subscription_id')
                                .is_required(true)
                                .should_encode(true))
               .query_param(new_parameter(options['start_date'], key: 'start_date'))
               .query_param(new_parameter(options['end_date'], key: 'end_date'))
               .query_param(new_parameter(options['status'], key: 'status'))
               .query_param(new_parameter(options['page'], key: 'page'))
               .query_param(new_parameter(options['per_page'], key: 'per_page'))
               .query_param(new_parameter(options['direction'], key: 'direction'))
               .query_param(new_parameter(options['line_items'], key: 'line_items'))
               .query_param(new_parameter(options['discounts'], key: 'discounts'))
               .query_param(new_parameter(options['taxes'], key: 'taxes'))
               .query_param(new_parameter(options['credits'], key: 'credits'))
               .query_param(new_parameter(options['payments'], key: 'payments'))
               .query_param(new_parameter(options['custom_fields'], key: 'custom_fields'))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('BasicAuth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(ListProformaInvoicesResponse.method(:from_hash)))
    .execute
end