> ## 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.

# Extend buyer access

> Adds days to a buyer's pass.

Adds `days` to a pass: the new end date is the later of now and the current end date, plus `days`. Lifetime access cannot be extended, and neither can a revoked record (grant it again instead); both return `400`. Send the same `grantId` on a retry to make it a no-op. 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 POST https://api.salesive.com/api/v1/digital-access/6702d3f0e1b3a40012cd3001/extend \
    -H "Authorization: Bearer app_<your-app-access-token>" \
    -H "Content-Type: application/json" \
    -d '{"days":14}'
  ```
</CodeGroup>


## OpenAPI

````yaml apps-api/specs/digital.json POST /digital-access/{id}/extend
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-access/{id}/extend:
    post:
      tags:
        - digital-access
      summary: Extend buyer access
      description: >-
        Adds days to a pass. The new end date is the later of now and the
        current end date, plus `days`. Lifetime access cannot be extended (400),
        and neither can a revoked record: grant it again instead. Send the same
        `grantId` on a retry to make it a no-op. Requires the `WRITE_INVENTORY`
        scope. The store must be a digital store, otherwise the call returns
        403.
      operationId: extendDigitalAccess
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The access record's ObjectId.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - days
              properties:
                days:
                  type: integer
                  minimum: 1
                  maximum: 3650
                  description: Days to add.
                grantId:
                  type: string
                  description: >-
                    Optional ObjectId you generate. Makes a retried request a
                    no-op.
              example:
                days: 14
                grantId: 6702f0b2e1b3a40012cd5002
      responses:
        '200':
          description: 'Extend buyer access: 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: Access extended
                  data:
                    allOf:
                      - $ref: '#/components/schemas/DigitalAccess'
                    example:
                      _id: 6702d3f0e1b3a40012cd3001
                      email: ada@example.com
                      user: 66f0aa11e1b3a40012ef0001
                      scope: product
                      product:
                        _id: 6702c1a4e1b3a40012cd2001
                        name: The Lagos Cookbook
                      kind: pass
                      status: active
                      source: granted
                      startsAt: '2026-10-12T08:00:00.000Z'
                      accessUntil: '2026-11-25T08:00:00.000Z'
                      daysLeft: 44
                      autoRenew:
                        enabled: false
                        cardLast4: null
                        cardBrand: null
                      revokedAt: null
                      revokedReason: ''
                      createdAt: '2026-10-12T08:00:00.000Z'
                      updatedAt: '2026-10-12T08:00:00.000Z'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    DigitalAccess:
      type: object
      description: >-
        One buyer's access record. There is one record per buyer, product (or
        the all-access pass) and kind, so buying a pass again extends the same
        record.
      properties:
        _id:
          type: string
        email:
          type: string
          description: The buyer's email address. Personal data.
        user:
          type: string
          description: The buyer's user id.
        scope:
          type: string
          enum:
            - product
            - store
          description: '`product` for one title, `store` for the all-access pass.'
        product:
          type: object
          nullable: true
          description: The title this record covers. `null` for the all-access pass.
          properties:
            _id:
              type: string
            name:
              type: string
              nullable: true
        kind:
          type: string
          enum:
            - lifetime
            - pass
          description: '`lifetime` never expires. `pass` runs until `accessUntil`.'
        status:
          type: string
          enum:
            - active
            - expired
            - revoked
          description: >-
            The effective status: a pass past its end date reads as `expired`
            even before the nightly sweep runs.
        source:
          type: string
          enum:
            - purchase
            - granted
          description: >-
            `granted` when a seller or app created the record, `purchase` when
            an order did.
        startsAt:
          type: string
          format: date-time
        accessUntil:
          type: string
          format: date-time
          nullable: true
          description: End of the pass. `null` for lifetime access.
        daysLeft:
          type: integer
          nullable: true
          description: >-
            Whole days left on an active pass. `null` for lifetime or inactive
            records.
        autoRenew:
          type: object
          properties:
            enabled:
              type: boolean
            cardLast4:
              type: string
              nullable: true
            cardBrand:
              type: string
              nullable: true
        revokedAt:
          type: string
          format: date-time
          nullable: true
        revokedReason:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
  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
    NotFound:
      description: The record does not exist in this store.
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: integer
                example: 404
              success:
                type: boolean
                example: false
              message:
                type: string
                example: Product not found
              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.