Domains
Buy domains
Buy 1 to 30 domains in one payment, charged to the workspace's saved card. No subscription is created: the domains are added to your purchased domains, ready to use in a new order.
https://server.scaledmail.com/api/v1/buy-domains- Token access
- Read and write
- Rate limit
- 15 buy calls per minute per token
This call charges your saved card right away. Always send an Idempotency-Key: if your call times out and you retry without one, you pay twice.
Bought domains show in GET /purchased-domains. Use them in POST /create-order with provider=scaledmail.
Headers
AuthorizationstringrequiredBearer <your API token>. The token needs Read and write access.Idempotency-Keystringoptionalat most 255 charactersAny unique text per purchase (a UUID works), at most 255 characters. Send the same key again with the same token and you get the first result back, with no second charge.
Query parameters
organization_idstringrequiredYour workspace id (
org_). Must be a workspace this token was made for.. . .
Body
domainsstring[]required1 to 30 itemsDomain names to buy, like
demo-domain-1.. Spaces at the ends are removed and case is ignored; no duplicates. A name is one word plus its ending (com demo-domain-1.,com demo-domain-1.), no subdomains.co. uk .,ai .,ca .andeu .can't be bought. Every name must be available, or nothing is bought.info
Response (200)
successtruerequiredmessagestringrequiredOrder created successfully.amount_chargednumberrequiredTotal charged to your saved card, in US dollars.
total_domainsintegerrequiredHow many domains were bought.
domainsobject[]requiredEach domain bought and its price, in the order bought.
ShowHide child fields
domainstringrequiredThe domain name, lower case.
pricenumberrequiredPrice of this domain, in US dollars.
Responses
- 200OK. The card was charged and the domains are yours.
- 400Not available. One or more names are taken, premium, have an ending we don't sell, or are not a valid name. Nothing is charged.
- 400Duplicates. The same name is in
domainstwice (case is ignored). - 400Too many or none.
domainsis missing, empty or has more than 30 names (the same text for all three). If it is not a list:Invalid input: domains must be an array. - 400Key too long. The
Idempotency-Keyheader is longer than 255 characters. - 400No card. The workspace has no saved card. Add one in the app under Billing.
- 401No token. The
Authorizationheader is missing or notBearer <token>. - 402Card declined. The bank refused the payment (
card_), or the card needs a check by its owner that an API call can't do (declined card_). The message is the bank's reason. Nothing is charged. Retry with a newrequires_ action Idempotency-Key. - 402Earlier call failed. You sent the
Idempotency-Keyof an earlier call whose payment did not go through. - 403Read-only token. The token has Read access only.
- 403Not allowed. The person who made the token is not an owner or admin of the workspace.
- 403Not for your account. Your workspace's billing set-up doesn't allow this call. Contact support.
- 409In progress. A call with the same
Idempotency-Keyis still running. Wait a moment and send it again. - 429Busy. Too many orders are being placed at once. Wait for the
Retry-Afterseconds and send the same call again. - 429Rate limited. More than 15 buy calls in a minute. Wait for the
Retry-Afterseconds. - 429Too many orders. The person who made the token started more than 30 purchases in the last hour (portal purchases count too). This answer has no
detailsand noRetry-After: try again later. Nothing is charged. - 500Server error. Something failed before the card was charged (for example the domain check could not run). Send the same call again with the same
Idempotency-Key. - 500Needs our team. Something failed after the card may have been charged. Our team was told and will finish or refund the purchase. Don't retry with a new
Idempotency-Key. - 501Not available. Buying domains or paying by saved card is switched off right now, or the payment could not be started. Nothing is charged.
- 503Server busy. The database is busy. Wait for the
Retry-Afterseconds (5) and send the same call again with the sameIdempotency-Key.
