Get purchase history
Changed onReturns paginated list of user's purchases with optional status filtering.
Chronological Ordering. Purchases are always returned newest first (descending by created_at).
Pagination behavior
- Results are consistent during session (no duplicates or missing items when paginating).
- has_next: true indicates more pages available.
- Maximum page_size is 50 items.
Filtering. Combine status filter with pagination for subset queries (e.g., all successful purchases).
Request
- Base URLhttps://api.getmytg.com
- URLhttps://api.getmytg.com/v1/purchases/
- Auth
- API key in header x-api-key
- or HTTP bearer
Query parameters
Purchase Status Lifecycle. PENDING (initial) → SUCCESS (after code request) or ERROR (provider failure). Any status can transition to REFUND via admin action.
Important. Status is immutable once set to SUCCESS, ERROR, or REFUND.
Filter options
- PENDING - code not requested.
- SUCCESS - code ready.
- ERROR - provider failed.
- REFUND - money returned.
Filter purchases by phone number fragment (partial match). Example: '123' matches '+71234567890'.
Sort purchases by creation date
Page number.
Number of items per page.
Response
Successful response.
Example response
{
"items": [
{
"id": 12345,
"country_code": "US",
"emoji": "🇺🇸",
"display_name": {
"ru": "США",
"en": "United States"
},
"phone_number": "+12025550123",
"price": {
"amount": "1.50",
"currency_code": "USD"
},
"status": "SUCCESS",
"purchase_type": "SINGLE",
"purchase_source": "BOT",
"verification": {
"code": "12345",
"password": "secret123",
"received_at": "2024-11-19T07:52:00.000Z"
},
"created_at": "2024-11-19T07:50:00.000Z"
}
],
"pagination": {
"current_page": 1,
"page_size": 50,
"total_items": 150,
"total_pages": 3,
"has_next": true
}
}Changes
- breaking
added the new required
queryrequest parametersort - breaking
the response property
///became nullable for the status - breaking
the
/response property's max was increased from150.00to250.00for the response status - warning
added the new
EXPIREDenum value to the//response property for the response status - info
added the new optional
queryrequest parameterphone_number - info
added the new enum value
EXPIREDto thequeryrequest parameterstatus - info
for the
queryrequest parameterpage_size, the max was increased from150.00to250.00 - info
added the non-success response with the status
- info
added the non-success response with the status
- info
added the non-success response with the status
- info
added the non-success response with the status
- info
added the non-success response with the status
- info
added the required property
//to the response with the status - info
added the required property
//to the response with the status
- breaking