openapi: 3.0.1
info:
  title: eSIM-Go API
  version: 2.5.0
  description: |
    To access the eSIMGo API, you need to authenticate your requests using an API key.
    Here's a brief overview of the authentication process:
      1. Assuming that you have created account already:
      - Log into your eSIMGo account at https://sso.esim-go.com/login.
      - Navigate to Account Settings -> API Details to find your API key.
      - Keep your API key secure and avoid sharing it with others.
      2. API Key Usage:
      - Include your API key in the header of all eSIMGo API requests.
      - Use the header key 'X-API-KEY' with your API key as the value.
      3. Security Scheme:
      - The eSIMGo API uses an HTTP security scheme type for authentication.
      4. Authorization Types:
      - The API supports 'apiKeyAuth' authorization type.
servers:
  - url: https://api.esim-go.com/v2.5
    description: eSIMGo API
tags:
  - name: API
  - name: Callback
  - name: Orders
  - name: eSIMs
  - name: eSIMs (Deprecated)
  - name: Organisation
  - name: Inventory
  - name: Catalogue
  - name: Networks
paths:
  /your-usage-callback-url/:
    post:
      tags:
        - Callback
      summary: eSIM Usage Callback
      x-explorer-enabled: false
      description: |
        **Note:** V3 of the Callback system is now available and provides additional data as well as HMAC signature validation.
        **This must be enabled in the eSIM Portal.**
        V2 of the Callback system is still available by default, but will be disabled in the future.

         To enable it on the eSIM Portal go to Account Settings -> API Details -> Callback Version.


        **Description:**
        The eSIMGo API offers a callback functionality that provides real-time notifications about eSIM activity, including data consumption and balance. This feature allows for tracking usage, automating responses, and customizing notifications, enhancing customer account management.
        Key benefits include real-time updates, usage tracking, automated responses, and customizable notifications.
        When data is used on an eSIM, a usage event can be sent to a URL defined by you in the eSIM Portal. The usage event will report the current bundle in use by an eSIM, and its remaining data.

          To set up the URL in the eSIM Portal go to Account Settings -> API Details -> Callback URL.



        Example of validating HMAC body in NodeJS:

        ```javascript
        import crypto from "crypto";

        const signature = crypto
            .createHmac("sha256", key) // key is your API Key
            .update(body) // body is the raw (string) request body
            .digest("base64");

        const matches = signature === signatureHeader;
        ```

        Validation uses your API Key as the HMAC key.
        The body of the request is the raw (string) request body, and should not be parsed as JSON before validation.

        **Note:** Bundle names are case sensitive e.g. "esim_1GB_7D_IM_U".

        **Request Body Notes:**
        - The "try" button for this endpoint is **NOT** functional
        - The schema defines an example message that is sent to the configured callback URL.
        - For more information on callback notification types, Please see the [Notifications Page](/api/notifications#overview).
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/BundleAlert"
            example:
              iccid: "8944538532008160222"
              alertType: Utilisation
              bundle:
                id: "123456789"
                name: A_BUNDLE_20GB_30D_EU_U
                description: A Bundle, 20GB, 30 Days, EU, Unthrottled
                initialQuantity: 20000000000
                remainingQuantity: 19000000000
                startTime: "2006-01-02T15:04:05Z"
                endTime: "2007-01-02T15:04:05Z"
                reference: 12345-12345-12345-12345-0
                unlimited: false
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
      responses:
        "200":
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell
          label: cURL
          source: |-
            curl 'https://api.esim-go.com/v2.5/your-usage-callback-url/' \
            -H 'X-API-Key: $API_KEY' \
            -H 'Content-Type: application/json' \
            -d '{"$ref":"#/components/schemas/BundleAlert"}'
        - lang: javascript
          label: Node
          source: |
            const axios = require('axios');
            let data = JSON.stringify({
              "$ref": "#/components/schemas/BundleAlert"
            });

            let config = {
              method: 'post',
              maxBodyLength: Infinity,
              url: 'https://api.esim-go.com/v2.5/your-usage-callback-url/',
              headers: { 
                'X-API-Key': '$API_KEY', 
                'Content-Type': 'application/json'
              },
              data : data
            };

            axios.request(config)
            .then((response) => {
              console.log(JSON.stringify(response.data));
            })
            .catch((error) => {
              console.log(error);
            });
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "fmt"
              "strings"
              "net/http"
              "io"
            )

            func main() {

              url := "https://api.esim-go.com/v2.5/your-usage-callback-url/"
              method := "POST"

              payload := strings.NewReader(`{"$ref":"#/components/schemas/BundleAlert"}`)

              client := &http.Client {
              }
              req, err := http.NewRequest(method, url, payload)

              if err != nil {
                fmt.Println(err)
                return
              }
              req.Header.Add("X-API-Key", "$API_KEY")
              req.Header.Add("Content-Type", "application/json")

              res, err := client.Do(req)
              if err != nil {
                fmt.Println(err)
                return
              }
              defer res.Body.Close()

              body, err := io.ReadAll(res.Body)
              if err != nil {
                fmt.Println(err)
                return
              }
              fmt.Println(string(body))
            }
        - lang: python
          label: Python
          source: |
            import requests
            import json

            url = "https://api.esim-go.com/v2.5/your-usage-callback-url/"

            payload = json.dumps({
              "$ref": "#/components/schemas/BundleAlert"
            })
            headers = {
              'X-API-Key': '$API_KEY',
              'Content-Type': 'application/json'
            }

            response = requests.request("POST", url, headers=headers, data=payload)

            print(response.text)
        - lang: csharp
          label: C#
          source: |
            var client = new HttpClient();
            var request = new HttpRequestMessage(HttpMethod.Post, "https://api.esim-go.com/v2.5/your-usage-callback-url/");
            request.Headers.Add("X-API-Key", "$API_KEY");
            var content = new StringContent("{\"$ref\":\"#/components/schemas/BundleAlert\"}", null, "application/json");
            request.Content = content;
            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            Console.WriteLine(await response.Content.ReadAsStringAsync());
        - lang: java
          label: Java
          source: |
            Unirest.setTimeouts(0, 0);
            HttpResponse<String> response = Unirest.post("https://api.esim-go.com/v2.5/your-usage-callback-url/")
              .header("X-API-Key", "$API_KEY")
              .header("Content-Type", "application/json")
              .body("{\"$ref\":\"#/components/schemas/BundleAlert\"}")
              .asString();
  /esims:
    get:
      summary: List eSIMs
      description: |
        This endpoint retrieves all eSIMs currently assigned to your organization. It provides a comprehensive view of your eSIM inventory with flexible options for data retrieval and management.

        **Key Features:**
          1. Pagination: Efficiently manage large datasets by specifying the page number and items per page.
          2. Sorting: Customize the order of results using the 'direction' and 'orderBy' parameters.
          3. Filtering: Refine your search with multiple filter options for precise data retrieval.
      tags:
        - eSIMs
      parameters:
        - in: query
          name: page
          schema:
            type: string
          description: Page of ESIMs to return
        - in: query
          name: perPage
          schema:
            type: integer
            enum:
              - 10
              - 25
              - 50
              - 100
          description: Number of ESIMs to return per page
        - in: query
          name: direction
          schema:
            type: string
            enum:
              - asc
              - desc
          description: Direction of ordering
        - in: query
          name: orderBy
          schema:
            type: string
            enum:
              - iccid
          description: Name of column to order by
        - in: query
          name: filterBy
          schema:
            type: string
            enum:
              - iccid, customerRef, lastAction, actionDate, assignedDate
          description: Name of column to filter by. eSIMs can be filtered by ICCID, Customer Reference, Last Action (Bundle Refund, Bundle Applied, Bundle Revoked, eSIM Updated, eSIM Refreshed, eSIM Utilisation Alert), Last Action Date and SIM Assignment Date.
        - in: query
          name: filter
          schema:
            type: string
          description: Value to filter by
      security:
        - apiKeyAuth: []
      responses:
        "200":
          description: A list of your eSIMs
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ESIMs"
              example:
                esims:
                  - iccid: "8901234567890123456"
                    customerRef: CUST001
                    lastAction: Bundle Applied
                    actionDate: "2023-05-15T14:30:00Z"
                    physical: false
                    assignedDate: "2023-05-01T10:00:00Z"
                    state: active
                  - iccid: "8909876543210987654"
                    customerRef: CUST002
                    lastAction: Activated
                    actionDate: "2023-05-16T09:15:00Z"
                    physical: true
                    assignedDate: "2023-05-10T11:30:00Z"
                    state: suspended
        "400":
          description: Bad Request - returned when incorrect data given
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "403":
          description: Unauthorised - returned when the api token is invalid
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "429":
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "500":
          description: Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
      x-codeSamples:
        - lang: shell
          label: cURL
          source: |-
            curl 'https://api.esim-go.com/v2.5/esims' \
            -H 'X-API-Key: $API_KEY' \
            -H 'Content-Type: application/json'
        - lang: javascript
          label: Node
          source: |
            const axios = require('axios');

            let config = {
              method: 'get',
              maxBodyLength: Infinity,
              url: 'https://api.esim-go.com/v2.5/esims',
              headers: { 
                'X-API-Key': '$API_KEY', 
                'Content-Type': 'application/json'
              }
            };

            axios.request(config)
            .then((response) => {
              console.log(JSON.stringify(response.data));
            })
            .catch((error) => {
              console.log(error);
            });
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "fmt"
              "net/http"
              "io"
            )

            func main() {

              url := "https://api.esim-go.com/v2.5/esims"
              method := "GET"

              client := &http.Client {
              }
              req, err := http.NewRequest(method, url, nil)

              if err != nil {
                fmt.Println(err)
                return
              }
              req.Header.Add("X-API-Key", "$API_KEY")
              req.Header.Add("Content-Type", "application/json")

              res, err := client.Do(req)
              if err != nil {
                fmt.Println(err)
                return
              }
              defer res.Body.Close()

              body, err := io.ReadAll(res.Body)
              if err != nil {
                fmt.Println(err)
                return
              }
              fmt.Println(string(body))
            }
        - lang: python
          label: Python
          source: |
            import requests
            import json

            url = "https://api.esim-go.com/v2.5/esims"

            payload = {}
            headers = {
              'X-API-Key': '$API_KEY',
              'Content-Type': 'application/json'
            }

            response = requests.request("GET", url, headers=headers, data=payload)

            print(response.text)
        - lang: csharp
          label: C#
          source: |
            var client = new HttpClient();
            var request = new HttpRequestMessage(HttpMethod.Get, "https://api.esim-go.com/v2.5/esims");
            request.Headers.Add("X-API-Key", "$API_KEY");
            var content = new StringContent(string.Empty);
            content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
            request.Content = content;
            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            Console.WriteLine(await response.Content.ReadAsStringAsync());
        - lang: java
          label: Java
          source: |
            Unirest.setTimeouts(0, 0);
            HttpResponse<String> response = Unirest.get("https://api.esim-go.com/v2.5/esims")
              .header("X-API-Key", "$API_KEY")
              .header("Content-Type", "application/json")
              .asString();
    put:
      summary: Update eSIM Details
      description: |
        A feature that enables the association of a unique identifier with an eSIM. This functionality allows for the integration of relevant operational data, such as customer order IDs.
      tags:
        - eSIMs
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: Accept
          in: header
          schema:
            type: string
          example: application/json
        - name: iccid
          in: query
          schema:
            type: string
          description: (Required) ICCID of eSIM
          example: 8944123456789012000
        - name: customerRef
          in: query
          schema:
            type: string
          description: (Required) New Customer Reference
          example: Test
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateSimDetails"
            example:
              iccid: "8944123456789012345"
              customerRef: ref-123
      security:
        - apiKeyAuth: []
      responses:
        "200":
          description: OK
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StatusMessage"
              example:
                status: success
        "400":
          description: Bad Request - returned when request format is not accepted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "403":
          description: Unauthorised - returned when the api token is invalid; the user does not have any available Bundles left or the ICCID is not accessible by the user
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "429":
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "500":
          description: Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "503":
          description: Processing - Please come back later or use the *Retry-After* (seconds) header
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
      x-codeSamples:
        - lang: shell
          label: cURL
          source: |-
            curl -X PUT 'https://api.esim-go.com/v2.5/esims' \
            -H 'X-API-Key: $API_KEY' \
            -H 'Content-Type: application/json' \
            -d '{"$ref":"#/components/schemas/UpdateSimDetails"}'
        - lang: javascript
          label: Node
          source: |
            const axios = require('axios');
            let data = JSON.stringify({
              "$ref": "#/components/schemas/UpdateSimDetails"
            });

            let config = {
              method: 'put',
              maxBodyLength: Infinity,
              url: 'https://api.esim-go.com/v2.5/esims',
              headers: { 
                'X-API-Key': '$API_KEY', 
                'Content-Type': 'application/json'
              },
              data : data
            };

            axios.request(config)
            .then((response) => {
              console.log(JSON.stringify(response.data));
            })
            .catch((error) => {
              console.log(error);
            });
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "fmt"
              "strings"
              "net/http"
              "io"
            )

            func main() {

              url := "https://api.esim-go.com/v2.5/esims"
              method := "PUT"

              payload := strings.NewReader(`{"$ref":"#/components/schemas/UpdateSimDetails"}`)

              client := &http.Client {
              }
              req, err := http.NewRequest(method, url, payload)

              if err != nil {
                fmt.Println(err)
                return
              }
              req.Header.Add("X-API-Key", "$API_KEY")
              req.Header.Add("Content-Type", "application/json")

              res, err := client.Do(req)
              if err != nil {
                fmt.Println(err)
                return
              }
              defer res.Body.Close()

              body, err := io.ReadAll(res.Body)
              if err != nil {
                fmt.Println(err)
                return
              }
              fmt.Println(string(body))
            }
        - lang: python
          label: Python
          source: |
            import requests
            import json

            url = "https://api.esim-go.com/v2.5/esims"

            payload = json.dumps({
              "$ref": "#/components/schemas/UpdateSimDetails"
            })
            headers = {
              'X-API-Key': '$API_KEY',
              'Content-Type': 'application/json'
            }

            response = requests.request("PUT", url, headers=headers, data=payload)

            print(response.text)
        - lang: csharp
          label: C#
          source: |
            var client = new HttpClient();
            var request = new HttpRequestMessage(HttpMethod.Put, "https://api.esim-go.com/v2.5/esims");
            request.Headers.Add("X-API-Key", "$API_KEY");
            var content = new StringContent("{\"$ref\":\"#/components/schemas/UpdateSimDetails\"}", null, "application/json");
            request.Content = content;
            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            Console.WriteLine(await response.Content.ReadAsStringAsync());
        - lang: java
          label: Java
          source: |
            Unirest.setTimeouts(0, 0);
            HttpResponse<String> response = Unirest.put("https://api.esim-go.com/v2.5/esims")
              .header("X-API-Key", "$API_KEY")
              .header("Content-Type", "application/json")
              .body("{\"$ref\":\"#/components/schemas/UpdateSimDetails\"}")
              .asString();
  /esims/apply:
    post:
      summary: Apply Bundle to an eSIM
      description: |
        # eSIM Provisioning and Bundle Application Endpoint

        This endpoint allows you to obtain a new eSIM with a pre-applied Bundle or apply a Bundle to an existing eSIM.

        ## Key Features:
        1. Assign Bundles to new or existing eSIMs
        2. Option to request multiple eSIMs with the same Bundle
        3. Ability to assign different Bundles to separate new eSIMs

        ## Usage Guidelines:
        - Provide either 'Bundle' or 'Bundles' parameter
        - ICCID is optional for existing eSIMs
        - 'Repeat' parameter for multiple new eSIMs (incompatible with ICCID)
        - Bundle names are case-sensitive (e.g., "esim_1GB_7D_IM_U")

        ## Important Notes:
        - Requires pre-purchased Bundles in your account inventory
        - Bundle activation usually instant, but allow up to 10 minutes for full processing
        - eSIM can be installed and registered on a network during processing
        - The Bundle Status can be checked through [Get the Status of a bundle assigned to an eSIM](/api/v2_4/operations/esimsiccidbundlesname/get/)
        - Deactivated eSIMs cannot have bundles applied and will return a 400 Bad Request error

        The endpoint always returns the ICCID in the response.
      tags:
        - eSIMs
      requestBody:
        description: Details of Bundle to apply to eSIM
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - $ref: "#/components/schemas/ApplyBundleWithICCIDRequest"
                - $ref: "#/components/schemas/ApplyBundleWithList"
            examples:
              New eSIM (or topup existing eSIM):
                value:
                  iccid: "8943108165015003887"
                  name: A_BUNDLE_20GB_30D_EU_U
                  allowReassign: false
              Mixed Bundles:
                value:
                  bundles:
                    - name: A_BUNDLE_20GB_30D_EU_U
                    - name: A_BUNDLE_20GB_30D_EU_U
      security:
        - apiKeyAuth: []
      responses:
        "200":
          description: Success message
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ESIMApplyResponse"
              example:
                esims:
                  - iccid: "8944123456789012345"
                    status: ACTIVE
                applyReference: 123e4567-e89b-12d3-a456-426614174000
        "400":
          description: Bad Request - returned when request format is not accepted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "403":
          description: Unauthorised - returned when the api token is invalid; the user does not have any available Bundles left or the ICCID is not accessible by the user
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "429":
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "500":
          description: Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "503":
          description: Processing - Please come back later or use the *Retry-After* (seconds) header
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
      x-codeSamples:
        - lang: shell
          label: cURL
          source: |-
            curl 'https://api.esim-go.com/v2.5/esims/apply' \
            -H 'X-API-Key: $API_KEY' \
            -H 'Content-Type: application/json' \
            -d '{"oneOf":[{"$ref":"#/components/schemas/ApplyBundleWithICCIDRequest"},{"$ref":"#/components/schemas/ApplyBundleWithList"}]}'
        - lang: javascript
          label: Node
          source: |
            const axios = require('axios');
            let data = JSON.stringify({
              "oneOf": [
                {
                  "$ref": "#/components/schemas/ApplyBundleWithICCIDRequest"
                },
                {
                  "$ref": "#/components/schemas/ApplyBundleWithList"
                }
              ]
            });

            let config = {
              method: 'post',
              maxBodyLength: Infinity,
              url: 'https://api.esim-go.com/v2.5/esims/apply',
              headers: { 
                'X-API-Key': '$API_KEY', 
                'Content-Type': 'application/json'
              },
              data : data
            };

            axios.request(config)
            .then((response) => {
              console.log(JSON.stringify(response.data));
            })
            .catch((error) => {
              console.log(error);
            });
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "fmt"
              "strings"
              "net/http"
              "io"
            )

            func main() {

              url := "https://api.esim-go.com/v2.5/esims/apply"
              method := "POST"

              payload := strings.NewReader(`{"oneOf":[{"$ref":"#/components/schemas/ApplyBundleWithICCIDRequest"},{"$ref":"#/components/schemas/ApplyBundleWithList"}]}`)

              client := &http.Client {
              }
              req, err := http.NewRequest(method, url, payload)

              if err != nil {
                fmt.Println(err)
                return
              }
              req.Header.Add("X-API-Key", "$API_KEY")
              req.Header.Add("Content-Type", "application/json")

              res, err := client.Do(req)
              if err != nil {
                fmt.Println(err)
                return
              }
              defer res.Body.Close()

              body, err := io.ReadAll(res.Body)
              if err != nil {
                fmt.Println(err)
                return
              }
              fmt.Println(string(body))
            }
        - lang: python
          label: Python
          source: |
            import requests
            import json

            url = "https://api.esim-go.com/v2.5/esims/apply"

            payload = json.dumps({
              "oneOf": [
                {
                  "$ref": "#/components/schemas/ApplyBundleWithICCIDRequest"
                },
                {
                  "$ref": "#/components/schemas/ApplyBundleWithList"
                }
              ]
            })
            headers = {
              'X-API-Key': '$API_KEY',
              'Content-Type': 'application/json'
            }

            response = requests.request("POST", url, headers=headers, data=payload)

            print(response.text)
        - lang: csharp
          label: C#
          source: |
            var client = new HttpClient();
            var request = new HttpRequestMessage(HttpMethod.Post, "https://api.esim-go.com/v2.5/esims/apply");
            request.Headers.Add("X-API-Key", "$API_KEY");
            var content = new StringContent("{\"oneOf\":[{\"$ref\":\"#/components/schemas/ApplyBundleWithICCIDRequest\"},{\"$ref\":\"#/components/schemas/ApplyBundleWithList\"}]}", null, "application/json");
            request.Content = content;
            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            Console.WriteLine(await response.Content.ReadAsStringAsync());
        - lang: java
          label: Java
          source: |
            Unirest.setTimeouts(0, 0);
            HttpResponse<String> response = Unirest.post("https://api.esim-go.com/v2.5/esims/apply")
              .header("X-API-Key", "$API_KEY")
              .header("Content-Type", "application/json")
              .body("{\"oneOf\":[{\"$ref\":\"#/components/schemas/ApplyBundleWithICCIDRequest\"},{\"$ref\":\"#/components/schemas/ApplyBundleWithList\"}]}")
              .asString();
  /esims/qr/{reference}:
    get:
      summary: Get QR codes for eSIMs from an Order or Bundle apply reference (Deprecated)
      description: |
        Get multiple QR codes by providing an Order or Apply Reference. Returns multiple QR codes as `.PNG` contained in a `.ZIP`.

        Deactivated eSIMs will return a 410 Gone error.

        Deprecated: See `/esims/assignments`
      tags:
        - eSIMs (Deprecated)
      parameters:
        - in: path
          name: reference
          schema:
            type: string
          required: true
          description: Order Reference or Apply Reference
      security:
        - apiKeyAuth: []
      responses:
        "200":
          description: QR code image in a ZIP file
          content:
            application/zip:
              schema:
                type: zip
                example: cfb94100-1c41-4d0e-9ff2-0dsfn23vd1121233cda46.zip
        "400":
          description: Bad Request - returned when request format is not accepted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "403":
          description: Unauthorised - returned when the api token is invalid or the user does not have permission to query the given ICCID
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "410":
          description: Gone - returned when the eSIM has been deactivated
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "500":
          description: Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
      x-codeSamples:
        - lang: shell
          label: cURL
          source: |-
            curl -g 'https://api.esim-go.com/v2.5/esims/qr/{reference}' \
            -H 'X-API-Key: $API_KEY' \
            -H 'Content-Type: application/json'
        - lang: javascript
          label: Node
          source: |
            const axios = require('axios');

            let config = {
              method: 'get',
              maxBodyLength: Infinity,
              url: 'https://api.esim-go.com/v2.5/esims/qr/{reference}',
              headers: { 
                'X-API-Key': '$API_KEY', 
                'Content-Type': 'application/json'
              }
            };

            axios.request(config)
            .then((response) => {
              console.log(JSON.stringify(response.data));
            })
            .catch((error) => {
              console.log(error);
            });
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "fmt"
              "net/http"
              "io"
            )

            func main() {

              url := "https://api.esim-go.com/v2.5/esims/qr/{reference}"
              method := "GET"

              client := &http.Client {
              }
              req, err := http.NewRequest(method, url, nil)

              if err != nil {
                fmt.Println(err)
                return
              }
              req.Header.Add("X-API-Key", "$API_KEY")
              req.Header.Add("Content-Type", "application/json")

              res, err := client.Do(req)
              if err != nil {
                fmt.Println(err)
                return
              }
              defer res.Body.Close()

              body, err := io.ReadAll(res.Body)
              if err != nil {
                fmt.Println(err)
                return
              }
              fmt.Println(string(body))
            }
        - lang: python
          label: Python
          source: |
            import requests
            import json

            url = "https://api.esim-go.com/v2.5/esims/qr/{reference}"

            payload = {}
            headers = {
              'X-API-Key': '$API_KEY',
              'Content-Type': 'application/json'
            }

            response = requests.request("GET", url, headers=headers, data=payload)

            print(response.text)
        - lang: csharp
          label: C#
          source: |
            var client = new HttpClient();
            var request = new HttpRequestMessage(HttpMethod.Get, "https://api.esim-go.com/v2.5/esims/qr/{reference}");
            request.Headers.Add("X-API-Key", "$API_KEY");
            var content = new StringContent(string.Empty);
            content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
            request.Content = content;
            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            Console.WriteLine(await response.Content.ReadAsStringAsync());
        - lang: java
          label: Java
          source: |
            Unirest.setTimeouts(0, 0);
            HttpResponse<String> response = Unirest.get("https://api.esim-go.com/v2.5/esims/qr/{reference}")
              .header("X-API-Key", "$API_KEY")
              .header("Content-Type", "application/json")
              .asString();
  /esims/csv/{reference}:
    get:
      summary: Get CSV containing eSIMs from an Order or Bundle apply (Deprecated)
      description: |
        Get eSIM SMDP+ details by providing an Order or Apply Reference.

        Contains ICCID, SMDP+ address and Matching ID.

        Deprecated: See `/esims/assignments`
      tags:
        - eSIMs (Deprecated)
      parameters:
        - in: path
          name: reference
          schema:
            type: string
          required: true
          description: Order Reference or Apply Reference
        - in: query
          name: additionalFields
          schema:
            type: array
            items:
              type: string
              enum:
                - appleInstallUrl
                - installUrl
          explode: true
      security:
        - apiKeyAuth: []
      responses:
        "200":
          description: CSV
          content:
            text/csv:
              schema:
                type: string
                example: |
                  "ICCID","Matching ID","RSP URL","Bundle"
                  "Value 1","Value 2","Value 3","Value 4"
        "400":
          description: Bad Request - returned when the given ICCID is not found and/or permission to view this ICCID is not granted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "403":
          description: Unauthorised - returned when the api token is invalid
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "500":
          description: Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
      x-codeSamples:
        - lang: shell
          label: cURL
          source: |-
            curl -g 'https://api.esim-go.com/v2.5/esims/csv/{reference}' \
            -H 'X-API-Key: $API_KEY' \
            -H 'Content-Type: application/json'
        - lang: javascript
          label: Node
          source: |
            const axios = require('axios');

            let config = {
              method: 'get',
              maxBodyLength: Infinity,
              url: 'https://api.esim-go.com/v2.5/esims/csv/{reference}',
              headers: { 
                'X-API-Key': '$API_KEY', 
                'Content-Type': 'application/json'
              }
            };

            axios.request(config)
            .then((response) => {
              console.log(JSON.stringify(response.data));
            })
            .catch((error) => {
              console.log(error);
            });
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "fmt"
              "net/http"
              "io"
            )

            func main() {

              url := "https://api.esim-go.com/v2.5/esims/csv/{reference}"
              method := "GET"

              client := &http.Client {
              }
              req, err := http.NewRequest(method, url, nil)

              if err != nil {
                fmt.Println(err)
                return
              }
              req.Header.Add("X-API-Key", "$API_KEY")
              req.Header.Add("Content-Type", "application/json")

              res, err := client.Do(req)
              if err != nil {
                fmt.Println(err)
                return
              }
              defer res.Body.Close()

              body, err := io.ReadAll(res.Body)
              if err != nil {
                fmt.Println(err)
                return
              }
              fmt.Println(string(body))
            }
        - lang: python
          label: Python
          source: |
            import requests
            import json

            url = "https://api.esim-go.com/v2.5/esims/csv/{reference}"

            payload = {}
            headers = {
              'X-API-Key': '$API_KEY',
              'Content-Type': 'application/json'
            }

            response = requests.request("GET", url, headers=headers, data=payload)

            print(response.text)
        - lang: csharp
          label: C#
          source: |
            var client = new HttpClient();
            var request = new HttpRequestMessage(HttpMethod.Get, "https://api.esim-go.com/v2.5/esims/csv/{reference}");
            request.Headers.Add("X-API-Key", "$API_KEY");
            var content = new StringContent(string.Empty);
            content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
            request.Content = content;
            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            Console.WriteLine(await response.Content.ReadAsStringAsync());
        - lang: java
          label: Java
          source: |
            Unirest.setTimeouts(0, 0);
            HttpResponse<String> response = Unirest.get("https://api.esim-go.com/v2.5/esims/csv/{reference}")
              .header("X-API-Key", "$API_KEY")
              .header("Content-Type", "application/json")
              .asString();
  /esims/assignments:
    get:
      summary: Get eSIM Install Details
      description: |
        # eSIM SMDP+ Details Retrieval Endpoint

        This API endpoint retrieves eSIM SMDP+ details based on provided Order or Apply References.

        ## Key features:

        1. Input: One or multiple reference numbers can be submitted via query parameters.
        2. Output: For each reference, the system returns:
           - ICCID (Integrated Circuit Card Identifier)
           - SMDP+ (Subscription Manager Data Preparation) address
           - Matching ID
        3. Output format options:
           - Default: text/csv
           - Alternative formats: application/json, application/zip
           - Format selection is controlled via the 'Accept' header in the request
        4. Special functionality: When requesting 'application/zip', the response is a ZIP file containing QR code images in PNG format.

        Deactivated eSIMs will return a 410 Gone error.
      tags:
        - eSIMs
      parameters:
        - name: reference
          in: query
          schema:
            type: string
          description: (Required) Order Reference or Apply Reference
        - name: additionalFields
          in: query
          schema:
            type: string
          example: installUrl
      security:
        - apiKeyAuth: []
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/eSIMDetailsInstallResponse"
              example:
                iccid: "8944123456789012345"
                matchingId: A1B2-C3D4-E5F6-G7H8
                smdpAddress: http://smdp.example.com
                profileStatus: Released
                pin: "1234"
                puk: "12345678"
                firstInstalledDateTime: "2023-06-15T14:30:00.000Z"
        "400":
          description: Bad Request - returned when request format is not accepted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "403":
          description: Unauthorised - returned when the api token is invalid; the user does not have any available Bundles left or the ICCID is not accessible by the user
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "410":
          description: Gone - returned when the eSIM has been deactivated
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "429":
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "500":
          description: Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "503":
          description: Processing - Please come back later or use the *Retry-After* (seconds) header
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
      x-codeSamples:
        - lang: shell
          label: cURL
          source: |-
            curl 'https://api.esim-go.com/v2.5/esims/assignments' \
            -H 'X-API-Key: $API_KEY' \
            -H 'Content-Type: application/json'
        - lang: javascript
          label: Node
          source: |
            const axios = require('axios');

            let config = {
              method: 'get',
              maxBodyLength: Infinity,
              url: 'https://api.esim-go.com/v2.5/esims/assignments',
              headers: { 
                'X-API-Key': '$API_KEY', 
                'Content-Type': 'application/json'
              }
            };

            axios.request(config)
            .then((response) => {
              console.log(JSON.stringify(response.data));
            })
            .catch((error) => {
              console.log(error);
            });
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "fmt"
              "net/http"
              "io"
            )

            func main() {

              url := "https://api.esim-go.com/v2.5/esims/assignments"
              method := "GET"

              client := &http.Client {
              }
              req, err := http.NewRequest(method, url, nil)

              if err != nil {
                fmt.Println(err)
                return
              }
              req.Header.Add("X-API-Key", "$API_KEY")
              req.Header.Add("Content-Type", "application/json")

              res, err := client.Do(req)
              if err != nil {
                fmt.Println(err)
                return
              }
              defer res.Body.Close()

              body, err := io.ReadAll(res.Body)
              if err != nil {
                fmt.Println(err)
                return
              }
              fmt.Println(string(body))
            }
        - lang: python
          label: Python
          source: |
            import requests
            import json

            url = "https://api.esim-go.com/v2.5/esims/assignments"

            payload = {}
            headers = {
              'X-API-Key': '$API_KEY',
              'Content-Type': 'application/json'
            }

            response = requests.request("GET", url, headers=headers, data=payload)

            print(response.text)
        - lang: csharp
          label: C#
          source: |
            var client = new HttpClient();
            var request = new HttpRequestMessage(HttpMethod.Get, "https://api.esim-go.com/v2.5/esims/assignments");
            request.Headers.Add("X-API-Key", "$API_KEY");
            var content = new StringContent(string.Empty);
            content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
            request.Content = content;
            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            Console.WriteLine(await response.Content.ReadAsStringAsync());
        - lang: java
          label: Java
          source: |
            Unirest.setTimeouts(0, 0);
            HttpResponse<String> response = Unirest.get("https://api.esim-go.com/v2.5/esims/assignments")
              .header("X-API-Key", "$API_KEY")
              .header("Content-Type", "application/json")
              .asString();
  /esims/{iccid}:
    get:
      summary: Get eSIM details
      description: |
        This endpoint allows you to retrieve detailed information about a
        specific eSIM using its ICCID (Integrated Circuit Card Identifier).

        eSIM profile statuses:

        **Released** - The eSIM is not installed. If there is a firstInstalledDateTime then the eSIM has been installed previously and then uninstalled again.

        **Installed** - The eSIM is installed.

        **Downloaded** - This is unlikely to be seen very often. It would be when the bundle has been delivered to LPA, but the eSIM has not yet been released.

        **Unavailable** - An eSIM in this status cannot be installed. We recommend reissuing a new eSIM instead, especially if the eSIM is not already installed.

        **Deactivated** - The eSIM has been deactivated and can no longer be used.
      tags:
        - eSIMs
      parameters:
        - name: Accept
          in: header
          schema:
            type: string
          example: application/json
        - name: additionalFields
          in: query
          schema:
            type: string
          example: installUrl
        - name: iccid
          in: path
          schema:
            type: string
          required: true
          description: (Required) The ICCID of the eSIM
          example: 8944123456789012000
      security:
        - apiKeyAuth: []
      responses:
        "200":
          description: OK
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/eSIMDetailsResponse"
        "400":
          description: Bad Request - returned when request format is not accepted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "403":
          description: Unauthorised - returned when the api token is invalid; the user does not have any available Bundles left or the ICCID is not accessible by the user
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "429":
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "500":
          description: Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "503":
          description: Processing - Please come back later or use the *Retry-After* (seconds) header
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
      x-codeSamples:
        - lang: shell
          label: cURL
          source: |-
            curl -g 'https://api.esim-go.com/v2.5/esims/{iccid}' \
            -H 'X-API-Key: $API_KEY' \
            -H 'Content-Type: application/json'
        - lang: javascript
          label: Node
          source: |
            const axios = require('axios');

            let config = {
              method: 'get',
              maxBodyLength: Infinity,
              url: 'https://api.esim-go.com/v2.5/esims/{iccid}',
              headers: { 
                'X-API-Key': '$API_KEY', 
                'Content-Type': 'application/json'
              }
            };

            axios.request(config)
            .then((response) => {
              console.log(JSON.stringify(response.data));
            })
            .catch((error) => {
              console.log(error);
            });
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "fmt"
              "net/http"
              "io"
            )

            func main() {

              url := "https://api.esim-go.com/v2.5/esims/{iccid}"
              method := "GET"

              client := &http.Client {
              }
              req, err := http.NewRequest(method, url, nil)

              if err != nil {
                fmt.Println(err)
                return
              }
              req.Header.Add("X-API-Key", "$API_KEY")
              req.Header.Add("Content-Type", "application/json")

              res, err := client.Do(req)
              if err != nil {
                fmt.Println(err)
                return
              }
              defer res.Body.Close()

              body, err := io.ReadAll(res.Body)
              if err != nil {
                fmt.Println(err)
                return
              }
              fmt.Println(string(body))
            }
        - lang: python
          label: Python
          source: |
            import requests
            import json

            url = "https://api.esim-go.com/v2.5/esims/{iccid}"

            payload = {}
            headers = {
              'X-API-Key': '$API_KEY',
              'Content-Type': 'application/json'
            }

            response = requests.request("GET", url, headers=headers, data=payload)

            print(response.text)
        - lang: csharp
          label: C#
          source: |
            var client = new HttpClient();
            var request = new HttpRequestMessage(HttpMethod.Get, "https://api.esim-go.com/v2.5/esims/{iccid}");
            request.Headers.Add("X-API-Key", "$API_KEY");
            var content = new StringContent(string.Empty);
            content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
            request.Content = content;
            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            Console.WriteLine(await response.Content.ReadAsStringAsync());
        - lang: java
          label: Java
          source: |
            Unirest.setTimeouts(0, 0);
            HttpResponse<String> response = Unirest.get("https://api.esim-go.com/v2.5/esims/{iccid}")
              .header("X-API-Key", "$API_KEY")
              .header("Content-Type", "application/json")
              .asString();
    delete:
      summary: Delete eSIM
      description: |
        This endpoint allows you to delete a specific eSIM.

        **IMPORTANT:** Deleting an eSIM will revoke all bundles without a refund, and 
        will remove the eSIM from your account - you will no longer be able to access it.
        This process is irreversible.
      tags:
        - eSIMs
      parameters:
        - name: Accept
          in: header
          schema:
            type: string
          example: application/json
        - name: iccid
          in: path
          schema:
            type: string
          required: true
          description: (Required) The ICCID of the eSIM
          example: 8944123456789012000
      security:
        - apiKeyAuth: []
      responses:
        "200":
          description: OK
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StatusMessage"
        "400":
          description: Bad Request - returned when request format is not accepted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "403":
          description: Unauthorised - returned when the api token is invalid or the user does not have permission to query the given ICCID
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "429":
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "500":
          description: Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
      x-codeSamples:
        - lang: shell
          label: cURL
          source: |-
            curl -g -X DELETE 'https://api.esim-go.com/v2.5/esims/{iccid}' \
            -H 'X-API-Key: $API_KEY' \
            -H 'Content-Type: application/json'
        - lang: javascript
          label: Node
          source: |
            const axios = require('axios');

            let config = {
              method: 'delete',
              maxBodyLength: Infinity,
              url: 'https://api.esim-go.com/v2.5/esims/{iccid}',
              headers: { 
                'X-API-Key': '$API_KEY', 
                'Content-Type': 'application/json'
              }
            };

            axios.request(config)
            .then((response) => {
              console.log(JSON.stringify(response.data));
            })
            .catch((error) => {
              console.log(error);
            });
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "fmt"
              "net/http"
              "io"
            )

            func main() {

              url := "https://api.esim-go.com/v2.5/esims/{iccid}"
              method := "DELETE"

              client := &http.Client {
              }
              req, err := http.NewRequest(method, url, nil)

              if err != nil {
                fmt.Println(err)
                return
              }
              req.Header.Add("X-API-Key", "$API_KEY")
              req.Header.Add("Content-Type", "application/json")

              res, err := client.Do(req)
              if err != nil {
                fmt.Println(err)
                return
              }
              defer res.Body.Close()

              body, err := io.ReadAll(res.Body)
              if err != nil {
                fmt.Println(err)
                return
              }
              fmt.Println(string(body))
            }
        - lang: python
          label: Python
          source: |
            import requests
            import json

            url = "https://api.esim-go.com/v2.5/esims/{iccid}"

            payload = {}
            headers = {
              'X-API-Key': '$API_KEY',
              'Content-Type': 'application/json'
            }

            response = requests.request("DELETE", url, headers=headers, data=payload)

            print(response.text)
        - lang: csharp
          label: C#
          source: |
            var client = new HttpClient();
            var request = new HttpRequestMessage(HttpMethod.Delete, "https://api.esim-go.com/v2.5/esims/{iccid}");
            request.Headers.Add("X-API-Key", "$API_KEY");
            var content = new StringContent(string.Empty);
            content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
            request.Content = content;
            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            Console.WriteLine(await response.Content.ReadAsStringAsync());
        - lang: java
          label: Java
          source: |
            Unirest.setTimeouts(0, 0);
            HttpResponse<String> response = Unirest.delete("https://api.esim-go.com/v2.5/esims/{iccid}")
              .header("X-API-Key", "$API_KEY")
              .header("Content-Type", "application/json")
              .asString();
  /esims/{iccid}/history:
    get:
      summary: Get eSIM history
      description: |
        This endpoint returns the history of a specific eSIM. It provides a chronological list of actions performed on the eSIM, including bundle assignments and their states.

        This endpoint is useful for tracking the lifecycle of an eSIM, including bundle assignments, updates, and other significant events.

        Bundle Assignment States:
        - **Bundle Applied:**
          The bundle has been successfully assigned to the eSIM
        - **eSIM Updated:**
          The eSIM Reference has been updated.
        - **eSIM Refreshed:**
          eSIM was forcibly disconnected from the network, prompting it to reestablish its connection.
        - **eSIM Utilisation Alert:**
          A notification has been triggered due to the eSIM reaching a certain usage threshold.
        - **eSIM Returned:**
          The eSIM is no longer assigned to your organisation after undergoing the returns process.
        - **Bundle Refunded To Balance:**
          The unused bundle has been credited back to the organization's account balance.
        - **Bundle Refunded to Inventory:**
          The unused bundle has been returned to the organization's inventory for potential reassignment.
        - **Bundle Revoked:**
          The bundle has been removed from the eSIM.
        - **eSIM First Attachment:**
          The eSIM has successfully connected to a mobile network for the first time since activation.
        - **eSIM First Use:**
         The eSIM has been used for the first time to consume data service.
        - **Bundle Expired:**
          The bundle's validity period has ended and/or has been used in full. It is no longer active or usable.
        - **Bundle Lapsed:**
          The bundle has become inactive after no activity for 12 months.
      tags:
        - eSIMs
      parameters:
        - name: Accept
          in: header
          schema:
            type: string
          example: application/json
        - name: iccid
          in: path
          schema:
            type: string
          required: true
          description: (Required) The ICCID of the eSIM
          example: 8944123456789012000
      security:
        - apiKeyAuth: []
      responses:
        "200":
          description: OK
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ESIMHistory"
              example:
                - name: Bundle Applied
                  bundleName: A_BUNDLE_20GB_30D_EU_U
                  date: "2023-04-07T00:50:31.618780311Z"
                - name: Bundle Revoked
                  bundleName: A_BUNDLE_20GB_30D_EU_U
                  date: "2023-04-07T00:50:31.618780311Z"
        "400":
          description: Bad Request - returned when request format is not accepted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "403":
          description: Unauthorised - returned when the api token is invalid; the user does not have any available Bundles left or the ICCID is not accessible by the user
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "429":
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "500":
          description: Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "503":
          description: Processing - Please come back later or use the *Retry-After* (seconds) header
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
      x-codeSamples:
        - lang: shell
          label: cURL
          source: |-
            curl -g 'https://api.esim-go.com/v2.5/esims/{iccid}/history' \
            -H 'X-API-Key: $API_KEY' \
            -H 'Content-Type: application/json'
        - lang: javascript
          label: Node
          source: |
            const axios = require('axios');

            let config = {
              method: 'get',
              maxBodyLength: Infinity,
              url: 'https://api.esim-go.com/v2.5/esims/{iccid}/history',
              headers: { 
                'X-API-Key': '$API_KEY', 
                'Content-Type': 'application/json'
              }
            };

            axios.request(config)
            .then((response) => {
              console.log(JSON.stringify(response.data));
            })
            .catch((error) => {
              console.log(error);
            });
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "fmt"
              "net/http"
              "io"
            )

            func main() {

              url := "https://api.esim-go.com/v2.5/esims/{iccid}/history"
              method := "GET"

              client := &http.Client {
              }
              req, err := http.NewRequest(method, url, nil)

              if err != nil {
                fmt.Println(err)
                return
              }
              req.Header.Add("X-API-Key", "$API_KEY")
              req.Header.Add("Content-Type", "application/json")

              res, err := client.Do(req)
              if err != nil {
                fmt.Println(err)
                return
              }
              defer res.Body.Close()

              body, err := io.ReadAll(res.Body)
              if err != nil {
                fmt.Println(err)
                return
              }
              fmt.Println(string(body))
            }
        - lang: python
          label: Python
          source: |
            import requests
            import json

            url = "https://api.esim-go.com/v2.5/esims/{iccid}/history"

            payload = {}
            headers = {
              'X-API-Key': '$API_KEY',
              'Content-Type': 'application/json'
            }

            response = requests.request("GET", url, headers=headers, data=payload)

            print(response.text)
        - lang: csharp
          label: C#
          source: |
            var client = new HttpClient();
            var request = new HttpRequestMessage(HttpMethod.Get, "https://api.esim-go.com/v2.5/esims/{iccid}/history");
            request.Headers.Add("X-API-Key", "$API_KEY");
            var content = new StringContent(string.Empty);
            content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
            request.Content = content;
            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            Console.WriteLine(await response.Content.ReadAsStringAsync());
        - lang: java
          label: Java
          source: |
            Unirest.setTimeouts(0, 0);
            HttpResponse<String> response = Unirest.get("https://api.esim-go.com/v2.5/esims/{iccid}/history")
              .header("X-API-Key", "$API_KEY")
              .header("Content-Type", "application/json")
              .asString();
  /esims/{iccid}/refresh:
    get:
      summary: Refresh eSIM
      description: |-
        This request generates a cancel location request to the network, prompting it to reestablish its connection.
        Please note that this process disconnects the customer from the network and should be used solely for troubleshooting. It is not intended for canceling locations in bulk.

        Deactivated eSIMs cannot be refreshed and will return a 400 Bad Request error.
      tags:
        - eSIMs
      parameters:
        - name: Accept
          in: header
          schema:
            type: string
          example: application/json
        - name: iccid
          in: path
          schema:
            type: string
          required: true
          description: (Required) The ICCID of the eSIM
          example: 8944123456789012000
      security:
        - apiKeyAuth: []
      responses:
        "200":
          description: OK
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StatusMessage"
              example:
                status: Successfully refreshed SIM
        "400":
          description: Bad Request - returned when request format is not accepted or when the eSIM is deactivated
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "403":
          description: Unauthorised - returned when the api token is invalid; the user does not have any available Bundles left or the ICCID is not accessible by the user
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "429":
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "500":
          description: Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "503":
          description: Processing - Please come back later or use the *Retry-After* (seconds) header
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
      x-codeSamples:
        - lang: shell
          label: cURL
          source: |-
            curl -g 'https://api.esim-go.com/v2.5/esims/{iccid}/refresh' \
            -H 'X-API-Key: $API_KEY' \
            -H 'Content-Type: application/json'
        - lang: javascript
          label: Node
          source: |
            const axios = require('axios');

            let config = {
              method: 'get',
              maxBodyLength: Infinity,
              url: 'https://api.esim-go.com/v2.5/esims/{iccid}/refresh',
              headers: { 
                'X-API-Key': '$API_KEY', 
                'Content-Type': 'application/json'
              }
            };

            axios.request(config)
            .then((response) => {
              console.log(JSON.stringify(response.data));
            })
            .catch((error) => {
              console.log(error);
            });
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "fmt"
              "net/http"
              "io"
            )

            func main() {

              url := "https://api.esim-go.com/v2.5/esims/{iccid}/refresh"
              method := "GET"

              client := &http.Client {
              }
              req, err := http.NewRequest(method, url, nil)

              if err != nil {
                fmt.Println(err)
                return
              }
              req.Header.Add("X-API-Key", "$API_KEY")
              req.Header.Add("Content-Type", "application/json")

              res, err := client.Do(req)
              if err != nil {
                fmt.Println(err)
                return
              }
              defer res.Body.Close()

              body, err := io.ReadAll(res.Body)
              if err != nil {
                fmt.Println(err)
                return
              }
              fmt.Println(string(body))
            }
        - lang: python
          label: Python
          source: |
            import requests
            import json

            url = "https://api.esim-go.com/v2.5/esims/{iccid}/refresh"

            payload = {}
            headers = {
              'X-API-Key': '$API_KEY',
              'Content-Type': 'application/json'
            }

            response = requests.request("GET", url, headers=headers, data=payload)

            print(response.text)
        - lang: csharp
          label: C#
          source: |
            var client = new HttpClient();
            var request = new HttpRequestMessage(HttpMethod.Get, "https://api.esim-go.com/v2.5/esims/{iccid}/refresh");
            request.Headers.Add("X-API-Key", "$API_KEY");
            var content = new StringContent(string.Empty);
            content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
            request.Content = content;
            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            Console.WriteLine(await response.Content.ReadAsStringAsync());
        - lang: java
          label: Java
          source: |
            Unirest.setTimeouts(0, 0);
            HttpResponse<String> response = Unirest.get("https://api.esim-go.com/v2.5/esims/{iccid}/refresh")
              .header("X-API-Key", "$API_KEY")
              .header("Content-Type", "application/json")
              .asString();
  /esims/{iccid}/compatible/{bundle}:
    get:
      summary: Check eSIM and Bundle Compatibility
      description: |-
        To ensure optimal service, eSIM Go utilizes multiple providers. As a result, certain bundles may be incompatible with existing eSIMs if they originate from different providers, preventing eSIM top-ups.

          This endpoint is designed to verify eSIM-bundle compatibility.
      tags:
        - eSIMs
      parameters:
        - name: Accept
          in: header
          schema:
            type: string
          example: application/json
        - name: iccid
          in: path
          schema:
            type: string
          required: true
          description: (Required) The ICCID of the eSIM
          example: 8944123456789012000
        - name: bundle
          in: path
          schema:
            type: string
          required: true
      security:
        - apiKeyAuth: []
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CompatibilityResponse"
              example:
                compatible: false
        "400":
          description: Bad Request - returned when request format is not accepted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "403":
          description: Unauthorised - returned when the api token is invalid; the user does not have any available Bundles left or the ICCID is not accessible by the user
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "429":
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "500":
          description: Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "503":
          description: Processing - Please come back later or use the *Retry-After* (seconds) header
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
      x-codeSamples:
        - lang: shell
          label: cURL
          source: |-
            curl -g 'https://api.esim-go.com/v2.5/esims/{iccid}/compatible/{bundle}' \
            -H 'X-API-Key: $API_KEY' \
            -H 'Content-Type: application/json'
        - lang: javascript
          label: Node
          source: |
            const axios = require('axios');

            let config = {
              method: 'get',
              maxBodyLength: Infinity,
              url: 'https://api.esim-go.com/v2.5/esims/{iccid}/compatible/{bundle}',
              headers: { 
                'X-API-Key': '$API_KEY', 
                'Content-Type': 'application/json'
              }
            };

            axios.request(config)
            .then((response) => {
              console.log(JSON.stringify(response.data));
            })
            .catch((error) => {
              console.log(error);
            });
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "fmt"
              "net/http"
              "io"
            )

            func main() {

              url := "https://api.esim-go.com/v2.5/esims/{iccid}/compatible/{bundle}"
              method := "GET"

              client := &http.Client {
              }
              req, err := http.NewRequest(method, url, nil)

              if err != nil {
                fmt.Println(err)
                return
              }
              req.Header.Add("X-API-Key", "$API_KEY")
              req.Header.Add("Content-Type", "application/json")

              res, err := client.Do(req)
              if err != nil {
                fmt.Println(err)
                return
              }
              defer res.Body.Close()

              body, err := io.ReadAll(res.Body)
              if err != nil {
                fmt.Println(err)
                return
              }
              fmt.Println(string(body))
            }
        - lang: python
          label: Python
          source: |
            import requests
            import json

            url = "https://api.esim-go.com/v2.5/esims/{iccid}/compatible/{bundle}"

            payload = {}
            headers = {
              'X-API-Key': '$API_KEY',
              'Content-Type': 'application/json'
            }

            response = requests.request("GET", url, headers=headers, data=payload)

            print(response.text)
        - lang: csharp
          label: C#
          source: |
            var client = new HttpClient();
            var request = new HttpRequestMessage(HttpMethod.Get, "https://api.esim-go.com/v2.5/esims/{iccid}/compatible/{bundle}");
            request.Headers.Add("X-API-Key", "$API_KEY");
            var content = new StringContent(string.Empty);
            content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
            request.Content = content;
            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            Console.WriteLine(await response.Content.ReadAsStringAsync());
        - lang: java
          label: Java
          source: |
            Unirest.setTimeouts(0, 0);
            HttpResponse<String> response = Unirest.get("https://api.esim-go.com/v2.5/esims/{iccid}/compatible/{bundle}")
              .header("X-API-Key", "$API_KEY")
              .header("Content-Type", "application/json")
              .asString();
  /esims/{iccid}/sms:
    post:
      summary: Send SMS to eSIM
      description: |
        The Send SMS endpoint is a powerful feature of the eSIMGo API that allows you to send text messages directly to eSIMs. This endpoint becomes particularly useful when combined with eSIMGo's real-time notification system, which provides updates about eSIM activity through callback functionality. The callback should be set up separatelly.

         Key points:

        1. Message requirements:
          - UTF-8 compliant
          - Length: 1-160 characters

        2. Default recipient: 'eSIM' (currently the only supported value)
          - Custom identifiers available upon request

        Note: For custom identifiers, please contact your Account Manager.

        Deactivated eSIMs cannot receive SMS messages.
      tags:
        - eSIMs
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                message:
                  description: UTF-8 compliant message
                  type: string
                  required: true
                  minLength: 1
                  maxLength: 160
                  default: message
                from:
                  description: |
                    Name of sender that will show in SMS.

                    This defaults to `eSIM` and is the only supported value by default. Unique identifiers can be assigned to your Organisation on request.
                  type: string
                  default: eSIM
              example:
                message: Hello!
                from: eSIM
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: Accept
          in: header
          schema:
            type: string
          example: application/json
        - name: iccid
          in: path
          schema:
            type: string
          required: true
          description: (Required) The ICCID of the eSIM
          example: 8944123456789012000
      security:
        - apiKeyAuth: []
      responses:
        "200":
          description: OK
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StatusMessage"
              example:
                status: sent
        "400":
          description: Bad Request - returned when request format is not accepted or when the eSIM is deactivated
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "403":
          description: Unauthorised - returned when the api token is invalid; the user does not have any available Bundles left or the ICCID is not accessible by the user
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "429":
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "500":
          description: Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "503":
          description: Processing - Please come back later or use the *Retry-After* (seconds) header
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
      x-codeSamples:
        - lang: shell
          label: cURL
          source: |-
            curl -g 'https://api.esim-go.com/v2.5/esims/{iccid}/sms' \
            -H 'X-API-Key: $API_KEY' \
            -H 'Content-Type: application/json' \
            -d '{"type":"object","properties":{"message":{"description":"UTF-8 compliant message","type":"string","required":true,"minLength":1,"maxLength":160,"default":"message"},"from":{"description":"Name of sender that will show in SMS.\n\nThis defaults to `eSIM` and is the only supported value by default. Unique identifiers can be assigned to your Organisation on request.\n","type":"string","default":"eSIM"}},"example":{"message":"Hello!","from":"eSIM"}}'
        - lang: javascript
          label: Node
          source: |
            const axios = require('axios');
            let data = JSON.stringify({
              "type": "object",
              "properties": {
                "message": {
                  "description": "UTF-8 compliant message",
                  "type": "string",
                  "required": true,
                  "minLength": 1,
                  "maxLength": 160,
                  "default": "message"
                },
                "from": {
                  "description": "Name of sender that will show in SMS.\n\nThis defaults to `eSIM` and is the only supported value by default. Unique identifiers can be assigned to your Organisation on request.\n",
                  "type": "string",
                  "default": "eSIM"
                }
              },
              "example": {
                "message": "Hello!",
                "from": "eSIM"
              }
            });

            let config = {
              method: 'post',
              maxBodyLength: Infinity,
              url: 'https://api.esim-go.com/v2.5/esims/{iccid}/sms',
              headers: { 
                'X-API-Key': '$API_KEY', 
                'Content-Type': 'application/json'
              },
              data : data
            };

            axios.request(config)
            .then((response) => {
              console.log(JSON.stringify(response.data));
            })
            .catch((error) => {
              console.log(error);
            });
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "fmt"
              "strings"
              "net/http"
              "io"
            )

            func main() {

              url := "https://api.esim-go.com/v2.5/esims/{iccid}/sms"
              method := "POST"

              payload := strings.NewReader(`{"type":"object","properties":{"message":{"description":"UTF-8 compliant message","type":"string","required":true,"minLength":1,"maxLength":160,"default":"message"},"from":{"description":"Name of sender that will show in SMS.\n\nThis defaults to `+"`"+`eSIM`+"`"+` and is the only supported value by default. Unique identifiers can be assigned to your Organisation on request.\n","type":"string","default":"eSIM"}},"example":{"message":"Hello!","from":"eSIM"}}`)

              client := &http.Client {
              }
              req, err := http.NewRequest(method, url, payload)

              if err != nil {
                fmt.Println(err)
                return
              }
              req.Header.Add("X-API-Key", "$API_KEY")
              req.Header.Add("Content-Type", "application/json")

              res, err := client.Do(req)
              if err != nil {
                fmt.Println(err)
                return
              }
              defer res.Body.Close()

              body, err := io.ReadAll(res.Body)
              if err != nil {
                fmt.Println(err)
                return
              }
              fmt.Println(string(body))
            }
        - lang: python
          label: Python
          source: |
            import requests
            import json

            url = "https://api.esim-go.com/v2.5/esims/{iccid}/sms"

            payload = json.dumps({
              "type": "object",
              "properties": {
                "message": {
                  "description": "UTF-8 compliant message",
                  "type": "string",
                  "required": True,
                  "minLength": 1,
                  "maxLength": 160,
                  "default": "message"
                },
                "from": {
                  "description": "Name of sender that will show in SMS.\n\nThis defaults to `eSIM` and is the only supported value by default. Unique identifiers can be assigned to your Organisation on request.\n",
                  "type": "string",
                  "default": "eSIM"
                }
              },
              "example": {
                "message": "Hello!",
                "from": "eSIM"
              }
            })
            headers = {
              'X-API-Key': '$API_KEY',
              'Content-Type': 'application/json'
            }

            response = requests.request("POST", url, headers=headers, data=payload)

            print(response.text)
        - lang: csharp
          label: C#
          source: |
            var client = new HttpClient();
            var request = new HttpRequestMessage(HttpMethod.Post, "https://api.esim-go.com/v2.5/esims/{iccid}/sms");
            request.Headers.Add("X-API-Key", "$API_KEY");
            var content = new StringContent("{\"type\":\"object\",\"properties\":{\"message\":{\"description\":\"UTF-8 compliant message\",\"type\":\"string\",\"required\":true,\"minLength\":1,\"maxLength\":160,\"default\":\"message\"},\"from\":{\"description\":\"Name of sender that will show in SMS.\\n\\nThis defaults to `eSIM` and is the only supported value by default. Unique identifiers can be assigned to your Organisation on request.\\n\",\"type\":\"string\",\"default\":\"eSIM\"}},\"example\":{\"message\":\"Hello!\",\"from\":\"eSIM\"}}", null, "application/json");
            request.Content = content;
            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            Console.WriteLine(await response.Content.ReadAsStringAsync());
        - lang: java
          label: Java
          source: |
            Unirest.setTimeouts(0, 0);
            HttpResponse<String> response = Unirest.post("https://api.esim-go.com/v2.5/esims/{iccid}/sms")
              .header("X-API-Key", "$API_KEY")
              .header("Content-Type", "application/json")
              .body("{\"type\":\"object\",\"properties\":{\"message\":{\"description\":\"UTF-8 compliant message\",\"type\":\"string\",\"required\":true,\"minLength\":1,\"maxLength\":160,\"default\":\"message\"},\"from\":{\"description\":\"Name of sender that will show in SMS.\\n\\nThis defaults to `eSIM` and is the only supported value by default. Unique identifiers can be assigned to your Organisation on request.\\n\",\"type\":\"string\",\"default\":\"eSIM\"}},\"example\":{\"message\":\"Hello!\",\"from\":\"eSIM\"}}")
              .asString();
  /esims/{iccid}/bundles:
    get:
      summary: List Bundles applied to eSIM
      description: |
        This endpoint allows you to retrieve a list of all bundles that have been applied to a specific eSIM. This endpoint is useful for tracking the service history and current status of an eSIM.

        Remaining data can be found here.

        Each Bundle can have multiple assignments.

        Bundle Assignment States:
        - **Processing:**
          The bundle assignment is currently processing.
          This is usually instant but can, on occasion, take up to 10 minutes to complete.
          The eSIM can still be installed and will register on a network while the bundle is processing.
        - **Queued:**
          The bundle has been successfully assigned, has not been used yet, and is queued for use.
        - **Active:**
          The bundle has successfully been used.
          It has data remaining and is within the bundle duration.
        - **Depleted:**
          The bundle has no data remaining but is still within the bundle duration.
        - **Expired:**
          The bundle has expired, and the bundle duration has been exceeded.
        - **Revoked:**
          The bundle has been revoked, and is no longer on the esim.
        - **Lapsed:**
          The bundle has expired without being used and is no longer on the eSIM.
      tags:
        - eSIMs
      parameters:
        - name: Accept
          in: header
          schema:
            type: string
          example: application/json
        - name: includeUsed
          in: query
          schema:
            type: string
          description: |
            Include used & expired Bundles
            Backward compatibility for v2.1
          example: true
        - name: limit
          in: query
          schema:
            type: string
          description: |
            Number of assignments to return. Must be between 1 and 200. Default is 15
          example: 10
        - name: iccid
          in: path
          schema:
            type: string
          required: true
          description: (Required) The ICCID of the eSIM
          example: 8943108165016100000
      security:
        - apiKeyAuth: []
      responses:
        "200":
          description: OK
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BundlesList"
              example:
                bundles:
                  - name: esim_1GB_7D_GB_V2
                    description: eSIM, 1GB, 7 Days, United Kingdom, V2
                    assignments:
                      - id: "215009266"
                        callTypeGroup: data
                        initialQuantity: 1000000000
                        remainingQuantity: 1000000000
                        assignmentDateTime: "2024-12-11T10:47:00.34523Z"
                        assignmentReference: 3a6e2e40-c674-45e9-b289-b35027bf72a9-0
                        bundleState: queued
                        unlimited: false
        "400":
          description: Bad Request - returned when request format is not accepted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "403":
          description: Unauthorised - returned when the api token is invalid; the user does not have any available Bundles left or the ICCID is not accessible by the user
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "429":
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "500":
          description: Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "503":
          description: Processing - Please come back later or use the *Retry-After* (seconds) header
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
      x-codeSamples:
        - lang: shell
          label: cURL
          source: |-
            curl -g 'https://api.esim-go.com/v2.5/esims/{iccid}/bundles' \
            -H 'X-API-Key: $API_KEY' \
            -H 'Content-Type: application/json'
        - lang: javascript
          label: Node
          source: |
            const axios = require('axios');

            let config = {
              method: 'get',
              maxBodyLength: Infinity,
              url: 'https://api.esim-go.com/v2.5/esims/{iccid}/bundles',
              headers: { 
                'X-API-Key': '$API_KEY', 
                'Content-Type': 'application/json'
              }
            };

            axios.request(config)
            .then((response) => {
              console.log(JSON.stringify(response.data));
            })
            .catch((error) => {
              console.log(error);
            });
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "fmt"
              "net/http"
              "io"
            )

            func main() {

              url := "https://api.esim-go.com/v2.5/esims/{iccid}/bundles"
              method := "GET"

              client := &http.Client {
              }
              req, err := http.NewRequest(method, url, nil)

              if err != nil {
                fmt.Println(err)
                return
              }
              req.Header.Add("X-API-Key", "$API_KEY")
              req.Header.Add("Content-Type", "application/json")

              res, err := client.Do(req)
              if err != nil {
                fmt.Println(err)
                return
              }
              defer res.Body.Close()

              body, err := io.ReadAll(res.Body)
              if err != nil {
                fmt.Println(err)
                return
              }
              fmt.Println(string(body))
            }
        - lang: python
          label: Python
          source: |
            import requests
            import json

            url = "https://api.esim-go.com/v2.5/esims/{iccid}/bundles"

            payload = {}
            headers = {
              'X-API-Key': '$API_KEY',
              'Content-Type': 'application/json'
            }

            response = requests.request("GET", url, headers=headers, data=payload)

            print(response.text)
        - lang: csharp
          label: C#
          source: |
            var client = new HttpClient();
            var request = new HttpRequestMessage(HttpMethod.Get, "https://api.esim-go.com/v2.5/esims/{iccid}/bundles");
            request.Headers.Add("X-API-Key", "$API_KEY");
            var content = new StringContent(string.Empty);
            content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
            request.Content = content;
            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            Console.WriteLine(await response.Content.ReadAsStringAsync());
        - lang: java
          label: Java
          source: |
            Unirest.setTimeouts(0, 0);
            HttpResponse<String> response = Unirest.get("https://api.esim-go.com/v2.5/esims/{iccid}/bundles")
              .header("X-API-Key", "$API_KEY")
              .header("Content-Type", "application/json")
              .asString();
    post:
      summary: Apply a Bundle to an eSIM (Deprecated)
      tags:
        - eSIMs (Deprecated)
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: Accept
          in: header
          schema:
            type: string
          example: application/json
        - name: iccid
          in: path
          schema:
            type: string
          required: true
          description: (Required) The ICCID of the eSIM
          example: <string>
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                name: <string>
                startTime: <string>
                repeat: <integer>
      security:
        - apiKeyAuth: []
      responses:
        "200":
          description: OK
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                type: object
              example:
                status: <string>
        "400":
          description: Bad Request - returned when request format is not accepted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "403":
          description: Unauthorised - returned when the api token is invalid; the user does not have any available Bundles left or the ICCID is not accessible by the user
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "429":
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "500":
          description: Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "503":
          description: Processing - Please come back later or use the *Retry-After* (seconds) header
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
      x-codeSamples:
        - lang: shell
          label: cURL
          source: |-
            curl -g 'https://api.esim-go.com/v2.5/esims/{iccid}/bundles' \
            -H 'X-API-Key: $API_KEY' \
            -H 'Content-Type: application/json' \
            -d '{"type":"object","example":{"name":"<string>","startTime":"<string>","repeat":"<integer>"}}'
        - lang: javascript
          label: Node
          source: |
            const axios = require('axios');
            let data = JSON.stringify({
              "type": "object",
              "example": {
                "name": "<string>",
                "startTime": "<string>",
                "repeat": "<integer>"
              }
            });

            let config = {
              method: 'post',
              maxBodyLength: Infinity,
              url: 'https://api.esim-go.com/v2.5/esims/{iccid}/bundles',
              headers: { 
                'X-API-Key': '$API_KEY', 
                'Content-Type': 'application/json'
              },
              data : data
            };

            axios.request(config)
            .then((response) => {
              console.log(JSON.stringify(response.data));
            })
            .catch((error) => {
              console.log(error);
            });
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "fmt"
              "strings"
              "net/http"
              "io"
            )

            func main() {

              url := "https://api.esim-go.com/v2.5/esims/{iccid}/bundles"
              method := "POST"

              payload := strings.NewReader(`{"type":"object","example":{"name":"<string>","startTime":"<string>","repeat":"<integer>"}}`)

              client := &http.Client {
              }
              req, err := http.NewRequest(method, url, payload)

              if err != nil {
                fmt.Println(err)
                return
              }
              req.Header.Add("X-API-Key", "$API_KEY")
              req.Header.Add("Content-Type", "application/json")

              res, err := client.Do(req)
              if err != nil {
                fmt.Println(err)
                return
              }
              defer res.Body.Close()

              body, err := io.ReadAll(res.Body)
              if err != nil {
                fmt.Println(err)
                return
              }
              fmt.Println(string(body))
            }
        - lang: python
          label: Python
          source: |
            import requests
            import json

            url = "https://api.esim-go.com/v2.5/esims/{iccid}/bundles"

            payload = json.dumps({
              "type": "object",
              "example": {
                "name": "<string>",
                "startTime": "<string>",
                "repeat": "<integer>"
              }
            })
            headers = {
              'X-API-Key': '$API_KEY',
              'Content-Type': 'application/json'
            }

            response = requests.request("POST", url, headers=headers, data=payload)

            print(response.text)
        - lang: csharp
          label: C#
          source: |
            var client = new HttpClient();
            var request = new HttpRequestMessage(HttpMethod.Post, "https://api.esim-go.com/v2.5/esims/{iccid}/bundles");
            request.Headers.Add("X-API-Key", "$API_KEY");
            var content = new StringContent("{\"type\":\"object\",\"example\":{\"name\":\"<string>\",\"startTime\":\"<string>\",\"repeat\":\"<integer>\"}}", null, "application/json");
            request.Content = content;
            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            Console.WriteLine(await response.Content.ReadAsStringAsync());
        - lang: java
          label: Java
          source: |
            Unirest.setTimeouts(0, 0);
            HttpResponse<String> response = Unirest.post("https://api.esim-go.com/v2.5/esims/{iccid}/bundles")
              .header("X-API-Key", "$API_KEY")
              .header("Content-Type", "application/json")
              .body("{\"type\":\"object\",\"example\":{\"name\":\"<string>\",\"startTime\":\"<string>\",\"repeat\":\"<integer>\"}}")
              .asString();
  /esims/{iccid}/bundles/{name}:
    get:
      summary: Get applied Bundle status
      description: |
        Provides details about an individual assignment of a Bundle applied to an eSIM.

         Bundle Assignment States:
          - **Processing:** The bundle assignment is currently processing. This is usually
            instant but can occasionally take up to 10 minutes to complete. The eSIM
            can still be installed and will register on a network while the bundle is
            processing.
          - **Queued:** The bundle has been successfully assigned, has not been used yet,
            and is queued for use.
          - **Active:** The bundle has successfully been used. It has data remaining and
            is within the bundle duration.
          - **Depleted:** The bundle has no data remaining but is still within the bundle
            duration.
          - **Expired:** The bundle has expired, and the bundle duration has been exceeded.
          - **Revoked:** The bundle has been revoked and is no longer on the eSIM.
          - **Lapsed:** The bundle has expired without being used and is no longer on the eSIM.

        Notes:
          - If multiple of the same bundle are applied to a single eSIM, the status
            bundle with the latest assignment will be returned.
          - Bundle names are case sensitive and should be typed exactly as shown,
            e.g., "esim_1GB_7D_IM_U".
          - Remaining data can be found in the response.
      tags:
        - eSIMs
      parameters:
        - name: Accept
          in: header
          schema:
            type: string
          example: application/json
        - name: iccid
          in: path
          schema:
            type: string
          required: true
          description: (Required) The ICCID of the eSIM
          example: 8943108165016100000
        - name: name
          in: path
          schema:
            type: string
          required: true
          description: |
            (Required) Name of Bundle Format as defined in [List Catalogue](/api/#get-/catalogue) API call. Example: `esim_1GB_7D_REUP_V2`
          example: esim_1GB_7D_REUP_V2
      security:
        - apiKeyAuth: []
      responses:
        "200":
          description: OK
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AssignmentResponse"
              example:
                assignments:
                  - id: "215009266"
                    callTypeGroup: data
                    initialQuantity: 1000000000
                    remainingQuantity: 1000000000
                    assignmentDateTime: "2024-12-11T10:47:00.34523Z"
                    assignmentReference: 3a6e2e40-c674-45e9-b289-b35027bf72a9-0
                    bundleState: queued
                    unlimited: false
        "400":
          description: Bad Request - returned when request format is not accepted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "403":
          description: Unauthorised - returned when the api token is invalid; the user does not have any available Bundles left or the ICCID is not accessible by the user
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "429":
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "500":
          description: Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "503":
          description: Processing - Please come back later or use the *Retry-After* (seconds) header
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
      x-codeSamples:
        - lang: shell
          label: cURL
          source: |-
            curl -g 'https://api.esim-go.com/v2.5/esims/{iccid}/bundles/{name}' \
            -H 'X-API-Key: $API_KEY' \
            -H 'Content-Type: application/json'
        - lang: javascript
          label: Node
          source: |
            const axios = require('axios');

            let config = {
              method: 'get',
              maxBodyLength: Infinity,
              url: 'https://api.esim-go.com/v2.5/esims/{iccid}/bundles/{name}',
              headers: { 
                'X-API-Key': '$API_KEY', 
                'Content-Type': 'application/json'
              }
            };

            axios.request(config)
            .then((response) => {
              console.log(JSON.stringify(response.data));
            })
            .catch((error) => {
              console.log(error);
            });
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "fmt"
              "net/http"
              "io"
            )

            func main() {

              url := "https://api.esim-go.com/v2.5/esims/{iccid}/bundles/{name}"
              method := "GET"

              client := &http.Client {
              }
              req, err := http.NewRequest(method, url, nil)

              if err != nil {
                fmt.Println(err)
                return
              }
              req.Header.Add("X-API-Key", "$API_KEY")
              req.Header.Add("Content-Type", "application/json")

              res, err := client.Do(req)
              if err != nil {
                fmt.Println(err)
                return
              }
              defer res.Body.Close()

              body, err := io.ReadAll(res.Body)
              if err != nil {
                fmt.Println(err)
                return
              }
              fmt.Println(string(body))
            }
        - lang: python
          label: Python
          source: |
            import requests
            import json

            url = "https://api.esim-go.com/v2.5/esims/{iccid}/bundles/{name}"

            payload = {}
            headers = {
              'X-API-Key': '$API_KEY',
              'Content-Type': 'application/json'
            }

            response = requests.request("GET", url, headers=headers, data=payload)

            print(response.text)
        - lang: csharp
          label: C#
          source: |
            var client = new HttpClient();
            var request = new HttpRequestMessage(HttpMethod.Get, "https://api.esim-go.com/v2.5/esims/{iccid}/bundles/{name}");
            request.Headers.Add("X-API-Key", "$API_KEY");
            var content = new StringContent(string.Empty);
            content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
            request.Content = content;
            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            Console.WriteLine(await response.Content.ReadAsStringAsync());
        - lang: java
          label: Java
          source: |
            Unirest.setTimeouts(0, 0);
            HttpResponse<String> response = Unirest.get("https://api.esim-go.com/v2.5/esims/{iccid}/bundles/{name}")
              .header("X-API-Key", "$API_KEY")
              .header("Content-Type", "application/json")
              .asString();
    delete:
      summary: Revoke applied Bundle
      description: |
        This endpoint is used to revoke the latest assignment of a given bundle type from an eSIM. It requires two parameters: the ICCID of the eSIM and the name of the bundle to be revoked. If the specified ICCID has multiple bundles with the same name, the oldest unused bundle will be revoked.

        Example:
        For an eSIM with ICCID 8943108165015003887 that has the following bundles:

        • ESIM_1G_UK (Assignment ID: 243)

        • ESIM_1G_UK (Assignment ID: 245)

        • ESIM_1G_US (Assignment ID: 247)

        If you revoke the "ESIM_1G_UK" bundle, the oldest unused assignment (ID: 243) will be revoked.



        If a bundle assignment has not been started and no data has been consumed, the bundle assignment can either be returned to the inventory or credited back to the organisations balance. If the bundle assignment has started, or was purchased outside of their permitted refund period, typically 60 days, it cannot be returned to the inventory or taken as a credit.

        **IMPORTANT:** Access to the refund functionality is **disabled by default**. To enable refunds (either to inventory or balance), you must first contact your account manager. Without this feature enabled, this endpoint will only revoke the bundle assignment **without a refund**.

        **Note:** Bundle names are case sensitive and should be typed like the following "esim_1GB_7D_IM_U".
      tags:
        - eSIMs
      parameters:
        - in: path
          name: iccid
          schema:
            type: string
          required: true
          description: The ICCID of the eSIM
        - in: path
          name: name
          schema:
            type: string
          required: true
          description: |
            Name of Bundle

            Format as defined in [List Catalogue](/api/v2_4/operations/catalogue/get) API call.
            Example: `esim_10GB_30D_IM_U`
        - in: query
          name: refundToBalance
          schema:
            type: boolean
          required: false
          description: If Applicable, refund the value of this bundle to organisation balance
        - in: query
          name: offerId
          schema:
            type: string
          required: false
          description: If Applicable, the offerId of the bundle to revoke. Needed for refunding to balance. You can find offerID (also known as Assigment ID) by querying “Get applied Bundle status” endpoint.
        - in: query
          name: type
          schema:
            type: string
            enum:
              - validate
              - transaction
          required: false
          description: type `validate` will provide options for the revoke and the behaviours, if any. type `transaction` will execute the revoke. Defaults to `transaction`
      security:
        - apiKeyAuth: []
      responses:
        "200":
          description: Success message
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StatusMessage"
        "400":
          description: Bad Request - returned when request format is not accepted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "403":
          description: Unauthorised - returned when the api token is invalid; the user does not have any available Bundles left or the eSIM is not accessible by the user
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "500":
          description: Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
      x-codeSamples:
        - lang: shell
          label: cURL
          source: |-
            curl -g -X DELETE 'https://api.esim-go.com/v2.5/esims/{iccid}/bundles/{name}' \
            -H 'X-API-Key: $API_KEY' \
            -H 'Content-Type: application/json'
        - lang: javascript
          label: Node
          source: |
            const axios = require('axios');

            let config = {
              method: 'delete',
              maxBodyLength: Infinity,
              url: 'https://api.esim-go.com/v2.5/esims/{iccid}/bundles/{name}',
              headers: { 
                'X-API-Key': '$API_KEY', 
                'Content-Type': 'application/json'
              }
            };

            axios.request(config)
            .then((response) => {
              console.log(JSON.stringify(response.data));
            })
            .catch((error) => {
              console.log(error);
            });
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "fmt"
              "net/http"
              "io"
            )

            func main() {

              url := "https://api.esim-go.com/v2.5/esims/{iccid}/bundles/{name}"
              method := "DELETE"

              client := &http.Client {
              }
              req, err := http.NewRequest(method, url, nil)

              if err != nil {
                fmt.Println(err)
                return
              }
              req.Header.Add("X-API-Key", "$API_KEY")
              req.Header.Add("Content-Type", "application/json")

              res, err := client.Do(req)
              if err != nil {
                fmt.Println(err)
                return
              }
              defer res.Body.Close()

              body, err := io.ReadAll(res.Body)
              if err != nil {
                fmt.Println(err)
                return
              }
              fmt.Println(string(body))
            }
        - lang: python
          label: Python
          source: |
            import requests
            import json

            url = "https://api.esim-go.com/v2.5/esims/{iccid}/bundles/{name}"

            payload = {}
            headers = {
              'X-API-Key': '$API_KEY',
              'Content-Type': 'application/json'
            }

            response = requests.request("DELETE", url, headers=headers, data=payload)

            print(response.text)
        - lang: csharp
          label: C#
          source: |
            var client = new HttpClient();
            var request = new HttpRequestMessage(HttpMethod.Delete, "https://api.esim-go.com/v2.5/esims/{iccid}/bundles/{name}");
            request.Headers.Add("X-API-Key", "$API_KEY");
            var content = new StringContent(string.Empty);
            content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
            request.Content = content;
            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            Console.WriteLine(await response.Content.ReadAsStringAsync());
        - lang: java
          label: Java
          source: |
            Unirest.setTimeouts(0, 0);
            HttpResponse<String> response = Unirest.delete("https://api.esim-go.com/v2.5/esims/{iccid}/bundles/{name}")
              .header("X-API-Key", "$API_KEY")
              .header("Content-Type", "application/json")
              .asString();
  /esims/{iccid}/bundles/{name}/applications/{assignmentId}:
    delete:
      summary: Revoke a specific Bundle Assignment from an eSIM (Deprecated)
      description: |
        Revokes a single assignment of a given Bundle type.

        e.g. Can remove 1 month from a 1-year Bundle.

        **Note:** Bundle names are case sensitive and should be typed like the following "esim_1GB_7D_IM_U".
      tags:
        - eSIMs (Deprecated)
      parameters:
        - in: path
          name: iccid
          schema:
            type: string
          required: true
          description: The ICCID of the eSIM
        - in: path
          name: name
          schema:
            type: string
          required: true
          description: |
            Name of Bundle

            Format as defined in [List Catalogue](/api/#get-/catalogue) API call.
            Example: `esim_10GB_30D_IM_U`
        - in: path
          name: assignmentId
          schema:
            type: string
          required: true
          description: ID of individual Bundle Assignment to revoke from an eSIM
        - in: query
          name: type
          schema:
            type: string
            enum:
              - validate
              - transaction
          required: false
          description: type `validate` will provide options for the revoke and the behaviours, if any. type `transaction` will execute the revoke. Defaults to `transaction`
      security:
        - apiKeyAuth: []
      responses:
        "200":
          description: Success message
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RevokeBundleResponse"
        "400":
          description: Bad Request - returned when request format is not accepted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "403":
          description: Unauthorised - returned when the api token is invalid; the user does not have any available Bundles left or the eSIM is not accessible by the user
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "500":
          description: Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
      x-codeSamples:
        - lang: shell
          label: cURL
          source: |-
            curl -g -X DELETE 'https://api.esim-go.com/v2.5/esims/{iccid}/bundles/{name}/applications/{assignmentId}' \
            -H 'X-API-Key: $API_KEY' \
            -H 'Content-Type: application/json'
        - lang: javascript
          label: Node
          source: |
            const axios = require('axios');

            let config = {
              method: 'delete',
              maxBodyLength: Infinity,
              url: 'https://api.esim-go.com/v2.5/esims/{iccid}/bundles/{name}/applications/{assignmentId}',
              headers: { 
                'X-API-Key': '$API_KEY', 
                'Content-Type': 'application/json'
              }
            };

            axios.request(config)
            .then((response) => {
              console.log(JSON.stringify(response.data));
            })
            .catch((error) => {
              console.log(error);
            });
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "fmt"
              "net/http"
              "io"
            )

            func main() {

              url := "https://api.esim-go.com/v2.5/esims/{iccid}/bundles/{name}/applications/{assignmentId}"
              method := "DELETE"

              client := &http.Client {
              }
              req, err := http.NewRequest(method, url, nil)

              if err != nil {
                fmt.Println(err)
                return
              }
              req.Header.Add("X-API-Key", "$API_KEY")
              req.Header.Add("Content-Type", "application/json")

              res, err := client.Do(req)
              if err != nil {
                fmt.Println(err)
                return
              }
              defer res.Body.Close()

              body, err := io.ReadAll(res.Body)
              if err != nil {
                fmt.Println(err)
                return
              }
              fmt.Println(string(body))
            }
        - lang: python
          label: Python
          source: |
            import requests
            import json

            url = "https://api.esim-go.com/v2.5/esims/{iccid}/bundles/{name}/applications/{assignmentId}"

            payload = {}
            headers = {
              'X-API-Key': '$API_KEY',
              'Content-Type': 'application/json'
            }

            response = requests.request("DELETE", url, headers=headers, data=payload)

            print(response.text)
        - lang: csharp
          label: C#
          source: |
            var client = new HttpClient();
            var request = new HttpRequestMessage(HttpMethod.Delete, "https://api.esim-go.com/v2.5/esims/{iccid}/bundles/{name}/applications/{assignmentId}");
            request.Headers.Add("X-API-Key", "$API_KEY");
            var content = new StringContent(string.Empty);
            content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
            request.Content = content;
            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            Console.WriteLine(await response.Content.ReadAsStringAsync());
        - lang: java
          label: Java
          source: |
            Unirest.setTimeouts(0, 0);
            HttpResponse<String> response = Unirest.delete("https://api.esim-go.com/v2.5/esims/{iccid}/bundles/{name}/applications/{assignmentId}")
              .header("X-API-Key", "$API_KEY")
              .header("Content-Type", "application/json")
              .asString();
  /esims/{iccid}/bundles/{name}/assignments/{assignmentId}:
    delete:
      summary: Revoke specific Bundle
      description: |
        This endpoint revokes a specific bundle from an eSIM using assignment ID.

         If a bundle assignment has not been started and no data has been consumed, the bundle assignment can either be returned to the inventory or credited back to the organisations balance. If the bundle assignment has started, or was purchased outside of their permitted refund period, typically 60 days, it cannot be returned to the inventory or taken as a credit.

         **IMPORTANT:** Access to the refund functionality is **disabled by default**. To enable refunds (either to inventory or balance), you must first contact your account manager. Without this feature enabled, this endpoint will only revoke the bundle assignment **without a refund**.
         
        **Note:** Bundle names are case sensitive and should be typed like the following "esim_1GB_7D_IM_U".
      tags:
        - eSIMs
      parameters:
        - name: Accept
          in: header
          schema:
            type: string
          example: application/json
        - name: type
          in: query
          schema:
            type: string
          description: type `validate` will provide options for the revoke and the behaviours, if any. type `transaction` will execute the revoke. Defaults to `transaction`
          example: validate
        - name: refundToBalance
          in: query
          schema:
            type: boolean
          description: If Applicable, refund the value of this bundle to organisation balance
          example: true
        - name: iccid
          in: path
          schema:
            type: string
          required: true
          description: (Required) The ICCID of the eSIM
          example: 8943108165016100000
        - name: name
          in: path
          schema:
            type: string
          required: true
          description: |
            (Required) Name of Bundle Format as defined in [List Catalogue](/api/#get-/catalogue) API call. Example: `esim_1GB_7D_REUP_V2`
          example: esim_1GB_7D_REUP_V2
        - name: assignmentId
          in: path
          schema:
            type: string
          required: true
          description: (Required) ID of individual Bundle Assignment to revoke from an eSIM. You can find Assigment ID by querying “Get applied Bundle status” endpoint.
          example: 123231231
      security:
        - apiKeyAuth: []
      responses:
        "200":
          description: OK
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StatusMessage"
              example:
                status: Successfully Revoked Bundle, bundle has been refunded to inventory
        "400":
          description: Bad Request - returned when request format is not accepted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "403":
          description: Unauthorised - returned when the api token is invalid; the user does not have any available Bundles left or the ICCID is not accessible by the user
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "429":
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "500":
          description: Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "503":
          description: Processing - Please come back later or use the *Retry-After* (seconds) header
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
      x-codeSamples:
        - lang: shell
          label: cURL
          source: |-
            curl -g -X DELETE 'https://api.esim-go.com/v2.5/esims/{iccid}/bundles/{name}/assignments/{assignmentId}' \
            -H 'X-API-Key: $API_KEY' \
            -H 'Content-Type: application/json'
        - lang: javascript
          label: Node
          source: |
            const axios = require('axios');

            let config = {
              method: 'delete',
              maxBodyLength: Infinity,
              url: 'https://api.esim-go.com/v2.5/esims/{iccid}/bundles/{name}/assignments/{assignmentId}',
              headers: { 
                'X-API-Key': '$API_KEY', 
                'Content-Type': 'application/json'
              }
            };

            axios.request(config)
            .then((response) => {
              console.log(JSON.stringify(response.data));
            })
            .catch((error) => {
              console.log(error);
            });
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "fmt"
              "net/http"
              "io"
            )

            func main() {

              url := "https://api.esim-go.com/v2.5/esims/{iccid}/bundles/{name}/assignments/{assignmentId}"
              method := "DELETE"

              client := &http.Client {
              }
              req, err := http.NewRequest(method, url, nil)

              if err != nil {
                fmt.Println(err)
                return
              }
              req.Header.Add("X-API-Key", "$API_KEY")
              req.Header.Add("Content-Type", "application/json")

              res, err := client.Do(req)
              if err != nil {
                fmt.Println(err)
                return
              }
              defer res.Body.Close()

              body, err := io.ReadAll(res.Body)
              if err != nil {
                fmt.Println(err)
                return
              }
              fmt.Println(string(body))
            }
        - lang: python
          label: Python
          source: |
            import requests
            import json

            url = "https://api.esim-go.com/v2.5/esims/{iccid}/bundles/{name}/assignments/{assignmentId}"

            payload = {}
            headers = {
              'X-API-Key': '$API_KEY',
              'Content-Type': 'application/json'
            }

            response = requests.request("DELETE", url, headers=headers, data=payload)

            print(response.text)
        - lang: csharp
          label: C#
          source: |
            var client = new HttpClient();
            var request = new HttpRequestMessage(HttpMethod.Delete, "https://api.esim-go.com/v2.5/esims/{iccid}/bundles/{name}/assignments/{assignmentId}");
            request.Headers.Add("X-API-Key", "$API_KEY");
            var content = new StringContent(string.Empty);
            content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
            request.Content = content;
            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            Console.WriteLine(await response.Content.ReadAsStringAsync());
        - lang: java
          label: Java
          source: |
            Unirest.setTimeouts(0, 0);
            HttpResponse<String> response = Unirest.delete("https://api.esim-go.com/v2.5/esims/{iccid}/bundles/{name}/assignments/{assignmentId}")
              .header("X-API-Key", "$API_KEY")
              .header("Content-Type", "application/json")
              .asString();
  "/esims/{iccid}/suspend":
    post:
      summary: Suspend or unsuspend an eSIM
      description: |
        This endpoint allows you to suspend or unsuspend an eSIM using its ICCID.

        When an eSIM is suspended, it will not be able to connect to the network. This can be useful for temporarily disabling an eSIM without revoking it entirely.

        To suspend an eSIM, set `suspend` to `true`. To unsuspend an eSIM, set `suspend` to `false`.
      tags:
        - eSIMs
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: Accept
          in: header
          schema:
            type: string
          example: application/json
        - name: iccid
          in: path
          schema:
            type: string
          required: true
          description: (Required) The ICCID of the eSIM
          example: 8944123456789012000
      security:
        - apiKeyAuth: []
      requestBody:
        description: Suspend or unsuspend the eSIM
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SuspendESIMBody"
            example:
              suspend: true
      responses:
        "201":
          description: Suspend status set successfully
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StatusMessage"
              example:
                status: eSIM suspended successfully
        "400":
          description: Bad Request - returned when request format is not accepted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "403":
          description: Unauthorised - returned when the api token is invalid or the ICCID is not accessible by the user
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "429":
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "500":
          description: Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
      x-codeSamples:
        - lang: shell
          label: cURL
          source: |-
            curl -g -X POST 'https://api.esim-go.com/v2.5/esims/{iccid}/suspend' \
            -H 'X-API-Key: $API_KEY' \
            -H 'Content-Type: application/json' \
            -d '{"suspend": true}'
        - lang: javascript
          label: Node
          source: |
            const axios = require('axios');
            let data = JSON.stringify({
              "suspend": true
            });

            let config = {
              method: 'post',
              maxBodyLength: Infinity,
              url: 'https://api.esim-go.com/v2.5/esims/{iccid}/suspend',
              headers: {
                'X-API-Key': '$API_KEY',
                'Content-Type': 'application/json'
              },
              data : data
            };

            axios.request(config)
            .then((response) => {
              console.log(JSON.stringify(response.data));
            })
            .catch((error) => {
              console.log(error);
            });
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "fmt"
              "strings"
              "net/http"
              "io"
            )

            func main() {

              url := "https://api.esim-go.com/v2.5/esims/{iccid}/suspend"
              method := "POST"

              payload := strings.NewReader(`{"suspend": true}`)

              client := &http.Client {
              }
              req, err := http.NewRequest(method, url, payload)

              if err != nil {
                fmt.Println(err)
                return
              }
              req.Header.Add("X-API-Key", "$API_KEY")
              req.Header.Add("Content-Type", "application/json")

              res, err := client.Do(req)
              if err != nil {
                fmt.Println(err)
                return
              }
              defer res.Body.Close()

              body, err := io.ReadAll(res.Body)
              if err != nil {
                fmt.Println(err)
                return
              }
              fmt.Println(string(body))
            }
        - lang: python
          label: Python
          source: |
            import requests
            import json

            url = "https://api.esim-go.com/v2.5/esims/{iccid}/suspend"

            payload = json.dumps({
              "suspend": True
            })
            headers = {
              'X-API-Key': '$API_KEY',
              'Content-Type': 'application/json'
            }

            response = requests.request("POST", url, headers=headers, data=payload)

            print(response.text)
        - lang: csharp
          label: C#
          source: |
            var client = new HttpClient();
            var request = new HttpRequestMessage(HttpMethod.Post, "https://api.esim-go.com/v2.5/esims/{iccid}/suspend");
            request.Headers.Add("X-API-Key", "$API_KEY");
            var content = new StringContent("{\"suspend\": true}", null, "application/json");
            request.Content = content;
            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            Console.WriteLine(await response.Content.ReadAsStringAsync());
        - lang: java
          label: Java
          source: |
            Unirest.setTimeouts(0, 0);
            HttpResponse<String> response = Unirest.post("https://api.esim-go.com/v2.5/esims/{iccid}/suspend")
              .header("X-API-Key", "$API_KEY")
              .header("Content-Type", "application/json")
              .body("{\"suspend\": true}")
              .asString();
  /organisation:
    get:
      summary: Get Current Organisation Details
      description: This endpoint allows you to retrieve comprehensive information about your organisation, including details of all associated users.
      tags:
        - Organisation
      security:
        - apiKeyAuth: []
      responses:
        "200":
          description: OK
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OrganisationResponse"
        "400":
          description: Bad Request - returned when request format is not accepted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "403":
          description: Unauthorised - returned when the api token is invalid; the user does not have any available Bundles left or the ICCID is not accessible by the user
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "429":
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "500":
          description: Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "503":
          description: Processing - Please come back later or use the *Retry-After* (seconds) header
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
      parameters:
        - name: Accept
          in: header
          schema:
            type: string
          example: application/json
      x-codeSamples:
        - lang: shell
          label: cURL
          source: |-
            curl 'https://api.esim-go.com/v2.5/organisation' \
            -H 'X-API-Key: $API_KEY' \
            -H 'Content-Type: application/json'
        - lang: javascript
          label: Node
          source: |
            const axios = require('axios');

            let config = {
              method: 'get',
              maxBodyLength: Infinity,
              url: 'https://api.esim-go.com/v2.5/organisation',
              headers: { 
                'X-API-Key': '$API_KEY', 
                'Content-Type': 'application/json'
              }
            };

            axios.request(config)
            .then((response) => {
              console.log(JSON.stringify(response.data));
            })
            .catch((error) => {
              console.log(error);
            });
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "fmt"
              "net/http"
              "io"
            )

            func main() {

              url := "https://api.esim-go.com/v2.5/organisation"
              method := "GET"

              client := &http.Client {
              }
              req, err := http.NewRequest(method, url, nil)

              if err != nil {
                fmt.Println(err)
                return
              }
              req.Header.Add("X-API-Key", "$API_KEY")
              req.Header.Add("Content-Type", "application/json")

              res, err := client.Do(req)
              if err != nil {
                fmt.Println(err)
                return
              }
              defer res.Body.Close()

              body, err := io.ReadAll(res.Body)
              if err != nil {
                fmt.Println(err)
                return
              }
              fmt.Println(string(body))
            }
        - lang: python
          label: Python
          source: |
            import requests
            import json

            url = "https://api.esim-go.com/v2.5/organisation"

            payload = {}
            headers = {
              'X-API-Key': '$API_KEY',
              'Content-Type': 'application/json'
            }

            response = requests.request("GET", url, headers=headers, data=payload)

            print(response.text)
        - lang: csharp
          label: C#
          source: |
            var client = new HttpClient();
            var request = new HttpRequestMessage(HttpMethod.Get, "https://api.esim-go.com/v2.5/organisation");
            request.Headers.Add("X-API-Key", "$API_KEY");
            var content = new StringContent(string.Empty);
            content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
            request.Content = content;
            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            Console.WriteLine(await response.Content.ReadAsStringAsync());
        - lang: java
          label: Java
          source: |
            Unirest.setTimeouts(0, 0);
            HttpResponse<String> response = Unirest.get("https://api.esim-go.com/v2.5/organisation")
              .header("X-API-Key", "$API_KEY")
              .header("Content-Type", "application/json")
              .asString();
  /organisation/balance:
    post:
      summary: Topup Organisation Balance
      description: |
        Update the pre-payed balance held by your organisation. Initial payment is done using the Portal: https://portal.esim-go.com/. This will store your card details for future use. Follow up payments can be done using the API.

         Note: The minimum top-up amount is $1000 and the maximum daily top-up is set at $5000. If you wish to raise or lower this amount, please contact your account manager.
      tags:
        - Organisation
      parameters:
        - name: Accept
          in: header
          schema:
            type: string
          example: application/json
        - name: amount
          in: query
          schema:
            type: string
          description: (Required) The amount of to be charged to the saved card
          example: 1000
      security:
        - apiKeyAuth: []
      responses:
        "200":
          description: OK
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TopupResponse"
        "400":
          description: Bad Request - returned when request format is not accepted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "403":
          description: Unauthorised - returned when the api token is invalid; the user does not have any available Bundles left or the ICCID is not accessible by the user
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "429":
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "500":
          description: Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "503":
          description: Processing - Please come back later or use the *Retry-After* (seconds) header
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
      requestBody:
        content: {}
      x-codeSamples:
        - lang: shell
          label: cURL
          source: |-
            curl -X POST 'https://api.esim-go.com/v2.5/organisation/balance' \
            -H 'X-API-Key: $API_KEY' \
            -H 'Content-Type: application/json'
        - lang: javascript
          label: Node
          source: |
            const axios = require('axios');
            let config = {
              method: 'post',
              maxBodyLength: Infinity,
              url: 'https://api.esim-go.com/v2.5/organisation/balance',
              headers: { 
                'X-API-Key': '$API_KEY', 
                'Content-Type': 'application/json'
              }
            };

            axios.request(config)
            .then((response) => {
              console.log(JSON.stringify(response.data));
            })
            .catch((error) => {
              console.log(error);
            });
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "fmt"
              "net/http"
              "io"
            )

            func main() {

              url := "https://api.esim-go.com/v2.5/organisation/balance"
              method := "POST"

              client := &http.Client {
              }
              req, err := http.NewRequest(method, url, nil)

              if err != nil {
                fmt.Println(err)
                return
              }
              req.Header.Add("X-API-Key", "$API_KEY")
              req.Header.Add("Content-Type", "application/json")

              res, err := client.Do(req)
              if err != nil {
                fmt.Println(err)
                return
              }
              defer res.Body.Close()

              body, err := io.ReadAll(res.Body)
              if err != nil {
                fmt.Println(err)
                return
              }
              fmt.Println(string(body))
            }
        - lang: python
          label: Python
          source: |
            import requests
            import json

            url = "https://api.esim-go.com/v2.5/organisation/balance"

            payload = {}
            headers = {
              'X-API-Key': '$API_KEY',
              'Content-Type': 'application/json'
            }

            response = requests.request("POST", url, headers=headers, data=payload)

            print(response.text)
        - lang: csharp
          label: C#
          source: |
            var client = new HttpClient();
            var request = new HttpRequestMessage(HttpMethod.Post, "https://api.esim-go.com/v2.5/organisation/balance");
            request.Headers.Add("X-API-Key", "$API_KEY");
            var content = new StringContent(string.Empty);
            content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
            request.Content = content;
            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            Console.WriteLine(await response.Content.ReadAsStringAsync());
        - lang: java
          label: Java
          source: |
            Unirest.setTimeouts(0, 0);
            HttpResponse<String> response = Unirest.post("https://api.esim-go.com/v2.5/organisation/balance")
              .header("X-API-Key", "$API_KEY")
              .header("Content-Type", "application/json")
              .asString();
  /orders:
    get:
      summary: List orders
      description: |
        Get details on all previous orders, including total cost and contents. Response data is paginated.
      tags:
        - Orders
      parameters:
        - name: Accept
          in: header
          schema:
            type: string
          example: application/json
        - name: includeIccids
          in: query
          schema:
            type: boolean
          description: |
            Set to true to include eSIM data (ICCID, Matching ID and SMDP Address) in the response, and an ICCIDs array.
          example: "true"
        - name: page
          in: query
          schema:
            type: integer
          description: |
            Page number to return.
          example: "1"
        - name: limit
          in: query
          schema:
            type: integer
          description: |
            Number of results to return per page.
          example: "10"
        - name: createdAt
          in: query
          schema:
            type: string
          description: |
            Specifies the date range for filtering orders. This parameter has a 'lte:' prefix to specify the end date. For example, to query orders from March 1, 2024, to March 31, 2024, use the following format: `createdAt=gte:2024-03-01T00:00:00.000Z&createdAt=lte:2024-03-31T23:59:59.999Z`.
          example: <dateTime>
      security:
        - apiKeyAuth: []
      responses:
        "200":
          description: OK
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OrderResponseTransaction"
        "400":
          description: Bad Request - returned when request format is not accepted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "403":
          description: Unauthorised - returned when the api token is invalid; the user does not have any available Bundles left or the ICCID is not accessible by the user
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "429":
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "500":
          description: Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "503":
          description: Processing - Please come back later or use the *Retry-After* (seconds) header
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
      x-codeSamples:
        - lang: shell
          label: cURL
          source: |-
            curl 'https://api.esim-go.com/v2.5/orders' \
            -H 'X-API-Key: $API_KEY' \
            -H 'Content-Type: application/json'
        - lang: javascript
          label: Node
          source: |
            const axios = require('axios');

            let config = {
              method: 'get',
              maxBodyLength: Infinity,
              url: 'https://api.esim-go.com/v2.5/orders',
              headers: { 
                'X-API-Key': '$API_KEY', 
                'Content-Type': 'application/json'
              }
            };

            axios.request(config)
            .then((response) => {
              console.log(JSON.stringify(response.data));
            })
            .catch((error) => {
              console.log(error);
            });
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "fmt"
              "net/http"
              "io"
            )

            func main() {

              url := "https://api.esim-go.com/v2.5/orders"
              method := "GET"

              client := &http.Client {
              }
              req, err := http.NewRequest(method, url, nil)

              if err != nil {
                fmt.Println(err)
                return
              }
              req.Header.Add("X-API-Key", "$API_KEY")
              req.Header.Add("Content-Type", "application/json")

              res, err := client.Do(req)
              if err != nil {
                fmt.Println(err)
                return
              }
              defer res.Body.Close()

              body, err := io.ReadAll(res.Body)
              if err != nil {
                fmt.Println(err)
                return
              }
              fmt.Println(string(body))
            }
        - lang: python
          label: Python
          source: |
            import requests
            import json

            url = "https://api.esim-go.com/v2.5/orders"

            payload = {}
            headers = {
              'X-API-Key': '$API_KEY',
              'Content-Type': 'application/json'
            }

            response = requests.request("GET", url, headers=headers, data=payload)

            print(response.text)
        - lang: csharp
          label: C#
          source: |
            var client = new HttpClient();
            var request = new HttpRequestMessage(HttpMethod.Get, "https://api.esim-go.com/v2.5/orders");
            request.Headers.Add("X-API-Key", "$API_KEY");
            var content = new StringContent(string.Empty);
            content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
            request.Content = content;
            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            Console.WriteLine(await response.Content.ReadAsStringAsync());
        - lang: java
          label: Java
          source: |
            Unirest.setTimeouts(0, 0);
            HttpResponse<String> response = Unirest.get("https://api.esim-go.com/v2.5/orders")
              .header("X-API-Key", "$API_KEY")
              .header("Content-Type", "application/json")
              .asString();
    post:
      summary: Create orders
      description: |
        Orders can be validated and processed using this endpoint.

        Total will be deducted from your Organisation's balance.

        ## Auto-assign

        By specifying ICCID(s) of eSIM(s) belonging to your Organisation and setting 'assign' to true, a bundle can be automatically assigned to eSIM(s).

        If specified ICCID(s) of eSIM(s) and the specified bundle(s) are not
        compatible, and ‘allowReassign’ set to true, the bundle(s) will be
        assigned to new ICCID(s).

        Bundle assignments to an eSIM are usually instant but please allow forup to 10 minutes for the bundle to fully process. While the bundle is processing the eSIM can be successfully installed and the eSIM will register onto a network if within coverage.

        The Bundle Status can be checked through [Get the Status of a bundle assigned to an eSIM](/api/v2_4/operations/esimsiccidbundlesname/get/)

        ## Branding Profile ID:

        This is optional and only used if you have multiple branding profiles. It allows you to generate an eSIM with a specific branding profile instead of the default (first) one. To find the Profile ID:

        1. Log in to your portal account

        2. Navigate to "eSIM Branding"

        3. Locate the desired branding profile

        4. Note the Profile ID associated with it

        If not specified, the default (first) branding profile will be used.

        ## Usage:

        - eSIM ICCIDs can only be specified if assign is set to true
        - If assign is set to true, but no ICCIDs are provided, bundles are
          assigned to new eSIMs
        - If ICCIDs are provided, quantity is required to match the number of
          ICCIDs for each bundle
        - If quantity is specified and assign is set to false, the quantity of
          that bundle is purchased into inventory
        - If new bundles and specified eSIM ICCIDs are not compatible and
        ‘allowReassign’ set to true, bundles will be assigned to new ICCIDs
        - To use profile id ensure that assign is set to true
      tags:
        - Orders
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/OrderRequest"
            example:
              type: transaction
              assign: true
              order:
                - type: bundle
                  quantity: 3
                  item: esim_10GB_30D_IM_U
                  allowReassign: false
                - type: bundle
                  quantity: 5
                  item: esim_10GB_30D_IM_U
                  iccids:
                    - "8901234567890123456"
                    - "8901234567890123457"
                  allowReassign: true
      security:
        - apiKeyAuth: []
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/OrderResponseValidate"
                  - $ref: "#/components/schemas/OrderResponseTransaction"
              examples:
                validateResponse:
                  summary: Example of a validation response
                  value:
                    $ref: "#/components/schemas/OrderResponseValidate/example"
                transactionResponse:
                  summary: Example of a transaction response
                  value:
                    $ref: "#/components/schemas/OrderResponseTransaction/example"
        "400":
          description: Bad Request
          content:
            text/plain:
              schema:
                $ref: "#/components/schemas/Message"
              example: ""
        "401":
          description: Unauthorized
          content:
            text/plain:
              schema:
                $ref: "#/components/schemas/Message"
              example: ""
        "503":
          description: Service Unavailable
          content:
            text/plain:
              schema:
                $ref: "#/components/schemas/Message"
              example: ""
      x-codeSamples:
        - lang: shell
          label: cURL
          source: |-
            curl 'https://api.esim-go.com/v2.5/orders' \
            -H 'X-API-Key: $API_KEY' \
            -H 'Content-Type: application/json' \
            -d '{"$ref":"#/components/schemas/OrderRequest"}'
        - lang: javascript
          label: Node
          source: |
            const axios = require('axios');
            let data = JSON.stringify({
              "$ref": "#/components/schemas/OrderRequest"
            });

            let config = {
              method: 'post',
              maxBodyLength: Infinity,
              url: 'https://api.esim-go.com/v2.5/orders',
              headers: { 
                'X-API-Key': '$API_KEY', 
                'Content-Type': 'application/json'
              },
              data : data
            };

            axios.request(config)
            .then((response) => {
              console.log(JSON.stringify(response.data));
            })
            .catch((error) => {
              console.log(error);
            });
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "fmt"
              "strings"
              "net/http"
              "io"
            )

            func main() {

              url := "https://api.esim-go.com/v2.5/orders"
              method := "POST"

              payload := strings.NewReader(`{"$ref":"#/components/schemas/OrderRequest"}`)

              client := &http.Client {
              }
              req, err := http.NewRequest(method, url, payload)

              if err != nil {
                fmt.Println(err)
                return
              }
              req.Header.Add("X-API-Key", "$API_KEY")
              req.Header.Add("Content-Type", "application/json")

              res, err := client.Do(req)
              if err != nil {
                fmt.Println(err)
                return
              }
              defer res.Body.Close()

              body, err := io.ReadAll(res.Body)
              if err != nil {
                fmt.Println(err)
                return
              }
              fmt.Println(string(body))
            }
        - lang: python
          label: Python
          source: |
            import requests
            import json

            url = "https://api.esim-go.com/v2.5/orders"

            payload = json.dumps({
              "$ref": "#/components/schemas/OrderRequest"
            })
            headers = {
              'X-API-Key': '$API_KEY',
              'Content-Type': 'application/json'
            }

            response = requests.request("POST", url, headers=headers, data=payload)

            print(response.text)
        - lang: csharp
          label: C#
          source: |
            var client = new HttpClient();
            var request = new HttpRequestMessage(HttpMethod.Post, "https://api.esim-go.com/v2.5/orders");
            request.Headers.Add("X-API-Key", "$API_KEY");
            var content = new StringContent("{\"$ref\":\"#/components/schemas/OrderRequest\"}", null, "application/json");
            request.Content = content;
            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            Console.WriteLine(await response.Content.ReadAsStringAsync());
        - lang: java
          label: Java
          source: |
            Unirest.setTimeouts(0, 0);
            HttpResponse<String> response = Unirest.post("https://api.esim-go.com/v2.5/orders")
              .header("X-API-Key", "$API_KEY")
              .header("Content-Type", "application/json")
              .body("{\"$ref\":\"#/components/schemas/OrderRequest\"}")
              .asString();
  /orders/{orderReference}:
    get:
      summary: Get order detail
      description: |
        Get details on an order, including total cost and contents
      tags:
        - Orders
      parameters:
        - name: Accept
          in: header
          schema:
            type: string
          example: application/json
        - name: orderReference
          in: path
          schema:
            type: string
          required: true
          description: (Required) Reference for your order
          example: <string>
      security:
        - apiKeyAuth: []
      responses:
        "200":
          description: OK
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OrderResponseTransaction"
              example:
                order:
                  - esims:
                      - iccid: "8912345678901234567"
                        matchingId: AB-12C3DE-4FGHIJ5
                        smdpAddress: http://rsp.mockprovider.com
                    type: bundle
                    item: esim_5GB_30D_EU_V3
                    iccids:
                      - "8912345678901234567"
                    quantity: 1
                    subTotal: 9.99
                    pricePerUnit: 9.99
                    AllowReassign: true
                total: 9.99
                currency: USD
                status: completed
                statusMessage: "Order completed: 1 eSIMs assigned"
                orderReference: 1a2b3c4d-5e6f-7g8h-9i10-11j12k13l14m
                createdDate: "2023-06-15T10:30:45.123456789Z"
                assigned: true
        "400":
          description: Bad Request - returned when request format is not accepted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "403":
          description: Unauthorised - returned when the api token is invalid; the user does not have any available Bundles left or the ICCID is not accessible by the user
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "429":
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "500":
          description: Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "503":
          description: Processing - Please come back later or use the *Retry-After* (seconds) header
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
      x-codeSamples:
        - lang: shell
          label: cURL
          source: |-
            curl -g 'https://api.esim-go.com/v2.5/orders/{orderReference}' \
            -H 'X-API-Key: $API_KEY' \
            -H 'Content-Type: application/json'
        - lang: javascript
          label: Node
          source: |
            const axios = require('axios');

            let config = {
              method: 'get',
              maxBodyLength: Infinity,
              url: 'https://api.esim-go.com/v2.5/orders/{orderReference}',
              headers: { 
                'X-API-Key': '$API_KEY', 
                'Content-Type': 'application/json'
              }
            };

            axios.request(config)
            .then((response) => {
              console.log(JSON.stringify(response.data));
            })
            .catch((error) => {
              console.log(error);
            });
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "fmt"
              "net/http"
              "io"
            )

            func main() {

              url := "https://api.esim-go.com/v2.5/orders/{orderReference}"
              method := "GET"

              client := &http.Client {
              }
              req, err := http.NewRequest(method, url, nil)

              if err != nil {
                fmt.Println(err)
                return
              }
              req.Header.Add("X-API-Key", "$API_KEY")
              req.Header.Add("Content-Type", "application/json")

              res, err := client.Do(req)
              if err != nil {
                fmt.Println(err)
                return
              }
              defer res.Body.Close()

              body, err := io.ReadAll(res.Body)
              if err != nil {
                fmt.Println(err)
                return
              }
              fmt.Println(string(body))
            }
        - lang: python
          label: Python
          source: |
            import requests
            import json

            url = "https://api.esim-go.com/v2.5/orders/{orderReference}"

            payload = {}
            headers = {
              'X-API-Key': '$API_KEY',
              'Content-Type': 'application/json'
            }

            response = requests.request("GET", url, headers=headers, data=payload)

            print(response.text)
        - lang: csharp
          label: C#
          source: |
            var client = new HttpClient();
            var request = new HttpRequestMessage(HttpMethod.Get, "https://api.esim-go.com/v2.5/orders/{orderReference}");
            request.Headers.Add("X-API-Key", "$API_KEY");
            var content = new StringContent(string.Empty);
            content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
            request.Content = content;
            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            Console.WriteLine(await response.Content.ReadAsStringAsync());
        - lang: java
          label: Java
          source: |
            Unirest.setTimeouts(0, 0);
            HttpResponse<String> response = Unirest.get("https://api.esim-go.com/v2.5/orders/{orderReference}")
              .header("X-API-Key", "$API_KEY")
              .header("Content-Type", "application/json")
              .asString();
  /inventory:
    get:
      summary: Get bundle inventory
      description: |
        All of your Organisation's currently purchased Bundles and their remaining usages.
      tags:
        - Inventory
      security:
        - apiKeyAuth: []
      responses:
        "200":
          description: OK
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/InventoryResponse"
        "400":
          description: Bad Request - returned when request format is not accepted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "403":
          description: Unauthorised - returned when the api token is invalid; the user does not have any available Bundles left or the ICCID is not accessible by the user
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "429":
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "500":
          description: Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "503":
          description: Processing - Please come back later or use the *Retry-After* (seconds) header
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
      parameters:
        - name: Accept
          in: header
          schema:
            type: string
          example: application/json
      x-codeSamples:
        - lang: shell
          label: cURL
          source: |-
            curl 'https://api.esim-go.com/v2.5/inventory' \
            -H 'X-API-Key: $API_KEY' \
            -H 'Content-Type: application/json'
        - lang: javascript
          label: Node
          source: |
            const axios = require('axios');

            let config = {
              method: 'get',
              maxBodyLength: Infinity,
              url: 'https://api.esim-go.com/v2.5/inventory',
              headers: { 
                'X-API-Key': '$API_KEY', 
                'Content-Type': 'application/json'
              }
            };

            axios.request(config)
            .then((response) => {
              console.log(JSON.stringify(response.data));
            })
            .catch((error) => {
              console.log(error);
            });
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "fmt"
              "net/http"
              "io"
            )

            func main() {

              url := "https://api.esim-go.com/v2.5/inventory"
              method := "GET"

              client := &http.Client {
              }
              req, err := http.NewRequest(method, url, nil)

              if err != nil {
                fmt.Println(err)
                return
              }
              req.Header.Add("X-API-Key", "$API_KEY")
              req.Header.Add("Content-Type", "application/json")

              res, err := client.Do(req)
              if err != nil {
                fmt.Println(err)
                return
              }
              defer res.Body.Close()

              body, err := io.ReadAll(res.Body)
              if err != nil {
                fmt.Println(err)
                return
              }
              fmt.Println(string(body))
            }
        - lang: python
          label: Python
          source: |
            import requests
            import json

            url = "https://api.esim-go.com/v2.5/inventory"

            payload = {}
            headers = {
              'X-API-Key': '$API_KEY',
              'Content-Type': 'application/json'
            }

            response = requests.request("GET", url, headers=headers, data=payload)

            print(response.text)
        - lang: csharp
          label: C#
          source: |
            var client = new HttpClient();
            var request = new HttpRequestMessage(HttpMethod.Get, "https://api.esim-go.com/v2.5/inventory");
            request.Headers.Add("X-API-Key", "$API_KEY");
            var content = new StringContent(string.Empty);
            content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
            request.Content = content;
            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            Console.WriteLine(await response.Content.ReadAsStringAsync());
        - lang: java
          label: Java
          source: |
            Unirest.setTimeouts(0, 0);
            HttpResponse<String> response = Unirest.get("https://api.esim-go.com/v2.5/inventory")
              .header("X-API-Key", "$API_KEY")
              .header("Content-Type", "application/json")
              .asString();
  /inventory/refund:
    post:
      summary: Refund bundle from inventory
      description: |
        Refunds an item in the inventory to the organisations balance.


        Takes a usageId and a quantity.


        The usageId's can be found by querying the /inventory endpoint.


        The quantity of a refund cannot exceed the remaining quantity left for the specific usageId. If you wish to refund multiple usageId's, multiple calls to this endpoint will need to be done. 
         

        If the bundle was purchased outside of their permitted refund period, typically 60 days, it cannot be refunded.


        **IMPORTANT:** Access to the refund functionality is **disabled by default**. To enable refunds, you must first contact your account manager.
      tags:
        - Inventory
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RefundInventoryItem"
      responses:
        "200":
          description: OK
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StatusMessage"
              example:
                status: Successfully refunded bundles to balance
        "400":
          description: Bad Request - returned when request format is not accepted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "403":
          description: Unauthorised - returned when the api token is invalid; the user does not have any available Bundles left or the ICCID is not accessible by the user
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "429":
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "500":
          description: Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "503":
          description: Processing - Please come back later or use the *Retry-After* (seconds) header
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: Accept
          in: header
          schema:
            type: string
          example: application/json
      x-codeSamples:
        - lang: shell
          label: cURL
          source: |-
            curl 'https://api.esim-go.com/v2.5/inventory/refund' \
            -H 'X-API-Key: $API_KEY' \
            -H 'Content-Type: application/json' \
            -d '{"$ref":"#/components/schemas/RefundInventoryItem"}'
        - lang: javascript
          label: Node
          source: |
            const axios = require('axios');
            let data = JSON.stringify({
              "$ref": "#/components/schemas/RefundInventoryItem"
            });

            let config = {
              method: 'post',
              maxBodyLength: Infinity,
              url: 'https://api.esim-go.com/v2.5/inventory/refund',
              headers: { 
                'X-API-Key': '$API_KEY', 
                'Content-Type': 'application/json'
              },
              data : data
            };

            axios.request(config)
            .then((response) => {
              console.log(JSON.stringify(response.data));
            })
            .catch((error) => {
              console.log(error);
            });
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "fmt"
              "strings"
              "net/http"
              "io"
            )

            func main() {

              url := "https://api.esim-go.com/v2.5/inventory/refund"
              method := "POST"

              payload := strings.NewReader(`{"$ref":"#/components/schemas/RefundInventoryItem"}`)

              client := &http.Client {
              }
              req, err := http.NewRequest(method, url, payload)

              if err != nil {
                fmt.Println(err)
                return
              }
              req.Header.Add("X-API-Key", "$API_KEY")
              req.Header.Add("Content-Type", "application/json")

              res, err := client.Do(req)
              if err != nil {
                fmt.Println(err)
                return
              }
              defer res.Body.Close()

              body, err := io.ReadAll(res.Body)
              if err != nil {
                fmt.Println(err)
                return
              }
              fmt.Println(string(body))
            }
        - lang: python
          label: Python
          source: |
            import requests
            import json

            url = "https://api.esim-go.com/v2.5/inventory/refund"

            payload = json.dumps({
              "$ref": "#/components/schemas/RefundInventoryItem"
            })
            headers = {
              'X-API-Key': '$API_KEY',
              'Content-Type': 'application/json'
            }

            response = requests.request("POST", url, headers=headers, data=payload)

            print(response.text)
        - lang: csharp
          label: C#
          source: |
            var client = new HttpClient();
            var request = new HttpRequestMessage(HttpMethod.Post, "https://api.esim-go.com/v2.5/inventory/refund");
            request.Headers.Add("X-API-Key", "$API_KEY");
            var content = new StringContent("{\"$ref\":\"#/components/schemas/RefundInventoryItem\"}", null, "application/json");
            request.Content = content;
            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            Console.WriteLine(await response.Content.ReadAsStringAsync());
        - lang: java
          label: Java
          source: |
            Unirest.setTimeouts(0, 0);
            HttpResponse<String> response = Unirest.post("https://api.esim-go.com/v2.5/inventory/refund")
              .header("X-API-Key", "$API_KEY")
              .header("Content-Type", "application/json")
              .body("{\"$ref\":\"#/components/schemas/RefundInventoryItem\"}")
              .asString();
  /organisation/groups:
    get:
      summary: Get Bundle Groups
      description: |
        This endpoint returns a list of the groups of Bundles available for your Organisation to order. Bundles in eSIM Go are categorised into groups.

         Name of the bundle group depends on your account tier. In the example below you will find the groups description for **standard** organisation tier.

         Standard Fixed
         * All these bundles are for a finite and fixed amount of data.
         * eg. the moniker for a Standard Fixed Turkey 1GB 7 Days bundle is esim_1GB_7D_TR_V2

         Standard Long Duration
         * All these bundles are for a finite and fixed amount of data.
         * eg. the moniker for a Standard 50GB 90 Days Long Duration Bundle is esim_50GB_90D_RGBS_V2

         Standard Unlimited Lite
         * These bundles will provide 1GB of unthrottled data every 24 hours, once this is depleted data will be throttled to 512kbps. This repeats each day for the duration of the bundle.
         * eg. the moniker for a Standard Unlimited Lite Turkey 1 day bundle is esim_UL_1D_TR_V2

         Standard Unlimited Essential
         * These bundles will provide 1GB of unthrottled data every 24 hours, once this is depleted data will be throttled to 1.25mbps. This repeats each day for the duration of the bundle.
         * eg. the moniker for a Standard Unlimited Lite Turkey 1 day bundle is esim_ULE_1D_TR_V2

         Standard Unlimited Plus
         * These bundles will provide 2GB of unthrottled data every 24 hours, once this is depleted data will be throttled to 2mbps. This repeats each day for the duration of the bundle.
         * eg. the moniker for a Standard Unlimited Plus Turkey 1 day bundle is esim_ULP_1D_TR_V2
      tags:
        - Organisation
      security:
        - apiKeyAuth: []
      responses:
        "200":
          description: OK
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BundleGroupList"
              example:
                groups:
                  - name: Standard Fixed Bundles
                  - name: Standard Unlimited Bundles
        "400":
          description: Bad Request - returned when request format is not accepted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "403":
          description: Unauthorised - returned when the api token is invalid; the user does not have any available Bundles left or the ICCID is not accessible by the user
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "429":
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "500":
          description: Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "503":
          description: Processing - Please come back later or use the *Retry-After* (seconds) header
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
      parameters:
        - name: Accept
          in: header
          schema:
            type: string
          example: application/json
      x-codeSamples:
        - lang: shell
          label: cURL
          source: |-
            curl 'https://api.esim-go.com/v2.5/organisation/groups' \
            -H 'X-API-Key: $API_KEY' \
            -H 'Content-Type: application/json'
        - lang: javascript
          label: Node
          source: |
            const axios = require('axios');

            let config = {
              method: 'get',
              maxBodyLength: Infinity,
              url: 'https://api.esim-go.com/v2.5/organisation/groups',
              headers: { 
                'X-API-Key': '$API_KEY', 
                'Content-Type': 'application/json'
              }
            };

            axios.request(config)
            .then((response) => {
              console.log(JSON.stringify(response.data));
            })
            .catch((error) => {
              console.log(error);
            });
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "fmt"
              "net/http"
              "io"
            )

            func main() {

              url := "https://api.esim-go.com/v2.5/organisation/groups"
              method := "GET"

              client := &http.Client {
              }
              req, err := http.NewRequest(method, url, nil)

              if err != nil {
                fmt.Println(err)
                return
              }
              req.Header.Add("X-API-Key", "$API_KEY")
              req.Header.Add("Content-Type", "application/json")

              res, err := client.Do(req)
              if err != nil {
                fmt.Println(err)
                return
              }
              defer res.Body.Close()

              body, err := io.ReadAll(res.Body)
              if err != nil {
                fmt.Println(err)
                return
              }
              fmt.Println(string(body))
            }
        - lang: python
          label: Python
          source: |
            import requests
            import json

            url = "https://api.esim-go.com/v2.5/organisation/groups"

            payload = {}
            headers = {
              'X-API-Key': '$API_KEY',
              'Content-Type': 'application/json'
            }

            response = requests.request("GET", url, headers=headers, data=payload)

            print(response.text)
        - lang: csharp
          label: C#
          source: |
            var client = new HttpClient();
            var request = new HttpRequestMessage(HttpMethod.Get, "https://api.esim-go.com/v2.5/organisation/groups");
            request.Headers.Add("X-API-Key", "$API_KEY");
            var content = new StringContent(string.Empty);
            content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
            request.Content = content;
            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            Console.WriteLine(await response.Content.ReadAsStringAsync());
        - lang: java
          label: Java
          source: |
            Unirest.setTimeouts(0, 0);
            HttpResponse<String> response = Unirest.get("https://api.esim-go.com/v2.5/organisation/groups")
              .header("X-API-Key", "$API_KEY")
              .header("Content-Type", "application/json")
              .asString();
  /catalogue:
    get:
      summary: Get Bundle catalogue
      description: |
        List all Bundles available to your Organisation for ordering.
        Bundle names can be used with the `/orders` endpoint to place an order.

          **Filters**
            
          When applying filters to the catalogue endpoint, we recommend that you use the following steps:

          *Group*
          
            The group filter will ensure that the response received only contains bundles from the group you are targeting. eg. Standard Fixed

          *Country*
            
            The country filter uses ISO codes, which are readily available in the rate sheet that is sent out periodically. eg. Turkey = TR, United Arab Emirates = AE.

          *Region*
            
            The region filter uses region names to retrieve all bundles that are available for a given region.


         **Please note:** When querying the catalogue the response should be saved for later use to keep in line with the Technical Service Agreement - Platform services - "Frequent and consistent polling of services is not allowed, we respectfully request our customers and partners to only make requests when information or data is required."
      tags:
        - Catalogue
      parameters:
        - name: Accept
          in: header
          schema:
            type: string
          example: application/json
        - name: page
          in: query
          schema:
            type: integer
            example: "1"
          description: Page of Bundles to return
        - name: perPage
          in: query
          schema:
            type: integer
          description: Number of Bundles to return per page
          example: "50"
        - name: direction
          in: query
          schema:
            type: string
          description: Direction of ordering
          example: asc
        - name: orderBy
          in: query
          schema:
            type: string
          description: Name of column to order by
        - name: description
          in: query
          schema:
            type: string
          description: Wildcard search for description
        - name: group
          in: query
          schema:
            type: string
          description: Filter by Bundle Group (exact value) e.g. `Standard eSIM Bundles`
        - name: countries
          in: query
          schema:
            type: string
          description: Comma-separated list of country ISO codes to filter by. This will search for Bundles that include at least one of the countries as their base country. e.g. `GB, US`
        - name: region
          in: query
          schema:
            type: string
          description: This will return Bundles that have a base country in the specified region. e.g. `Europe`
      security:
        - apiKeyAuth: []
      responses:
        "200":
          description: OK
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CatalogueResponse"
        "400":
          description: Bad Request - returned when request format is not accepted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "403":
          description: Unauthorised - returned when the api token is invalid; the user does not have any available Bundles left or the ICCID is not accessible by the user
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "429":
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "500":
          description: Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "503":
          description: Processing - Please come back later or use the *Retry-After* (seconds) header
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
      x-codeSamples:
        - lang: shell
          label: cURL
          source: |-
            curl 'https://api.esim-go.com/v2.5/catalogue' \
            -H 'X-API-Key: $API_KEY' \
            -H 'Content-Type: application/json'
        - lang: javascript
          label: Node
          source: |
            const axios = require('axios');

            let config = {
              method: 'get',
              maxBodyLength: Infinity,
              url: 'https://api.esim-go.com/v2.5/catalogue',
              headers: { 
                'X-API-Key': '$API_KEY', 
                'Content-Type': 'application/json'
              }
            };

            axios.request(config)
            .then((response) => {
              console.log(JSON.stringify(response.data));
            })
            .catch((error) => {
              console.log(error);
            });
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "fmt"
              "net/http"
              "io"
            )

            func main() {

              url := "https://api.esim-go.com/v2.5/catalogue"
              method := "GET"

              client := &http.Client {
              }
              req, err := http.NewRequest(method, url, nil)

              if err != nil {
                fmt.Println(err)
                return
              }
              req.Header.Add("X-API-Key", "$API_KEY")
              req.Header.Add("Content-Type", "application/json")

              res, err := client.Do(req)
              if err != nil {
                fmt.Println(err)
                return
              }
              defer res.Body.Close()

              body, err := io.ReadAll(res.Body)
              if err != nil {
                fmt.Println(err)
                return
              }
              fmt.Println(string(body))
            }
        - lang: python
          label: Python
          source: |
            import requests
            import json

            url = "https://api.esim-go.com/v2.5/catalogue"

            payload = {}
            headers = {
              'X-API-Key': '$API_KEY',
              'Content-Type': 'application/json'
            }

            response = requests.request("GET", url, headers=headers, data=payload)

            print(response.text)
        - lang: csharp
          label: C#
          source: |
            var client = new HttpClient();
            var request = new HttpRequestMessage(HttpMethod.Get, "https://api.esim-go.com/v2.5/catalogue");
            request.Headers.Add("X-API-Key", "$API_KEY");
            var content = new StringContent(string.Empty);
            content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
            request.Content = content;
            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            Console.WriteLine(await response.Content.ReadAsStringAsync());
        - lang: java
          label: Java
          source: |
            Unirest.setTimeouts(0, 0);
            HttpResponse<String> response = Unirest.get("https://api.esim-go.com/v2.5/catalogue")
              .header("X-API-Key", "$API_KEY")
              .header("Content-Type", "application/json")
              .asString();
  /catalogue/bundle/{name}:
    get:
      summary: Get Bundle details from catalogue
      description: |-
        Get details of a specific Bundle from your Organisation's catalogue.
        **Note:** Bundle names are case sensitive e.g. "esim_1GB_7D_IM_U".
      tags:
        - Catalogue
      security:
        - apiKeyAuth: []
      parameters:
        - name: Accept
          in: header
          schema:
            type: string
          example: application/json
        - name: name
          in: path
          schema:
            type: string
          required: true
          description: (Required) Name of Bundle to get countries for. Bundle names are case sensitive.
      responses:
        "200":
          description: OK
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BundleCatalogueResponse"
        "400":
          description: Bad Request - returned when request format is not accepted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "403":
          description: Unauthorised - returned when the api token is invalid; the user does not have any available Bundles left or the ICCID is not accessible by the user
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "429":
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "500":
          description: Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "503":
          description: Processing - Please come back later or use the *Retry-After* (seconds) header
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
      x-codeSamples:
        - lang: shell
          label: cURL
          source: |-
            curl -g 'https://api.esim-go.com/v2.5/catalogue/bundle/{name}' \
            -H 'X-API-Key: $API_KEY' \
            -H 'Content-Type: application/json'
        - lang: javascript
          label: Node
          source: |
            const axios = require('axios');

            let config = {
              method: 'get',
              maxBodyLength: Infinity,
              url: 'https://api.esim-go.com/v2.5/catalogue/bundle/{name}',
              headers: { 
                'X-API-Key': '$API_KEY', 
                'Content-Type': 'application/json'
              }
            };

            axios.request(config)
            .then((response) => {
              console.log(JSON.stringify(response.data));
            })
            .catch((error) => {
              console.log(error);
            });
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "fmt"
              "net/http"
              "io"
            )

            func main() {

              url := "https://api.esim-go.com/v2.5/catalogue/bundle/{name}"
              method := "GET"

              client := &http.Client {
              }
              req, err := http.NewRequest(method, url, nil)

              if err != nil {
                fmt.Println(err)
                return
              }
              req.Header.Add("X-API-Key", "$API_KEY")
              req.Header.Add("Content-Type", "application/json")

              res, err := client.Do(req)
              if err != nil {
                fmt.Println(err)
                return
              }
              defer res.Body.Close()

              body, err := io.ReadAll(res.Body)
              if err != nil {
                fmt.Println(err)
                return
              }
              fmt.Println(string(body))
            }
        - lang: python
          label: Python
          source: |
            import requests
            import json

            url = "https://api.esim-go.com/v2.5/catalogue/bundle/{name}"

            payload = {}
            headers = {
              'X-API-Key': '$API_KEY',
              'Content-Type': 'application/json'
            }

            response = requests.request("GET", url, headers=headers, data=payload)

            print(response.text)
        - lang: csharp
          label: C#
          source: |
            var client = new HttpClient();
            var request = new HttpRequestMessage(HttpMethod.Get, "https://api.esim-go.com/v2.5/catalogue/bundle/{name}");
            request.Headers.Add("X-API-Key", "$API_KEY");
            var content = new StringContent(string.Empty);
            content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
            request.Content = content;
            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            Console.WriteLine(await response.Content.ReadAsStringAsync());
        - lang: java
          label: Java
          source: |
            Unirest.setTimeouts(0, 0);
            HttpResponse<String> response = Unirest.get("https://api.esim-go.com/v2.5/catalogue/bundle/{name}")
              .header("X-API-Key", "$API_KEY")
              .header("Content-Type", "application/json")
              .asString();
  /catalogue/prices:
    get:
      summary: Consumption - Get Prices
      description: |
        Get current per GB prices for all countries available to your Organisation.
        Prices are grouped by country and include the profile name for each price.
        The response includes a hash that can be used to detect changes in pricing data.

        **Note:** This endpoint is only available to customers that are on Consumption billing.
      tags:
        - Catalogue
      parameters:
        - name: Accept
          in: header
          schema:
            type: string
          example: application/json
      security:
        - apiKeyAuth: []
      responses:
        '200':
          description: OK
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CataloguePricesResponse'
        '400':
          description: Bad Request - returned when request format is not accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Message'
        '403':
          description: >-
            Unauthorised - returned when the api token is invalid or the Organisation is not a Consumption partner
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Message'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Message'
        '500':
          description: Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Message'
      x-codeSamples:
        - lang: shell
          label: cURL
          source: |-
            curl -g 'https://api.esim-go.com/v2.5/catalogue/prices' \
            -H 'X-API-Key: $API_KEY' \
            -H 'Content-Type: application/json'
        - lang: javascript
          label: Node
          source: |
            const axios = require('axios');

            let config = {
              method: 'get',
              maxBodyLength: Infinity,
              url: 'https://api.esim-go.com/v2.5/catalogue/prices',
              headers: {
                'X-API-Key': '$API_KEY',
                'Content-Type': 'application/json'
              }
            };

            axios.request(config)
            .then((response) => {
              console.log(JSON.stringify(response.data));
            })
            .catch((error) => {
              console.log(error);
            });
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "fmt"
              "net/http"
              "io"
            )

            func main() {

              url := "https://api.esim-go.com/v2.5/catalogue/prices"
              method := "GET"

              client := &http.Client {
              }
              req, err := http.NewRequest(method, url, nil)

              if err != nil {
                fmt.Println(err)
                return
              }
              req.Header.Add("X-API-Key", "$API_KEY")
              req.Header.Add("Content-Type", "application/json")

              res, err := client.Do(req)
              if err != nil {
                fmt.Println(err)
                return
              }
              defer res.Body.Close()

              body, err := io.ReadAll(res.Body)
              if err != nil {
                fmt.Println(err)
                return
              }
              fmt.Println(string(body))
            }
        - lang: python
          label: Python
          source: |
            import requests
            import json

            url = "https://api.esim-go.com/v2.5/catalogue/prices"

            payload = {}
            headers = {
              'X-API-Key': '$API_KEY',
              'Content-Type': 'application/json'
            }

            response = requests.request("GET", url, headers=headers, data=payload)

            print(response.text)
        - lang: csharp
          label: C#
          source: |
            var client = new HttpClient();
            var request = new HttpRequestMessage(HttpMethod.Get, "https://api.esim-go.com/v2.5/catalogue/prices");
            request.Headers.Add("X-API-Key", "$API_KEY");
            var content = new StringContent(string.Empty);
            content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
            request.Content = content;
            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            Console.WriteLine(await response.Content.ReadAsStringAsync());
        - lang: java
          label: Java
          source: |
            Unirest.setTimeouts(0, 0);
            HttpResponse<String> response = Unirest.get("https://api.esim-go.com/v2.5/catalogue/prices")
              .header("X-API-Key", "$API_KEY")
              .header("Content-Type", "application/json")
              .asString();
  /esims/{iccid}/location:
    get:
      summary: Get eSIM Location
      description: This endpoint provides the most recent location and associated network operator information for a specified eSIM.
      tags:
        - eSIMs
      security:
        - apiKeyAuth: []
      responses:
        "200":
          description: OK
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LocationResponse"
              example:
                mobileNetworkCode: FRAF1
                networkName: Orange
                networkBrandName: Orange France
                country: FR
                lastSeen: "2024-07-27T00:25:07.382562Z"
        "400":
          description: Bad Request - returned when request format is not accepted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "403":
          description: Unauthorised - returned when the api token is invalid; the user does not have any available Bundles left or the ICCID is not accessible by the user
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "429":
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "500":
          description: Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "503":
          description: Processing - Please come back later or use the *Retry-After* (seconds) header
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
      parameters:
        - name: Accept
          in: header
          schema:
            type: string
          example: application/json
        - name: iccid
          in: path
          schema:
            type: string
          required: true
      x-codeSamples:
        - lang: shell
          label: cURL
          source: |-
            curl -g 'https://api.esim-go.com/v2.5/esims/{iccid}/location' \
            -H 'X-API-Key: $API_KEY' \
            -H 'Content-Type: application/json'
        - lang: javascript
          label: Node
          source: |
            const axios = require('axios');

            let config = {
              method: 'get',
              maxBodyLength: Infinity,
              url: 'https://api.esim-go.com/v2.5/esims/{iccid}/location',
              headers: { 
                'X-API-Key': '$API_KEY', 
                'Content-Type': 'application/json'
              }
            };

            axios.request(config)
            .then((response) => {
              console.log(JSON.stringify(response.data));
            })
            .catch((error) => {
              console.log(error);
            });
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "fmt"
              "net/http"
              "io"
            )

            func main() {

              url := "https://api.esim-go.com/v2.5/esims/{iccid}/location"
              method := "GET"

              client := &http.Client {
              }
              req, err := http.NewRequest(method, url, nil)

              if err != nil {
                fmt.Println(err)
                return
              }
              req.Header.Add("X-API-Key", "$API_KEY")
              req.Header.Add("Content-Type", "application/json")

              res, err := client.Do(req)
              if err != nil {
                fmt.Println(err)
                return
              }
              defer res.Body.Close()

              body, err := io.ReadAll(res.Body)
              if err != nil {
                fmt.Println(err)
                return
              }
              fmt.Println(string(body))
            }
        - lang: python
          label: Python
          source: |
            import requests
            import json

            url = "https://api.esim-go.com/v2.5/esims/{iccid}/location"

            payload = {}
            headers = {
              'X-API-Key': '$API_KEY',
              'Content-Type': 'application/json'
            }

            response = requests.request("GET", url, headers=headers, data=payload)

            print(response.text)
        - lang: csharp
          label: C#
          source: |
            var client = new HttpClient();
            var request = new HttpRequestMessage(HttpMethod.Get, "https://api.esim-go.com/v2.5/esims/{iccid}/location");
            request.Headers.Add("X-API-Key", "$API_KEY");
            var content = new StringContent(string.Empty);
            content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
            request.Content = content;
            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            Console.WriteLine(await response.Content.ReadAsStringAsync());
        - lang: java
          label: Java
          source: |
            Unirest.setTimeouts(0, 0);
            HttpResponse<String> response = Unirest.get("https://api.esim-go.com/v2.5/esims/{iccid}/location")
              .header("X-API-Key", "$API_KEY")
              .header("Content-Type", "application/json")
              .asString();
  /networks:
    get:
      summary: Get Country Network Data
      description: |
        This endpoint is used to return the networks for a country/countries searched for either by an array of countires or ISO codes (ISOs).

         Alternatively, it can be toggled to return all countries and their
        networks.

         Please refer to the rate sheet, availible to download in the eSIM Go
        Management Portal for a full list of country names and ISO codes.
      tags:
        - Networks
      parameters:
        - name: Accept
          in: header
          schema:
            type: string
          example: application/json
        - name: countries
          in: query
          schema:
            type: string
          description: List of Countries e.g. United Kingdom, United States
        - name: isos
          in: query
          schema:
            type: string
          description: List of ISOs e.g. GB, US
        - name: returnAll
          in: query
          schema:
            type: string
          description: Used to toggle returning of all Countries e.g. true/false
          example: true
      security:
        - apiKeyAuth: []
      responses:
        "200":
          description: OK
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NetworkResponse"
        "400":
          description: Bad Request - returned when request format is not accepted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "403":
          description: Unauthorised - returned when the api token is invalid; the user does not have any available Bundles left or the ICCID is not accessible by the user
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "429":
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "500":
          description: Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
        "503":
          description: Processing - Please come back later or use the *Retry-After* (seconds) header
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
      x-codeSamples:
        - lang: shell
          label: cURL
          source: |-
            curl 'https://api.esim-go.com/v2.5/networks' \
            -H 'X-API-Key: $API_KEY' \
            -H 'Content-Type: application/json'
        - lang: javascript
          label: Node
          source: |
            const axios = require('axios');

            let config = {
              method: 'get',
              maxBodyLength: Infinity,
              url: 'https://api.esim-go.com/v2.5/networks',
              headers: { 
                'X-API-Key': '$API_KEY', 
                'Content-Type': 'application/json'
              }
            };

            axios.request(config)
            .then((response) => {
              console.log(JSON.stringify(response.data));
            })
            .catch((error) => {
              console.log(error);
            });
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "fmt"
              "net/http"
              "io"
            )

            func main() {

              url := "https://api.esim-go.com/v2.5/networks"
              method := "GET"

              client := &http.Client {
              }
              req, err := http.NewRequest(method, url, nil)

              if err != nil {
                fmt.Println(err)
                return
              }
              req.Header.Add("X-API-Key", "$API_KEY")
              req.Header.Add("Content-Type", "application/json")

              res, err := client.Do(req)
              if err != nil {
                fmt.Println(err)
                return
              }
              defer res.Body.Close()

              body, err := io.ReadAll(res.Body)
              if err != nil {
                fmt.Println(err)
                return
              }
              fmt.Println(string(body))
            }
        - lang: python
          label: Python
          source: |
            import requests
            import json

            url = "https://api.esim-go.com/v2.5/networks"

            payload = {}
            headers = {
              'X-API-Key': '$API_KEY',
              'Content-Type': 'application/json'
            }

            response = requests.request("GET", url, headers=headers, data=payload)

            print(response.text)
        - lang: csharp
          label: C#
          source: |
            var client = new HttpClient();
            var request = new HttpRequestMessage(HttpMethod.Get, "https://api.esim-go.com/v2.5/networks");
            request.Headers.Add("X-API-Key", "$API_KEY");
            var content = new StringContent(string.Empty);
            content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
            request.Content = content;
            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            Console.WriteLine(await response.Content.ReadAsStringAsync());
        - lang: java
          label: Java
          source: |
            Unirest.setTimeouts(0, 0);
            HttpResponse<String> response = Unirest.get("https://api.esim-go.com/v2.5/networks")
              .header("X-API-Key", "$API_KEY")
              .header("Content-Type", "application/json")
              .asString();
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      x-displayName: API Key in Header
      description: |
        Your API Key can passed to the eSIMGo API by setting a Header with the key `X-API-Key` in your HTTP call.

        e.g.

        ```
        curl -H 'X-API-Key: $API_KEY' https://api.esim-go.com/v2.3/esims/$ICCID/bundles
        ```
  schemas:
    Details:
      type: array
      items:
        type: string
    Message:
      type: object
      properties:
        message:
          description: status of api functions which do not return data
          type: string
    CataloguePricesResponse:
      type: object
      properties:
        hash:
          type: string
          description: SHA256 hash of the prices data for change detection
          example: "a1b2c3d4e5f6..."
        prices:
          type: array
          items:
            $ref: '#/components/schemas/CataloguePricesByCountry'
    CataloguePricesByCountry:
      type: object
      properties:
        country:
          $ref: '#/components/schemas/CatalogueCountry'
        prices:
          type: array
          items:
            $ref: '#/components/schemas/CataloguePrice'
    CataloguePrice:
      type: object
      properties:
        id:
          type: string
          format: uuid
        price:
          type: string
        currency:
          type: string
        profile:
          type: string
          description: The profile name for this price
        country:
          $ref: '#/components/schemas/CatalogueCountry'
    CatalogueCountry:
      type: object
      properties:
        iso:
          type: string
        name:
          type: string
    Assignments:
      type: array
      items:
        type: object
        properties:
          iccid:
            description: ICCID of ESIM
            type: string
          matchingId:
            description: The activation code from installing the eSIM
            type: string
          rspUrl:
            description: SMDP+ Address
            type: url
          bundle:
            description: The bundle name
            type: string
          reference:
            description: Assignment/Order reference
            type: string
    StatusResponse:
      type: object
      required:
        - iccid
        - profileStatus
      properties:
        iccid:
          description: The ICCID of the eSIM
          type: string
        msisdn:
          description: The MSISDN of the eSIM. This only available on eSIMs with a Domestic Bundle applied (i.e. Voice and/or SMS)
          type: string
        matchingId:
          description: Activation Code for eSIM
          type: string
        smdpAddress:
          description: The SMDP+ Address of the eSIM
          type: string
        profileStatus:
          description: The status of the eSIM profile
          type: string
          enum:
            - Released
            - Downloaded
            - Installed
            - Unavailable
            - Deactivated
        pin:
          description: The PIN of the eSIM
          type: string
        puk:
          description: The PUK of the eSIM
          type: string
        firstInstalledDateTime:
          description: First install date and time (UTC in Milliseconds)
          type: string
          format: date-time
    BundleAssignment:
      description: An individual assignment of a bundle to an eSIM
      type: object
      properties:
        id:
          description: id of the assignment
          type: string
        callTypeGroup:
          description: Call Type Group of the assignment
          type: string
        initialQuantity:
          description: The initial quantity the assignment had
          type: integer
          format: float
          deprecated: true
        remainingQuantity:
          description: The remaining quantity the assignment has
          type: integer
          format: float
          deprecated: true
        startTime:
          type: string
          format: date-time
          description: |
            The time the assignment started (utc string)

            Format as defined in [RFC 3339, section 5.6](https://tools.ietf.org/html/rfc3339#section-5.6). Timezone is UTC (ends with 'Z').
            Example: `2006-01-02T15:04:05Z`
        endTime:
          type: string
          format: date-time
          description: |
            The time the assignment ended (utc string, can be empty if assignment has no endTime)

            Format as defined in [RFC 3339, section 5.6](https://tools.ietf.org/html/rfc3339#section-5.6). Timezone is UTC (ends with 'Z').
            Example: `2006-01-02T15:04:05Z`
        bundleState:
          type: string
          enum:
            - processing
            - queued
            - active
            - depleted
            - expired
            - revoked
          description: |
            Current state of a bundle. Supported: `processing`,`queued`, `active`, `depleted`, `expired`, `revoked`
        assignmentDateTime:
          type: string
          format: date-time
          description: |
            The time the assignment was created (utc string)

            Format as defined in [RFC 3339, section 5.6](https://tools.ietf.org/html/rfc3339#section-5.6). Timezone is UTC (ends with 'Z').
            Example: `2006-01-02T15:04:05Z`
        assignmentReference:
          description: Assignment reference
          type: string
        unlimited:
          description: If the bundle is unlimited
          type: boolean
          deprecated: true
        allowances:
          description: The allowances of the bundle
          type: array
          items:
            type: object
            properties:
              type:
                description: The type of allowance
                type: string
                enum:
                  - DATA
                  - VOICE
                  - SMS
              service:
                description: The service of the allowance, this defines where the allowance can be used
                type: string
                enum:
                  - STANDARD
                  - ROAMING
              description:
                description: The description of the allowance
                type: string
              initialAmount:
                description: The initial amount of the allowance
                type: integer
                format: float
              remainingAmount:
                description: The remaining amount of the allowance
                type: integer
                format: float
              unit:
                description: The unit of the allowance
                type: string
                enum:
                  - BYTES
                  - SMS
                  - MINS
              unlimited:
                description: If the allowance is unlimited
                type: boolean
    BundleStatusResponse:
      type: object
      properties:
        assignments:
          type: array
          items:
            $ref: "#/components/schemas/BundleAssignment"
    AllBundleStatusResponse:
      type: object
      properties:
        bundles:
          type: array
          items:
            type: object
            properties:
              name:
                description: The name of the Bundle
                type: string
              assignments:
                type: array
                items:
                  $ref: "#/components/schemas/BundleAssignment"
    ESIMs:
      type: object
      properties:
        esims:
          type: array
          items:
            type: object
            properties:
              iccid:
                description: ICCID of ESIM
                type: string
              customerRef:
                description: Reference of ESIM
                type: string
              msisdn:
                description: MSISDN of ESIM. This only available on eSIMs with a Domestic Bundle applied (i.e. Voice and/or SMS)
                type: string
              lastAction:
                description: Last action performed on the ESIM (e.g. Bundle Applied)
                type: string
              actionDate:
                description: The date of the Last Action performed on the ESIM
                type: string
              physical:
                description: Type of SIM
                type: boolean
              assignedDate:
                description: The date of ESIM's first assignment
                type: string
              state:
                description: The current state of the eSIM
                type: string
                enum:
                  - active
                  - suspended
                  - deactivated
    ApplyBundleWithList:
      type: object
      properties:
        bundles:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                description: Name of Bundle to apply
              repeat:
                description: How many eSIMs will be assigned with this bundle applied (if left empty Bundle will assign to one eSIM)
                type: integer
              allowReassign:
                description: Allow a new eSIM to be provided if the bundle is not compatible with the eSIM profile
                type: boolean
            required:
              - name
      required:
        - bundles
    ApplyBundleWithICCIDRequest:
      type: object
      properties:
        iccid:
          type: string
          description: ICCID of target eSIM to apply Bundle to. If not provided, a new eSIM will be assigned to you.
        name:
          type: string
          description: Name of Bundle to apply
        repeat:
          description: How many eSIMs will be assigned with this bundle applied (if left empty Bundle will assign to one eSIM)
          type: integer
        allowReassign:
          description: Allow a new eSIM to be provided if the bundle is not compatible with the eSIM profile
          type: boolean
      required:
        - name
    ApplyBundleRequest:
      type: object
      properties:
        name:
          type: string
          description: Name of Bundle to apply
          required: true
        startTime:
          description: |
            When the Bundle should start (if left empty, Bundle will start immediately)

            **Note:** This is only applicable to bundles with `autostart=false`
          type: string
        repeat:
          description: How many times the bundle will be applied (if left empty Bundle will apply once)
          type: integer
    CreateOrderRequest:
      type: object
      properties:
        type:
          type: string
          description: Order type
          required: true
          enum:
            - validate
            - transaction
        assign:
          type: boolean
          description: Whether to assign the Bundles to eSIMs straight after a successful order
        Order:
          type: array
          items:
            type: object
            properties:
              type:
                description: Item Type
                type: string
                required: true
                enum:
                  - bundle
              quantity:
                type: integer
                description: The number of the specific item to buy
                required: true
              item:
                description: Item name
                type: string
                required: true
              iccids:
                description: ICCIDs of eSIMs to apply bundle to
                type: array
                items:
                  type: string
                required: false
              allowReassign:
                description: Allow a new eSIM to be provided if the bundle is not compatible with the eSIM profile
                type: boolean
                required: false
    ApplyBundleResponse:
      type: object
      properties:
        status:
          description: Status of Bundle
          type: string
    ESIMApplyResponse:
      type: object
      properties:
        esims:
          type: array
          items:
            type: object
            properties:
              iccid:
                description: Newly assigned eSIM ICCID
                type: string
              status:
                description: Status of Bundle
                type: string
              bundle:
                description: Name of bundle applied
                type: string
        applyReference:
          type: string
          description: Apply Reference
    RevokeBundleResponse:
      type: object
      properties:
        status:
          description: Status of Bundle
          type: string
    TopupResponse:
      type: object
      properties:
        amount:
          type: integer
          description: The amount of the topup
          example: 5000
        balance:
          type: integer
          description: The current balance after the topup
          example: 12500
        ref:
          type: integer
          description: A reference number for the topup transaction
          example: 987654321
    OrganisationResponse:
      type: object
      properties:
        name:
          type: string
          example: Acme Corp
          description: Name of organisation
        apiKey:
          type: string
          example: ak_1234567890abcdef
          description: API Key
        taxLiable:
          type: string
          example: "Yes"
          description: If the organisation is tax liable
        addr1:
          type: string
          example: 123 Main St
          description: Address line 1
        addr2:
          type: string
          example: Suite 456
          description: Address line 2
        city:
          type: string
          example: Metropolis
          description: City
        country:
          type: string
          example: USA
          description: Country
        postcode:
          type: string
          example: "12345"
          description: Postal Code
        callbackUrl:
          type: string
          example: https://api.acmecorp.com/callback
          description: Callback URL
        notes:
          type: string
          example: Premium customer
          description: Notes attached to organisation
        groups:
          type: array
          items:
            type: string
          example:
            - Enterprise
            - Tech
          description: Groups an organisation assigned to
        currency:
          type: string
          example: USD
          description: Selected currency
        balance:
          type: integer
          example: 10000
          description: Organisational balance + test credit
        testCredit:
          type: integer
          example: 500
          description: Organisational test credit
        testCreditExpiry:
          type: string
          format: date
          example: "2023-12-31"
          description: Organisational test credit expiry date
        businessType:
          type: string
          example: Corporation
          description: Business type
        website:
          type: string
          example: https://www.acmecorp.com
          description: Website
        productDescription:
          type: string
          example: Cloud computing services
          description: Product Description
        users:
          type: array
          items:
            type: object
            properties:
              firstName:
                type: string
                example: John
                description: User first name
              lastName:
                type: string
                example: Doe
                description: User last name
              role:
                type: string
                example: Admin
                description: User role
              emailAddress:
                type: string
                example: "{EMAIL}"
                description: Email address (login)
              phoneNumber:
                type: string
                example: +1 (555) 123-4567
                description: Phone number
              timeZone:
                type: string
                example: America/New_York
                description: User Time Zone
    CatalogueBundlesResponse:
      type: array
      items:
        type: object
        properties:
          name:
            description: Bundle Name
            type: string
          description:
            description: Bundle Description
            type: string
          groups:
            description: Bundle Groups
            type: array
            items:
              type: string
          countries:
            type: array
            items:
              type: object
              properties:
                name:
                  description: Country name
                  type: string
                region:
                  description: Country region
                  type: string
                iso:
                  description: Country iso
                  type: string
          dataAmount:
            description: Data Amount (MB)
            type: integer
            deprecated: true
          duration:
            description: Duration
            type: integer
          speed:
            description: Bundle speed
            type: array
            items:
              type: string
          autostart:
            description: If the bundle auto starts
            type: boolean
          unlimited:
            description: If the bundle is unlimited
            type: boolean
            deprecated: true
          roamingEnabled:
            type: array
            items:
              type: object
              properties:
                name:
                  description: Country name
                  type: string
                region:
                  description: Country region
                  type: string
                iso:
                  description: Country iso
                  type: string
          price:
            description: Bundle price in the organisation currency
            type: integer
          allowances:
            description: The allowances of the bundle
            type: array
            items:
              type: object
              properties:
                type:
                  description: The type of allowance
                  type: string
                  enum:
                    - DATA
                    - VOICE
                    - SMS
                service:
                  description: The service of the allowance, this defines where the allowance can be used
                  type: string
                  enum:
                    - STANDARD
                    - ROAMING
                description:
                  description: The description of the allowance
                  type: string
                amount:
                  description: The amount of the allowance
                  type: integer
                  format: float
                unit:
                  description: The unit of the allowance
                  type: string
                  enum:
                    - MB
                    - SMS
                    - MINS
                unlimited:
                  description: If the allowance is unlimited
                  type: boolean
    CatalogueBundleResponse:
      type: object
      properties:
        name:
          description: Bundle Name
          type: string
        description:
          description: Bundle Description
          type: string
        countries:
          type: array
          items:
            type: object
            properties:
              name:
                description: Country name
                type: string
              region:
                description: Country region
                type: string
              iso:
                description: Country iso
                type: string
        dataAmount:
          description: Data Amount (MB)
          type: integer
          deprecated: true
        duration:
          description: Duration
          type: integer
        speed:
          description: Bundle speed
          type: array
          items:
            type: string
        autostart:
          description: If the bundle auto starts
          type: boolean
        unlimited:
          description: If the bundle is unlimited
          type: boolean
          deprecated: true
        roamingEnabled:
          type: array
          items:
            type: object
            properties:
              name:
                description: Country name
                type: string
              region:
                description: Country region
                type: string
              iso:
                description: Country iso
                type: string
        price:
          description: Bundle price in the organisation currency
          type: integer
        allowances:
          description: The allowances of the bundle
          type: array
          items:
            type: object
            properties:
              type:
                description: The type of allowance
                type: string
                enum:
                  - DATA
                  - VOICE
                  - SMS
              service:
                description: The service of the allowance, this defines where the allowance can be used
                type: string
                enum:
                  - STANDARD
                  - ROAMING
              description:
                description: The description of the allowance
                type: string
              amount:
                description: The amount of the allowance
                type: integer
                format: float
              unit:
                description: The unit of the allowance
                type: string
                enum:
                  - MB
                  - SMS
                  - MINS
              unlimited:
                description: If the allowance is unlimited
                type: boolean
    OrdersResponse:
      type: array
      items:
        type: object
        properties:
          order:
            description: Items within the order
            type: array
            items:
              type: object
              properties:
                type:
                  description: |
                    item type. Supported: `bundle`,`autoTopup`, `apiTopup`, `topup``
                  type: string
                item:
                  description: item name. This is the Bundle name when `type = "bundle"`
                  type: string
                quantity:
                  description: quantity of item
                  type: integer
                subTotal:
                  description: item Subtotal
                  type: integer
                pricePerUnit:
                  description: Price per Item
                  type: integer
                invoiceLink:
                  description: Topup Invoice Link
                  type: string
          total:
            description: Order total
            type: integer
          currency:
            description: Order currency
            type: string
          status:
            description: Status of the order
            type: string
          statusMessage:
            description: Order status message
            type: string
          orderReference:
            description: Order Reference
            type: string
          createDate:
            description: |
              Date/Time of order creation

              Format as defined in [RFC 3339, section 5.6](https://tools.ietf.org/html/rfc3339#section-5.6). Timezone is UTC (ends with 'Z').
              Example: `2006-01-02T15:04:05Z`
            type: string
    OrganisationGroups:
      type: array
      items:
        type: object
        properties:
          name:
            description: Group Name
            type: string
    SimLocation:
      type: object
      properties:
        mobileNetworkCode:
          description: Mobile Network Code
          type: string
        networkName:
          description: Network Name
          type: string
        country:
          description: Country
          type: string
        lastSeen:
          description: Last seen time
          type: string
    OrderResponse:
      type: object
      properties:
        order:
          description: Items within the order
          type: array
          items:
            type: object
            properties:
              type:
                description: item type
                type: string
              item:
                description: item name
                type: string
              quantity:
                description: quantity of item
                type: integer
              subTotal:
                description: item Subtotal
                type: integer
              pricePerUnit:
                description: Price per Item
                type: integer
        total:
          description: Order total
          type: integer
        currency:
          description: Order currency
          type: string
        status:
          description: Status of the order
          type: string
        statusMessage:
          description: Order status message
          type: string
        orderReference:
          description: Order Reference
          type: string
        createDate:
          description: Date/Time of order creation
          type: string
    SimHistoryResponse:
      type: array
      items:
        type: object
        properties:
          name:
            description: Action Name
            type: string
          bundle:
            description: Bundle Name
            type: string
          date:
            description: |
              Action Date

              Format as defined in [RFC 3339, section 5.6](https://tools.ietf.org/html/rfc3339#section-5.6). Timezone is UTC (ends with 'Z').
              Example: `2006-01-02T15:04:05Z`
            type: string
          bundleState:
            type: string
            description: |
              Current state of a bundle. Supported: `processing`,`queued`, `active`, `depleted`, `expired`, `revoked`
          alertType:
            description: The type of alert (If applicable) e.g. 1% Used, 50% Used
            type: string
    UserBundlesResponse:
      type: object
      properties:
        bundles:
          description: The available bundles in the Organisation inventory
          type: array
          items:
            type: object
            properties:
              name:
                description: Bundle name
                type: string
              desc:
                description: Bundle description
                type: string
              available:
                description: The availability of the bundle
                type: array
                items:
                  type: object
                  properties:
                    id:
                      description: The usage id
                      type: integer
                    total:
                      description: Total bundle quantity in order
                      type: integer
                    remaining:
                      description: The number of uses left
                      type: integer
                    expiry:
                      description: When the uses expire
                      type: string
              countries:
                description: Bundle description
                type: array
                items:
                  type: string
              data:
                description: Data amount in MB
                type: integer
              duration:
                description: Duration amount
                type: integer
              durationUnit:
                description: Duration unit
                type: string
              autostart:
                description: Whether the bundle auto starts
                type: boolean
              unlimited:
                description: Whether the bundle is unlimited
                type: boolean
              speed:
                description: Array of speeds of bundle
                type: array
                items:
                  type: string
    UpdateSimDetails:
      type: object
      properties:
        iccid:
          type: string
          description: ICCID of eSIM
        customerRef:
          type: string
          description: New Customer Reference
    RefundInventoryItem:
      type: object
      properties:
        usageId:
          type: integer
          description: The usage id for the refund. Can be found by querying "Get bundle inventory" endpoint
        quantity:
          type: integer
          description: The quantity of the refund
    UsageCallbackV2:
      title: V2 Body
      type: object
      properties:
        iccid:
          type: string
          description: Your eSIM ICCID value
        alertType:
          type: string
          description: Type of callback alert
        bundle:
          type: object
          properties:
            name:
              type: string
              description: Name of Bundle applied to eSIM
            initialQuantity:
              type: integer
              format: float
              description: Starting quantity of data supplied by Bundle (in Bytes)
            remainingQuantity:
              type: integer
              format: float
              description: Remaining quantity of data (in Bytes)
            startTime:
              type: string
              format: date-time
              description: |
                Start time of Bundle.

                Format as defined in [RFC 3339, section 5.6](https://tools.ietf.org/html/rfc3339#section-5.6). Timezone is UTC (ends with 'Z').
                Example: `2006-01-02T15:04:05Z`
            endTime:
              type: string
              format: date-time
              description: |
                End time of Bundle.

                Format as defined in [RFC 3339, section 5.6](https://tools.ietf.org/html/rfc3339#section-5.6). Timezone is UTC (ends with 'Z').
                Example: `2007-01-02T15:04:05Z`
    UsageCallbackV3:
      title: V3 Body
      type: object
      properties:
        iccid:
          type: string
          description: Your eSIM ICCID value
        alertType:
          type: string
          description: Type of callback alert
        bundle:
          type: object
          properties:
            id:
              type: string
              description: ID of the Bundle assignment; used for removing single assignment of a Bundle from an eSIM
            reference:
              type: string
              description: Reference of the Bundle assignment; this can be used with Assignment endpoint https://docs.esim-go.com/api/#get-/esims/assignments
            name:
              type: string
              description: Name of Bundle applied to eSIM
            description:
              type: string
              description: Description of Bundle applied to eSIM
            initialQuantity:
              type: integer
              format: float
              description: Starting quantity of data supplied by Bundle (in Bytes)
            remainingQuantity:
              type: integer
              format: float
              description: Remaining quantity of data (in Bytes)
            startTime:
              type: string
              format: date-time
              description: |
                Start time of Bundle.

                Format as defined in [RFC 3339, section 5.6](https://tools.ietf.org/html/rfc3339#section-5.6). Timezone is UTC (ends with 'Z').
                Example: `2006-01-02T15:04:05Z`
            endTime:
              type: string
              format: date-time
              description: |
                End time of Bundle.

                Format as defined in [RFC 3339, section 5.6](https://tools.ietf.org/html/rfc3339#section-5.6). Timezone is UTC (ends with 'Z').
                Example: `2007-01-02T15:04:05Z`
            unlimited:
              type: boolean
              description: Whether the bundle is unlimited
    NetworksResponse:
      type: array
      items:
        type: object
        properties:
          countryNetworks:
            description: Array of Networks for Countries Searched
            type: array
            items:
              type: CountryNetworks
              properties:
                name:
                  description: Name of Country
                  type: string
                networks:
                  description: Array of Networks for a Country
                  type: Network
                  properties:
                    name:
                      description: Name of Network
                      type: string
                    mcc:
                      description: Mobile Country Code
                      type: string
                    mnc:
                      description: Mobile Network Code
                      type: string
                    tagid:
                      description: TAGID of network of country
                      type: string
                    speeds:
                      description: Array of Speeds of Network
                      type: array
                      items:
                        type: string
    EndCustomerOperationsRequest:
      type: object
      properties:
        newName:
          description: The Name for the eSIM
          type: string
    ListNotifications:
      type: object
      properties:
        notifications:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                description: ID of the notification
              content:
                type: string
                description: Text for the notification content
              type:
                type: string
                description: Type of notification level
              createdAt:
                type: string
                description: Notification date and time (UTC in Milliseconds)
                format: date-time
              expiresAt:
                type: string
                description: Expiry date and time (UTC in Milliseconds)
                format: date-time
              hasSeen:
                type: boolean
                description: Wether the user has marked the notification as seen
        pageCount:
          type: integer
          description: The number of pages of notifications
        pageSize:
          type: integer
          description: The number of notifications per page
        rows:
          type: integer
          description: The number of notifications in the response
    OrgNote:
      type: object
      properties:
        id:
          type: string
          description: ID of the note
        text:
          type: string
          description: Text content of the note
        time:
          type: string
          format: date-time
          description: The time the note was created
        author:
          type: string
          description: The user who created the note
        lastEditedAt:
          type: string
          format: date-time
          description: Last edited date and time (UTC in Milliseconds)
        lastEditedBy:
          type: string
          description: The user who edited the note last
        deletedAt:
          type: string
          format: date-time
          description: Delted date and time (UTC in Milliseconds)
        deletedBy:
          type: string
          description: The user who deleted the note
    OrgNotes:
      type: object
      properties:
        notes:
          type: array
          items:
            $ref: "#/components/schemas/OrgNote"
    CreateOrgNote:
      type: object
      properties:
        orgId:
          type: string
        text:
          type: string
    UpdateOrgNote:
      type: object
      properties:
        orgId:
          type: string
        noteId:
          type: string
        text:
          type: string
    UpdateNotification:
      type: object
      properties:
        id:
          type: integer
          description: The ID of the notification to mark as seen
        content:
          type: string
          description: The content of the notification
        expiresAt:
          type: string
          format: date-time
          description: The expiry date and time of the notification
        name:
          type: string
          description: The name of the notification
        severity:
          type: string
          description: The severity of the notification
        type:
          type: string
          description: The type of notification
    CreateNotificationRequest:
      type: object
      properties:
        name:
          type: string
          description: The name of the notification
        content:
          type: string
          description: The content of the notification
        type:
          type: string
          description: The type of notification
        expiresAt:
          type: string
          format: date-time
          description: The expiry date and time of the notification
        severity:
          type: string
          description: The severity of the notification
    CreateNotificationResponse:
      type: object
      properties:
        id:
          type: integer
          description: The ID of the notification
        content:
          type: string
          description: The content of the notification
        type:
          type: string
          description: The type of notification
        expiresAt:
          type: string
          format: date-time
          description: The expiry date and time of the notification
        name:
          type: string
          description: The name of the notification
        severity:
          type: string
          description: The severity of the notification
        createdAt:
          type: string
          format: date-time
          description: The creation date and time of the notification
    PortingOutResponse:
      type: object
      properties:
        pac:
          type: string
          description: |
            The PAC code for the port

            This can be taken by the user to their new provider, to port
            their number in.
    PortingInResponse:
      type: object
      properties:
        portDate:
          type: string
          format: date-time
          description: |
            The date the port will be completed

            Given in the format `YYYY-MM-DD`

            The port will generally be completed at between 8.30pm-9.30pm
            British time.
    BundleAlert:
      type: object
      properties:
        iccid:
          type: string
          description: The ICCID (Integrated Circuit Card Identifier) of the SIM card
        alertType:
          type: string
          description: The type of alert being sent
        bundle:
          type: object
          properties:
            id:
              type: string
              description: Unique identifier for the bundle
            reference:
              type: string
              description: Reference code for the bundle
            name:
              type: string
              description: Name of the bundle
            description:
              type: string
              description: Description of the bundle
            initialQuantity:
              type: integer
              description: The initial quantity the bundle had (in bytes)
            remainingQuantity:
              type: integer
              description: The remaining quantity the bundle had (in bytes)
            startTime:
              type: string
              format: date-time
              description: Start time of the bundle validity
            endTime:
              type: string
              format: date-time
              description: End time of the bundle validity
            unlimited:
              type: boolean
              description: Indicates if the bundle has unlimited usage
    ESIMHistory:
      type: object
      properties:
        name:
          type: string
          description: Bundle Assignment State
        bundleName:
          type: string
          description: Bundle name
        date:
          type: string
          description: Action date and time
    CompatibilityResponse:
      type: object
      properties:
        compatible:
          type: boolean
          description: Indicates whether the item is compatible or not
      required:
        - compatible
    BundlesList:
      type: object
      properties:
        bundles:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                description: Name of the bundle
              description:
                type: string
                description: Description of the bundle (size, validity period, coverage)
              assignments:
                type: array
                items:
                  type: object
                  properties:
                    allowances:
                      description: The allowances of the bundle
                      type: array
                      items:
                        type: object
                        properties:
                          type:
                            description: The type of allowance
                            type: string
                            enum:
                              - DATA
                              - VOICE
                              - SMS
                          service:
                            description: The service of the allowance, this defines where the allowance can be used
                            type: string
                            enum:
                              - STANDARD
                              - ROAMING
                          description:
                            description: The description of the allowance
                            type: string
                          initialAmount:
                            description: The initial amount of the allowance
                            type: integer
                            format: float
                          remainingAmount:
                            description: The remaining amount of the allowance
                            type: integer
                            format: float
                          unit:
                            description: The unit of the allowance
                            type: string
                            enum:
                              - MB
                              - SMS
                              - MINS
                          unlimited:
                            description: If the allowance is unlimited
                            type: boolean
                    id:
                      type: string
                      description: ID of assignment
                    callTypeGroup:
                      type: string
                      description: Type of the bundle
                    initialQuantity:
                      type: integer
                      description: The initial quantity the bundle had (in bytes)
                    remainingQuantity:
                      type: integer
                      description: The remaining quantity the bundle had (in bytes)
                    assignmentDateTime:
                      type: string
                      format: date-time
                      description: The date and time the bundle was created (utc string)
                    assignmentReference:
                      type: string
                      description: Assigment reference
                    bundleState:
                      type: string
                      description: Current state of a bundle
                    startTime:
                      type: string
                      format: date-time
                      description: The date and time the bundle was started (utc string)
                    endTime:
                      type: string
                      format: date-time
                      description: The date and time the bundle ends (utc string)
                    unlimited:
                      type: boolean
                      description: If the bundle is unlimited
    AssignmentResponse:
      type: object
      properties:
        assignments:
          type: array
          items:
            $ref: "#/components/schemas/Assignment"
    Assignment:
      type: object
      properties:
        id:
          type: string
          description: ID of the bundle
        callTypeGroup:
          type: string
          description: Call Type Group of the bundle
        initialQuantity:
          type: integer
          format: int64
          description: The initial quantity the bundle had (in bytes)
        remainingQuantity:
          type: integer
          format: int64
          description: The remaining quantity the bundle has (in bytes)
        assignmentDateTime:
          type: string
          format: date-time
          description: The date and time the bundle was created (utc string)
        assignmentReference:
          type: string
          description: Assigment reference
        bundleState:
          type: string
          description: Current state of a bundle
        startTime:
          type: string
          format: date-time
          description: The date and time the bundle was started (utc string)
        endTime:
          type: string
          format: date-time
          description: The date and time the bundle was ends (utc string)
        unlimited:
          type: boolean
          description: If the bundle is unlimited
        allowances:
          description: The allowances of the bundle
          type: array
          items:
            type: object
            properties:
              type:
                description: The type of allowance
                type: string
                enum:
                  - DATA
                  - VOICE
                  - SMS
              service:
                description: The service of the allowance, this defines where the allowance can be used
                type: string
                enum:
                  - STANDARD
                  - ROAMING
              description:
                description: The description of the allowance
                type: string
              initialAmount:
                description: The initial amount of the allowance
                type: integer
                format: float
              remainingAmount:
                description: The remaining amount of the allowance
                type: integer
                format: float
              unit:
                description: The unit of the allowance
                type: string
                enum:
                  - BYTES
                  - SMS
                  - MINS
              unlimited:
                description: If the allowance is unlimited
                type: boolean
    eSIMDetailsResponse:
      type: object
      properties:
        iccid:
          type: string
          description: The Integrated Circuit Card Identifier of the SIM card
          example: "894123456789123456"
        msisdn:
          type: string
          description: The phone number. Assign only to eSIMs with SMS or voice allowances
          example: 4471234131234
        pin:
          type: string
          description: The Personal Identification Number for the SIM card
          example: "0000"
        puk:
          type: string
          description: The Personal Unblocking Key for the SIM card
          example: "123445678"
        matchingId:
          type: string
          description: A unique identifier for matching purposes (used for eSIM activation)
          example: JQ-123456-ABCDEPFX
        smdpAddress:
          type: string
          description: The Subscription Manager Data Preparation server address (used for eSIM activation)
          example: http://rsp.example.com
        profileStatus:
          type: string
          description: The current status of the SIM profile
          example: Installed
        firstInstalledDateTime:
          type: integer
          format: int64
          description: The timestamp of when the profile was first installed (in milliseconds since epoch)
          example: 1723541877280
        customerRef:
          type: string
          description: Customer reference information
          example: ""
        appleInstallUrl:
          type: string
          description: URL used for eSIM installation for Apple devices with iOS 17.4 and above
          example: "https://esimsetup.apple.com/esim_qrcode_provisioning?carddata=LPA:1$rsp-1234.example.com$ABCD-ABCD-ABCD-ABCD"
        androidInstallUrl:
          type: string
          description: URL used for eSIM installation for Android devices
          example: "https://esimsetup.android.com/esim_qrcode_provisioning?carddata=LPA:1$rsp-1234.example.com$ABCD-ABCD-ABCD-ABCD"
        brandingId:
          type: string
          description: The unique ID of the branding assigned to the eSIM. If the default branding is used, the response will show "(default)"
          example: f616f7g8-ey0d-123d-803d-0214a2f5dafb
        profileName:
          type: string
          description: The eSIM operator's profile name
          example: Profile 1
        state:
          type: string
          description: The current state of the eSIM
          enum:
            - active
            - suspended
            - deactivated
          example: active
    BundleGroupList:
      type: object
      properties:
        groups:
          type: array
          items:
            $ref: "#/components/schemas/BundleGroup"
    BundleGroup:
      type: object
      properties:
        name:
          type: string
          description: Bundle group name
        priceListUrl:
          type: string
          format: uri
          description: URL to download a pricing list for specific bundle group
        desc:
          type: string
          description: Bundle group description
        icon:
          type: string
          format: uri
          description: URL to download a bundle group icon
      required:
        - name
    Order:
      type: object
      properties:
        order:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
              item:
                type: string
              quantity:
                type: integer
              subTotal:
                type: integer
              pricePerUnit:
                type: integer
              invoiceLink:
                type: string
        total:
          type: integer
        currency:
          type: string
        status:
          type: string
        statusMessage:
          type: string
        orderReference:
          type: string
        createDate:
          type: string
    OrderList:
      type: array
      items:
        $ref: "#/components/schemas/Order"
    OrderRequest:
      type: object
      properties:
        type:
          type: string
          enum:
            - validate
            - transaction
        assign:
          type: boolean
          description: To specify if bundle(s) to be assigned to eSIM(s)
        order:
          type: array
          items:
            $ref: "#/components/schemas/BundleOrder"
        profileID:
          type: string
          description: Optional identifier for selecting a specific eSIM branding profile when multiple profiles exist.
    BundleOrder:
      type: object
      properties:
        type:
          type: string
          enum:
            - bundle
        quantity:
          type: integer
          description: Quantity of the bundles to purchase. If you purchase several different bundles, specify the quantity of each item separately.
        item:
          type: string
          description: Name of the bundle
        iccids:
          type: array
          description: ICCID of the eSIM to assign bundle to (quantity of items and number of ICCIDs should match)
          items:
            type: string
        allowReassign:
          type: boolean
          description: Allow a new eSIM to be provided if the bundle is not compatible with the eSIM profile
    OrderResponseValidate:
      type: object
      properties:
        order:
          type: array
          description: Order type [ validate ]
          items:
            type: object
            properties:
              type:
                type: string
                description: Item type [ bundle ]
              item:
                type: string
                description: Name of the bundle
              quantity:
                type: integer
                description: Quantity of items
              subTotal:
                type: number
                format: float
                description: Cost of a bundle multiplied by its quantity
              pricePerUnit:
                type: number
                format: float
                description: Price per each item
              AllowReassign:
                type: boolean
                description: Allow a new eSIM to be provided if the bundle is not compatible with the eSIM profile
        total:
          type: number
          format: float
          description: Total price
        valid:
          type: boolean
          description: Indicates if request is valid
        currency:
          type: string
          description: Currency of the transaction
        createdDate:
          type: string
          format: date-time
          description: Data and time of order creation
        assigned:
          type: boolean
          description: Indicates if bundle was assigned to eSIM
      example:
        order:
          - type: bundle
            item: esim_1GB_7D_AX_V2
            quantity: 1
            subTotal: 2.28
            pricePerUnit: 2.28
            AllowReassign: false
        total: 2.28
        valid: true
        currency: USD
        createdDate: "2025-03-28T14:47:26.153875019Z"
        assigned: true
    OrderResponseTransaction:
      type: object
      properties:
        order:
          type: array
          description: Order type [ transaction ]
          items:
            type: object
            properties:
              esims:
                type: array
                items:
                  type: object
                  properties:
                    iccid:
                      type: string
                      description: ICCID of eSIM new bundle was assigned to
                    matchingId:
                      type: string
                      description: SMDP+ ID (used in eSIM activation)
                    smdpAddress:
                      type: string
                      description: SMDP+ Address (used in eSIM activation)
              type:
                type: string
                description: Item type [ bundle ]
              item:
                type: string
                description: Name of the bundle
              iccids:
                type: array
                description: ICCID of eSIM new bundle was assigned to
                items:
                  type: string
              quantity:
                type: integer
                description: Quantity of items
              subTotal:
                type: number
                format: float
                description: Cost of a bundle multiplied by its quantity
              pricePerUnit:
                type: number
                format: float
                description: Price per each item
              AllowReassign:
                type: boolean
                description: Allow a new eSIM to be provided if the bundle is not compatible with the eSIM profile
        total:
          type: number
          format: float
          description: Total price
        currency:
          type: string
          description: Currency of the transaction
        status:
          type: string
          description: Status of the order
        statusMessage:
          type: string
          description: Status message
        orderReference:
          type: string
          description: Order reference
        createdDate:
          type: string
          format: date-time
          description: Data and time of order creation
        assigned:
          type: boolean
          description: Indicates if bundle was assigned to eSIM
        sourceIP:
          type: string
          description: Source IP of the order
        runningBalance:
          type: string
          description: Current balance at a time when the order was placed
      example:
        order:
          - type: bundle
            item: esim_data_plan_2
            quantity: 1
            subTotal: 9.99
            pricePerUnit: 9.99
            AllowReassign: false
            esims:
              - iccid: "8900000000000000001"
                matchingId: MATCH-001
                smdpAddress: http://smdp.example.com
            iccids:
              - "8900000000000000001"
        total: 9.99
        currency: USD
        status: completed
        statusMessage: "Order completed: 1 eSIM assigned"
        orderReference: order-ref-002
        createdDate: "2023-06-14T15:45:00Z"
        assigned: true
    eSIMDetailsInstallResponse:
      type: object
      properties:
        iccid:
          type: string
          description: The ICCID (Integrated Circuit Card Identifier) of the eSIM
          example: "8944123456789012345"
        matchingId:
          type: string
          description: The matching ID for the eSIM profile
          example: A1B2-C3D4-E5F6-G7H8
        smdpAddress:
          type: string
          description: The address of the Subscription Manager Data Preparation (SM-DP+) server
          example: http://smdp.example.com
        profileStatus:
          type: string
          description: The current status of the eSIM profile
          example: Released
        pin:
          type: string
          description: The PIN (Personal Identification Number) for the eSIM
          example: "1234"
        puk:
          type: string
          description: The PUK (PIN Unlock Key) for the eSIM
          example: "12345678"
        firstInstalledDateTime:
          type: string
          format: date-time
          description: The date and time when the profile was first installed
          example: "2023-06-15T14:30:00.000Z"
    LocationResponse:
      type: object
      properties:
        mobileNetworkCode:
          type: string
          example: FRAF1
          description: Mobile Network Code
        networkName:
          type: string
          example: Orange
          description: Mobile network name
        networkBrandName:
          type: string
          example: Orange France
          description: Mobile network brand name
        country:
          type: string
          example: FR
          description: Country
        lastSeen:
          type: string
          format: date-time
          example: "2024-07-27T00:25:07.382562Z"
          description: Last seen date and time
    InventoryResponse:
      type: object
      properties:
        bundles:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                description: The name of the bundle
              desc:
                type: string
                description: A description of the bundle
              useDms:
                type: boolean
                description: Indicates if DMS is used
              available:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: integer
                      description: The ID of the available bundle
                    total:
                      type: integer
                      description: The total number of bundles
                    remaining:
                      type: integer
                      description: The remaining number of bundles
                    expiry:
                      type: string
                      format: date
                      description: The expiry date of the bundle
              countries:
                type: array
                items:
                  type: string
                description: List of countries where the bundle is valid
              data:
                type: integer
                description: The amount of data in MB
              duration:
                type: integer
                description: The duration of the bundle
              durationUnit:
                type: string
                enum:
                  - day
                  - month
                description: The unit of duration (day or month)
              autostart:
                type: boolean
                description: Indicates if the bundle autostarts
              unlimited:
                type: boolean
                description: Indicates if the bundle has unlimited data
              speed:
                type: array
                items:
                  type: string
                nullable: true
                description: The supported network speeds
              allowances:
                type: array
                items:
                  type: object
                  properties:
                    type:
                      type: string
                      description: Type of allowances (DATA, SMS, VOICE)
                    service:
                      type: string
                      description: Service (Roaming, Standard)
                    description:
                      type: string
                      description: Allowance description
                    amount:
                      type: integer
                      description: The amount of units
                    unit:
                      type: string
                      description: MB/MINS/SMS
                    unlimited:
                      type: boolean
                      description: Indicates if the allowance is unlimited
    CatalogueResponse:
      type: array
      items:
        type: object
        properties:
          name:
            type: string
            description: Bundle Name
          description:
            type: string
            description: Bundle Description
          groups:
            type: array
            description: Bundle Group
            items:
              type: string
          countries:
            type: array
            items:
              type: object
              properties:
                name:
                  type: string
                  description: Country name
                region:
                  type: string
                  description: Country region
                iso:
                  type: string
                  description: Country ISO (internationally recognized means of identifying countries)
          dataAmount:
            type: integer
            description: Data Amount (MB)
          duration:
            type: integer
            description: Bundle Duration
          speed:
            type: array
            description: Bundle Speed
            items:
              type: string
          autostart:
            type: boolean
            description: If the bundle auto starts
          unlimited:
            type: boolean
            description: If the bundle is unlimited
          roamingEnabled:
            type: array
            items:
              type: object
              properties:
                name:
                  type: string
                  description: Country name
                region:
                  type: string
                  description: Country region
                iso:
                  type: string
                  description: Country ISO (internationally recognized means of identifying countries)
          price:
            type: integer
            description: Bundle price in the organisation currency
          billingType:
            type: string
            description: Billing type of the Bundle
            enum:
              - FixedCost
          profileName:
            type: string
            description: The bundle operator's profile name
            example: Profile 1
          allowances:
            description: The allowances of the bundle
            type: array
            items:
              type: object
              properties:
                type:
                  description: The type of allowance
                  type: string
                  enum:
                    - DATA
                    - VOICE
                    - SMS
                service:
                  description: The service of the allowance, this defines where the allowance can be used
                  type: string
                  enum:
                    - STANDARD
                    - ROAMING
                description:
                  description: The description of the allowance
                  type: string
                amount:
                  description: The amount of the allowance
                  type: integer
                  format: float
                unit:
                  description: The unit of the allowance
                  type: string
                  enum:
                    - MB
                    - SMS
                    - MINS
                unlimited:
                  description: If the allowance is unlimited
                  type: boolean
    BundleCatalogueResponse:
      type: object
      properties:
        name:
          type: string
          description: Bundle Name
        description:
          type: string
          description: Bundle Description
        countries:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                description: Country name
              region:
                type: string
                description: Country region
              iso:
                type: string
                description: Country ISO (internationally recognized means of identifying countries)
        dataAmount:
          type: integer
          description: Data Amount (MB)
        duration:
          type: integer
          description: Bundle Duration
        speed:
          type: array
          description: Bundle Speed
          items:
            type: string
        autostart:
          type: boolean
          description: If the bundle auto starts
        unlimited:
          type: boolean
          description: If the bundle is unlimited
        roamingEnabled:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                description: Country name
              region:
                type: string
                description: Country region
              iso:
                type: string
                description: Country ISO (internationally recognized means of identifying countries)
        price:
          type: integer
          description: Bundle price in the organisation currency
        group:
          type: array
          description: Bundle groups
          items:
            type: string
        billingType:
          type: string
          description: Billing type of the Bundle
          enum:
            - FixedCost
        profileName:
          type: string
          description: The bundle operator's profile name
          example: Profile 1
        allowances:
          description: The allowances of the bundle
          type: array
          items:
            type: object
            properties:
              type:
                description: The type of allowance
                type: string
                enum:
                  - DATA
                  - VOICE
                  - SMS
              service:
                description: The service of the allowance, this defines where the allowance can be used
                type: string
                enum:
                  - STANDARD
                  - ROAMING
              description:
                description: The description of the allowance
                type: string
              amount:
                description: The amount of the allowance
                type: integer
                format: float
              unit:
                description: The unit of the allowance
                type: string
                enum:
                  - MB
                  - SMS
                  - MINS
              unlimited:
                description: If the allowance is unlimited
                type: boolean
    NetworkResponse:
      type: object
      properties:
        countryNetworks:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                description: Country ISO (internationally recognized means of identifying countries)
              networks:
                type: array
                items:
                  type: object
                  properties:
                    name:
                      type: string
                      description: Network name
                    brandName:
                      type: string
                      description: Brand network name
                    mcc:
                      type: string
                      description: Mobile Country Code
                    mnc:
                      type: string
                      description: Mobile Network Code
                    tagid:
                      type: string
                      description: Network TADIG
                    speed:
                      type: array
                      description: Network speed
                      items:
                        type: string
    StatusMessage:
      type: object
      properties:
        status:
          description: status message of api request
          type: string

    SuspendESIM:
      type: object
      properties:
        suspended:
          type: boolean
          description: Indicates whether the ESIM is suspended

    SuspendESIMBody:
      type: object
      required:
        - suspend
      properties:
        suspend:
          type: boolean
