Account provisioning
Create Met accounts from your own product and top them up with energy, using a partner API key.
If you embed Met inside your product, your customers don't have to sign up by hand: you can create their account from your backend and hand it over ready to use. This is the "Meteor as a service" case.
It is available to approved Tech Partners, with a partner API key. A workspace key cannot do it: the permissions in this guide only exist on partner keys.
Scopes
| Scope | What it is for |
|---|---|
workspaces:provision | Create a new account with its owner |
workspaces:recharge | Top up an account you created |
workspaces:close | Request and revert the closure of an account attributed to you |
Both are partner-key only, and neither works with a test key (met_test_): the accounts they create are real, and so are the charges.
Create an account
import Met from '@meteor.ia/sdk';
const met = new Met(process.env.MET_PARTNER_KEY!);
const account = await met.workspaces.create({
business_name: 'Inmobiliaria Andes',
owner_email: 'ana@andes.co',
owner_name: 'Ana Gómez',
owner_phone: '+573001234567',
country: 'CO',
});
console.log(account.id, account.operational); // 1234 falsefrom meteor_ia import Met
met = Met(api_key=os.environ["MET_PARTNER_KEY"])
account = met.workspaces.create(
business_name="Inmobiliaria Andes",
owner_email="ana@andes.co",
owner_name="Ana Gómez",
owner_phone="+573001234567",
country="CO",
)owner_phone is optional: it's the business owner's WhatsApp, with the country code. If you don't have it, leave it out. Don't use your own number: if another Meteor user already has it, the call returns 409 PHONE_TAKEN.
The account starts on the Tech Partner plan: monthly, no fixed fee, Energy at a premium rate. Your customer can move up to a commercial plan whenever they want, and from then on they pay that plan's rate.
Three things worth knowing first
The account starts with no energy
The response carries operational: false and balance_usd: 0. An account without energy cannot run a single Met turn: the first message replies that there is no budget.
Energy is always paid by the account consuming it, so the next step is topping it up (below) or asking your customer to do it. Don't leave it until after the first message.
You do not set the password
You don't send a password in the call, and there is no way to do so. Met emails the owner a link to set their own. The owner.invitation_sent field tells you whether that email went out; if it came back false, your customer can request it again from "Forgot my password".
Retrying does not duplicate
The Idempotency-Key header is required. The SDK generates one for you if you don't pass it, but it is better to pass your own — the id of your own record, for instance: that way a network-timeout retry returns the same account instead of creating a second one.
await met.workspaces.create(data, { idempotencyKey: `signup-${myRecord.id}` });
Top up energy
const r = await met.workspaces.recharge(account.id, 50, { idempotencyKey: `energy-${order.id}` });
if (r.object === 'energy_charge') {
// Charged in the call: r.pagado_con_saldo_usd + r.cobrado_a_tarjeta_usd
} else {
// r.checkout_url → Stripe payment link
}
The response tells you how it was charged, in object:
energy_charge: charged in the same call. If your agreement charges energy to your partner balance, it comes out of the balance first and whatever is missing goes to your saved card; with neither enough balance nor a card it returns409 insufficient_balance. Withoff_session: trueit goes straight to your card.recharge_checkout: acheckout_url; the charge happens when someone completes the payment.
Either way the energy lands when Stripe confirms the payment, not in the response. The minimum is USD 5. If your agreement charges your balance, each top-up can be up to USD 500 and they all count against your monthly top-up cap, the same one as automatic top-ups (409 monthly_cap_reached with what you have left).
It never charges twice. Send your own Idempotency-Key: a retry with the same key returns the same top-up. The SDK generates one per call and reuses it in its own retries.
Check your balance first with met.workspaces.partnerBalance() (GET /partner/balance).
It only works on accounts you created. Someone else's account returns 403.
Account plan
met.workspaces.upgrade() (POST /workspaces/{workspaceId}/subscription) moves an account from tech_partner to a commercial plan that you pay, with your partner discount. If your agreement charges your balance, the license comes out of it first and whatever is missing from your card; without a card it works when your balance covers the first charge (otherwise 402 insufficient_balance), and we warn you in the portal 7 days before any renewal your balance won't cover.
If the plan includes WhatsApp numbers, the lines you were paying for on that account are cancelled up to that number, at the end of the period already paid; the rest you keep paying and can lower with setAddon(). The response details it in lineas_whatsapp.
To move it between commercial plans later: met.workspaces.changePlan() (PUT on the same route). Upgrading charges the prorated difference right away; downgrading takes effect at the next renewal. Your discount stays as it was when you upgraded the account, and you keep paying the account's energy while you pay its license, automatic top-ups included.
Quotas
Each partner tier has a monthly quota of new accounts:
| Tier | Accounts per month |
|---|---|
| Bronze | 100 |
| Silver | 300 |
| Gold | 1000 |
Once it runs out, creation returns 403 with the quota, how much you have used and when it resets. The counter goes back to zero on the first day of each month.
Close an account
Closing an account takes two steps, and no API call deletes data. It is in pilot, per account. It only applies to accounts you provisioned and still pay for, or on the Tech Partner plan: if the merchant pays for its own account, its owner requests the closure from Meteor.
- You request it.
POST /workspaces/{workspaceId}/closurewithauthorization_confirmed: true: you guarantee you have the user's authorization, and who requested it and when is recorded. Mets stop replying and automated sends stop. You have 30 days to revert it withPOST /workspaces/{workspaceId}/closure/revertand to export the data, because the account can still be read. - Meteor decides the deletion. Once the term ends you lose access and a person at Meteor reviews the closure. Nothing is deleted without their approval.
While the closure lasts, that account's subscriptions are not charged: billing pauses when you request it and stays paused if the term ends. If it is reverted, billing resumes and what was left pending during those days is charged; if Meteor approves the deletion, the subscription is canceled and that is voided. On revert, what came due during those days does not go out on its own: the owner decides what to send. If the owner objects, your key loses access to the account while Meteor reviews.
Check its status with GET /workspaces/{workspaceId}/closure. Invoices and charges are kept for 10 years, and backups for up to 90 days. The owner is notified and can object by writing to support: Meteor freezes it and their service returns during the review. Meteor can also freeze a closure over a claim, a disputed debt, an order from an authority or an abuse investigation.
Errors
| Code | What happened |
|---|---|
403 scope_not_allowed_for_owner | You are using a workspace key; this needs a partner key |
403 test_mode_restricted | You are using a met_test_ key; these operations are real |
403 account_closing | The account is being closed: it cannot be operated. After the 30 days, it cannot be read either |
403 closure_requires_owner | The merchant pays for its own account: its owner requests the closure |
429 closure_daily_limit | More than 10 closure requests in a day |
409 closure_expired | The 30 days passed: you can no longer revert the closure |
409 closure_frozen | Meteor froze the closure while it reviews a case |
409 PHONE_TAKEN | That owner_phone already belongs to another Meteor user: use the business owner's WhatsApp or leave it out |
403 with a capability message | Your partner account does not have the Tech Partner capability approved |
403 with a quota message | You ran out of quota for the month |
400 | The Idempotency-Key header is missing, or some owner detail is invalid |
For the full detail on retries and idempotency, see Errors and idempotency.