Skip to content
  • Auto
  • Light
  • Dark
Talk to an expert

List

List credit grants
post/v1/credits/listGrants

List credit grants. This list does not included voided grants.

Query Parameters
limitnumber
optional

Max number of results that should be returned

minimum1
maximum100
next_pagestring
optional

Cursor that indicates where the next page of results should start.

Body Parameters
credit_grant_idsarray of string
optional

An array of credit grant IDs. If this is specified, neither credit_type_ids nor customer_ids may be specified.

credit_type_idsarray of string
optional

An array of credit type IDs. This must not be specified if credit_grant_ids is specified.

customer_idsarray of string
optional

An array of Metronome customer IDs. This must not be specified if credit_grant_ids is specified.

effective_beforestring
optional

Only return credit grants that are effective before this timestamp (exclusive).

formatdate-time
not_expiring_beforestring
optional

Only return credit grants that expire at or after this timestamp.

formatdate-time
Returns
dataarray of object
next_pagestring
curl https://api.metronome.com/v1/credits/listGrants \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $METRONOME_BEARER_TOKEN"
200 Example
{
  "data": [
    {
      "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "balance": {
        "effective_at": "2019-12-27T18:11:19.117Z",
        "excluding_pending": 0,
        "including_pending": 0
      },
      "custom_fields": {
        "foo": "string"
      },
      "customer_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "deductions": [
        {
          "amount": 0,
          "created_by": "created_by",
          "credit_grant_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
          "effective_at": "2019-12-27T18:11:19.117Z",
          "reason": "Automated invoice deduction",
          "running_balance": 0,
          "invoice_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
        }
      ],
      "effective_at": "2019-12-27T18:11:19.117Z",
      "expires_at": "2019-12-27T18:11:19.117Z",
      "grant_amount": {
        "amount": 0,
        "credit_type": {
          "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
          "name": "name"
        }
      },
      "name": "name",
      "paid_amount": {
        "amount": 0,
        "credit_type": {
          "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
          "name": "name"
        }
      },
      "pending_deductions": [
        {
          "amount": 0,
          "created_by": "created_by",
          "credit_grant_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
          "effective_at": "2019-12-27T18:11:19.117Z",
          "reason": "Automated invoice deduction",
          "running_balance": 0,
          "invoice_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
        }
      ],
      "priority": 0,
      "credit_grant_type": "credit_grant_type",
      "invoice_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "products": [
        {
          "id": "id",
          "name": "name"
        }
      ],
      "reason": "reason",
      "uniqueness_key": "x"
    }
  ],
  "next_page": "next_page"
}