# Retrieve an invoice

<mark style="color:blue;">`GET`</mark> `https://us-central1-appgregator.cloudfunctions.net/stripe/invoices/:id/`

#### Query Parameters

| Name                                               | Type   | Description |
| -------------------------------------------------- | ------ | ----------- |
| name<mark style="color:red;">\*</mark>             | String | ft-4        |
| connection\_name<mark style="color:red;">\*</mark> | String | stripe-1    |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| x-api-key<mark style="color:red;">\*</mark> | String | XXX         |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "id": "in_1MYnhJIyq0PiFIhUFeI3wMrp",
    "object": "invoice",
    "account_country": "US",
    "account_name": "Appgregator",
    "account_tax_ids": null,
    "amount_due": 2000,
    "amount_paid": 0,
    "amount_remaining": 2000,
    "amount_shipping": 0,
    "application": null,
    "application_fee_amount": null,
    "attempt_count": 1,
    "attempted": true,
    "auto_advance": false,
    "automatic_tax": {
        "enabled": false,
        "status": null
    },
    "billing_reason": "manual",
    "charge": null,
    "collection_method": "charge_automatically",
    "created": 1675762965,
    "currency": "usd",
    "custom_fields": null,
    "customer": "cus_MQqeLuPp19Qbk8",
    "customer_address": null,
    "customer_email": "account@accdemo.com",
    "customer_name": null,
    "customer_phone": null,
    "customer_shipping": null,
    "customer_tax_exempt": "none",
    "customer_tax_ids": [],
    "default_payment_method": null,
    "default_source": null,
    "default_tax_rates": [],
    "description": null,
    "discount": null,
    "discounts": [],
    "due_date": null,
    "ending_balance": 0,
    "footer": null,
    "from_invoice": null,
    "hosted_invoice_url": "https://invoice.stripe.com/i/acct_1L7a15Iyq0PiFIhU/test_YWNjdF8xTDdhMTVJeXEwUGlGSWhVLF9OSlFZaTd3NHpmSWJ2UmN5RWRSTkZBWm04OWl3ODZqLDY2NDc4MDUz02008NRBkP7Q?s=ap",
    "invoice_pdf": "https://pay.stripe.com/invoice/acct_1L7a15Iyq0PiFIhU/test_YWNjdF8xTDdhMTVJeXEwUGlGSWhVLF9OSlFZaTd3NHpmSWJ2UmN5RWRSTkZBWm04OWl3ODZqLDY2NDc4MDUz02008NRBkP7Q/pdf?s=ap",
    "last_finalization_error": null,
    "latest_revision": null,
    "lines": {
        "object": "list",
        "data": [
            {
                "id": "il_1MYnh7Iyq0PiFIhUQpcRZJGP",
                "object": "line_item",
                "amount": 2000,
                "amount_excluding_tax": 2000,
                "currency": "usd",
                "description": null,
                "discount_amounts": [],
                "discountable": true,
                "discounts": [],
                "invoice_item": "ii_1MYnh7Iyq0PiFIhUkVrsWrLC",
                "livemode": false,
                "metadata": {},
                "period": {
                    "end": 1675762953,
                    "start": 1675762953
                },
                "plan": null,
                "price": {
                    "id": "price_1MYnh7Iyq0PiFIhUOssRW0Js",
                    "object": "price",
                    "active": false,
                    "billing_scheme": "per_unit",
                    "created": 1675762953,
                    "currency": "usd",
                    "custom_unit_amount": null,
                    "livemode": false,
                    "lookup_key": null,
                    "metadata": {},
                    "nickname": null,
                    "product": "prod_NJQYBIRDcjz2jR",
                    "recurring": null,
                    "tax_behavior": "unspecified",
                    "tiers_mode": null,
                    "transform_quantity": null,
                    "type": "one_time",
                    "unit_amount": 2000,
                    "unit_amount_decimal": "2000"
                },
                "proration": false,
                "proration_details": {
                    "credited_items": null
                },
                "quantity": 1,
                "subscription": null,
                "tax_amounts": [],
                "tax_rates": [],
                "type": "invoiceitem",
                "unit_amount_excluding_tax": "2000"
            }
        ],
        "has_more": false,
        "total_count": 1,
        "url": "/v1/invoices/in_1MYnhJIyq0PiFIhUFeI3wMrp/lines"
    },
    "livemode": false,
    "metadata": {},
    "next_payment_attempt": null,
    "number": "8027F949-0004",
    "on_behalf_of": null,
    "paid": false,
    "paid_out_of_band": false,
    "payment_intent": "pi_3MYniZIyq0PiFIhU1yqV8S8Q",
    "payment_settings": {
        "default_mandate": null,
        "payment_method_options": null,
        "payment_method_types": null
    },
    "period_end": 1675762965,
    "period_start": 1675762965,
    "post_payment_credit_notes_amount": 0,
    "pre_payment_credit_notes_amount": 0,
    "quote": null,
    "receipt_number": null,
    "rendering_options": null,
    "shipping_cost": null,
    "shipping_details": null,
    "starting_balance": 0,
    "statement_descriptor": null,
    "status": "open",
    "status_transitions": {
        "finalized_at": 1675763043,
        "marked_uncollectible_at": null,
        "paid_at": null,
        "voided_at": null
    },
    "subscription": null,
    "subtotal": 2000,
    "subtotal_excluding_tax": 2000,
    "tax": null,
    "test_clock": null,
    "total": 2000,
    "total_discount_amounts": [],
    "total_excluding_tax": 2000,
    "total_tax_amounts": [],
    "transfer_data": null,
    "webhooks_delivered_at": 1675762966
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="cURL" %}

```shell
curl --location --request GET 'https://us-central1-appgregator.cloudfunctions.net/stripe/invoices/in_1MYnhJIyq0PiFIhUFeI3wMrp?name=ft-4&connection_name=stripe-1' \
--header 'x-api-key: XXX'
```

{% endtab %}

{% tab title="NodeJS - Axios" %}

```javascript
var axios = require('axios');

var config = {
  method: 'get',
  url: 'https://us-central1-appgregator.cloudfunctions.net/stripe/invoices/in_1MYnhJIyq0PiFIhUFeI3wMrp?name=ft-4&connection_name=stripe-1',
  headers: { 
    'x-api-key': 'XXX'
  }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

```

{% endtab %}

{% tab title="PHP - cURL" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://us-central1-appgregator.cloudfunctions.net/stripe/invoices/in_1MYnhJIyq0PiFIhUFeI3wMrp?name=ft-4&connection_name=stripe-1',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'x-api-key: XXX'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

```

{% endtab %}
{% endtabs %}
