# Passes with external IDs

These endpoints support passes incorporating external IDs for the template, the pass, or both. A pass is essentially a populated, personalized template intended for a single platform — Apple Wallet or Google Wallet. Passes manifest as links; you distribute the pass link to users, and they tap or click the link to install the pass.

If you want to distribute passes to both Apple and Google users, you may want to use adaptive links instead. While a pass is intended for a single platform, so you have to distribute separate pass links to independent Apple and Google audiences, an adaptive link is a single pass link that detects the user's platform and installs the correct pass. Adaptive links can save you the trouble of maintaining separate passes and distribution lists for your customers.


## Add locations to pass {#addlocationstopassfromtemplateexternalid}

Add the locations to the specified pass.

[Jump to examples ↓](#addlocationstopassfromtemplateexternalid-examples)

### `POST /pass/template/{templateId}/id/{passExternalId}/locations`

**Security:**

- [httpBasic]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-httpBasic)
- [oauth2Token]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-oauth2Token): wpas

**Path parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `templateId` | `string` | Required | The template of the pass that you want to add locations to. |
| `passExternalId` | `string` | Required | The external ID of the pass you want to add locations to. |

**Request headers:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Api-Revision` | `string` | Required | The particular API revision you want to use. In general, this is `1.2`. Possible values: `1.2` |

**Request body**

Set locations for the pass.

**Content-Type:** `application/json`

- **`locations`** `array` <[Location object]({{< ref "/developer/rest-api/wallet/schemas/others/" >}}#locationobject)>
**Responses**

**`200`** Returns `passLocationId` for each location on the pass. Use this value to identify locations in other location-based operations.

Response body:

**Content-Type:** `application/json`

Type: `array`

**`404`** The pass or template ID does not exist.

**Examples**

*Example request*

```http
POST /v1/pass/template/123/id/mypass/locations HTTP/1.1
Content-Type: application/json
Authorization: Basic <Base64 key>
Api-Revision: 1.2

{
  "locations": [
    {
      "longitude": "-122.374",
      "latitude": "37.618",
      "relevantText": "Hello loc0",
      "streetAddress1": "address line #1",
      "streetAddress2": "address line #2",
      "city": "San Francisco",
      "region": "CA",
      "regionCode": "94404",
      "country": "US"
    },
    { "...": "..." }
  ]
}

```

*Response*

```http
HTTP/1.1 200 OK
Content-Type: application/json

[
   {
      "passLocationId": 65,
      "value": {
         "region": "CA",
         "regionCode": "94404",
         "relevantText": "Hello loc0!",
         "streetAddress1": "add11",
         "streetAddress2": "add22",
         "longitude": "-122.3742",
         "latitude": "37.618",
         "city": "FC"
      }
   },
   {
      "passLocationId": 66,
      "value": {
         "region": "CA",
         "regionCode": "94404",
         "relevantText": "Hello loc1!",
         "streetAddress1": "add12",
         "streetAddress2": "add23",
         "longitude": "-123.374",
         "latitude": "38.618",
         "city": "FC"
      }
   }
]

```

---

## Create pass {#createpassexternalid}

Create a pass from the specified template and give it a custom identifier. You can use this custom ID to perform operations against the pass like you would use the standard, unique `id` given by Wallet.

[Jump to examples ↓](#createpassexternalid-examples)

### `POST /pass/template/{templateId}/id/{passExternalId}`

**Security:**

- [httpBasic]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-httpBasic)
- [oauth2Token]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-oauth2Token): wpas

**Path parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `templateId` | `string` | Required | The ID of the template the pass will be or was created from. |
| `passExternalId` | `string` | Required | The external ID you want to assign to the new pass. |

**Request headers:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Api-Revision` | `string` | Required | The particular API revision you want to use. In general, this is `1.2`. Possible values: `1.2` |

**Request body**

Create a pass; pass composition varies by vendor.

**Content-Type:** `application/json`

**One of:**

- [Apple Wallet pass request]({{< ref "/developer/rest-api/wallet/schemas/passes/" >}}#createpassapplewalletrequest)

  A pass for Apple Wallet.

- [Google Wallet pass request]({{< ref "/developer/rest-api/wallet/schemas/passes/" >}}#createpassandroidpayrequest)

  A pass for Google Wallet. Unlike templates, in which the `fieldsModel` contains fields nested inside `module` objects, fields are collapsed in pass requests and responses. The `fieldType` corresponds to the template field module that the field belongs to.

Aside from differences in field composition, and a lack of beacons, Google Wallet passes are very similar to Apple Wallet passes.



**Responses**

**`200`** A response is a populated pass and meta information about the pass. The pass response includes fields that are read only, some of which are populated directly from the template specified in the request.

Response body:

**Content-Type:** `application/json`

**One of:**

- [Apple Wallet pass response]({{< ref "/developer/rest-api/wallet/schemas/passes/" >}}#createpassapplewalletresponse)

  A pass response includes both identifiers and the content of all fields on a pass.

- [Google Wallet pass response]({{< ref "/developer/rest-api/wallet/schemas/passes/" >}}#createpassandroidpayresponse)

  A pass response for Google Wallet.  A pass is a populated template. Therefore, the pass includes all headers and fields from the template, along with identifiers for the pass and URLs to access it.

Unlike templates, in which the `fieldsModel` contains fields nested inside `module` objects, fields are collapsed in pass requests and responses. The `fieldType` corresponds to the template field module (an object) that the field belongs to.


Aside from differences in field composition, and a lack of beacons, Google Wallet passes are very similar to Apple Wallet passes.



**`404`** The pass or template ID does not exist.

**Examples**

*Example request*

```http
POST /v1/pass/template/123/id/mypass HTTP/1.1
Content-Type: application/json
Authorization: Basic <Base64 key>
Api-Revision: 1.2

{
    "headers": {
        "expirationDate": {
           "value": "2014-08-20T09:41-08:00"
         },
         "barcodeAltText": {
            "changeMessage": null,
            "value": "abc1234567890",
            "label": ""
         },
         "barcode_value": {
            "changeMessage": null,
            "value": "abc1234567890",
            "label": ""
         }
    },
    "fields": {
      "Coupon": {
         "changeMessage": "Enjoy %@ off your next order!",
         "value": "20%",
         "label": "Coupon"
      },
      "SiteAddress": {
         "changeMessage": "Check out things we think you would like at %@",
         "value": "https://www.example.com/new?custnumb=123456",
         "label": "personal deals"
      },
      "InStore": {
         "changeMessage": "Or visit your nearest store at %@",
         "value": "1234 Fake St.",
         "label": "nearestStore"
      },
      "thumbnail_image": {
          "value": "https:\/\/example.com\/assets\/favicon.png"
      }
    },
    "beacons":[
        {
           "uuid": "55502220-A123-A88A-F321-555A444B333C",
           "relevantText": "You are near the Ship",
           "major": 2,
           "minor": 346
        }
    ],
    "locations":[
        {
           "longitude": -122.374,
           "latitude": 37.618,
           "relevantText": "Hello loc0",
           "streetAddress1": "address line #1",
           "streetAddress2": "address line #2",
           "city": "San Francisco",
           "region": "CA",
           "regionCode": "94404",
           "country": "US"
        }
    ],
    "publicUrl": {
        "type": "single"
    }
}

```

*Response*

```http
HTTP/1.1 200 OK
Content-Type: application/json

{
    "id": 12345,
    "templateId": 123,
    "createdAt": "2012-11-01 12:37:07.0",
    "url": "https:\/\/wallet-api.urbanairship.com\/v1\/pass\/888\/download",
    "publicUrl": {
          "path": "https:\/\/wallet-api.urbanairship.com\/v1\/download\/pass\/9c9c9c7d-c6b6-9c9c-9d2b-9c9c9c54c89c",
          "used": false,
          "type": "Single",
          "installs": 0
    },
    "passFields": {
        "gate": {
            "changeMessage": "Your gate has changed to %@",
            "fieldType": "HEADER",
            "value": "A56",
            "label": "my value",
            "required": false
        },
        "logo_text": {
            "changeMessage": null,
            "fieldType": "TOP_LEVEL",
            "value": "Test Value",
            "label": "",
            "required": false
        },
        "boarding_time": {
            "changeMessage": "Be at your new gate by %@",
            "fieldType": "PRIMARY",
            "value": "08:45",
            "label": "",
            "required": false
        },
        "thumbnail_image": {
            "formatType": "String",
            "changeMessage": null,
            "fieldType": "image",
            "value": "https:\/\/example.com\/passtools...0bb4_favicon.png",
            "label": "",
            "required": false,
            "hideEmpty": false
        }
    },
    "beacons":[
        {
            "uuid": "55502220-A123-A88A-F321-555A444B333C",
            "relevantText": "You are near the Ship",
            "major": 2,
            "minor": 346
        }
    ],
    "locations":[
        {
            "relevantText":"Hello loc0",
            "latitude":37.618,
            "id":30473906,
            "longitude":-122.374
        }
    ]
}

```

---

## Create pass from a template {#createpassfromtemplateexternalid}

Create a pass from the specified template and give it a custom identifier. You can use this custom ID to perform operations against the pass in addition to the standard, unique `id` given by Wallet.

[Jump to examples ↓](#createpassfromtemplateexternalid-examples)

### `POST /pass/id/{templateExternalId}/id/{passExternalId}`

**Security:**

- [httpBasic]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-httpBasic)
- [oauth2Token]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-oauth2Token): wpas

**Path parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `templateExternalId` | `string` | Required | The external ID of the template you want to create your pass from. |
| `passExternalId` | `string` | Required | The external ID that you want to give your pass. |

**Request headers:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Api-Revision` | `string` | Required | The particular API revision you want to use. In general, this is `1.2`. Possible values: `1.2` |

**Request body**

Create a pass; pass composition varies by vendor.

**Content-Type:** `application/json`

**One of:**

- [Apple Wallet pass request]({{< ref "/developer/rest-api/wallet/schemas/passes/" >}}#createpassapplewalletrequest)

  A pass for Apple Wallet.

- [Google Wallet pass request]({{< ref "/developer/rest-api/wallet/schemas/passes/" >}}#createpassandroidpayrequest)

  A pass for Google Wallet. Unlike templates, in which the `fieldsModel` contains fields nested inside `module` objects, fields are collapsed in pass requests and responses. The `fieldType` corresponds to the template field module that the field belongs to.

Aside from differences in field composition, and a lack of beacons, Google Wallet passes are very similar to Apple Wallet passes.



**Responses**

**`200`** A response is a populated pass and meta information about the pass. The pass response includes fields that are read only, some of which are populated directly from the template specified in the request.

Response body:

**Content-Type:** `application/json`

**One of:**

- [Apple Wallet pass response]({{< ref "/developer/rest-api/wallet/schemas/passes/" >}}#createpassapplewalletresponse)

  A pass response includes both identifiers and the content of all fields on a pass.

- [Google Wallet pass response]({{< ref "/developer/rest-api/wallet/schemas/passes/" >}}#createpassandroidpayresponse)

  A pass response for Google Wallet.  A pass is a populated template. Therefore, the pass includes all headers and fields from the template, along with identifiers for the pass and URLs to access it.

Unlike templates, in which the `fieldsModel` contains fields nested inside `module` objects, fields are collapsed in pass requests and responses. The `fieldType` corresponds to the template field module (an object) that the field belongs to.


Aside from differences in field composition, and a lack of beacons, Google Wallet passes are very similar to Apple Wallet passes.



**Examples**

*Example request*

```http
POST /v1/pass/id/myExternalTemplate/id/myNewPass HTTP/1.1
Content-Type: application/json
Authorization: Basic <Base64 key>
Api-Revision: 1.2

{
    "headers": {
        "expirationDate": {
           "value": "2014-08-20T09:41-08:00"
         },
         "barcodeAltText": {
            "changeMessage": null,
            "value": "abc1234567890",
            "label": ""
         },
         "barcode_value": {
            "changeMessage": null,
            "value": "abc1234567890",
            "label": ""
         }
    },
    "fields": {
      "Coupon": {
         "changeMessage": "Enjoy %@ off your next order!",
         "value": "20%",
         "label": "Coupon"
      },
      "SiteAddress": {
         "changeMessage": "Check out things we think you would like at %@",
         "value": "https://www.example.com/new?custnumb=123456",
         "label": "personal deals"
      },
      "InStore": {
         "changeMessage": "Or visit your nearest store at %@",
         "value": "1234 Fake St.",
         "label": "nearestStore"
      },
      "thumbnail_image": {
          "value": "https:\/\/example.com\/assets\/favicon.png"
      }
    },
    "beacons":[
        {
           "uuid": "55502220-A123-A88A-F321-555A444B333C",
           "relevantText": "You are near the Ship",
           "major": 2,
           "minor": 346
        }
    ],
    "locations":[
        {
           "longitude": -122.374,
           "latitude": 37.618,
           "relevantText": "Hello loc0",
           "streetAddress1": "address line #1",
           "streetAddress2": "address line #2",
           "city": "San Francisco",
           "region": "CA",
           "regionCode": "94404",
           "country": "US"
        }
    ],
    "publicUrl": {
        "type": "single"
    }
}

```

*Response*

```http
HTTP/1.1 200 OK
Content-Type: application/json

{
    "externalId": "myNewPass",
    "id": 12345,
    "templateId": 123,
    "createdAt": "2012-11-01 12:37:07.0",
    "url": "https:\/\/wallet-api.urbanairship.com\/v1\/pass\/888\/download",
    "publicUrl": {
          "path": "https:\/\/wallet-api.urbanairship.com\/v1\/download\/pass\/9c9c9c7d-c6b6-9c9c-9d2b-9c9c9c54c89c",
          "used": false,
          "type": "Single",
          "installs": 0
    },
    "passFields": {
        "gate": {
            "changeMessage": "Your gate has changed to %@",
            "fieldType": "HEADER",
            "value": "A56",
            "label": "my value",
            "required": false
        },
        "logo_text": {
            "changeMessage": null,
            "fieldType": "TOP_LEVEL",
            "value": "Test Value",
            "label": "",
            "required": false
        },
        "boarding_time": {
            "changeMessage": "Be at your new gate by %@",
            "fieldType": "PRIMARY",
            "value": "08:45",
            "label": "",
            "required": false
        },
        "thumbnail_image": {
            "formatType": "String",
            "changeMessage": null,
            "fieldType": "image",
            "value": "https:\/\/example.com\/passtools...0bb4_favicon.png",
            "label": "",
            "required": false,
            "hideEmpty": false
        }
    },
    "beacons":[
        {
            "uuid": "55502220-A123-A88A-F321-555A444B333C",
            "relevantText": "You are near the Ship",
            "major": 2,
            "minor": 346
        }
    ],
    "locations":[
        {
            "relevantText":"Hello loc0",
            "latitude":37.618,
            "id":30473906,
            "longitude":-122.374
        }
    ]
}

```

---

## Delete locations from pass {#deletelocationfrompassfromtemplateexternalid}

Delete the specified location from a pass using an external ID.

[Jump to examples ↓](#deletelocationfrompassfromtemplateexternalid-examples)

### `DELETE /pass/template/{templateId}/id/{passExternalId}/location/{locationId}`

**Security:**

- [httpBasic]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-httpBasic)
- [oauth2Token]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-oauth2Token): wpas

**Path parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `templateId` | `string` | Required | The template of the pass that you want to delete locations from. |
| `passExternalId` | `string` | Required | The external ID of the pass you want to delete locations from. |
| `locationId` | `string` | Required | The location you want to remove from the pass. |

**Request headers:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Api-Revision` | `string` | Required | The particular API revision you want to use. In general, this is `1.2`. Possible values: `1.2` |

**Responses**

**`200`** Success.

Response body:

**Content-Type:** `application/json`

- **`locations`** `array` <[Location object]({{< ref "/developer/rest-api/wallet/schemas/others/" >}}#locationobject)>
**`404`** The pass ID, template ID, or location does not exist.

**Examples**

*Example request*

```http
DELETE /v1/pass/template/123/id/mypass/location/456 HTTP/1.1
Authorization: Basic <Base64 key>
Api-Revision: 1.2

```

---

## Delete pass {#deletepassfromtemplateexternalid}

Delete a pass with an external ID.

[Jump to examples ↓](#deletepassfromtemplateexternalid-examples)

### `DELETE /pass/template/{templateId}/id/{passExternalId}`

{{< note >}}
The Delete function does not remove passes from the end-user's device, but removes from our system. Deleted passes no longer count towards billing. See [Editing Wallet Pass Expiration](/docs/guides/wallet/user-guide/updating-passes/edit-expiration/) to deactivate the pass on the end-user's device.
{{< /note >}}

**Security:**

- [httpBasic]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-httpBasic)
- [oauth2Token]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-oauth2Token): wpas

**Path parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `templateId` | `string` | Required | The ID of the template the pass will be or was created from. |
| `passExternalId` | `string` | Required | The external ID of the pass you want to delete. |

**Request headers:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Api-Revision` | `string` | Required | The particular API revision you want to use. In general, this is `1.2`. Possible values: `1.2` |

**Responses**

**`200`** The pass was successfully deleted.

Response body:

**Content-Type:** `application/json`

- **`passId`** `integer`

  The internal identifier for the pass. Use this ID to get or modify the pass in other calls.

  Read only: true

- **`status`** `string`

  Indicates that the pass was deleted.

  Possible values: `deleted`

**`404`** The pass or template ID does not exist.

**Examples**

*Example request*

```http
DELETE /v1/pass/template/123/id/mypass HTTP/1.1
Authorization: Basic <authorization string>
Api-Revision: 1.2

```

*Response*

```http
HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
   "status": "deleted",
   "passId": "33"
}

```

---

## Get pass {#getpassfromtemplateexternalid}

Get a pass with an external ID.

[Jump to examples ↓](#getpassfromtemplateexternalid-examples)

### `GET /pass/template/{templateId}/id/{passExternalId}`

**Security:**

- [httpBasic]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-httpBasic)
- [oauth2Token]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-oauth2Token): wpas

**Path parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `templateId` | `string` | Required | The ID of the template the pass will be or was created from. |
| `passExternalId` | `string` | Required | The custom ID assigned to the pass. |

**Request headers:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Api-Revision` | `string` | Required | The particular API revision you want to use. In general, this is `1.2`. Possible values: `1.2` |

**Responses**

**`200`** A response is a populated pass and meta information about the pass. The pass response includes fields that are read only, some of which are populated directly from the template specified in the request.


Response body:

**Content-Type:** `application/json`

**One of:**

- [Apple Wallet pass response]({{< ref "/developer/rest-api/wallet/schemas/passes/" >}}#createpassapplewalletresponse)

  A pass response includes both identifiers and the content of all fields on a pass.

- [Google Wallet pass response]({{< ref "/developer/rest-api/wallet/schemas/passes/" >}}#createpassandroidpayresponse)

  A pass response for Google Wallet.  A pass is a populated template. Therefore, the pass includes all headers and fields from the template, along with identifiers for the pass and URLs to access it.

Unlike templates, in which the `fieldsModel` contains fields nested inside `module` objects, fields are collapsed in pass requests and responses. The `fieldType` corresponds to the template field module (an object) that the field belongs to.


Aside from differences in field composition, and a lack of beacons, Google Wallet passes are very similar to Apple Wallet passes.



**`404`** The pass or template ID does not exist.

**Examples**

*Example request*

```http
GET /v1/pass/template/123/id/mypass HTTP/1.1
Authorization: Basic <Base64 key>
Api-Revision: 1.2

```

*Response*

```http
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
   "tags":[

   ],
   "headers": {
      "barcodeAltText": {
         "formatType": "String",
         "changeMessage": null,
         "fieldType": "barcode",
         "value": "123456789",
         "label": "",
         "required": false,
         "hideEmpty": false
      },
      "logo_color": {
         "formatType": "String",
         "changeMessage": null,
         "fieldType": "topLevel",
         "value": "rgb(24,86,148)",
         "label": "",
         "required": false,
         "hideEmpty": false
      },
      "icon_image": {
         "formatType": "String",
         "changeMessage": null,
         "fieldType": "topLevel",
         "value": "https:\/\/example.com\/passtools_prod\/1\/images\/default-pass-icon.png",
         "label": "",
         "required": false,
         "hideEmpty": false
      },
      "barcode_value": {
         "formatType": "String",
         "changeMessage": null,
         "fieldType": "barcode",
         "value": "123456789",
         "label": "",
         "required": false,
         "hideEmpty": false
      },
      "logo_text": {
         "formatType": "String",
         "changeMessage": "%@",
         "fieldType": "topLevel",
         "value": "Logo",
         "label": "",
         "required": false,
         "hideEmpty": false
      },
      "barcode_encoding": {
         "formatType": "String",
         "changeMessage": null,
         "fieldType": "barcode",
         "value": "iso-8859-1",
         "label": "",
         "required": false,
         "hideEmpty": false
      },
      "suppress_strip_shine": {
         "formatType": "String",
         "changeMessage": null,
         "fieldType": "topLevel",
         "value": "true",
         "label": "",
         "required": false,
         "hideEmpty": false
      },
      "barcode_label": {
         "formatType": "String",
         "changeMessage": "%@",
         "fieldType": "barcode",
         "value": "Member ID",
         "label": "",
         "required": false,
         "hideEmpty": false
      },
      "barcode_type": {
         "formatType": "String",
         "changeMessage": null,
         "fieldType": "barcode",
         "value": "PKBarcodeFormatPDF417",
         "label": "",
         "required": false,
         "hideEmpty": false
      },
      "foreground_color": {
         "formatType": "String",
         "changeMessage": null,
         "fieldType": "topLevel",
         "value": "rgb(255,255,255)",
         "label": "",
         "required": false,
         "hideEmpty": false
      },
      "background_color": {
         "formatType": "String",
         "changeMessage": null,
         "fieldType": "topLevel",
         "value": "rgb(0,147,201)",
         "label": "",
         "required": false,
         "hideEmpty": false
      },
      "relevantDate": {
         "changeMessage": "The new date is %@",
         "label": "relevantDate",
         "hideEmpty": false,
         "formatType": "String",
         "value": "2015-12-31T23:00:00-08:00",
         "fieldType": "topLevel",
         "required": false
      }
   },
   "id": "1234",
   "templateId": "12345",
   "externalId": "mypass",
   "updatedAt": "2013-06-19T01:06:23.000Z",
   "createdAt": "2013-06-19T01:06:17.000Z",
   "serialNumber": "14f94898-2f5e-46f5-925c-7e29fa9a0508",
   "installedAt": "2013-06-19T01:06:17.000Z",
   "url": "https:\/\/wallet-api.urbanairship.com\/v1\/pass\/1249\/download",
   "status": "installed",
   "fields": {
      "Merchant Website": {
         "formatType": "URL",
         "changeMessage": "Get event details at %@",
         "order": 2,
         "fieldType": "back",
         "value": "http:\/\/www.example.com",
         "label": "Merchant Website",
         "required": false,
         "hideEmpty": false
      },
      "More Details": {
         "formatType": "String",
         "changeMessage": "%@",
         "order": 1,
         "fieldType": "back",
         "value": "More details about how to use this event ticket. Additional terms and support information.",
         "label": "More Details",
         "required": false,
         "hideEmpty": false
      },
      "Seat": {
         "textAlignment": "textAlignmentNatural",
         "changeMessage": "You are now seated at %@",
         "numberStyle": "PKNumberStyleDecimal",
         "label": "Seat",
         "hideEmpty": false,
         "formatType": "Number",
         "value": 1.0,
         "fieldType": "auxiliary",
         "required": false,
         "order": 3
      },
      "Row": {
         "textAlignment": "textAlignmentNatural",
         "changeMessage": "You are now seated in row %@",
         "numberStyle": "PKNumberStyleDecimal",
         "label": "Row",
         "hideEmpty": false,
         "formatType": "Number",
         "value": 1.0,
         "fieldType": "auxiliary",
         "required": false,
         "order": 2
      },
      "Section": {
         "textAlignment": "textAlignmentLeft",
         "changeMessage": "You are now seated in section %@",
         "label": "Section",
         "hideEmpty": false,
         "formatType": "String",
         "value": "1",
         "fieldType": "auxiliary",
         "required": true,
         "order": 1
      }
   }
}

```

---

## Update pass {#updatepassexternalid}

Update the specified pass. You need only include the fields that you want to update for the pass.

Do not use the response payload from a `GET` to update a pass, as it contains information from both the pass itself and the template used to create the pass, and you cannot update a template from the `/v1/pass endpoint`. You should only populate the JSON Parameters below. Within the headers and fields objects, these are the changeMessage, value, and label fields.


You can update `locations` on a pass, but doing so will replace all locations on the pass. See the Location Object for more about the fields you should provide in the locations array.

[Jump to examples ↓](#updatepassexternalid-examples)

### `PUT /pass/id/{externalId}`

{{< note >}}
You can also update a pass to include an expiration date using the `expirationDate` key.
{{< /note >}}

**Security:**

- [httpBasic]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-httpBasic)
- [oauth2Token]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-oauth2Token): wpas

**Path parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `externalId` | `string` | Required | The external ID of the pass you want to modify. |

**Request headers:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Api-Revision` | `string` | Required | The particular API revision you want to use. In general, this is `1.2`. Possible values: `1.2` |

**Request body**

Provide only the fields you want to update.


Locations operate as a `set` operation. The array of pass locations is replaced by the locations you provide in an update; if you want to add to the locations on the pass, you must provide both the current locations and the locations you want to add in the payload.

**Content-Type:** `application/json`

**All of:**

  - **`templates`** `array[integer]`

    Include an array of templates IDs, required to identify individual passes if there are multiple passes for the external ID in the path. If there are multiple passes for the external ID and you do not specify the templates corresponding to the passes you want to update, your request will return a 400.


  - **`beacons`** `array` <[Beacon object]({{< ref "/developer/rest-api/wallet/schemas/passes/" >}}#beacon)> **APPLE ONLY**

    An array of beacon objects you want to update for this pass.

  - **`fields`** `object`

    The fields you want to update on the pass.

  - **`headers`** `object`

    The headers you want to update for this pass.

  - **`locations`** `array` <[Location object]({{< ref "/developer/rest-api/wallet/schemas/others/" >}}#locationobject)>

    The locations you want to update for this pass. Location updates replace existing locations on the pass. When updating locations, you should provide all the locations that you want to remain on the pass.

  - **`semantics`** `object` <[Boarding pass semantics]({{< ref "/developer/rest-api/wallet/schemas/flights-and-boarding-passes/" >}}#boardingpasssemantics)>

    An object that defines structured metadata for an Apple Wallet pass using key-value pairs. These semantic tags provide contextual information to the system to enhance the user experience.

    For Apple boarding passes only, a JSON object that uses key-value pairs to add rich, machine-readable data that enhances passes. You can nest this object within `fields`.


  - **`universalLinks`** `object` <[Universal links]({{< ref "/developer/rest-api/wallet/schemas/others/" >}}#universallinksobject)>

    An object containing key-value pairs of universal links where each key-value pair defines a universal link.

    A list of key-value pairs that represents partner URLs.


**Responses**

**`200`** A response returns one or more [`ticketId`](/docs/developer/rest-api/wallet/operations/tickets/) values, each referencing the pass update operation. If your request does not include the `templates` array, the response includes a single `ticketId`. If your request includes the `templates` array, the response is an array of of ticket objects, corresponding to the order of templates in the array.


Response body:

**Content-Type:** `application/json`

**One of:**

  - **`ticketId`** `integer`

    A ticket you can use to reference this operation for status, troubleshooting, or logging purposes.


- `array`

**Examples**

*Example request*

```http
PUT /v1/pass/id/myExternalPassId HTTP/1.1
Content-Type: application/json
Authorization: Basic <Base64 key>
Api-Revision: 1.2

{
    "templates": ["5350", "5359"],
    "fields": {
       "Coupon": {
          "changeMessage": "Enjoy %@ off your next order!",
          "value": "20%",
          "label": "Coupon"
       },
       "SiteAddress": {
          "changeMessage": "Check out things we think you would like at %@",
          "value": "https://www.example.com/new?custnumb=123456",
          "label": "personal deals"
       },
       "InStore": {
          "changeMessage": "Or visit your nearest store at %@",
          "value": "1234 Fake St.",
          "label": "nearestStore"
       },
       "thumbnail_image": {
          "value": "https:\/\/example.com\/assets\/favicon.png"
       }
    },
    "beacons": [
       {
          "uuid": "55502220-A123-A88A-F321-555A444B333C",
          "relevantText": "You are near the Ship",
          "major": 1,
          "minor": 777
       },
       {
          "uuid": "55502220-A123-A88A-F321-555A444B333C",
          "relevantText": "You are near the Ship"
       }
    ],
    "locations":[
       {
           "longitude": -122.374,
           "latitude": 37.618,
           "relevantText": "Hello loc0",
           "streetAddress1": "address line #1",
           "streetAddress2": "address line #2",
           "city": "San Francisco",
           "region": "CA",
           "regionCode": "94404",
           "country": "US"
       }
    ]
}

```

*Response*

```http
HTTP/1.1 200 OK
Content-Type: application/json

{
    "ticketId": 1234
}

```

---

## Update pass for a template {#updatepassfromtemplateexternalid}

Update a pass with an external ID.

[Jump to examples ↓](#updatepassfromtemplateexternalid-examples)

### `PUT /pass/template/{templateId}/id/{passExternalId}`

**Security:**

- [httpBasic]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-httpBasic)
- [oauth2Token]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-oauth2Token): wpas

**Path parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `templateId` | `string` | Required | The ID of the template the pass will be or was created from. |
| `passExternalId` | `string` | Required | The external ID of the pass you want to modify. |

**Request headers:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Api-Revision` | `string` | Required | The particular API revision you want to use. In general, this is `1.2`. Possible values: `1.2` |

**Request body**

Update a pass. You can provide any of the fields or headers used when creating a pass to update the pass.


**Content-Type:** `application/json`

**One of:**

- [Apple Wallet pass request]({{< ref "/developer/rest-api/wallet/schemas/passes/" >}}#createpassapplewalletrequest)

  A pass for Apple Wallet.

- [Google Wallet pass request]({{< ref "/developer/rest-api/wallet/schemas/passes/" >}}#createpassandroidpayrequest)

  A pass for Google Wallet. Unlike templates, in which the `fieldsModel` contains fields nested inside `module` objects, fields are collapsed in pass requests and responses. The `fieldType` corresponds to the template field module that the field belongs to.

Aside from differences in field composition, and a lack of beacons, Google Wallet passes are very similar to Apple Wallet passes.



**Responses**

**`200`** The response contains a [`ticketId`](/docs/developer/rest-api/wallet/operations/tickets/) that you can use to look up the operation.

Response body:

**Content-Type:** `application/json`

- **`ticketId`** `integer`

  An identifier for this operation.

**`400`** The request was malformed.

**`404`** The pass or template ID does not exist.

**Examples**

*Example request*

```http
PUT /v1/pass/template/123/id/mypass HTTP/1.1
Content-Type: application/json
Authorization: Basic <Base64 key>
Api-Revision: 1.2

{
    "fields": {
       "Coupon": {
          "changeMessage": "Enjoy %@ off your next order!",
          "value": "20%",
          "label": "Coupon"
       },
       "SiteAddress": {
          "changeMessage": "Check out things we think you would like at %@",
          "value": "https://www.example.com/new?custnumb=123456",
          "label": "personal deals"
       },
       "InStore": {
          "changeMessage": "Or visit your nearest store at %@",
          "value": "1234 Fake St.",
          "label": "nearestStore"
       },
       "thumbnail_image": {
          "value": "https:\/\/example.com\/assets\/favicon.png"
       }
    },
    "beacons": [
       {
          "uuid": "55502220-A123-A88A-F321-555A444B333C",
          "relevantText": "You are near the Ship",
          "major": 1,
          "minor": 777
       },
       {
          "uuid": "55502220-A123-A88A-F321-555A444B333C",
          "relevantText": "You are near the Ship"
       }
    ],
    "locations":[
       {
           "longitude": -122.374,
           "latitude": 37.618,
           "relevantText": "Hello loc0",
           "streetAddress1": "address line #1",
           "streetAddress2": "address line #2",
           "city": "San Francisco",
           "region": "CA",
           "regionCode": "94404",
           "country": "US"
       }
    ]
}

```

*Response*

```http
HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
      "ticketId": 1234
}

```

---

