apiTON
HomeExplorerBlog
HomeExplorerBlog
Contact
  1. v2.SiteProxy
  • api:TON Documentation
  • v2.Nft
    • Username
      POST
    • Number
      POST
    • Domain
      POST
    • Gift
      POST
    • Item
      POST
    • Items
      POST
  • v2.Rate
    • Fiat rate
      POST
    • Crypto rate
      POST
    • Exchanges rate
      POST
    • Jetton prices
      POST
  • v2.Auth
    • Do
      POST
    • List
      POST
    • Import
      POST
    • Backup
      POST
    • Delete
      POST
    • New
      POST
  • v2.Wallet
    • Send TON
      POST
    • Send Jetton
      POST
    • Send Nft
      POST
  • v2.Address
    • Transactions
    • Details
    • Jettons
    • NFTs
    • Wallets
    • Collections
    • Run get-method
    • Address labels
  • v2.NftContract
    • Mint Nft Collection
    • Mint NFT
  • v2.JettonContract
    • Mint
    • Burn
    • Change owner
    • Close Mint
  • v2.Watch
    • Create watch
    • List watches
    • Delete watch
    • Poll events
    • Test watch
  • v2.SiteProxy
    • Site proxy offer
      POST
    • Check website and domain
      POST
    • Create site proxy order
      POST
    • Get site proxy order
      POST
    • Verify site proxy order
      POST
    • Stop site proxy order
      POST
    • List site proxy orders
      POST
  • Schemas
    • Schemas
      • Connect Error
      • google.protobuf.Any
      • NftDomainSite
      • ListValue
      • Message
      • NullValue
      • Struct
      • AddressGetMethod
      • FieldsEntry
      • DetailsResponse
      • AddressGetMethodArg
      • google.protobuf.Timestamp
      • DetailsRequest
      • AddressLabel
      • AddressLabelsRequest
      • google.protobuf.Value
      • AddressRunGetMethodRequest
      • AddressLabelsResponse
      • BlockID
      • AddressRunGetMethodResponse
      • BurnRequest
      • AddressStackEntry
      • BurnResponse
      • TransactionsResponse
      • ChangeAdminRequest
      • SiteProxyCheckRequest
      • ChangeAdminResponse
      • SiteProxyCheckResponse
      • CloseMintRequest
      • SiteProxyCreateRequest
      • CloseMintResponse
      • SiteProxyCreateResponse
      • DetailsAddress
      • SiteProxyGetRequest
      • DetailsRequest
      • SiteProxyGetResponse
      • DetailsResponse
      • SiteProxyListRequest
      • DomainRequest
      • SiteProxyListResponse
      • DomainResponse
      • SiteProxyOfferRequest
      • ItemRequest
      • SiteProxyOfferResponse
      • ItemResponse
      • SiteProxyOrder
      • Jetton
      • SiteProxyOwner
      • JettonDetails
      • SiteProxyPay
      • JettonsRequest
      • SiteProxyPayMessage
      • JettonsResponse
      • SiteProxyProblem
      • Message
      • SiteProxyRecord
      • MintCollectionRequest
      • SiteProxyRouteLimits
      • MintCollectionResponse
      • SiteProxyStopRequest
      • MintNftRequest
      • SiteProxyStopResponse
      • MintNftResponse
      • SiteProxyUsage
      • MintRequest
      • SiteProxyVerifyRequest
      • MintResponse
      • SiteProxyVerifyResponse
      • NftItem
      • SiteProxyWebProof
      • NftsRequest
      • NftsResponse
      • NumberRequest
      • NumberResponse
      • RateCryptoRequest
      • RateCryptoResponse
      • ResultEntry
      • RateExchangesRequest
      • RateExchangesResponse
      • ResultEntry
      • RateFiatRequest
      • RateFiatResponse
      • ResultEntry
      • SendJettonRequest
      • SendJettonResponse
      • SendNftRequest
      • SendNftResponse
      • SendRequest
      • SendResponse
      • TeleAuction
      • TeleAuctionConfig
      • TeleAuctionLastBid
      • TeleSale
      • Transaction
      • TransactionsRequest
      • TransactionsResponse
      • UsernameRequest
      • UsernameResponse
      • Version
      • WalletAuth
      • WalletAuth4
      • WalletDetails
      • WalletNewRequest
      • WalletNewResponse
      • WalletsRequest
      • WalletsResponse
      • AddressCollection
      • AddressCollectionsRequest
      • AddressCollectionsResponse
      • AuthBackupRequest
      • AuthDeleteRequest
      • AuthDeleteResponse
      • AuthDoRequest
      • AuthImportRequest
      • AuthJwtResponse
      • AuthListRequest
      • AuthListResponse
      • AuthNewRequest
      • BlockID
      • BurnRequest
      • BurnResponse
      • ChangeAdminRequest
      • ChangeAdminResponse
      • CloseMintRequest
      • CloseMintResponse
      • DetailsAddress
      • DomainRequest
      • DomainResponse
      • GiftAttribute
      • GiftRequest
      • GiftResponse
      • ItemRequest
      • ItemResponse
      • Jetton
      • JettonDetails
      • JettonsRequest
      • JettonsResponse
      • MintCollectionRequest
      • MintCollectionResponse
      • MintNftRequest
      • MintNftResponse
      • MintRequest
      • MintResponse
      • NftItem
      • NftItemsRequest
      • NftsRequest
      • NftsResponse
      • NumberRequest
      • NumberResponse
      • RateCryptoRequest
      • RateCryptoResponse
      • RateExchangesRequest
      • RateExchangesResponse
      • RateFiatRequest
      • RateFiatResponse
      • RateJettonPricesRequest
      • RateJettonPricesResponse
      • SendJettonRequest
      • SendJettonResponse
      • SendNftRequest
      • SendNftResponse
      • SendRequest
      • SendResponse
      • TeleAuction
      • TeleAuctionConfig
      • TeleAuctionLastBid
      • TeleSale
      • Transaction
      • TransactionsRequest
      • UsernameRequest
      • UsernameResponse
      • Version
      • WalletAuth
      • WalletDetails
      • WalletInfo
      • WalletsRequest
      • WalletsResponse
    • WatchCreateRequest
    • WatchCreateResponse
    • WatchDeleteRequest
    • WatchDeleteResponse
    • WatchEvent
    • WatchLimits
    • WatchListRequest
    • WatchListResponse
    • WatchPollRequest
    • WatchPollResponse
    • WatchSubscription
    • WatchTestRequest
    • WatchTestResponse
    • WatchTx
    • WatchWebhook
  1. v2.SiteProxy

