Buy DID
buy_didPurchase one or more DIDs by creating an Order. Pass the sku_id from search_coverage — this is the Stock Keeping Unit (SKU) UUID, NOT the group_id. The first (token-less) call charges nothing and returns a preview: DID group location and type, included channels, per-DID and total prices, balance impact and any DID-group service restrictions. All amounts are in USD. Confirming with the returned confirmation_token executes the purchase AND constitutes acceptance of the service restrictions shown in the preview. Charges the customer's balance, creates an Order and returns the purchased DID ids and numbers. Occasionally some numbers are allocated asynchronously — when the response carries a note about pending DIDs, tell the user and check list_dids after a minute or later. When the response contains a registration_required block the numbers need end-user registration before they work — follow its next_steps instead of stopping at the purchase. An out-of-stock purchase is accepted by default as a back-order (the preview warns about it): the order is charged now and the missing numbers are provisioned later. Pass allow_back_ordering false to refuse instead. This spends real money.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| qty | No | Quantity of DIDs to purchase (default 1). | |
| sku_id | Yes | The `sku_id` field from search_coverage (a Stock Keeping Unit UUID, not group_id). | |
| description | No | Free-text description set on every purchased DID (back-ordered ones too), overriding the DID configuration profile's. Omit to keep the profile's. | |
| confirmation_token | No | Leave empty on the first call — it returns a preview + confirmation_token and charges nothing; re-call with the token to execute the purchase. | |
| allow_back_ordering | No | Default true (same as a User Panel order): when the group has no (or not enough) DIDs in stock the order is still accepted and charged, and the missing numbers are provisioned later — they appear in list_dids once assigned, and a pending order can be canceled if the customer prefers not to wait. Set false to reject an out-of-stock purchase instead. |