Skip to main content

Documentation

Retrieve Invoice Item

Retrieve the details of an invoice item.

    • invoice_item

    • ID of the invoice item.

Code Samples
    • .NET

      • using System;
        
        namespace RapydApiRequestSample
        {
            class Program
            {
                static void Main(string[] args)
                {
                    try
                    {
                        string invoiceItem = "ii_50f7127dd0f7725c6599697d971af8b8";
        
                        string result = RapydApiRequestSample.Utilities.MakeRequest("GET", $"/v1/invoice_items/{invoiceItem}");
        
                        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/invoice_items/ii_50f7127dd0f7725c6599697d971af8b8'
            );
        
            console.log(result);
          } catch (error) {
            console.error('Error completing request', error);
          }
        }
    • PHP

      • <?php
        $path = $_SERVER['DOCUMENT_ROOT'];
        $path .= "/<path-to-your-utility-file>/utilities.php";
        include($path);
        try {
            $object = make_request('get', "/v1/invoice_items/ii_50f7127dd0f7725c6599697d971af8b8");
            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/invoice_items/ii_50f7127dd0f7725c6599697d971af8b8')
        pprint(result)
  • /v1/invoice_items/:invoice_item

  • Retrieve Invoice Item

  • curl -X get
    https://sandboxapi.rapyd.net/v1/invoice_items/ii_50f7127dd0f7725c6599697d971af8b8
    -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": "f331c1b7-a646-4048-9cec-6bf21d14196a"
        },
        "data": {
            "id": "ii_50f7127dd0f7725c6599697d971af8b8",
            "amount": 100,
            "currency": "USD",
            "customer": "cus_f4251b4835e51e52d8adf3f1340c3419",
            "date": 1542974679,
            "description": "",
            "discountable": false,
            "invoice": "",
    				"metadata": {
    						"merchant_defined": true
    				},
            "period": {
                "start": 0,
                "end": 0
            },
            "plan": {
                "product": null,
                "transform_usage": {}
            },
            "proration": "",
            "quantity": 0,
            "subscription": "sub_a19440d43875dd18c58058e722f1dd18",
            "unit_amount": 0
        }
    }