# Get one payment

`GET /api/v1/billing/payments/{payment}`

Retrieve one payment by the id Stripe gave its invoice.

This endpoint also answers QUERY, with the same parameters sent in the request body. [How QUERY works](https://my.monicahq.com/docs/api/query-method).

## Path parameters

- `payment` (string, required): The id of the invoice at Stripe.

## Returns

A payment object. Another account's payment answers 404, the same as one that does not exist.

- `data` (object): The payment.
- `data.type` (string): Always payment. It names the kind of record, so a caller holding several kinds can tell them apart without looking at where they came from.
- `data.id` (string): The id of this record, as a string even when it reads as a number. It is what every endpoint naming this record takes.
- `data.attributes` (object): Everything the record holds.
- `data.attributes.provider_id` (string): The id of the invoice at Stripe, which is also this record's id. It is what makes a confirmation Stripe sends twice recognisable as one payment.
- `data.attributes.offer` (string): Which plan was paid for: monthly, yearly or lifetime. It is kept as it stood on the day, so retagging a price at Stripe never rewrites the history, and it is null when the catalogue no longer knows the price that was charged.
- `data.attributes.status` (string): The state of the invoice, as Stripe names it.
- `data.attributes.total` (integer): What was paid, in the smallest unit of the currency, tax included.
- `data.attributes.tax` (integer): The tax share of that total, worked out by Stripe from where the buyer was, and already part of it rather than added to it.
- `data.attributes.currency` (string): The currency of both amounts, three letters as Stripe writes them.
- `data.attributes.invoice_number` (string): The number Stripe gave the invoice, null when it gave none.
- `data.attributes.invoice_url` (string): The page at Stripe where the invoice is read. Null when Stripe issued none.
- `data.attributes.invoice_pdf_url` (string): The same invoice as a file. Null when Stripe issued none.
- `data.attributes.billed_at` (timestamp): When Stripe finalised the invoice, as a count of seconds since 1970. It is what the list is ordered by.
- `data.links` (object): Where to find this record.
- `data.links.self` (string): The absolute address this record is read from.

## Rate limit

Sixty requests per minute, per user, shared by every key and device. Every answer carries the budget left in `X-RateLimit-Remaining`.

## Request

```sh
curl https://my.monicahq.com/api/v1/billing/payments/in_1QdundieAwards \
  -H "Authorization: Bearer $MONICA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
      "payment": "in_1QdundieAwards"
  }'
```

```javascript
const response = await fetch('https://my.monicahq.com/api/v1/billing/payments/in_1QdundieAwards', {
  headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    payment: 'in_1QdundieAwards',
  }),
})
const data = await response.json()
```

```php
$response = Http::withToken($token)->get('https://my.monicahq.com/api/v1/billing/payments/in_1QdundieAwards', [
    'payment' => 'in_1QdundieAwards',
]);
```

## Response

`200`

```json
{
    "data": {
        "type": "payment",
        "id": "in_1QdundieAwards",
        "attributes": {
            "provider_id": "in_1QdundieAwards",
            "offer": "lifetime",
            "status": "paid",
            "total": 19900,
            "tax": 3317,
            "currency": "eur",
            "invoice_number": "DM-0042",
            "invoice_url": "https://invoice.stripe.com/i/test_a1dundermifflin",
            "invoice_pdf_url": "https://pay.stripe.com/invoice/test_a1dundermifflin/pdf",
            "billed_at": 1757073600
        },
        "links": {
            "self": "https://my.monicahq.com/api/v1/billing/payments/in_1QdundieAwards"
        }
    }
}
```
