1) Optional pre-check
skilldock skills get acme/my-skillRead: access.can_buy, sale.price_usd, sale.price_ton, and the provider-specific active price fields.
2) Create or reuse invoice
skilldock skills buy acme/my-skill --payment-provider ton --referral-code aInput: payment_provider=ton, optional referral_code
Output: created: true|false, invoice{id,status,payment_provider,amount_usd|amount_ton_nano,pay_to_address,expires_at,...}
3) Poll invoice status
skilldock skills buy acme/my-skill --payment-provider ton --poll
# or
skilldock skills invoice <invoice_id>Terminal states: paid | expired | cancelled
Unlock condition: access_granted: true
4) Confirm inventory
skilldock skills bought --page 1 --per-page 20Output: paginated purchased skills list (items, page, per_page, has_more)
5) Runtime compatibility rule
Buy currently supports payment_provider=ton. Stripe payments are temporarily unavailable; please use TON checkout where available, or try again later.
6) Common API errors to handle
401 unauthorized403 forbidden404 not_found400 invalid_request|not_for_sale409 already_owner|already_purchased|seller_setup_incomplete|payment_provider_unsupported