curl --request POST \
--url https://api.example.com/v1/account/shop/purchase \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-CSRF-Token: <x-csrf-token>' \
--data '
{
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 5,
"recipient": "<string>",
"quote": {
"priceMinor": 123,
"currency": "<string>",
"expiresAt": "2023-11-07T05:31:56Z"
},
"forSelf": true,
"promoCode": "<string>",
"useWallet": false
}
'import requests
url = "https://api.example.com/v1/account/shop/purchase"
payload = {
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 5,
"recipient": "<string>",
"quote": {
"priceMinor": 123,
"currency": "<string>",
"expiresAt": "2023-11-07T05:31:56Z"
},
"forSelf": True,
"promoCode": "<string>",
"useWallet": False
}
headers = {
"X-CSRF-Token": "<x-csrf-token>",
"Idempotency-Key": "<idempotency-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-CSRF-Token': '<x-csrf-token>',
'Idempotency-Key': '<idempotency-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
productId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
quantity: 5,
recipient: '<string>',
quote: {priceMinor: 123, currency: '<string>', expiresAt: '2023-11-07T05:31:56Z'},
forSelf: true,
promoCode: '<string>',
useWallet: false
})
};
fetch('https://api.example.com/v1/account/shop/purchase', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/account/shop/purchase",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'productId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'quantity' => 5,
'recipient' => '<string>',
'quote' => [
'priceMinor' => 123,
'currency' => '<string>',
'expiresAt' => '2023-11-07T05:31:56Z'
],
'forSelf' => true,
'promoCode' => '<string>',
'useWallet' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"X-CSRF-Token: <x-csrf-token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/account/shop/purchase"
payload := strings.NewReader("{\n \"productId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 5,\n \"recipient\": \"<string>\",\n \"quote\": {\n \"priceMinor\": 123,\n \"currency\": \"<string>\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\"\n },\n \"forSelf\": true,\n \"promoCode\": \"<string>\",\n \"useWallet\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-CSRF-Token", "<x-csrf-token>")
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/account/shop/purchase")
.header("X-CSRF-Token", "<x-csrf-token>")
.header("Idempotency-Key", "<idempotency-key>")
.header("Content-Type", "application/json")
.body("{\n \"productId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 5,\n \"recipient\": \"<string>\",\n \"quote\": {\n \"priceMinor\": 123,\n \"currency\": \"<string>\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\"\n },\n \"forSelf\": true,\n \"promoCode\": \"<string>\",\n \"useWallet\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/account/shop/purchase")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-CSRF-Token"] = '<x-csrf-token>'
request["Idempotency-Key"] = '<idempotency-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"productId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 5,\n \"recipient\": \"<string>\",\n \"quote\": {\n \"priceMinor\": 123,\n \"currency\": \"<string>\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\"\n },\n \"forSelf\": true,\n \"promoCode\": \"<string>\",\n \"useWallet\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"productName": "<string>",
"kind": "telegram_premium",
"quantity": 123,
"recipient": "<string>",
"forSelf": true,
"currency": "<string>",
"amounts": {
"priceMinor": 123,
"discountMinor": 123,
"walletMinor": 123,
"externalMinor": 123,
"paidMinor": 123
},
"payment": {
"state": "<string>",
"required": true,
"possible": true
},
"delivery": {
"state": "awaiting_payment",
"attempts": 123,
"supportHandoff": true,
"supportReference": "<string>",
"failureReason": "retryable",
"deliveredAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"refund": {
"amountMinor": 123,
"currency": "<string>"
}
},
"createdAt": "2023-11-07T05:31:56Z"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}Post v1accountshoppurchase
Opens the order for a reviewed recipient against a live quote. The displayed quote is echoed back and the server re-quotes before charging, refusing with quote_expired when the window has passed and price_changed when the number moved. The recipient must be byte-identical to the reviewed form, so a raw @name or a pasted link is refused rather than silently normalised after confirmation.
curl --request POST \
--url https://api.example.com/v1/account/shop/purchase \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-CSRF-Token: <x-csrf-token>' \
--data '
{
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 5,
"recipient": "<string>",
"quote": {
"priceMinor": 123,
"currency": "<string>",
"expiresAt": "2023-11-07T05:31:56Z"
},
"forSelf": true,
"promoCode": "<string>",
"useWallet": false
}
'import requests
url = "https://api.example.com/v1/account/shop/purchase"
payload = {
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 5,
"recipient": "<string>",
"quote": {
"priceMinor": 123,
"currency": "<string>",
"expiresAt": "2023-11-07T05:31:56Z"
},
"forSelf": True,
"promoCode": "<string>",
"useWallet": False
}
headers = {
"X-CSRF-Token": "<x-csrf-token>",
"Idempotency-Key": "<idempotency-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-CSRF-Token': '<x-csrf-token>',
'Idempotency-Key': '<idempotency-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
productId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
quantity: 5,
recipient: '<string>',
quote: {priceMinor: 123, currency: '<string>', expiresAt: '2023-11-07T05:31:56Z'},
forSelf: true,
promoCode: '<string>',
useWallet: false
})
};
fetch('https://api.example.com/v1/account/shop/purchase', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/account/shop/purchase",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'productId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'quantity' => 5,
'recipient' => '<string>',
'quote' => [
'priceMinor' => 123,
'currency' => '<string>',
'expiresAt' => '2023-11-07T05:31:56Z'
],
'forSelf' => true,
'promoCode' => '<string>',
'useWallet' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"X-CSRF-Token: <x-csrf-token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/account/shop/purchase"
payload := strings.NewReader("{\n \"productId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 5,\n \"recipient\": \"<string>\",\n \"quote\": {\n \"priceMinor\": 123,\n \"currency\": \"<string>\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\"\n },\n \"forSelf\": true,\n \"promoCode\": \"<string>\",\n \"useWallet\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-CSRF-Token", "<x-csrf-token>")
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/account/shop/purchase")
.header("X-CSRF-Token", "<x-csrf-token>")
.header("Idempotency-Key", "<idempotency-key>")
.header("Content-Type", "application/json")
.body("{\n \"productId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 5,\n \"recipient\": \"<string>\",\n \"quote\": {\n \"priceMinor\": 123,\n \"currency\": \"<string>\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\"\n },\n \"forSelf\": true,\n \"promoCode\": \"<string>\",\n \"useWallet\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/account/shop/purchase")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-CSRF-Token"] = '<x-csrf-token>'
request["Idempotency-Key"] = '<idempotency-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"productId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 5,\n \"recipient\": \"<string>\",\n \"quote\": {\n \"priceMinor\": 123,\n \"currency\": \"<string>\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\"\n },\n \"forSelf\": true,\n \"promoCode\": \"<string>\",\n \"useWallet\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"productName": "<string>",
"kind": "telegram_premium",
"quantity": 123,
"recipient": "<string>",
"forSelf": true,
"currency": "<string>",
"amounts": {
"priceMinor": 123,
"discountMinor": 123,
"walletMinor": 123,
"externalMinor": 123,
"paidMinor": 123
},
"payment": {
"state": "<string>",
"required": true,
"possible": true
},
"delivery": {
"state": "awaiting_payment",
"attempts": 123,
"supportHandoff": true,
"supportReference": "<string>",
"failureReason": "retryable",
"deliveredAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"refund": {
"amountMinor": 123,
"currency": "<string>"
}
},
"createdAt": "2023-11-07T05:31:56Z"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}Headers
Echoes the token from the current session. Required on every unsafe method.
8 - 128Body
1 <= x <= 10A price and the moment it stops applying. The two travel together so a client cannot hold one without the other.
Show child attributes
Show child attributes
Presentation only. Omniflow stores no Telegram username for a web customer, so this never decides delivery or authorisation.
Stated explicitly, so a balance is never spent by omission.
Response
Order opened
telegram_premium, telegram_stars Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes