# Update wallet pass

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

## 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/update:
    post:
      tags:
        - Wallet passes
      summary: Update wallet pass
      operationId: updateWalletPassUsingPOST
      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.

        ---

        Queue a wallet pass update for asynchronous update. The request is
        validated and enqueued and the endpoint return the HTTP 202 status. You must provide one profile identifier (`clientId` or `clientUuid`, but not both).  
        The system locates the pass and makes an update request to the associated service: Apple sends an APN background push (the device re-fetches the pass from the web service), Google PATCHes the wallet object.

        Each card emits one terminal event per platform — `walletPass.updated` on success or `walletPass.updateFailed` on failure, both always carrying the card's specific parameters. Failures add `cause=noDevicesFound` for an iOS pass with no registered device left (removed or automatic updates off, which are indistinguishable) or `error=<message>` for any other Apple or Google failure, the sole exception being an iOS pass that was issued but never installed, which is skipped with no event at all.


        ---

        **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
              description: |
                Exactly one of `clientId` or `clientUuid` must be supplied (neither/both → 400).
              required:
                - recordId
              properties:
                clientId:
                  type: integer
                  format: int64
                  description: |
                    Synerise profile ID. Mutually exclusive with `clientUuid`.
                clientUuid:
                  type: string
                  format: uuid
                  description: |
                    Synerise profile UUID. Mutually exclusive with `clientId`.
                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) identifying the pass to update.
                platform:
                  type: string
                  description: Optional; restricts the update to a single platform.
                  enum:
                    - IOS
                    - ANDROID
        required: true
      responses:
        "202":
          description: Accepted - the update was enqueued and will be processed asynchronously
        "400":
          description: Bad Request - Validation failed (recordId missing, or not exactly one of clientId/clientUuid)
          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
        "502":
          description: Bad Gateway - failed to enqueue the command
          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/updateWalletPassUsingPOST
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/device-hub/wallets/update \
              --header 'content-type: application/json' \
              --data '{"clientId":0,"clientUuid":"c6e70fa5-bbfd-4e2e-9660-1407608fb247","recordId":"0470cfd4-dcf3-4d8c-ac28-58c6deeff25f","platform":"IOS"}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"clientId\":0,\"clientUuid\":\"c6e70fa5-bbfd-4e2e-9660-1407608fb247\",\"recordId\":\"0470cfd4-dcf3-4d8c-ac28-58c6deeff25f\",\"platform\":\"IOS\"}"

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

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

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "clientId": 0,
              "clientUuid": "c6e70fa5-bbfd-4e2e-9660-1407608fb247",
              "recordId": "0470cfd4-dcf3-4d8c-ac28-58c6deeff25f",
              "platform": "IOS"
            });

            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/update");
            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/update",
              "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({
              clientId: 0,
              clientUuid: 'c6e70fa5-bbfd-4e2e-9660-1407608fb247',
              recordId: '0470cfd4-dcf3-4d8c-ac28-58c6deeff25f',
              platform: 'IOS'
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

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

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

            $request->setBody('{"clientId":0,"clientUuid":"c6e70fa5-bbfd-4e2e-9660-1407608fb247","recordId":"0470cfd4-dcf3-4d8c-ac28-58c6deeff25f","platform":"IOS"}');

            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/update")
              .header("content-type", "application/json")
              .body("{\"clientId\":0,\"clientUuid\":\"c6e70fa5-bbfd-4e2e-9660-1407608fb247\",\"recordId\":\"0470cfd4-dcf3-4d8c-ac28-58c6deeff25f\",\"platform\":\"IOS\"}")
              .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
```
