# Create or replace the number registration `POST /profiles/{profileReference}/esims/{esimReference}/number-registration` Registers the number this eSIM is on or porting to, replacing whatever was registered before. The body is the same `numberRegistration` block the eSIM order accepts, and it replaces the record in full — the registry stores exactly what is sent, so omitting a field clears it. Use it to correct a registration the registry rejected, or to keep a subscriber's details current after they move or change name. Responds `201` when it creates a registration and `200` when it replaces one that has not been sent yet. A registration already sent and awaiting the registry's result cannot be changed: that is `409`. Repeat the write once the outcome arrives, under a **new** `X-Idempotency-Key` — reusing the rejected request's key replays its cached `409`. The registration is sent once the number is live, so the status is `processing` immediately after a successful write. Requires OAuth2 client-credentials authentication: send `Authorization: Bearer {token}`. ## Path parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | `profileReference` | string | Yes | Profile reference | | `esimReference` | string | Yes | eSIM reference | ## Header parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | `X-Idempotency-Key` | string | No | Optional idempotency key for requests that change state. If provided, duplicate requests with the same key within 48 hours will return the cached original response without duplicating side effects. **Behavior:** - Same key + same method, path and request body → returns cached response (prevents duplicate operations) - Same key + different method, path or request body → returns 422 error - Same key + in-flight request → returns 423 error - Keys are held for at least 48 hours; use a fresh key for every new request **Request Body Matching:** Request bodies are compared by their JSON content. Object key order, including in nested objects, and whitespace do not affect matching. This means: - `{"a":1,"b":2}` and `{"b":2,"a":1}` are treated as identical ✓ - Whitespace differences are ignored ✓ - The method and the full path, query included, must match as well; headers are not compared **Best Practices:** - Use UUIDs or client-generated unique strings - Store keys on your side to support retries - Don't reuse keys across different operations | ## Request body (application/json) | Field | Type | Required | Description | | --- | --- | --- | --- | | `Person` | object | No | What a person's and an organization's registration have in common. | | `Person.countryCode` | string | Yes | The number's country as a two-character uppercase ISO 3166-1 alpha-2 code (malformed: 400). A country whose registry is not supported is rejected with a 422. | | `Person.languageCode` | string | Yes | Subscriber's communication language as a two-character lowercase ISO 639-1 code. A language a registry does not accept is rejected with a descriptive error. | | `Person.address` | object | Yes | | | `Person.address.streetName` | string | Yes | | | `Person.address.houseNumber` | string | Yes | | | `Person.address.unit` | string | No | Bus/box/apartment, when present. | | `Person.address.postalCode` | string | Yes | | | `Person.address.city` | string | Yes | | | `Person.firstName` | string | No | | | `Person.lastName` | string | Yes | | | `Person.organizationName` | any | No | | | `Person.legalForm` | any | No | | | `Person.vatNumber` | any | No | | | `Organization` | object | No | What a person's and an organization's registration have in common. | | `Organization.countryCode` | string | Yes | The number's country as a two-character uppercase ISO 3166-1 alpha-2 code (malformed: 400). A country whose registry is not supported is rejected with a 422. | | `Organization.languageCode` | string | Yes | Subscriber's communication language as a two-character lowercase ISO 639-1 code. A language a registry does not accept is rejected with a descriptive error. | | `Organization.address` | object | Yes | | | `Organization.address.streetName` | string | Yes | | | `Organization.address.houseNumber` | string | Yes | | | `Organization.address.unit` | string | No | Bus/box/apartment, when present. | | `Organization.address.postalCode` | string | Yes | | | `Organization.address.city` | string | Yes | | | `Organization.organizationName` | string | Yes | | | `Organization.legalForm` | string | No | The organization's legal form, for example `NV` or `BV`. | | `Organization.vatNumber` | string | No | The organization's VAT number. | | `Organization.firstName` | any | No | | | `Organization.lastName` | any | No | | ```json { "countryCode": "BE", "languageCode": "nl", "address": { "streetName": "Grote Markt", "houseNumber": "1", "unit": "A", "postalCode": "1000", "city": "Brussel" }, "firstName": "Jane", "lastName": "Doe" } ``` ## Example request ```bash curl 'https://connect.test.firsty.app/api/v3/profiles/{profileReference}/esims/{esimReference}/number-registration' \ --request POST \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --header 'X-Idempotency-Key: ' \ --data '{ "countryCode": "BE", "languageCode": "nl", "address": { "streetName": "Grote Markt", "houseNumber": "1", "unit": "A", "postalCode": "1000", "city": "Brussel" }, "firstName": "Jane", "lastName": "Doe" }' ``` ## Responses ### 200 — The existing registration was replaced ```json { "data": { "numberRegistrationReference": "A1B2C3D4", "registry": "be_cndb", "msisdn": "32470123456", "status": "processing", "reason": { "code": "5130", "message": "CustomerAliasLastName is missing" } } } ``` ### 201 — A registration was created ```json { "data": { "numberRegistrationReference": "A1B2C3D4", "registry": "be_cndb", "msisdn": "32470123456", "status": "processing", "reason": { "code": "5130", "message": "CustomerAliasLastName is missing" } } } ``` ### 400 — Bad request - invalid parameters ### 401 — Unauthorized - missing or invalid API key ### 403 — Forbidden - client does not have access to this resource ### 404 — Resource not found ### 409 — A registration for this number is currently being processed by the registry ```json { "type": "https://developers.firsty.app/errors/number_registration_pending", "code": "number_registration_pending", "title": "Conflict", "status": 409, "detail": "A registration for this number is currently being processed by the registry" } ``` ### 422 — The registration cannot be applied to this number: the eSIM's variant is not `local`, its country has no registry Firsty submits to, or the eSIM has no phone number available to register. Also returned for an idempotency key reused for a different request (`idempotency_key_reused`). ```json { "type": "https://developers.firsty.app/errors/number_registration_not_supported", "code": "number_registration_not_supported", "title": "Unprocessable entity", "status": 422, "detail": "Number registration is not supported for country 'US'" } ``` ### 423 — A request with this idempotency key is still being processed ### 429 — Rate limit exceeded. A `429` can also arrive without these headers or this body; handle it by its status code. ### 500 — Internal server error