Skip to content
Docs menu

Copy the text

Your browser did not allow copying. The text below is selected: press Ctrl+C, or ⌘C on a Mac.

List credit transactions

Purchases from the website and the App Store, plan payments, welcome credits, refunds and expiries (newest first, up to 100), plus credits used per day over the last 30 days.

GEThttps://api.switchfile.io/v1/account/transactions

Needs an API key: Authorization: Bearer YOUR_API_KEY. See Authentication.

Example

curl "https://api.switchfile.io/v1/account/transactions" \
  -H "Authorization: Bearer $SWITCHFILE_API_KEY"

Responses

  • 200OK
    • dataobject[]required
    • data[].atstringrequired

      ISO 8601 timestamp

    • data[].balance_afterstring (integer) | integerrequired
    • data[].creditsstring (integer) | integerrequired

      Positive: added; negative: taken off

    • data[].expires_atstring | nullrequired

      ISO 8601 timestamp

    • data[].idstringrequired
    • data[].kindstringrequired

      one of "purchase", "subscription", "expire", "welcome", "welcome_expire", "grant", "refund", "frozen"

    • data[].receiptobject | nullrequired

      Our receipt for web purchases; App Store purchases have Apple's receipt

    • data[].receipt.numberstringrequired
    • data[].receipt.urlstringrequired

      Receipt and contract documents in the dashboard

    • data[].sourcestring | nullrequired

      one of "web", "app_store"

    • usage_by_dayobject[]required

      Days of the last 30 with credits used, newest first

    • usage_by_day[].creditsstring (integer) | integerrequired
    • usage_by_day[].daystringrequired

      YYYY-MM-DD (UTC)

    • usage_by_day[].filesstring (integer) | integerrequired
    200 application/json
    {
      "data": [
        {
          "id": "41",
          "at": "2026-11-06T18:00:02+00:00",
          "kind": "purchase",
          "credits": 1000,
          "balance_after": 1240,
          "expires_at": null,
          "source": "app_store",
          "receipt": null
        },
        {
          "id": "17",
          "at": "2026-11-06T18:00:00+00:00",
          "kind": "purchase",
          "credits": 1000,
          "balance_after": 1100,
          "expires_at": null,
          "source": "web",
          "receipt": {
            "number": "SF-000123",
            "url": "https://switchfile.io/dashboard/billing"
          }
        }
      ],
      "usage_by_day": [
        {
          "day": "2026-11-06",
          "files": 7,
          "credits": 12
        }
      ]
    }
  • 401The API key is missing or not valid
    401 application/problem+json
    {
      "type": "https://switchfile.io/docs/api/v1#errors-unauthenticated",
      "title": "Unauthenticated",
      "status": 401,
      "code": "UNAUTHENTICATED",
      "detail": "Missing or invalid API key."
    }
  • 403Not available with a service key or a connected app
    403 application/problem+json
    {
      "type": "https://switchfile.io/docs/api/v1#errors-not-available",
      "title": "Not available",
      "status": 403,
      "code": "NOT_AVAILABLE",
      "detail": "This endpoint is only available with your own API key or the switchfile app."
    }
  • 404Does not exist for this account
    404 application/problem+json
    {
      "type": "https://switchfile.io/docs/api/v1#errors-not-found",
      "title": "Not found",
      "status": 404,
      "code": "NOT_FOUND",
      "detail": "Not found."
    }
  • 422Invalid data. errors names the fields
    422 application/problem+json
    {
      "type": "https://switchfile.io/docs/api/v1#errors-invalid-data",
      "title": "Invalid data",
      "status": 422,
      "code": "INVALID_DATA",
      "detail": "The request contains invalid data.",
      "errors": {
        "to": [
          "Expected string"
        ]
      }
    }
  • 429Too many requests or a daily quota is used up. See Retry-After
    429 application/problem+json
    {
      "type": "https://switchfile.io/docs/api/v1#errors-rate-limit-exceeded",
      "title": "Rate limit exceeded",
      "status": 429,
      "code": "RATE_LIMIT_EXCEEDED",
      "detail": "Too many requests. Try again in 12 seconds."
    }

Error bodies and codes are explained in Errors.