# payments

```graphql
query Payments {
  payments {
    data {
      id
      status
      paid
      amount
      currency
      createdAt
      description
      receiptUrl
      invoiceId
      paymentIntentId
    }
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
  }
}
```

List the payments an account has made, with their receipt links; returns one page of payments with amounts in minor currency units. Requires account.billing.read.

## Arguments

| Name              | Type             | Required | Description                                                                                     |
| ----------------- | ---------------- | -------- | ----------------------------------------------------------------------------------------------- |
| `input`           | PaymentListInput |          |                                                                                                 |
| `input.sortBy`    | String           |          | date or amount. Pages follow Stripe order, newest first; sorting orders the returned page only. |
| `input.sortOrder` | String           |          | asc or desc. Defaults to desc.                                                                  |
| `input.limit`     | Int              |          | Maximum number of payments to return, 1 to 100. Defaults to 20.                                 |
| `input.cursor`    | String           |          | Opaque cursor pointing at the next page. Omit it to read the first page.                        |

## Responses

| Status | Description                        |
| ------ | ---------------------------------- |
| 200    | The PaymentPage! in data.payments. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "query Payments {\n  payments {\n    data {\n      id\n      status\n      paid\n      amount\n      currency\n      createdAt\n      description\n      receiptUrl\n      invoiceId\n      paymentIntentId\n    }\n    pageInfo {\n      hasNextPage\n      hasPreviousPage\n      startCursor\n      endCursor\n    }\n  }\n}"
}'
```

## Example response

```json
{
  "data": {
    "payments": {
      "data": [
        {
          "id": "string",
          "status": "string",
          "paid": false,
          "amount": 0,
          "currency": "string",
          "createdAt": "string",
          "description": "string",
          "receiptUrl": "https://example.com",
          "invoiceId": "string",
          "paymentIntentId": "string"
        }
      ],
      "pageInfo": {
        "hasNextPage": false,
        "hasPreviousPage": false,
        "startCursor": "string",
        "endCursor": "string"
      }
    }
  }
}
```
