Provision a SIM
This recipe provisions a SIM through the API and checks its result. There is no sandbox. Provisioning affects a real SIM and may incur charges. Confirm the serial number, account, network and tariff with the caller before creating the submission. The sample identifiers are placeholders, not test resources.
Authenticate
Obtain an API client_id and client_secret from your Account Manager. Portal usernames and passwords do not work. Follow Authentication to obtain an access token from POST https://auth.cellhire.com/connect/token using grant_type=client_credentials and form-encoded credentials. Keep credentials and tokens out of source files and logs.
Use Authorization: Bearer <access-token> for the remaining calls. Renew the token according to its returned expires_in value.
Identify the company, account and SIM
- Call
GET /api/companyand choose the intended company'sidascompanyId. - Call
GET /api/Company/{companyId}/accountand choose the intended account'sidasaccountId. - Call
GET /api/company/{companyId}/account/{accountId}/simto find the intended SIM, orGET /api/sim/{serialNumber}if its serial number is known. Check itscompanyId,accountId,serialNumber,networkIdand currentstatusbefore proceeding. Keep SIM serial numbers as strings. - Look up the SIM's
networkIdin Networks to determine whether provisioning uses Atlas or Hireman. If the network or current SIM state is unclear, resolve it before submitting.
List requests may require pagination. Follow Get requests; the maximum page size is 250. Use the OpenAPI JSON (opens in a new tab) for published read response schemas.
curl --location 'https://api.cellhire.com/api/Company/<company-id>/account' \
--header 'Authorization: Bearer <access-token>'Select the tariff and network options
Call GET /api/account/{accountId}/network/{networkId}/tariff. Select an available tariff and use its number as tariffNumber. Obtain identifiers from responses for this account and network rather than copying example values.
For Atlas networks:
- Fetch
GET /api/account/{accountId}/tariff/{tariffNumber}/boltons. Use selected BoltOnnumbervalues inboltOnsand satisfy the tariff's data BoltOn requirements. - If a selected BoltOn requires a public or static IP group, fetch the corresponding groups and use the selected group's
idinpublicIpGroupIdorstaticIpGroupId. - To use an existing provisioning order, fetch
GET /api/account/{accountId}/network/{networkId}/provisioningOrderand use itsnumberasprovisioningOrderNumber. To create an order, usecreateNewProvisioningOrder: trueand an alphanumericnewProvisioningOrderName. Do not combine these alternatives.
For Hireman networks, omit BoltOns, IP groups and provisioning order fields. See Provisioning extras for lookup requests and network restrictions, and Provision for the full write contract.
Create the submission once
Include the selected SIM in stock. Only provide msisdn when the SIM does not already have one. For an Atlas request, add the applicable options selected above. The following minimal example is for a Hireman network:
curl --location 'https://api.cellhire.com/api/SimSubmission/Provision' \
--header 'Authorization: Bearer <access-token>' \
--header 'Content-Type: application/json;charset=UTF-8' \
--data '{
"stock": [
{ "serialNumber": "<serial-number>" }
],
"tariffNumber": 100001
}'Store the returned ticketNumber alongside the intended SIM and requested configuration:
{ "ticketNumber": "1beeb8dd-1825-4bcd-8a62-f941aacb8d15" }This confirms creation of a submission. It does not confirm provisioning has completed. If the connection times out before a ticket is received, do not automatically repeat the POST. The published contract does not guarantee idempotency; reconcile whether the submission was created before submitting again.
Check the result
Call GET /api/SimSubmission/{ticketNumber}?includeCommands=true using the stored ticket number:
curl --location 'https://api.cellhire.com/api/SimSubmission/<ticket-number>?includeCommands=true' \
--header 'Authorization: Bearer <access-token>'Use the submission handling guidance for polling and recovery. pending, validating, ready, running, network-notified and network-processing do not confirm completion. In particular, ready only means validation passed, and Hireman provisioning may stay in network-processing until network processing is confirmed.
Inspect the submission, its commands and individual SIM results before reporting success. For invalid, correct validation errors before creating a replacement request. For failed, identify which SIMs already completed and reconcile their state before retrying anything. Do not resubmit the entire batch automatically.
If submission webhooks are configured, use a notification to trigger a fresh status read. Failed webhook deliveries are not retried, so keep a polling or reconciliation path for missing events.