> ## Documentation Index
> Fetch the complete documentation index at: https://docs.passform.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Post v1pass 

> Upserts a pass for a given template



## OpenAPI

````yaml /api-reference/openapi.json post /v1/pass/{templateId}/{passId}
openapi: 3.1.0
info:
  title: Passform API
  description: The Passform API for creating Google and Apple wallet passes
  version: 0.1.0
servers:
  - url: https://api.passform.io
security: []
tags:
  - name: auth
    description: Routes for managing API keys
  - name: templates
    description: >-
      Templates represent the appearance of a pass. They include information on
      things such as icons, images, colours and text. A template is used by a
      pass to define how the pass should look and behave.
  - name: passes
    description: >-
      A pass is an individual instance based on a template. It contains details
      that are specific to its instance.
  - name: apple
    description: >-
      Routes used by apple to update passes and manage devices associated to
      passes.
externalDocs:
  url: https://swagger.io
  description: Find more info here
paths:
  /v1/pass/{templateId}/{passId}:
    post:
      tags:
        - passes
      description: Upserts a pass for a given template
      parameters:
        - schema:
            type: string
          in: query
          name: accountId
          required: false
        - schema:
            type: string
          in: path
          name: templateId
          required: true
        - schema:
            type: string
          in: path
          name: passId
          required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              allOf:
                - examples:
                    - code: ASDF123
                      expiry: '2025-04-04T19:41:12.733Z'
                      validFrom: '2025-04-04T19:41:12.733Z'
                      voided: false
                      fields:
                        - key: voucher
                          label: free drinks
                          value: '1'
                      backFields:
                        - key: terms
                          label: Terms and Condictions
                          value: https://myshout.co/terms
                  type: object
                  properties:
                    voided:
                      default: false
                      description: Set this to true once the pass has been used
                      type: boolean
                    primaryValue:
                      description: Required for 'generic' pass types.
                      type: string
                    metadata:
                      description: >-
                        Metadata is for your internal use. It is not exposed to
                        users through passes.
                         The metadata is limited to 5000 characters when serialized to JSON.
                      type: object
                      additionalProperties: {}
                    fields:
                      maxItems: 4
                      type: array
                      items:
                        description: >-
                          A field that is displayed in a voucher, that is
                          identified by the key. It can be defined in a template
                          and overwritten in a pass
                        examples:
                          - key: voucher
                            label: free drinks
                            value: '1'
                        type: object
                        properties:
                          key:
                            description: >-
                              The identifier of the field. This is not presented
                              to the user.
                            type: string
                          label:
                            description: The label to go with the value.
                            type: string
                          value:
                            description: The data to display.
                            type: string
                        required:
                          - key
                          - label
                          - value
                    backFields:
                      description: The values can be text, numbers or urls.
                      type: array
                      items:
                        description: >-
                          A field that is displayed in a voucher, that is
                          identified by the key. It can be defined in a template
                          and overwritten in a pass
                        examples:
                          - key: voucher
                            label: free drinks
                            value: '1'
                        type: object
                        properties:
                          key:
                            description: >-
                              The identifier of the field. This is not presented
                              to the user.
                            type: string
                          label:
                            description: The label to go with the value.
                            type: string
                          value:
                            description: The data to display.
                            type: string
                        required:
                          - key
                          - label
                          - value
                  required:
                    - voided
                - examples:
                    - code: ASDF123
                      expiry: '2025-04-04T19:41:12.733Z'
                      validFrom: '2025-04-04T19:41:12.733Z'
                      voided: false
                      fields:
                        - key: voucher
                          label: free drinks
                          value: '1'
                      backFields:
                        - key: terms
                          label: Terms and Condictions
                          value: https://myshout.co/terms
                  type: object
                  properties:
                    code:
                      minLength: 1
                      description: >-
                        The code that is used as data in the QR Code. This can
                        be different to the id if you wish to have a url or more
                        data in the QR code.
                      type: string
                    validFrom:
                      anyOf:
                        - format: date-time
                          description: >-
                            The UTC date at which the pass becomes valid. If
                            this is not provided the pass is valid from when it
                            is created.
                          type: string
                        - type: 'null'
                    expiry:
                      anyOf:
                        - format: date-time
                          description: >-
                            The UTC date at which the pass expires. If this is
                            not provided the voucher will have no expiry.
                          type: string
                        - type: 'null'
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  pass:
                    description: The current details of a pass instance
                    type: object
                    properties:
                      id:
                        minLength: 1
                        description: >-
                          Id is a unique identifier of the pass, it could be a
                          voucher code or membership id
                        type: string
                      templateId:
                        description: Template id used by this voucher
                        type: string
                      accountId:
                        description: The account id that created the pass/template
                        type: string
                      code:
                        minLength: 1
                        description: >-
                          The code that is used as data in the QR Code. This can
                          be different to the id if you wish to have a url or
                          more data in the QR code.
                        type: string
                      expiry:
                        anyOf:
                          - format: date-time
                            description: >-
                              The UTC date at which the pass expires. If this is
                              not provided the voucher will have no expiry.
                            type: string
                          - type: 'null'
                      validFrom:
                        anyOf:
                          - format: date-time
                            description: >-
                              The UTC date at which the pass becomes valid. If
                              this is not provided the pass is valid from when
                              it is created.
                            type: string
                          - type: 'null'
                      voided:
                        default: false
                        description: Set this to true once the pass has been used
                        type: boolean
                      primaryValue:
                        description: Required for 'generic' pass types.
                        type: string
                      metadata:
                        description: >-
                          Metadata is for your internal use. It is not exposed
                          to users through passes.
                           The metadata is limited to 5000 characters when serialized to JSON.
                        type: object
                        additionalProperties: {}
                      fields:
                        maxItems: 4
                        type: array
                        items:
                          description: >-
                            A field that is displayed in a voucher, that is
                            identified by the key. It can be defined in a
                            template and overwritten in a pass
                          type: object
                          properties:
                            key:
                              description: >-
                                The identifier of the field. This is not
                                presented to the user.
                              type: string
                            label:
                              description: The label to go with the value.
                              type: string
                            value:
                              description: The data to display.
                              type: string
                          required:
                            - key
                            - label
                            - value
                          example:
                            key: voucher
                            label: free drinks
                            value: '1'
                      backFields:
                        description: The values can be text, numbers or urls.
                        type: array
                        items:
                          description: >-
                            A field that is displayed in a voucher, that is
                            identified by the key. It can be defined in a
                            template and overwritten in a pass
                          type: object
                          properties:
                            key:
                              description: >-
                                The identifier of the field. This is not
                                presented to the user.
                              type: string
                            label:
                              description: The label to go with the value.
                              type: string
                            value:
                              description: The data to display.
                              type: string
                          required:
                            - key
                            - label
                            - value
                          example:
                            key: voucher
                            label: free drinks
                            value: '1'
                    required:
                      - id
                      - templateId
                      - accountId
                      - code
                      - expiry
                      - validFrom
                      - voided
                    example:
                      id: WgXcQ
                      templateId: fan-reward
                      accountId: LDvGjp645u6Q6t9pbvog
                      code: ASDF123
                      expiry: '2025-04-04T19:41:12.733Z'
                      validFrom: '2025-04-04T19:41:12.733Z'
                      voided: false
                      fields:
                        - key: voucher
                          label: free drinks
                          value: '1'
                      backFields:
                        - key: terms
                          label: Terms and Condictions
                          value: https://myshout.co/terms
                  googleUrl:
                    type: string
                  appleUrl:
                    type: string
                  webUrl:
                    type: string
                required:
                  - pass
                  - googleUrl
                  - appleUrl
                  - webUrl
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/def-0'
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/def-0'
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/def-0'
      security:
        - bearerAuth: []
components:
  schemas:
    def-0:
      type: object
      properties:
        statusCode:
          type: number
        code:
          type: string
        error:
          type: string
        message:
          type: string
      title: HttpError
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````