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

# Create promo code



## OpenAPI

````yaml openapi-v2-affiliate-promo-codes post /promo_codes
openapi: 3.0.1
info:
  title: FirstPromoter API
  version: '1.0'
  description: API for managing promo codes in the FirstPromoter system
servers:
  - url: https://api.firstpromoter.com/api/v2/affiliate
security:
  - BearerAuth: []
paths:
  /promo_codes:
    post:
      tags:
        - Promo Codes
      summary: Create promo code
      parameters:
        - $ref: '#/components/parameters/AccountId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PromoCodeCreate'
      responses:
        '200':
          description: Promo code created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PromoCode'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    AccountId:
      name: Account-ID
      in: header
      required: true
      description: Account identifier that specifies which account is making the request
      schema:
        type: string
        example: acc_123456
  schemas:
    PromoCodeCreate:
      type: object
      required:
        - code
        - reward_id
        - promoter_campaign_id
      properties:
        code:
          type: string
          description: Code of the promo code
        description:
          type: string
          description: Description of the promo code
        reward_id:
          type: integer
          description: ID of the reward
        promoter_campaign_id:
          type: integer
          description: ID of the promoter campaign
        metadata:
          type: object
          description: Metadata of the promo code
        details:
          type: object
          description: Details of the promo code
    PromoCode:
      type: object
      properties:
        id:
          type: integer
        code:
          type: string
        reward:
          type: object
          properties:
            id:
              type: integer
            name:
              type: string
        ext_id:
          type: string
        description:
          type: string
        company_id:
          type: integer
        promoter_campaign_id:
          type: integer
        metadata:
          type: object
        details:
          type: object
        archived_at:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        message:
          type: string
        code:
          type: string
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Access token passed as a Bearer token in the Authorization header

````