# getInvoicePayment

One OPEN invoice by `number` (listInvoices), as the person is asked to pay it: `amountRemainingCents` (what paying charges, cents), `dueAt`, `hostedInvoiceUrl` and the `card` on file (`brand`, `last4`; null: no card, so it cannot be paid here). Null when no open invoice has that number. Read it right before asking. Needs the spending permission.

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "getInvoicePayment", "variables": {...} }`
- Scope: `ADMIN`
- Type: query
- Idempotency: a read; rejects `Idempotency-Key`
- Rate-limited: no

## Variables

- `number`: `String!` (required)

## Response (data, an example)

```json
{
  "subscriptionQuery": {
    "invoicePayment": {
      "number": "…",
      "amountRemainingCents": 0,
      "currency": "…",
      "dueAt": "2026-01-01T00:00:00.000Z",
      "hostedInvoiceUrl": "…",
      "card": {
        "brand": "…",
        "last4": "…"
      }
    }
  }
}
```

## Example

```bash
curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "operationId": "getInvoicePayment",
    "variables": {
      "number": "<String>"
    }
  }'
```
