Get Payments

GET /payment-history

Get all client's payments using JWT.

Responses

  • 200 application/json

    Successful retrieval of payments.

    Hide response attributes Show response attributes object
    • success boolean

      Whether the retrieval is successful

    • payment_history array[object]
      Any of:
      Hide attributes Show attributes
      • payment_history_id integer Required

        Id of the payment in database

      • type string Required

        Type of the payment

        Values are membership or trainer_appointment.

      • client_id integer Required

        Id of the client in database

      • level_type string Required

        Membership level

        Values are SIMPLE, INFINITY, or PREMIUM.

      • created_at string(date) Required

        Payment creation date

  • 401 application/json

    User is not unauthorized or permissions are missing.

    Hide response attributes Show response attributes object
    • success boolean

      Whether query is successful

    • error string

      Error message

  • 429 application/json

    Rate limit exceeded - 100 queries per 15 minutes.

    Hide response attributes Show response attributes object
    • success boolean

      Whether query is successful

    • error string

      Error message

GET /payment-history
curl \
 --request GET 'http://63.141.232.244:25540/v0/payment-history' \
 --header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "success": true,
  "payment_history": [
    {
      "type": "membership",
      "client_id": 1,
      "created_at": "2024-10-10T18:36:47Z",
      "level_type": "SIMPLE",
      "payment_history_id": 1
    }
  ]
}
Response examples (401)
{
  "success": false,
  "error": "Unauthorized"
}
Response examples (429)
{
  "success": false,
  "error": "Too many requests, please try again later"
}