Domains
Buy domains
Buy 1 to 30 domains in one payment with the workspace's saved card (a sub-workspace uses its main workspace's card). The domains are then yours to use in POST /orders.
https://api.scaledmail.com/v2/domain-purchases- Token access
- Can buy
- Rate limit
- Purchase: 20 calls per minute per token
Every call charges the card. If a call times out, look in GET /domains?status=unused before you try again.
If any name is taken or premium, nothing is bought. Once paid, each name shows in GET /domains as unused, ready for an order.
Headers
AuthorizationstringrequiredBearer <your API token>. Tokens start withsm_.live_ WorkspacestringrequiredThe workspace id to act on (from
GET /workspacesor Settings › API tokens). Required on every call except the/workspacescalls; without it:400workspace_.required
Body
domainsstring[]required1 to 30 items1 to 30 names to buy, like
demo-domain-1.. No duplicates (case is ignored). Every name must be available, or nothing is bought.com
Response (200)
statusenumrequiredsucceeded= paid; the names are yours (GET /domains?status=unused).pending_= the payment is not confirmed yet.payment One of:
succeededpending_paymentamountnumberrequiredWhat was charged for the purchase.
domainsstring[]requiredThe names bought, lower case.
Responses
- 201Created. The purchase is saved: paid (
succeeded), orpending_when the payment is not confirmed yet.payment - 400Invalid domains. A name is not a valid domain (
domain_), a name is in the list twice (invalid duplicate_), ordomain domainsis empty or has more than 30 names (too_).many_ domains paramnames the entry (domainsfortoo_). A body with wrong types answersmany_ domains validation_. Nothing is charged.failed - 402Payment failed. No saved card (
no_, checked before any name), the bank refused (payment_ method card_), 3-D Secure is needed (declined authentication_; pay once in the portal, then try again) or the payment failed otherwise (required payment_). Nothing is charged.failed - 403Missing scope. The token was made without Can buy (
missing_,scope param=purchases:write). Make a token with Can buy in Settings › API tokens. - 403Not allowed. The person who made the token is not an owner or admin of this workspace (
role_), or the workspace buys only into its own subscription (not_ allowed not_).available_ for_ account - 422Not available. A name is taken, already used in ScaledMail or not sold by us (
domain_), or premium (unavailable domain_: premium names can't be bought through the API).premium paramnames the first one when it's found before charging. Nothing is charged. - 429Rate limited. More than 20 purchase calls in a minute with this token, more than 60 domain checks in a minute by the token's maker, or too many purchases started (
rate_in every case).limited - 500Outcome unclear. The payment outcome is unclear, or the purchase was paid but could not be read back (
needs_). Our team is told and finishes or refunds it. Don't send the purchase again; the names show inteam GET /domains?status=unused. - 503Try again later. A name could not be checked at the registrar right now (
check_,failed paramnames it), or buying domains or paying with the saved card is switched off for now (not_). Nothing is charged.available
Like every call, it can also answer 401 (bad key), 400 workspace_, 403 workspace_. See Errors.
