Purchases
Refund purchase
Changed onRefunds a purchase if verification code was not received within 20 minutes.
Requirements:
- Status PENDING, code not received
- At least 20 minutes since purchase creation
post/v1/purchases/{purchase_id}/refund
Request
- Base URLhttps://api.getmytg.com
- URLhttps://api.getmytg.com/v1/purchases/{purchase_id}/refund
- Auth
- API key in header x-api-key
- or HTTP bearer
Path parameters
purchase_idinteger required
Unique purchase identifier.
Example:12345
Response
Response for status 200
Example response
{
"purchase": {
"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"
},
"refund": {
"amount": {
"amount": "1.50",
"currency_code": "USD"
},
"reason": "Auto-refund: code not received within 20 minutes",
"refunded_at": "2024-11-19T08:15:00.000Z"
}
}Changes
- breaking
the response property
//became nullable for the status - warning
added the new
EXPIREDenum value to the/response property for the response 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 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