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

# Get or Create Public Token

> Returns an existing public token for the shop, or creates a new one if none exists

<Note>
  **OAuth scope:** `shop_read`

  API keys have full access to this endpoint.
</Note>


## OpenAPI

````yaml PUT /open-api/v1.0/public-token
openapi: 3.1.0
info:
  title: Fourthwall APIs
  description: Service used for management of orders, carts, and payments.
  termsOfService: https://fourthwall.com/terms-of-service
  contact:
    name: Backend team
    url: https://fourthwall.com
    email: backend@fourthwall.com
  version: unspecified
servers:
  - url: https://api.fourthwall.com
    description: Production server
security: []
externalDocs:
  description: OpenAPI documentation
  url: https://docs.fourthwall.com
paths:
  /open-api/v1.0/public-token:
    put:
      tags:
        - Shop
      summary: Get or create a public token
      description: >-
        Returns an existing public token for the shop, or creates a new one if
        none exists
      operationId: get-public-token
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/com.fourthwall.app.openapi.endpoint.OpenApiShopEndpoint.PublicTokenResponse
      security:
        - oauth:
            - shop_read
        - basicAuth: []
      externalDocs:
        url: >-
          https://docs.fourthwall.com/api-reference/platform/shop/get-public-token
components:
  schemas:
    com.fourthwall.app.openapi.endpoint.OpenApiShopEndpoint.PublicTokenResponse:
      type: object
      properties:
        token:
          type: string
      required:
        - token
      title: Public Token Response
  securitySchemes:
    oauth:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: >-
            https://auth.staging.fourthwall.com/auth/realms/Fourthwall/protocol/openid-connect/auth
          scopes:
            donation_read: donation_read
            order_read: order_read
            order_write: order_write
            fulfillment_write: fulfillment_write
            giveaway_read: giveaway_read
            giveaway_write: giveaway_write
            memberships_read: memberships_read
            memberships_write: memberships_write
            promotions_write: promotions_write
            promotions_read: promotions_read
            offer_read: offer_read
            offer_write: offer_write
            shop_read: shop_read
            thankyou_read: thankyou_read
            thankyou_write: thankyou_write
            webhook_read: webhook_read
            webhook_write: webhook_write
            media_read: media_read
            media_write: media_write
            analytics_read: analytics_read
            samples_read: samples_read
            samples_write: samples_write
            dns_read: dns_read
            dns_write: dns_write
            settings_read: settings_read
            payout_read: payout_read
            integrations_read: integrations_read
    basicAuth:
      type: http
      scheme: basic

````