# Create wallet pass issue link

- Operation ID: `createIssueLinkUsingPOST`
- HTTP method: `POST`
- Path: `/device-hub/wallets/issue/link`
- [Human-readable API reference](https://hub.synerise.com/api-reference/loyalty-and-engagement#tag/Wallet-passes/operation/createIssueLinkUsingPOST)

## Self-contained OpenAPI method

The fenced document below contains this method's documentation and all of its local references. It is self-contained; no category or master specification fetch is required.

```yaml
openapi: 3.0.0
info:
  title: Synerise Public API
  version: 1.9.1
paths:
  /device-hub/wallets/issue/link:
    post:
      tags:
        - Wallet passes
      summary: Create wallet pass issue link
      operationId: createIssueLinkUsingPOST
      description: |
        **IMPORTANT**: This feature is in private preview mode and accessible only on selected workspaces. To get access, contact your account manager or Synerise Support.

        ---

        Create (or reuse) a wallet issue link for the authenticated workspace.
        The link's origin is fetched from the given record under the
        wallet pass template. Calls with the same `recordId` and `expirationTime`
        return the same `issueId` (and therefore the same HMAC when `clientUuid` is not
        included in the signature).

        After using this endpoint, use the link from the response as a the request to the `/wallets/issue` endpoint.


        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `WALLET_PASSES_UPDATE`

        **User role permission required:** `campaigns_wallets: update`
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - recordId
              properties:
                clientUuid:
                  type: string
                  format: uuid
                  description: Optional client UUID; appended as a query param to the link and (if enabled) included in the HMAC payload.
                recordId:
                  type: string
                  format: uuid
                  description: Wallet pass ID (`id` of the template in the API; part of the URL of the wallet pass details when using the Web Portal) of the template from which you want to generate a pass.
                expirationTime:
                  type: string
                  format: date-time
                  description: Optional ISO-8601 expiration timestamp; persisted with the issue link.
                eventParams:
                  type: object
                  additionalProperties:
                    type: string
                    maxLength: 512
                  description: |
                    Optional caller-supplied params (string→string) attached to the wallet-pass events
                    generated for this link: `walletPass.issued`, `walletPass.installed` and
                    `walletPass.installFailed`.  

                    Persisted as part of the issue link's natural key, so
                    links differing only in these params are deduplicated separately. Reserved event keys
                    (`eventUUID`, `time`, `uuid`, `businessProfileId`, `os`) cannot be overridden. Max 20 entries;
                    keys ≤ 64 characters and values ≤ 512 characters.
                context:
                  type: object
                  additionalProperties:
                    type: string
                  description: |
                    Optional caller-supplied context (string→string) forwarded to Brickworks as the `context` object of the record generation performed when the link is clicked, so it shapes the card's content — the record's Jinjava inserts read it as `{{ context.key }}` (keys that are not plain identifiers must be read as `{{ context['my-key'] }}`). Snapshotted onto the issued card and replayed on later regenerations (Google object update, Apple pass refresh) so a refreshed pass keeps the same content. Persisted as part of the issue link's natural key, so links differing only in context are deduped separately. Max 20 entries; keys ≤ 64 and values ≤ 512 characters.
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  link:
                    type: string
                    description: Ready-to-use link to the `/wallets/issue` endpoint
                    example: https://api.synerise.com/device-hub/wallets/issue?issueId=b40385e1-3394-48bc-86a5-000000000000&hmac=uX3Wa-wYwJdJ7Geinvldd1iWyAAfPEk
        "400":
          description: Bad Request - Validation failed (missing/invalid recordId, or malformed UUID/Instant)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                properties:
                  error:
                    description: Summary of the error
                    type: string
                  message:
                    description: Description of the problem
                    type: string
                  status:
                    description: Status code
                    format: int32
                    type: integer
                  timestamp:
                    description: Time when the message was sent
                    type: string
                type: object
                x-class-name: GatewayError
                x-interface-name-ts: GatewayError
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                properties:
                  error:
                    description: Summary of the error
                    type: string
                  message:
                    description: Description of the problem
                    type: string
                  status:
                    description: Status code
                    format: int32
                    type: integer
                  timestamp:
                    description: Time when the message was sent
                    type: string
                type: object
                x-class-name: GatewayError
                x-interface-name-ts: GatewayError
        "404":
          description: Not Found - no such wallet pass template/record for this tenant
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message
        "500":
          description: Internal Server Error - unexpected error during request processing
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message
        "502":
          description: Bad Gateway - external service returned 5xx or is unreachable
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message
      x-snr-doc-urls:
        - /api-reference/loyalty-and-engagement#tag/Wallet-passes/operation/createIssueLinkUsingPOST
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/device-hub/wallets/issue/link \
              --header 'content-type: application/json' \
              --data '{"clientUuid":"c6e70fa5-bbfd-4e2e-9660-1407608fb247","recordId":"0470cfd4-dcf3-4d8c-ac28-58c6deeff25f","expirationTime":"2019-08-24T14:15:22Z","eventParams":{"property1":"string","property2":"string"},"context":{"property1":"string","property2":"string"}}'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "{\"clientUuid\":\"c6e70fa5-bbfd-4e2e-9660-1407608fb247\",\"recordId\":\"0470cfd4-dcf3-4d8c-ac28-58c6deeff25f\",\"expirationTime\":\"2019-08-24T14:15:22Z\",\"eventParams\":{\"property1\":\"string\",\"property2\":\"string\"},\"context\":{\"property1\":\"string\",\"property2\":\"string\"}}"

            headers = { 'content-type': "application/json" }

            conn.request("POST", "/device-hub/wallets/issue/link", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "clientUuid": "c6e70fa5-bbfd-4e2e-9660-1407608fb247",
              "recordId": "0470cfd4-dcf3-4d8c-ac28-58c6deeff25f",
              "expirationTime": "2019-08-24T14:15:22Z",
              "eventParams": {
                "property1": "string",
                "property2": "string"
              },
              "context": {
                "property1": "string",
                "property2": "string"
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/device-hub/wallets/issue/link");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/device-hub/wallets/issue/link",
              "headers": {
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              clientUuid: 'c6e70fa5-bbfd-4e2e-9660-1407608fb247',
              recordId: '0470cfd4-dcf3-4d8c-ac28-58c6deeff25f',
              expirationTime: '2019-08-24T14:15:22Z',
              eventParams: {property1: 'string', property2: 'string'},
              context: {property1: 'string', property2: 'string'}
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/device-hub/wallets/issue/link');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"clientUuid":"c6e70fa5-bbfd-4e2e-9660-1407608fb247","recordId":"0470cfd4-dcf3-4d8c-ac28-58c6deeff25f","expirationTime":"2019-08-24T14:15:22Z","eventParams":{"property1":"string","property2":"string"},"context":{"property1":"string","property2":"string"}}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/device-hub/wallets/issue/link")
              .header("content-type", "application/json")
              .body("{\"clientUuid\":\"c6e70fa5-bbfd-4e2e-9660-1407608fb247\",\"recordId\":\"0470cfd4-dcf3-4d8c-ac28-58c6deeff25f\",\"expirationTime\":\"2019-08-24T14:15:22Z\",\"eventParams\":{\"property1\":\"string\",\"property2\":\"string\"},\"context\":{\"property1\":\"string\",\"property2\":\"string\"}}")
              .asString();
servers:
  - description: Microsoft Azure EU
    url: https://api.synerise.com
  - description: Microsoft Azure USA
    url: https://api.azu.synerise.com
  - description: Google Cloud Platform
    url: https://api.geb.synerise.com
tags:
  - name: Wallet passes
```