Site proxy offer

POST
/v2.SiteProxy/Offer
Serves your website (https://shop.example.com) as the TON Site of your .ton domain (shop.ton): apiton's customer node answers http://shop.ton/ and takes every page from your website. 1 GRAM per 30 days; one payment buys up to 12 periods, and a renewal adds to what is left. No refunds once the site is live. Offer has the numbers in force; the terms are at its terms_url.
What the relay does not do: only GET and HEAD are relayed (forms, logins, carts do not work), pages are not rewritten (absolute links to https://shop.example.com/… lead the visitor there), one second-level domain (shop.ton, not a.shop.ton), responses up to 16 MiB, no uptime guarantee. Sites about drugs, weapons, gambling, adult content, fraud and the rest of the restricted class are refused or taken down (blocked).

The flow#

1.
Offer — the price, the period, the customer node's ADNL id (adnl_id: what the domain's site record must hold) and the receiving wallet.
2.
Check — whether a website and a domain can be ordered; writes nothing and lists every problem.
3.
Create — a new order (draft) and, once, its manage_secret.
4.
Put the web proof in place (order.web_proof), then Verify — the order becomes ready_to_pay.
5.
Get — order.pay: the payment as one TON Connect transaction, sent from the wallet that owns the domain — the order becomes active.
6.
Get / Verify to follow the order, Stop with the secret to end it, List for the orders of an API key.

An order proves two things#

The website. A file https://<host>/.well-known/apiton-verify.txt whose first line is apiton-verify=<token>, or a TXT record _apiton-verify.<host> with that value (order.web_proof gives all three). Keep it in place: it is checked again every day, and three failures in a row suspend the site.
The domain. Its site record points at the customer node (adnl_id) and the first payment comes from the wallet that owns the domain at that moment. Both are one TON Connect sendTransaction of two messages (order.pay.messages): the payment with the order's comment (px-…) and the domain's change_dns_record (record_attach_nano, 0.05 GRAM, stays on the domain's item; changing a record also renews the domain for a year). The two messages execute independently: if the record message fails, the order is paid_pending_record until the record is there (read every minute for an hour, then every 6 hours); the paid period starts at the payment. Without TON Connect: pay with order.pay.ton_link (a QR code of it) from the domain owner's wallet, and set the record on dns.ton.org.

Statuses (order.status)#

StatusMeaning
draftweb proof not verified yet, or verified while Cloudflare challenges the home page (see Verify); deleted after a day
ready_to_payverified, waiting for the first payment; deleted after 7 days unpaid
reviewpaid, waiting for an operator — only when manual_review is true
paid_pending_recordpaid; the domain's site record does not point at the customer node yet
activeserved
gracethe paid period is over; still served for grace_hours (72)
expirednot served; a payment within 30 days revives it, from the same owner
suspendeda check failed — status_reason web_proof_lost · record_moved · domain_expired · domain_on_sale; served again when the check passes
releasedowner_changed: the domain changed hands; final — the new owner makes a new order
blockedtaken down: restricted:<class> or the operator's reason
stoppedended by Stop (stopped_by_user) or by apiton on request (stopped_by_operator); final
rejectedrefused by an operator — only when manual_review is true; final
No account is needed. Create answers a new order and, once, its manage_secret, which Stop needs. With an API key (Authorization: Bearer <tg_id>:<secret>) the order is linked to the key and List shows it. Each RPC costs one request of your plan; anonymous callers have the free limits per IP (1 rps, 10 000 a month), which is enough for the flow. While the service is off on the server, every RPC answers unavailable.
JSON. 64-bit integers (price_nano, record_attach_nano, byte counts) arrive as JSON strings. Fields that are false, 0 or empty are left out: eligible: false, manual_review: false, a subdomain_price_nano of 0.
Names under apiton.ton — not open yet. Without a .ton domain of your own, a site will be able to run on a name under apiton.ton (http://shop.apiton.ton/, order kind subdomain): no NFT and no record, one payment message that any wallet may send (the first payment binds the order to that wallet and claims the name for as long as it is paid), and the website proved the same way. Such names open later: until then subdomain_price_nano is 0 (absent) and Check / Create refuse them with bad_domain.

Offer#

curl -X POST https://app.apiton.org/v2.SiteProxy/Offer -H 'Content-Type: application/json' -d '{}'
No state: cache the answer for a few minutes. An empty pay_address means payments are not taken now. limits bound one site on the customer node; above them a visitor gets 503 (max_inflight requests in progress), 429 (rps, burst), 502 (a response over max_response_bytes), 504 (the website takes longer than request_timeout_seconds to answer) or 509 (quota_bytes of the last period_days used up).
Errors: unavailable (503) — the service is off on the server.

Request

Body Params application/jsonRequired

Example
{}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://app.apiton.org/v2.SiteProxy/Offer' \
--header 'Content-Type: application/json' \
--data '{}'

Responses

🟢200OK
application/json
Bodyapplication/json

Example
{
    "price_nano": "1000000000",
    "price": 1,
    "period_days": 30,
    "max_periods": 12,
    "grace_hours": 72,
    "adnl_id": "73ee271186b7d87e8dcfa0817d067d6a6002c240b3c9e1bce03e6a1f65369f5d",
    "adnl_name": "vz64jyrq235q7unz6qic7igpvvgaawcicz4tyn44a7guh3fg2pv2nsx.adnl",
    "pay_address": "UQAKWIDXH-EHPfAOyDok-ZZ2gLSmshnXAWDzN9z9_exWWQI6",
    "record_attach_nano": "50000000",
    "limits": {
        "max_inflight": 8,
        "rps": 5,
        "burst": 20,
        "max_response_bytes": "16777216",
        "request_timeout_seconds": 15,
        "quota_bytes": "5000000000"
    },
    "terms_url": "https://apiton.org/sites/proxy/terms",
    "verify_path": "/.well-known/apiton-verify.txt"
}
🔴500Server Error
Previous
Test watch
Next
Check website and domain
Built with