Retrieve Invoice Lines from Invoice
Retrieve invoice lines from an invoice.
Invoice lines are subscription items or invoice items.
invoice
ID of the invoice. String starting with invoice_.
Code Samples
.NET
using System; namespace RapydApiRequestSample { class Program { static void Main(string[] args) { try { string invoice = "invoice_6bfb9a7b969e6ceb7675659db01cb7f0"; string result = RapydApiRequestSample.Utilities.MakeRequest("GET", $"/v1/invoices/{invoice}/lines"); Console.WriteLine(result); } catch (Exception e) { Console.WriteLine("Error completing request: " + e.Message); } } } }
JavaScript
const makeRequest = require('<path-to-your-utility-file>/utilities').makeRequest; async function main() { try { const result = await makeRequest( 'GET', '/v1/invoices/invoice_6bfb9a7b969e6ceb7675659db01cb7f0/lines' ); console.log(result); } catch (error) { console.error('Error completing request', error); } }
PHP
<?php $path .= "/<path-to-your-utility-file>/utilities.php"; include($path); try { $object = make_request('get', "/v1/invoices/invoice_6bfb9a7b969e6ceb7675659db01cb7f0/lines"); var_dump($object); } catch(Exception $e) { echo "Error => $e"; } ?>
Python
from pprint import pprint from utilities import make_request result = make_request(method='get', path='/v1/invoices/invoice_6bfb9a7b969e6ceb7675659db01cb7f0/lines') pprint(result)
/v1/invoices/:invoice/lines
Retrieve Invoice Lines from Invoice
curl -X get https://sandboxapi.rapyd.net/v1/invoices/invoice_6bfb9a7b969e6ceb7675659db01cb7f0/lines -H 'access_key: your-access-key-here' -H 'Content-Type: application/json' -H 'salt: your-random-string-here' -H 'signature: your-calculated-signature-here' -H 'timestamp: your-unix-timestamp-here'
{ "status": { "error_code": "", "status": "SUCCESS", "message": "", "response_code": "", "operation_id": "869d6b11-67f7-44fc-abc3-5e6fbea3ab79" }, "data": [ { "id": "il_b0051532fd10d381dcd6fbf8ddcb4016", "amount": 0, "currency": "USD", "description": "NAME1559645618", "discountable": true, "invoice_item": "", "metadata": { "merchant_defined": true }, "period": { "start": 1559742818, "end": 1562334818 }, "proration": false, "quantity": 5, "plan": { "id": "plan_de8738ce3432b230d8b9f921f3203d4d", "aggregate_usage": "sum", "amount": 0, "billing_scheme": "per_unit", "created_at": 1559742810, "currency": "USD", "interval": "month", "interval_count": 1, "metadata": {}, "nickname": "", "tiers": [], "tiers_mode": "", "transform_usage": { "divide_by": 0, "round": "" }, "trial_period_days": 0, "usage_type": "licensed" }, "subscription": "sub_a2976850ce6601ce0cbe1ef412b374ba", "subscription_item": "subi_ddc7bca515c3925faac075ffa8e1f02e", "type": "subscription" } ] }