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.

POSThttps://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

  • Authorizationstringrequired

    Bearer <your API token>. Tokens start with sm_live_.

  • Workspacestringrequired

    The workspace id to act on (from GET /workspaces or Settings › API tokens). Required on every call except the /workspaces calls; without it: 400 workspace_required.

Body

  • domainsstring[]required1 to 30 items

    1 to 30 names to buy, like demo-domain-1.com. No duplicates (case is ignored). Every name must be available, or nothing is bought.

Response (200)

  • statusenumrequired

    succeeded = paid; the names are yours (GET /domains?status=unused). pending_payment = the payment is not confirmed yet.

    One of: succeeded pending_payment

  • amountnumberrequired

    What was charged for the purchase.

  • domainsstring[]required

    The names bought, lower case.

Responses

  • 201Created. The purchase is saved: paid (succeeded), or pending_payment when the payment is not confirmed yet.
  • 400Invalid domains. A name is not a valid domain (domain_invalid), a name is in the list twice (duplicate_domain), or domains is empty or has more than 30 names (too_many_domains). param names the entry (domains for too_many_domains). A body with wrong types answers validation_failed. Nothing is charged.
  • 402Payment failed. No saved card (no_payment_method, checked before any name), the bank refused (card_declined), 3-D Secure is needed (authentication_required; pay once in the portal, then try again) or the payment failed otherwise (payment_failed). Nothing is charged.
  • 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_not_allowed), or the workspace buys only into its own subscription (not_available_for_account).
  • 422Not available. A name is taken, already used in ScaledMail or not sold by us (domain_unavailable), or premium (domain_premium: premium names can't be bought through the API). param names 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_limited in every case).
  • 500Outcome unclear. The payment outcome is unclear, or the purchase was paid but could not be read back (needs_team). Our team is told and finishes or refunds it. Don't send the purchase again; the names show in GET /domains?status=unused.
  • 503Try again later. A name could not be checked at the registrar right now (check_failed, param names it), or buying domains or paying with the saved card is switched off for now (not_available). Nothing is charged.

Like every call, it can also answer 401 (bad key), 400 workspace_required, 403 workspace_not_allowed. See Errors.