githubEdit

get__credits_packs

GET /credits/packs

List Credit Packs

Returns the list of available credit packs (one-time purchases). Each pack has an ID, name, code, number of credits, and price. No authentication is required; this is reference data for display and for initiating a pack purchase via POST /credits/packs/buy.

TypeScript Client Library

public getCreditsPacks = async (): Promise<GetCreditsPacksResponse> => {
  return this.makeRequest<GetCreditsPacksResponse>('credits/packs', 'GET', null);
};

Code Samples

curl -X GET https://backend.flashback.tech/credits/packs \
  -H 'Accept: application/json'

Example responses

200 Response

{
  "success": true,
  "data": [
    {
      "id": "pack-1",
      "name": "Pack 1",
      "code": "PACK_1",
      "credits": 100,
      "price": 19.99
    },
    {
      "id": "pack-2",
      "name": "Pack 2",
      "code": "PACK_2",
      "credits": 500,
      "price": 49.99
    },
    {
      "id": "pack-3",
      "name": "Pack 3",
      "code": "PACK_3",
      "credits": 1100,
      "price": 99.99
    }
  ]
}

500 Response

Responses

Status
Meaning
Description
Schema

200

OK

List of credit packs

Inline

500

Internal Server Error

Server error

Inline

Response Schema (200)

Name
Type
Required
Description

» success

boolean

false

Whether the request succeeded

» data

array

false

List of packs

»» id

string

false

Pack ID (use in POST /credits/packs/buy)

»» name

string

false

Display name

»» code

string

false

Code (e.g. PACK_1)

»» credits

integer

false

Credits included in pack

»» price

number

false

Price in USD

» error_code

string

false

Set on error

» message

string

false

Error or status message

Security

  • None: This endpoint does not require authentication.

Notes

  • Use the returned id as packId in POST /credits/packs/buy to start checkout for that pack.

  • Only active, non-deleted packs are returned.

Last updated

Was this helpful?