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

# Update the all-access pass

> Creates or updates the store's all-access pass.

Creates or updates the store's all-access pass. The period is fixed at 30 days. Turning the pass on (`enabled: true`) needs a `price` above 0, otherwise the call returns `400` with `Set a price above 0 to turn the pass on`. Only the fields you send change. Requires the `WRITE_INVENTORY` scope.

<Note>
  These endpoints only work on a store whose type is `digital`. On any other store they return `403` with `This is only available on digital stores.` See [Digital stores](/digital-stores).
</Note>

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT https://api.salesive.com/api/v1/digital-products/pass \
    -H "Authorization: Bearer app_<your-app-access-token>" \
    -H "Content-Type: application/json" \
    -d '{"enabled":true,"name":"All-access pass","price":7500}'
  ```
</CodeGroup>


## OpenAPI

````yaml apps-api/specs/digital.json PUT /digital-products/pass
openapi: 3.1.0
info:
  title: Salesive Apps API , Digital products
  description: >-
    Digital store endpoints (products, the all-access pass and buyer access)
    callable by an installed third-party app using its app access token. They
    only work on stores whose type is `digital`. The target store is bound to
    the token server-side by the OAuth install flow.
  version: 1.0.0
servers:
  - url: https://api.salesive.com/api/v1
    description: Production
security:
  - AppToken: []
paths:
  /digital-products/pass:
    put:
      tags:
        - digital-products
      summary: Update the all-access pass
      description: >-
        Creates or updates the store's all-access pass: one price for 30 days of
        every listed product marked `inPass`. The 30-day period is fixed.
        Turning the pass on needs a price above 0. Only the fields you send
        change. Requires the `WRITE_INVENTORY` scope. The store must be a
        digital store, otherwise the call returns 403.
      operationId: updateDigitalPass
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - enabled
              properties:
                enabled:
                  type: boolean
                  description: Turn the pass on or off.
                name:
                  type: string
                  description: Max 80 characters.
                description:
                  type: string
                  description: Max 1,000 characters.
                price:
                  type: number
                  minimum: 0
                  description: >-
                    Price for 30 days in the store currency. Above 0 when
                    `enabled` is `true`.
              example:
                enabled: true
                name: All-access pass
                description: Every book in the store for 30 days.
                price: 7500
      responses:
        '200':
          description: 'Update the all-access pass: success.'
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - success
                  - message
                  - data
                properties:
                  status:
                    type: integer
                    example: 200
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: All-access pass saved successfully
                  data:
                    type: object
                    properties:
                      pass:
                        $ref: '#/components/schemas/DigitalPass'
                    example:
                      pass:
                        _id: 6702e0a1e1b3a40012cd4001
                        shop: 66a1eee0e1b3a40012ab0001
                        enabled: true
                        name: All-access pass
                        description: Every book in the store for 30 days.
                        price: 7500
                        periodDays: 30
                        configured: true
                        productCount: 12
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
components:
  schemas:
    DigitalPass:
      type: object
      description: >-
        The store's all-access pass: one price for 30 days of every listed
        product marked `inPass`. A store that never saved one reads as the
        defaults with `configured: false`.
      properties:
        enabled:
          type: boolean
        name:
          type: string
          description: Max 80 characters. Default `All-access pass`.
        description:
          type: string
          description: Max 1,000 characters.
        price:
          type: number
          description: >-
            Price for one period, in the store currency. Must be above 0 to turn
            the pass on.
        periodDays:
          type: integer
          description: Always 30.
        configured:
          type: boolean
          description: '`false` until the pass has been saved once.'
        productCount:
          type: integer
          description: 'Listed products with `inPass: true`.'
  responses:
    BadRequest:
      description: The body or query failed validation. `message` says which rule.
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: integer
                example: 400
              success:
                type: boolean
                example: false
              message:
                type: string
                example: A one-time price is required
              data:
                type: object
                nullable: true
    Unauthorized:
      description: Missing or invalid app access token.
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: integer
                example: 401
              success:
                type: boolean
                example: false
              message:
                type: string
                example: App token expired or invalid.
              data:
                type: object
                nullable: true
    Forbidden:
      description: >-
        The app token lacks the required scope (`READ_INVENTORY` for reads,
        `WRITE_INVENTORY` for writes), or the store is not a digital store
        (`This is only available on digital stores.`).
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: integer
                example: 403
              success:
                type: boolean
                example: false
              message:
                type: string
                example: >-
                  This app is missing the required permission(s):
                  WRITE_INVENTORY
              data:
                type: object
                nullable: true
  securitySchemes:
    AppToken:
      type: http
      scheme: bearer
      description: >-
        Installed-app access token (prefix app_), issued by the OAuth install
        flow. The store is bound to the token server-side , never send a shop
        id.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.