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

# Revoke buyer access

> Removes a buyer's access to a product or the all-access pass.

Revokes a buyer's access. Download links stop working and the title leaves the buyer's library. The optional `reason` is stored with the record. Revoking twice keeps the first reason and time. Granting the same access again reactivates the record. 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/revoke \
    -H "Authorization: Bearer app_<your-app-access-token>" \
    -H "Content-Type: application/json" \
    -d '{"reason":"Chargeback"}'
  ```
</CodeGroup>


## OpenAPI

````yaml apps-api/specs/digital.json POST /digital-access/{id}/revoke
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}/revoke:
    post:
      tags:
        - digital-access
      summary: Revoke buyer access
      description: >-
        Revokes a buyer's access: the download links stop working and the
        library no longer lists the title. Revoking twice keeps the first reason
        and time. Granting the same access again reactivates the record.
        Requires the `WRITE_INVENTORY` scope. The store must be a digital store,
        otherwise the call returns 403.
      operationId: revokeDigitalAccess
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The access record's ObjectId.
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                reason:
                  type: string
                  maxLength: 500
                  description: Why access was removed. Optional.
              example:
                reason: Chargeback
      responses:
        '200':
          description: 'Revoke 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 revoked
                  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: revoked
                      source: granted
                      startsAt: '2026-10-12T08:00:00.000Z'
                      accessUntil: '2026-11-11T08:00:00.000Z'
                      daysLeft: null
                      autoRenew:
                        enabled: false
                        cardLast4: null
                        cardBrand: null
                      revokedAt: '2026-10-13T10:00:00.000Z'
                      revokedReason: Chargeback
                      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.