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

# Favorite a merchant

> Marks a merchant as a favorite so the user receives `VOUCHER_PUBLISHED` events for new vouchers and unlocks vouchers flagged `favoritesOnly`. Idempotent.



## OpenAPI

````yaml /openapi.json post /me/favorites
openapi: 3.1.0
info:
  title: Voucher Platform — Partner Integration API
  version: 1.0.0
  description: >-
    Server-to-server and consumer endpoints used by partner apps to provision
    users, embed the voucher webview, and receive lifecycle webhooks. See the
    [partner integration guide](/docs) for the full narrative including JWT
    setup, HMAC signing, and a worked end-to-end example.
servers:
  - url: http://localhost:4000
    description: Local development
security: []
tags:
  - name: Integrations
    description: >-
      Server-to-server endpoints called from the partner backend. Authenticated
      with an HMAC signature.
  - name: Consumer
    description: >-
      Called from inside the partner-issued webview (or partner-native UI) on
      behalf of an end user. Authenticated with a partner-signed JWT.
paths:
  /me/favorites:
    post:
      tags:
        - Consumer
      summary: Favorite a merchant
      description: >-
        Marks a merchant as a favorite so the user receives `VOUCHER_PUBLISHED`
        events for new vouchers and unlocks vouchers flagged `favoritesOnly`.
        Idempotent.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - merchantId
              additionalProperties: false
              properties:
                merchantId:
                  type: string
                  format: uuid
      responses:
        '200':
          description: Already favorited.
          content:
            application/json:
              schema:
                description: Already favorited.
                type: object
                additionalProperties: true
                properties:
                  userId:
                    type: string
                    format: uuid
                  merchantId:
                    type: string
                    format: uuid
                  createdAt:
                    type: string
                    format: date-time
        '201':
          description: Favorite created.
          content:
            application/json:
              schema:
                description: Favorite created.
                type: object
                additionalProperties: true
                properties:
                  userId:
                    type: string
                    format: uuid
                  merchantId:
                    type: string
                    format: uuid
                  createdAt:
                    type: string
                    format: date-time
        '403':
          description: Merchant outside this partner's scope.
          content:
            application/json:
              schema:
                description: Merchant outside this partner's scope.
                type: object
                additionalProperties: true
                properties:
                  error:
                    type: string
                    example: merchant_out_of_scope
        '404':
          description: Merchant not found.
          content:
            application/json:
              schema:
                description: Merchant not found.
                type: object
                additionalProperties: true
                properties:
                  error:
                    type: string
                    example: merchant_not_found
        '422':
          description: Merchant is inactive.
          content:
            application/json:
              schema:
                description: Merchant is inactive.
                type: object
                additionalProperties: true
                properties:
                  error:
                    type: string
                    example: merchant_inactive
      security:
        - BearerJwt: []
components:
  securitySchemes:
    BearerJwt:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer JWT signed by your app, with `iss` matching the issuer registered
        on the partner record. Verified against your JWKS URL or static public
        key.

````