Purchases by Hash
Request verification code by hash
Changed onRequests verification code and password from provider using purchase hash code. Updates purchase status to SUCCESS.
No authentication required. The hash code serves as the access token.
Idempotent Operation. Safe to retry on network errors - will not generate duplicate codes.
Path parameter hash. If it is missing or empty before /request-code (e.g. /v1/purchases-by-hash/request-code), the API returns 400 with fieldViolations on hash.
post/v1/purchases-by-hash/{hash}/request-code
Request
- Base URLhttps://api.getmytg.com
- URLhttps://api.getmytg.com/v1/purchases-by-hash/{hash}/request-code
- Auth
- API key in header x-api-key
- or HTTP bearer
Path parameters
hashstring required
Unique hash code of the purchase
Example:abc-def-1234567890
Request body
Example request
{
"callback_url": "https://example.com/webhooks/code-received"
}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"
},
"code_request": {
"status": "pending",
"attempt": 1,
"max_attempts": 18,
"next_attempt_at": "2024-01-15T10:30:00.000Z",
"retry_after": 10
}
}Changes
- info
endpoint added
- info