What you will learn
- The code names a server and an order. It is not the eSIM.
- A confirmation code is separate. The carrier sets the retry limit.
- The server checks the order, the chip, the state and the attempt count.
- A closed or errored order needs a new one from the carrier.
- We did not scan a code or test a phone.
On this page
- The short answer: the QR code is an address and a ticket number, not the eSIM
- The activation code, field by field
- The token: what MatchingID actually does
- Who is who: the five parties behind one scan
- Three ways a phone finds the server, and what Apple and Google add
- The download, step by step
- The confirmation code and the consent steps
- What the server learns about your phone
- Installing the profile on the chip
- Why a code stops working: the order's states on the server
- Cancelling, deleting and getting the code back
- What to do with all this, and what we did not check
- Frequently asked questions
- Sources and audit notes
The short answer: the QR code is an address and a ticket number, not the eSIM
If you came here because an eSIM QR code arrived by email and you want to know what is actually inside it, here is the plain version. We pulled the complete text of the GSMA's two main eSIM documents for phones, SGP.21 and SGP.22, both version 2.7 and dated April 2026.
We read the parts that matter here: the definitions, the architecture, the activation code and confirmation code rules, the download and install procedure, the profile states, profile deletion and the eligibility annex. We did not read all 404 pages line by line, and we say below where we stopped. We also read Apple's and Google's setup pages and Google's Android developer pages. We read them all on November 14, 2026.
The GSMA specification says the QR code carries an "Activation Code." Its own definition is short: "Information issued by an Operator/Service Provider to an End User. It is used by the End User to request for the download and installation of a Profile." The word to notice is "request." The code asks for a download. It is not the download.
A QR code in the format the specification describes holds a short text string. The string names a server, which the specification calls an SM-DP+, and a token that tells that server which order you mean. It can also hold a flag that says a confirmation code is needed. When the code is shown as a QR code, the specification says it is prefixed with "LPA:".
The eSIM itself, which the specification calls a Profile, is sent later. Your phone connects to the named server, the two sides prove who they are to each other, the server checks that it has a matching order for you, and only then does it send the Profile, bound to the chip in your phone.
What we can say, in seven lines
- The code is text. The specification lists its fields. They are a format number, a server address, a token, and two optional items.
- The server address is inside it. That is how your phone knows where to ask.
- The token is the order number. The specification calls it the MatchingID, or the "Activation Code Token."
- A confirmation code is separate. The code can carry a flag that says one is required. The confirmation code itself is not one of the listed fields.
- The Profile comes later. It is built for your chip and sent after checks on both sides.
- The server keeps count. The specification says the server limits the number of download attempts and the number of confirmation code attempts for each Profile.
- Reuse depends on the server's state for that order. The specification describes states such as Released, Downloaded, Installed and Error. We explain what each means for a code you try a second time.
What this guide is and is not
This is a reading guide for the GSMA documents and the vendor pages that sit on top of them. It is not a test. We did not scan a code, install a profile, or watch the traffic between a phone and a server. Where the specification leaves a choice to the carrier or the phone maker, we say so and we do not guess.
One more limit. The specification is written for people who build eSIM systems. It describes what each part must do. It does not say what any one carrier does on a Tuesday afternoon. A carrier may use an activation code, an app, a link or a tap on a notification. Apple's setup page lists those routes, and we cover them in a later chapter. What follows is the common machinery underneath.
If you only want to fix a phone that will not install an eSIM, our guide on why an eSIM is not working is the better starting point. This article is for people who want to understand the code.
The activation code, field by field
The specification gives the activation code a precise structure. It says the code "SHALL be coded to be the concatenation of the following strings listed in the following table." In plain words, the code is a row of parts joined with dollar signs.
The parts, in order
The first part is the format. The specification says it is set to "1" for this format "and any subsequent backward compatible Format." It adds a rule for phones: "The Device SHALL treat an AC_Format other than "1" as invalid." So a code that starts with anything but 1 is rejected by a compliant phone.
The second part is a delimiter, the dollar sign. Then comes the address of the server. The specification describes it as the "FQDN (Fully Qualified Domain Name) of the SM-DP+," and gives the example SMDP.GSMA.COM. It is "restricted to the Alphanumeric mode character set defined in table 5 of ISO/IEC 18004 [15] excluding '$'." That is a QR code rule.
Alphanumeric mode is the compact way to store text in a QR code, and the dollar sign is left out of the address because it is the separator.
After another dollar sign comes the token. The table calls it "AC_Token" and says it is the "MatchingID as described in section (0)." The next chapter covers it.
Then come two optional parts. One is the "SM-DP+ OID," which the table describes as the "SM-DP+ OID in the CERT.DPauth.ECDSA." That is an identifier that appears in the server's certificate. The other is the "Confirmation Code Required Flag," which "SHALL be present and set to "1" if Confirmation Code is required; otherwise it SHALL be absent."
Each optional part has a delimiter before it. The table says the delimiter "SHALL be present and set to "$" if any of the following optional parameters is present." So a code with a flag but no OID has two dollar signs in a row, and the specification's own example shows that: 1$SMDP.GSMA.COM$04386-AGYFT-A74Y8-3F815$$1.
Five examples from the specification
The specification gives five example codes. They show every combination of the two optional parts:
- 1$SMDP.GSMA.COM$04386-AGYFT-A74Y8-3F815 has neither optional part.
- 1$SMDP.GSMA.COM$04386-AGYFT-A74Y8-3F815$$1 has the flag and no OID.
- 1$SMDP.GSMA.COM$04386-AGYFT-A74Y8-3F815$1.3.6.1.4.1.31746$1 has both.
- 1$SMDP.GSMA.COM$04386-AGYFT-A74Y8-3F815$1.3.6.1.4.1.31746 has the OID and no flag.
- 1$SMDP.GSMA.COM$$1.3.6.1.4.1.31746 has the OID and a blank token.
These are examples from the document. They are not real orders, and the server name is the GSMA's own demonstration name.
Length, typing and the QR prefix
The specification sets a ceiling: "The maximum length of the Activation Code SHALL be 255 characters, but in practise it is recommended to consider the user experience when choosing the length." A shorter code makes a smaller, easier QR code.
It also says how the code is used in two ways. "When entered manually, the Activation Code SHALL be used as defined above." And: "When provided in a QR code according to ISO/IEC 18004 [15], the Activation Code SHALL be prefixed with "LPA:"" So the text inside a QR code reads LPA:1$..., while the text you type by hand starts at the 1. Apple's page describes the manual route without showing the string: "Manually enter the eSIM information" through "Enter Details Manually."
Finally, the specification plans for change. "To support extension by future versions of this specification, the Device SHALL ignore a delimiter and any further parameters following those defined in Table 8." A phone that meets version 2.7 skips extra parts it does not know. One scope note: the GSMA also publishes a separate version 3 track of SGP.22, listed on its own resource pages. We did not read it, so everything here is about version 2.7 only.
A word on what the table does not list
The table lists no phone number, no name, no account number and no key. We are careful here. The specification says what the code is made of. It does not say what a carrier might attach to the same email or web page. A carrier may send a QR code with a confirmation code on a different page or in a different message. The specification says the means of delivering the confirmation code to the user "is out of scope."
The token: what MatchingID actually does
The token in the middle of the code does most of the work, so it deserves its own look. The specification calls it the MatchingID, and says it "is mandatory information (but MAY be zero-length)." It is something that "SHALL be set-up between the Operator and the SM-DP+, to identify the context of a specific management order given to the SM-DP+."
A management order is the carrier telling the server: prepare this profile for a customer. The MatchingID is the label on that order. The SGP.22 text gives the same thing a second name: "The MatchingID is equivalent to the "Activation Code Token" as defined is SGP.21 [4]."
Two jobs
The specification gives the MatchingID two jobs. It must be "a unique identifier in the context of the Operator and the SM-DP+ to" do two things. The first is to "Match a download order initiated by the Operator with a Profile Download request coming from an LPD." That is, tie the carrier's order to your phone's request.
The second is protection: "As a protection for the SM-DP+: the SM-DP+ SHALL only process requests containing a MatchingID known to the SM-DP+ (and therefore inherently valid)." So a random string does nothing. The server ignores requests with a token it has not issued.
We want to be exact about what that means. The specification calls a known MatchingID "inherently valid" for the purpose of deciding whether to process the request. It does not say the token is a password, and it does not say the token alone proves you are the customer. Other checks follow, and the next chapters list them.
The character rule
The specification restricts the token's alphabet. It "SHALL consist only of upper case alphanumeric characters (0-9, A-Z) and the "-" in any combination." The reason is given in a note: "This selection allows more compact alphanumeric QR code encoding and is expected to be supported for manual entry."
That explains why real tokens look like the example, 04386-AGYFT-A74Y8-3F815: capital letters, digits and hyphens. It is a QR code size choice and a typing choice, and the specification does not describe the pattern as a security feature.
When the token is blank
The specification allows the token to be "missing completely" on certain interfaces. It says "On ES9+ and ES11, the data object containing the MatchingID MAY also be missing completely." The fifth example above shows a blank token inside an activation code, where the OID is present and the token is not.
The text we read does not say what a carrier does with a blank token in practice. Our reading is that this supports flows where the server identifies the order another way, such as by the chip's identifier. That is our inference, not a statement from the document.
The same word, a different use
The MatchingID turns up in a second place, and it is easy to confuse the two. When a phone wants to retrieve the activation code of a profile it already has, the specification builds a special MatchingID from the letters ACR, a request type and the profile's ICCID. The example is ACR-0-8947010000123456784. That use is for getting a code back, not for a first install. A later chapter covers it.
Who is who: the five parties behind one scan
A QR code scan involves more parties than most people expect. The GSMA documents give each a name and a job.
The Operator
The specification defines an Operator as "A Mobile Network Operator or Mobile Virtual Network Operator; a company providing wireless cellular network services." It is the carrier or the carrier's brand. The Operator issues the activation code to you. The specification says the Operator and the server set up the MatchingID between them, and that the Operator "is free to request a new Profile download order corresponding to the same Profile" in some failure cases.
The SM-DP+
The server in the code is called a Subscription Manager Data Preparation+ server, shortened to SM-DP+. The SGP.21 definition reads: "This role prepares Profile Packages, secures each with a Profile protection key, stores Profile protection keys in a secure manner as well as the Protected Profile Packages in a Profile Package repository, and links the Protected Profile Packages to specified EIDs.
The SM-DP+ binds Protected Profile Packages to the respective EID and securely downloads these Bound Profile Packages to the LPA of the respective eUICC."
Put simply, it is the warehouse and the shipping desk. It holds the prepared profile, ties it to your chip, and sends it.
The LPA
The LPA is the Local Profile Assistant. SGP.21 defines it as "A functional element in the Device or in the eUICC that provides the LPD, LDS and LUI features." Those three letter groups stand for the parts that download profiles, discover them and show the user interface. In a phone, the LPA is the software that scans the QR code, shows the "Add eSIM" screens and talks to the server. The specification's term for an LPA that lives in the device is "LPAd."
Google's Android pages show how this looks to an app developer. They describe a method to download a subscription "created from an activation code or a QR code," and an error that fires if "the profile metadata indicates that a carrier confirmation code is required."
The eUICC
The chip is the eUICC. SGP.21 defines it as "A UICC which enables the local management of Profiles in a secure way," and notes that "The term originates from "embedded UICC"." It is the secure element that stores the profile. It also holds the keys and certificates it uses to prove its identity to the server.
The chip has an identifier called the EID, short for eUICC Identifier. The specification says "The EID SHALL uniquely identify an eUICC." Older EIDs began with 89 and followed a structure with a country code and an issuer number. Newer ones may follow a different scheme defined in another GSMA document, SGP.29, where the older rules "no longer apply."
The SM-DS, which many scans never touch
The fifth party is optional. SGP.21 defines the SM-DS, the Subscription Manager Discovery Server, as "responsible for providing addresses of one or more SM DP+(s) to a LDS." It is a lookup service. If the phone has no activation code, it can ask the SM-DS whether any server has a download waiting for its EID.
Where the person sits
The documents also name the people. The "End User" is "The person using the Device." The "Subscriber" is the one with the contract. They are often the same person. The specification says each local operation "SHALL be explicitly initiated by the End User, and verified by User Intent," and defines User Intent as "the direct, real time acquisition of the manual End User input on the LUI to trigger locally a Profile download or Profile Management operation."
So there are five technical parties and one person. The specification asks for the person's input on the phone to trigger a download, and we cover the consent steps in a later chapter.
Three ways a phone finds the server, and what Apple and Google add
The QR code is only one way to start. The specification describes three, and the phone's software picks the one it has the information for.
The three starts in the specification
The download procedure begins with the phone getting the address of the server. The specification's procedure lists the options as "(a) Get SM-DP+ Address, Parse Activation Code Token, [SM-DP+ OID] from AC," or "(b) Get SM-DP+ Address and EventID from SM-DS," or "(c) Get Default SM-DP+ Address from eUICC."
Each start sets the MatchingID differently. The procedure says: "If an Activation Code is used, the MatchingID value SHALL be set to Activation Code Token." "If an SM-DS is used, the MatchingID value SHALL be set to EventID." And "If a Default SM-DP+ is used, the MatchingID SHALL be missing."
In the first start, which is the QR code case, the person provides the code. The specification says "Depending on the Device capabilities, the LPAd SHALL support entry of the Activation Code by manual typing and QR code scanning." So a phone that has a camera must let you scan, and every phone must let you type.
In the second start, the phone asks the discovery server. The SGP.21 definition of an "Event" is "A Profile download which is set by an SM-DP+ on behalf of an Operator, to be processed by a specific eUICC." The server registers that event with the SM-DS, and the phone retrieves it.
The record is made of "the Event-ID, EID, and SM-DP+ address," or the Event-ID, EID and the address of another discovery server. So here the chip's identifier, not a scanned code, is what links the order to your phone.
In the third start, the chip itself holds an address. The specification says the phone retrieves the default server address from the eUICC by calling a function named "ES10a.GetEuiccConfiguredAddresses." We did not read what real carriers do with this route, and the specification does not name any.
What Apple lists for iPhone
Apple's setup page for eSIM, published October 22, 2026, lists the starts from the iPhone side. It says "You can activate your eSIM on iPhone through one of the following methods, depending on your carrier's eSIM support." The five are eSIM Quick Transfer, eSIM Carrier Activation, a QR code, "other methods," and transfer from an Android or other non-Apple device.
The "other methods" are a carrier link, a carrier app and manual entry. For links, Apple says "Your carrier might send you a link instead of a QR code," and that on iOS 17.4 or later you tap the link and then "Allow" the "Activate New eSIM notification." For QR codes sent by email or in a browser, Apple says to "tap and hold the QR code. Then, tap Add eSIM."
Apple does not say which of these maps to which of the three specification starts. We will not guess. What the page does tell us is that the QR code is one choice among several, and that "In most cases, you can activate your eSIM while you're setting up your iPhone, or you can activate your eSIM after setup."
What Android adds
Google's Android developer pages describe the carrier app route in more detail. They say "The carrier app can download profiles by calling downloadSubscription directly or by providing an activation code to the LPA." In the activation code case, "the LPA fetches an activation code from the carrier app and downloads the profile."
The same pages add a safety rule: "For security reasons, the LPA should not directly accept an activation code supplied in the result intent to ensure that non-LPA callers can't get an activation code from the carrier app." That sentence is useful. It says an activation code is something worth protecting from other apps on the phone, which is Google's own view in its developer guidance.
Google's Pixel help page says little about codes. It says "Some phones can use eSIM, depending on the phone and mobile carrier. For details, check with your carrier." The Android pages are written for developers, so they describe the interface, not what a carrier does in a given country.
Why the route matters
All three starts end in the same procedure. The phone has a server address and a way to name the order. After that, the steps in the next chapter apply. That fits with Apple listing several routes that all end in an installed eSIM.
The download, step by step
Once the phone has an address, the specification's download procedure runs. The steps below follow its section on Profile Download and Installation. We keep its wording where it matters and use plain words for the rest. The order of the checks is the specification's. The names we give the stages are ours.
Step 1: parse the code
The phone reads the activation code. The procedure says "The LPAd parses the Activation Code and finds the SM-DP+ address, Activation Code Token, and optional SM-DP+ OID. If the format of the Activation Code is invalid, the procedure SHALL be stopped with an error message provided by the LPAd to the End User." An invalid code ends here, before any network call. Android's EuiccManager has a matching error, "ERROR_INVALID_ACTIVATION_CODE."
Step 2: both sides prove who they are
The specification calls this the "common mutual authentication procedure." Both the server and the chip show certificates and signatures. One rule ties back to the code. The phone must "verify that the SM-DP+ OID contained in the CERT.DPauth.ECDSA returned by the SM-DP+ is identical to the SM-DP+ OID if the LPAd has acquired it from the Activation Code." If they differ, "the LPAd SHALL inform the End User and the procedure SHALL be stopped."
That is the job of the optional OID in the code. When the OID is present, the phone can check that the server it reached is the server the code expected. When it is absent, there is nothing to compare, and the text we read describes no other comparison for that case.
During this step the phone also hands over the MatchingID and the device information to the chip to sign, which we cover in the chapter on what the server learns.
Step 3: the server looks up your order
Now the server acts. After it has authenticated the chip, "the SM-DP+ SHALL" do three checks. It must "Verify that there is a related pending Profile download order for provided the MatchingID." Then, "If this Profile download order is already linked to an EID, verify that it matches the EID of the authenticated eUICC." And it must "Verify that the Profile corresponding to the pending Profile download order is in 'Released' state, or, in case of a retry due to a previous installation failure, in 'Downloaded' state."
The server also keeps count. The specification says it "SHALL increment the count of download attempts for the identified Profile." If the maximum number of attempts has been exceeded, it "SHALL terminate the corresponding Profile download order" and notify the Operator.
If any check fails, the server "SHALL return a relevant error status and the procedure SHALL stop." The spec's list of status codes includes one named "MatchingID - Refused" for the case where no pending order matches. Whether a given carrier shows that as a message on your screen is up to the phone's software.
Step 4: the eligibility check
Next comes the question of whether this profile fits this phone. The specification says the server "SHALL perform appropriate eligibility checks, based on the Device Info and/or eUICCInfo2. These checks SHALL include the check if the eUICC can install one more Profile."
Annex F, which is marked informative, describes two kinds. A static check is "based on the static capabilities of the Device and / or the eUICC," and is "under the responsibility of the Operator." A dynamic check is "based on the eUICC Info and / or the Device capabilities signed by the eUICC during Profile Download and Installation procedure," and is "under the responsibility of the SM-DP+ on behalf of the Operator." The annex says the means of working out compatibility "is out of scope of this specification."
If the eligibility check fails, the server sets the order's profile to an "Error" state and returns an error. That is a one-way trip for that order, as the state chapter shows.
Step 5: metadata and consent
If all that passes, the server returns Profile Metadata. The phone may check profile policy rules, and then it asks the person. The specification says the phone "SHALL ask for Simple Confirmation (e.g., simple 'Yes' or 'No' or 'Not Now') on the Profile download" if there are no extra rules, and that the confirmation request can show the profile's name or related details. We cover that and the confirmation code in the next chapter.
Step 6: the sealed package
After consent, the phone asks the chip to prepare for download. The chip checks the server's certificate and signature and makes a fresh one-time key pair for this session, unless a valid earlier one is offered for a retry. The server then builds the Bound Profile Package, using session keys it derives from the one-time keys. SGP.21 defines a Bound Profile Package as "A Protected Profile Package which has been cryptographically linked to a particular eUICC."
When the server sends the package, the specification says it sets the profile for that order to the 'Downloaded' state. That state matters later.
What the steps tell you about a failed scan
A failed scan can fail in at least four places: the code is malformed, the server certificate does not match, the server has no matching order or the order is in the wrong state, or the profile does not fit the phone. The specification treats each as a separate error.
A vague "cannot add eSIM" message on a phone does not tell you which of them it was. Our guide on eSIM problems covers the practical fixes for the carrier-side causes.
The confirmation code and the consent steps
Some activation codes ask for a second secret. The specification calls it the Confirmation Code, and it is the only part of the flow that the carrier can add on top of the QR code to protect an order.
What the code carries and what it does not
The activation code carries a flag, not the secret itself. The table says the flag is "Confirmation Code Required Flag" and that it is set to "1" if a confirmation code is required. The specification says the order "MAY be protected by a specific Confirmation Code" and that "The Confirmation Code is provided by the Operator to the SM-DP+ and the End User during the Profile download initiation procedure." Then it adds the limit: "The means by which the Confirmation Code is provided to the End User is out of scope of this specification."
So the carrier decides how you get the number. Apple's page says what you see: "If you're asked to enter a confirmation code to activate your eSIM, enter the number that your carrier provided." It does not say how carriers deliver it.
When the phone asks
The flag can also come from the server. The procedure says "If the Confirmation Code Required Flag is set in either the Activation Code Token or in the smdpSigned2, then the LPAd SHALL ask for the End User to enter the Confirmation Code which was provided by the Operator." The phone may show the profile name next to the prompt "to help the End User identify the Profile." The specification adds that the code entry "SHALL be obtained no later than this step," so the phone cannot defer it until after the package arrives.
Android handles this as a fixable error. The Android guide says "downloadSubscription may fail if the profile metadata indicates that a carrier confirmation code is required." That error is a resolvable one, which means the system can ask the user for the code through its own screen and then try again. Android also has a separate error, "ERROR_INVALID_CONFIRMATION_CODE," for a code that is wrong.
How the server checks it
The phone does not send the code in plain form. The specification says the phone computes a hash of the code combined with the session's TransactionID. We will not repeat the formula, which is in section 3.1.3 of SGP.22. The point is that the server compares hashes, and the session identifier is part of the hash.
The specification also puts a cap on guessing. "The SM-DP+ SHALL protect against excessive incorrect entries of the Confirmation Code. The maximum number of Confirmation Code retries allowed to an End User is defined by the Operator and communicated to the SM-DP+ by means out of scope of this specification." The number is not in the document. It is the carrier's choice.
When the limit is reached
The specification is exact about the result: "Once the maximum number of Confirmation Code retries is exceeded for a Profile download order, the Profile download order SHALL be terminated and the SM-DP+ SHALL communicate the final status to the Operator. The Operator is free to request a new Profile download order corresponding to the same Profile, with the same or a different Confirmation Code."
Two readings follow, and we label them as ours. First, a locked-out order does not fix itself on the phone. The server ended it, and the carrier has to create a new one. Second, the same eSIM profile can be offered again with a new order, so asking the carrier is the path the specification points to. The document does not say how long a carrier takes or whether it charges for this.
Simple and strong confirmation
The specification separates two kinds of consent. A "Simple Confirmation" is a yes or no. A "Strong Confirmation" is "A secure and non-interceptable mechanism to guarantee a higher level of User Intent than Simple Confirmation by which the End User confirms their action, e.g., by inputting PIN or fingerprint, repeating Simple Confirmation, entering Confirmation Code, etc." So entering the confirmation code can count as strong confirmation, and the specification says it "MAY be considered as a Strong Confirmation."
If the person does nothing, the download is cancelled. The procedure says "If the End User does not respond to the LPAd prompt within an implementation-dependent timeout interval, the LPAd SHALL cancel the Profile download." The length of the timeout is up to the phone maker, and we found no number in the specification.
What the server learns about your phone
People often ask whether scanning an eSIM code shares their phone's details with the carrier. The specification answers part of that question. It describes what the phone must send, and it is explicit that the carrier chooses how to use it. It does not describe any carrier's practices.
Device information, signed by the chip
The specification says "any Device Information provided by the LPA to the eUICC SHALL be signed by the eUICC, and then provided by the eUICC to the SM-DP+ for the purpose of Device eligibility check. The SM-DP+/Operator is free to use or ignore this information at their discretion."
The list of what the device information holds is short. It "includes" the "Device type allocation code: TAC" and "Device capabilities," which cover "Radio access technologies, including release," contactless interfaces and optional RSP functions. It may also include the IMEI. The specification says the IMEI is "optional" and that it "SHOULD be present if the Device contains a non-removable eUICC."
The specification calls the TAC information "comprised in the IMEI" and points to a 3GPP document for its definition. We did not read that document. So we do not describe the TAC beyond what the GSMA text says.
The chip's identifier
The server also learns the EID. During the checks, it verifies that an order linked to an EID "matches the EID of the authenticated eUICC." And at the package step the specification says "If the Profile is not linked to the EID of the target eUICC, the SM-DP+ SHALL link the Profile to the EID at this step." So after a download, the profile is tied to your chip's identifier in the server's records.
The carrier may know the EID earlier. In the contract step, the specification says "the EID and IMEI of the target Device MAY be provided, and related Device capabilities MAY be acquired (e.g. based on the TAC information comprised in the IMEI)." Google's Pixel help page mentions the same numbers: "When you speak with your carrier, you may need to provide Pixel ID numbers like the IMEI 1, IMEI 2, or EID number." That is consistent with a carrier asking for them when setting up an order.
What the carrier hears back
The server can also report progress to the carrier. The specification describes an optional notification function that tells the Operator the stage reached. When the server reports, it "SHALL provide the EID, the ICCID, the identification of the point reached," plus "the timestamp when this point was reached, and the execution result of this step." The spec adds that this is "Depending on the agreed behaviour with the Operator (out of scope of this specification)."
The stages named in the text include the eligibility check, the confirmation code check, the package download and the installation. The specification says one of these notices "does not have any impact on the Profile state." So the progress notices tell the carrier what happened. They do not drive the server's own state machine.
What we cannot say
We cannot say what any particular carrier stores, for how long, or whether it uses device details for anything beyond the eligibility check. The specification states that the SM-DP+ and Operator may "use or ignore" the information. The privacy policy of the carrier, not the GSMA document, covers what happens next. If you care about this, ask your carrier. We did not do that.
We can say one more thing from the text. The specification describes no field that carries your name, your address or your payment details in the download itself. It says contract details, user details and payment details "are also out of scope of this specification." That means the standard does not move them in this flow. It does not mean your carrier does not hold them.
Installing the profile on the chip
After the server sends the Bound Profile Package, the phone passes it to the chip in pieces. The specification calls this the Profile Installation sub-procedure, and it is the part where the eSIM actually lands on your phone.
The package goes in as segments
The phone's software breaks the package into segments and feeds them to the chip with a function named "ES10b.LoadBoundProfilePackage." If the phone cannot split it, or if "any call of "ES10b.LoadBoundProfilePackage" returns status words other than '90 00' or '91 XX'," the phone cancels with the reason "Load BPP execution error." That is the cancel path covered in the next chapters.
Inside the chip, the segments arrive in a set order. First the secure channel is set up from the server's data, and the chip makes session keys. Then the chip is told how to configure its profile space, the metadata is stored, and the profile elements are loaded. The specification names these as ES8+ functions: InitialiseSecureChannel, ConfigureISDP, StoreMetadata, optionally ReplaceSessionKeys, and LoadProfileElements. We will not walk through the byte formats. They are interface detail for chip makers.
The chip keeps a receipt
The last step of loading returns a Profile Installation Result. The specification says "The eUICC SHALL store the Profile Installation Result in its non-volatile memory before delivering it to the LPA." In other words, the chip writes the receipt down before it tells the phone.
It also cleans up. The specification says "The eUICC SHALL erase the otSK.EUICC.ECKA attached to this RSP session no later than the successful completion of the BPP installation." That is the one-time private key made for this download. After installation, the chip removes it.
The server hears about it
The phone then tells the server the result. The procedure says the phone calls "ES9+.HandleNotification" with the Profile Installation Result, and the server acknowledges it. On that call, the server will "Terminate the pending download order and set the corresponding Profile in state 'Installed' or 'Error'" as the Profile Installation Result indicates.
This is the point where a download order ends. Before it, the server's record says the profile is waiting or in transit. After it, the order is closed, and the profile is either installed or in an error state. The server can tell the carrier too, with a progress notice for the stage "BPP installation," if the carrier has set that up.
Once the server acknowledges, the phone removes the notification from the chip's list and "The eUICC SHALL delete the Profile Installation Result from its non-volatile memory." So the receipt is kept until the server confirms it received it. If the phone loses power before that, the receipt is still on the chip, and the specification says the phone should "provide an appropriate error indication to the End User when possible (e.g., when power is restored)."
What can go wrong in the middle
The specification lists failures that are not errors reported by the chip. It names three: "the End User could remove the card" (for removable chips), "The End User could switch off the power or remove the battery," and "A software fault could cause a crash of the LPA, host Device, and/or baseband processor."
It also covers the case of starting twice. "The LPA SHOULD NOT initiate a new Profile download and installation procedure while there is an active download RSP session. However, in the event that this does occur, the eUICC SHALL discard its session state." The only thing the chip may keep is "an unused otPK/otSK.EUICC.ECKA" for a retry.
So if you scan a code twice while the first attempt is still running, the chip drops the first attempt's state and starts over.
How many profiles fit
The specification says "Several profiles MAY be installed on the eUICC, subject to non-volatile memory limitations." The eligibility check includes whether the chip "can install one more Profile." Apple's setup page gives a practical figure for iPhone: "manage up to eight or more eSIMs." Apple does not say what limits the number. The specification gives memory as the limit and does not give a count.
Neither source says what to do when you reach a phone's limit. The question for your carrier or phone maker is what the limit is on that model. We did not test it.
Why a code stops working: the order's states on the server
Here is the part that answers the question people actually search for: why does a QR code fail the second time? The specification does not use the phrase "single use." It describes states the server keeps for each profile, and the states explain the behavior.
The nine states
The specification's Table 6b lists the states of a profile at the SM-DP+. We give them with the specification's descriptions.
- Available: "The Profile is available in the inventory of the SM-DP+."
- Allocated: "The Profile is reserved for downloading without being linked to an EID."
- Linked: "The Profile is reserved for downloading and is linked to an EID."
- Confirmed: "The Profile is reserved for downloading (linked or not linked to an EID) with Matching ID and Confirmation Code if required."
- Released: "The Profile is ready for download and installation after Network Configuration by the Operator (e.g.: HLR Registration)."
- Downloaded: "The Bound Profile was delivered to the LPA."
- Installed: "The Profile was successfully installed on the eUICC."
- Error: "The Profile has not been installed because of one of the following error cases," which are the confirmation code retry limit, the download retry limit, end user rejection, and a permanent error during download and installation.
- Unavailable: "The Profile cannot be reused anymore by the SM-DP+."
The note under the table matters. It says "Additional states and additional or customised ES2+ functions MAY be agreed between the Operator and the SM-DP+." A real carrier may use more states than these.
The path in, before your phone is involved
The carrier moves the profile through the first states. The specification's diagram shows "ES2+.DownloadOrder" taking a profile from Available to Allocated, or to Linked if the chip's identifier is already known. Then "ES2+.ConfirmOrder" moves it to Confirmed or, if the release flag is set, straight to Released. A Confirmed profile moves to Released when the carrier calls "ES2+.ReleaseProfile."
Released is the state a download needs. The check in step 3 of the download says the profile must be in "'Released' state, or, in case of a retry due to a previous installation failure, in 'Downloaded' state." That is the whole list. A profile in any other state fails that check.
The path through your phone
When the server sends the package, the profile moves from Released to Downloaded. When the phone reports success, it moves to Installed. The diagram also shows a loop: a Downloaded profile stays Downloaded on a retry or after a temporary error report. If the phone reports a permanent error, it moves to Error.
Several failures at the package step also send the profile to Error. The diagram lists "Eligibility check failed," "Exceed CCode Try Limit," "Exceed Download Try Limit," "End User Rejection," and "BPP not available for rebinding." Those can happen from Released or from Downloaded.
What this means for scanning a code again
Here is our reading, and we label it as ours. After a successful install, the profile is Installed and the order is closed. A second download request with the same MatchingID would not find a pending order in the state the check requires. The specification has a status code for a request with no matching order. It does not say what message a given phone shows.
After an install failure, the profile can be Downloaded, and the specification allows a retry from that state. So a code that failed because the phone lost power can work on the next try. After the retry limits or a rejection, the profile is in Error, and a new scan will not revive it. The carrier has to act.
The document also describes how the carrier clears an order. "ES2+.CancelOrder" can send a profile from Allocated, Linked, Confirmed or Released back to Available, or to Unavailable. A profile in Error can be sent to Available or Unavailable, "or Automatic Transition." Available means it can be offered again. Unavailable means "cannot be reused anymore."
Why the carrier's side of this is invisible
None of these states is shown on your phone. The server keeps them, and the carrier sees them in its own tools. When a carrier tells you a QR code "has been used" or "has expired," we cannot tell from the specification which state or rule they mean. The expiry of an order is not described in the parts we read.
If the code stops working and you have not installed anything, the useful step is to ask the carrier to look at the order and issue a new one, which is the action the specification gives them.
Cancelling, deleting and getting the code back
Three things can end a profile's life on your phone: you cancel during the download, you delete it later, or the chip is reset. The specification treats each differently, and the differences decide whether the carrier needs to send you something new.
Cancelling during the download
When the person says no, or the phone times out, the phone asks the chip to cancel the session. The reasons the specification names are "End User rejection," "End User postponed," "Timeout," "PPR not allowed," "Metadata mismatch," "Load BPP execution error," and "undefinedReason."
The server's response splits them in two. "If the reason contained in euiccCancelSessionSigned indicates 'End user postponed' or 'Timeout', the SM-DP+ SHALL simply return a function execution status 'Executed-Success' and keep the corresponding Profile download order in the 'Released' state available for a further retry." For any other reason, the server sets the profile to Error and tells the carrier.
That is a practical difference. If you tap "Not Now" or walk away from the screen, the order stays Released and the same code can work again. If you tap a flat refusal, or the package fails to load, the profile goes to Error. We found no text on how a phone words these choices on screen. On iPhone, Apple's pages we read do not describe the cancel behavior either.
Deleting the profile
Deletion is a local operation on the phone. The specification says "The LPAd SHALL ask for Strong Confirmation by presenting the consequences." If the profile is enabled, it must be disabled first. The chip then refuses unless the profile is disabled and its policy rules allow deletion. The wording is "If the target Profile is in the Enabled state or the Profile Policy Rules do not allow deletion, the ISD-R SHALL return a response indicating a failure."
Apple's page on erasing an eSIM gives the user-facing warning. "If you erase an eSIM, you'll need to contact your carrier to get a new one. Then set up the new eSIM." It also says "Don't erase an eSIM as a troubleshooting step unless directed to by your carrier." That matches the state picture. Deleting removes the profile from the chip. It does not by itself tell you that the server will let the profile be downloaded again.
The Apple page adds a billing point for one case: "If you erase an eSIM that is set up on a device using iPhone Handoff, you must contact your carrier to turn off iPhone Handoff for that eSIM. Your carrier may continue to charge you until you request them to turn off the service."
The delete notification
The chip can report a deletion to the server. The specification says notifications are generated for operations listed in a profile's "Notification Configuration," so whether a delete notice goes out depends on how the carrier set up the profile. For a full reset of the chip, "a Delete Notification SHALL be generated for all the deleted Profiles for which the delete Profile is indicated in the Notification Configuration List."
Getting an activation code back
The specification also has a way to retrieve the activation code of a profile that is already installed. The phone builds a special MatchingID, ACR-0- followed by the profile's ICCID, and asks the server. The example is ACR-0-8947010000123456784. A request type of 1 instead of 0 checks only whether retrieval is available.
The conditions are strict. The server must be "configured in such a way that it will allow a Profile (with the Activation Code retrieved by this procedure) to be redownloaded after the reception of the associated Delete Notification." And the profile "Can be re-downloaded to another eUICC if and only if the associated Delete Notification has been successfully received." If a download follows a retrieval and the notification has not arrived, the server returns the error status "Profile - Not Allowed."
So the order of events matters. Delete on the old phone, let the delete notice reach the server, then use the retrieved code on the new one. If the carrier has not enabled retrieval, the server refuses. The text also says the carrier can be asked to confirm each request, and the server can return a retry delay "If more time is required." Whether your carrier supports any of this is not something the specification tells us.
Our guide on moving an eSIM to a new phone covers the paths carriers actually use, including the Apple and Android transfer features.
What to do with all this, and what we did not check
You do not need to read a standard to install an eSIM. But a few habits follow from the machinery, and each rests on something the documents say.
A short routine
- Treat the code like an order number. The specification says the server only processes a MatchingID it knows, and Google's developer guidance protects activation codes from other apps. Do not post a QR code in a screenshot. We did not find a source that says a leaked code can be used by someone else, so we do not claim it. The safe reading is that you do not know.
- Scan once and let it finish. The chip drops an active session if a new one starts. If the first attempt is running, wait for it to end.
- Keep the confirmation code with the QR code. Apple says to enter "the number that your carrier provided." The specification caps the retries, and the carrier sets the cap.
- If you tap "Not Now," the order can stay available. The specification says postponed and timeout cancels keep the order Released. Other cancels send it to Error.
- Do not delete an eSIM to troubleshoot. Apple says to do that only if your carrier directs you.
- If it fails twice, ask the carrier for a new order. The specification describes the carrier's action: cancel the order, or create a new one with the same or a different confirmation code.
- Keep your EID and IMEI handy. Google's Pixel page says carriers may ask for them. The specification says they may be provided when the order is made.
What we did not do
We did not scan a code, install a profile, capture a network exchange or test a phone. Everything here is what the GSMA, Apple and Google say.
We read parts of SGP.21 and SGP.22 version 2.7, not every page of the 404. We did not read the chapters on the SM-DS event procedures in detail, the certificate and key formats, the profile package structure, or the function-by-function interface tables. We read the definitions, the activation code and confirmation code rules, the download and install procedure, the profile states, deletion, activation code retrieval and the eligibility annex.
The specifications say what each system must do. They leave many choices to the carrier: how a confirmation code is delivered, how many tries it allows, whether notices go out, whether activation code retrieval is on, and what extra states exist. We cannot tell you what your carrier chose.
We found no Apple or Google page that says a QR code is "single use," and the specification does not say it in those words. The behavior we describe comes from the state rules and is our reading. A carrier's own page may use stricter or looser terms.
Apple's and Google's pages apply to the phones and software versions they name. Apple's eSIM page names iOS 17.4 and 18.4 and 26 features. We did not test those on a phone.
Finally, SGP.22 version 2.7 is the version we read. The Android reference pages we read point to "SGP.22 v2.2 section[4.1]" for the activation code. We did not compare version 2.2 to 2.7 line by line.
The five-line version
An eSIM QR code names a server and an order. The server checks that the order exists, belongs to your chip, is in the right state and has not been tried too many times. Then it sends a profile built for your chip. When the order is closed, a second scan has nothing to open, and the carrier is the one who can issue a new order.
Frequently asked questions
What is inside an eSIM QR code?
SGP.22 version 2.7 says the activation code is a string of parts joined by dollar signs: a format number, the SM-DP+ server address, a token called the MatchingID, and two optional parts, the server OID and a confirmation code flag. In a QR code it is prefixed with LPA:.
Does the QR code contain the eSIM itself?
No. The code requests a download. The profile is sent later by the SM-DP+ after both sides authenticate and the server checks its order.
What is an SM-DP+?
SGP.21 says it prepares profile packages, secures them, links them to specified EIDs and downloads them to the phone's LPA.
What is the MatchingID?
The specification says it identifies a specific order at the SM-DP+. The server only processes a MatchingID it knows. It uses capital letters, digits and hyphens.
What is a confirmation code?
A second secret the carrier can require. The code carries a flag when one is required. The carrier provides the code, and the specification does not say how.
How many times can I enter a wrong confirmation code?
The specification says the Operator sets the maximum and does not give a number. When it is exceeded, the order is terminated and the Operator may request a new one.
Can I scan the same eSIM QR code twice?
The specification does not say single use. A profile must be in the Released state, or Downloaded on a retry, to be downloaded. After a successful install the order closes, which is our reading. A carrier may describe it differently.
What happens if I tap Not Now?
The specification says postponed and timeout cancels keep the order Released for a further retry. Other cancel reasons send the profile to Error.
What does the server learn about my phone?
Device information signed by the chip: the type code, capabilities and optionally the IMEI. It also learns the chip's EID. The server and the carrier may use or ignore the device information. The specification does not say what a carrier stores.
Can I get an activation code back after I install?
The specification has an activation code retrieval request, and it works only if the carrier enabled it and the server received the delete notice for the installed profile.
Should I delete an eSIM to fix a problem?
Apple says not to erase an eSIM as a troubleshooting step unless your carrier directs you to.
Did you test any of this?
No. We did not scan a code or test a phone. This guide reports what the GSMA, Apple and Google published.
Sources and audit notes
How we audited this guide. On November 14, 2026 we downloaded the complete GSMA SGP.21 and SGP.22 version 2.7 documents and converted them to text, and we saved Apple's, Google's and Android's pages as text. We read the definitions, the architecture, the activation code and confirmation code rules, the download and install procedure, the profile states, deletion, activation code retrieval and the eligibility annex, and we did not read the other chapters line by line. We checked each quoted phrase against the saved texts by search. Where we drew a conclusion that no source states, such as what happens when you scan a closed order again, we said it is our reading. We did not scan a code, install a profile or test a phone, and we do not know what any carrier configured.
- GSMA: SGP.21 RSP Architecture v2.7 (Apr 24, 2026) (www.gsma.com)
- GSMA: SGP.22 RSP Technical Specification v2.7 (Apr 24, 2026) (www.gsma.com)
- GSMA: SGP.22 v2.7 page (Apr 27, 2026) (www.gsma.com)
- Apple: Set up eSIM on iPhone (Oct 22, 2026) (support.apple.com)
- Apple: How to erase an eSIM on your iPhone or iPad (Sep 17, 2026) (support.apple.com)
- Google: Get a SIM or eSIM and add it to your Pixel phone (support.google.com)
- Android Open Source Project: Implement eSIM (source.android.com)
- Android Developers: EuiccManager reference (developer.android.com)