> ## Documentation Index
> Fetch the complete documentation index at: https://yn-c9bb3266.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Campaign Rule

> Creates a new rule for a campaign that defines conditions and benefits.



## OpenAPI

````yaml POST /v1/campaign-rules
openapi: 3.1.0
info:
  title: Yuno Payments API
  description: >-
    Yuno payment orchestration platform — unified REST API for payments,
    checkout sessions, customers, payment methods, subscriptions, payouts,
    marketplace transfers, and banking connectivity across Latin America.
  version: 1.0.0
  contact:
    name: Yuno Support
    email: support@y.uno
    url: https://docs.y.uno
  license:
    name: Proprietary
    url: https://y.uno
servers:
  - url: https://api-sandbox.y.uno
    description: Sandbox
  - url: https://api.y.uno
    description: Production
security:
  - publicApiKey: []
    privateSecretKey: []
paths:
  /v1/campaign-rules:
    post:
      tags:
        - Campaigns
      summary: Create campaign rule
      description: Creates a new rule for a campaign that defines conditions and benefits.
      operationId: createCampaignRule
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignRuleRequest'
            example:
              campaign_id: c1d2e3f4-a5b6-7c8d-9e0f-1a2b3c4d5e6f
              name: 10% off cards
              conditions:
                payment_method: CARD
                min_amount: 100
              benefit:
                type: DISCOUNT
                value: 10
                unit: PERCENTAGE
      responses:
        '201':
          description: Campaign rule created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignRule'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CampaignRuleRequest:
      type: object
      required:
        - campaign_id
        - name
        - conditions
        - benefit
      properties:
        campaign_id:
          type: string
          format: uuid
          description: Associated campaign ID
        name:
          type: string
          description: Rule name
        conditions:
          type: object
          properties:
            payment_method:
              type: string
              description: Payment method filter
            min_amount:
              type: number
              description: Minimum transaction amount
            max_amount:
              type: number
              description: Maximum transaction amount
            bin_range:
              type: string
              description: Card BIN range filter
        benefit:
          type: object
          required:
            - type
            - value
          properties:
            type:
              type: string
              enum:
                - DISCOUNT
                - CASHBACK
                - INSTALLMENT_RATE
              description: Benefit type
            value:
              type: number
              description: Benefit value
            unit:
              type: string
              enum:
                - PERCENTAGE
                - FIXED
              description: Benefit unit
    CampaignRule:
      type: object
      properties:
        id:
          type: string
          format: uuid
        campaign_id:
          type: string
          format: uuid
        name:
          type: string
        status:
          type: string
          enum:
            - ACTIVE
            - INACTIVE
        conditions:
          type: object
        benefit:
          type: object
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    Error:
      type: object
      description: >-
        Standard error envelope returned by every Yuno service for any 4xx or
        5xx response. Top level. `code` is a stable SCREAMING_SNAKE_CASE
        identifier. `messages` is always an array of strings, even when there is
        only one entry. There is no `error` wrapper, no singular `message`, no
        `type`, no `details`. See the Error handling guide for the full code
        catalog.
      required:
        - code
        - messages
      properties:
        code:
          type: string
          description: >-
            Stable, machine readable identifier. Branch on this in your client.
            Common values include `BAD_REQUEST`, `VALIDATION_ERROR`,
            `INVALID_REQUEST`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`,
            `TOO_MANY_REQUESTS`, `INTERNAL_ERROR`, `BAD_GATEWAY`,
            `SERVICE_UNAVAILABLE`, plus business codes like
            `CUSTOMER_ID_DUPLICATED`, `RECIPIENT_NOT_FOUND`, `INVALID_STATE`,
            and the `PROVIDER_*` family for downstream provider errors.
          example: VALIDATION_ERROR
        messages:
          type: array
          description: >-
            Human readable details. Validation errors put one entry per failed
            field, formatted `"fieldName message"`.
          items:
            type: string
          example:
            - merchant_customer_id must not be blank
      example:
        code: VALIDATION_ERROR
        messages:
          - amount must be greater than 0
          - country must not be blank
  securitySchemes:
    publicApiKey:
      type: apiKey
      in: header
      name: public-api-key
      description: Your public API key from the Yuno Dashboard
    privateSecretKey:
      type: apiKey
      in: header
      name: private-secret-key
      description: Your private secret key (server-side only)

````