# Create Edition

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/management/attendance_challenge/editions:
    post:
      summary: Create Edition
      deprecated: false
      description: ''
      tags:
        - API Reference/Management API/AttendanceChallenge/Editions
      parameters:
        - name: dry_run
          in: query
          description: When true, the request doesn't persist record on success
          example: ''
          schema:
            type: boolean
        - name: Content-Type
          in: header
          description: '[Details](doc-341635)'
          required: true
          example: application/json
          schema:
            type: string
            default: application/json
            const: application/json
        - name: X-User-Agent
          in: header
          description: Arbitrary identifier of your client. [Details](doc-341635)
          required: true
          example: '{{X_USER_AGENT}}'
          schema:
            type: string
            default: '{{X_USER_AGENT}}'
        - name: X-Product-Name
          in: header
          description: API Product for API context. [Details](doc-341635)
          required: true
          example: '{{PRODUCT_NAME}}'
          schema:
            type: string
            default: '{{PRODUCT_NAME}}'
        - name: X-Customer
          in: header
          description: Customer for API context.  [Details](doc-342139)
          required: false
          example: '{{CUSTOMER_ID}}'
          schema:
            type: string
            default: '{{CUSTOMER_ID}}'
        - name: Authorization
          in: header
          description: '[Member](doc-342129) or [User](doc-342130) Authorization.'
          required: false
          example: Bearer {{_OAUTH_TOKEN}}
          schema:
            type: string
            default: Bearer {{_OAUTH_TOKEN}}
        - name: X-Client-Authorization
          in: header
          description: '[Token](doc-342128) Authorization.'
          example: '{{API_TOKEN}}'
          schema:
            type: string
            default: '{{API_TOKEN}}'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                edition:
                  type: object
                  x-apidog-refs:
                    01EDITION_CREATE: &ref_1
                      $ref: '#/components/schemas/Edition'
                  x-apidog-orders:
                    - 01EDITION_CREATE
                  properties:
                    id: &ref_2
                      $ref: '#/components/schemas/id1'
                    start_date:
                      type: string
                      description: The month determining the start of the Edition
                      format: regex
                      minLength: 1
                      pattern: ^(0[1-9]|1[0-2])-\d{4}$
                      examples:
                        - 2026-04
                    end_date:
                      type: string
                      description: The month determining the end of the Edition
                      format: regex
                      minLength: 1
                      pattern: ^(0[1-9]|1[0-2])-\d{4}$
                      examples:
                        - 2026-11
                    stages:
                      type: array
                      items:
                        type: object
                        properties:
                          date:
                            type: string
                            description: The month of the Edition
                            minLength: 1
                            pattern: ^(0[1-9]|1[0-2])-\d{4}$
                            examples:
                              - 2026-05
                          starts_at:
                            type: string
                            format: date-time
                            examples:
                              - '2026-04-01T00:00:00.000000+02:00'
                            readOnly: true
                            description: >-
                              The actual time (reflecting the Customer's
                              timezone and start hour of the Edition) when the
                              Edition starts.
                          ends_at:
                            type: string
                            format: date-time
                            examples:
                              - '2026-11-31T23:59:59.999999+01:00'
                            readOnly: true
                            description: >-
                              The actual time (reflecting the Customer's
                              timezone and start hour of the Edition) when the
                              Edition ends.
                          extra_period_ends_at:
                            type: string
                            format: date-time
                            examples:
                              - '2026-12-10T23:59:59.999999+01:00'
                            readOnly: true
                            description: >-
                              The time (reflecting the Customer's timezone and
                              start hour of the Edition) when the extra period
                              ends.
                        x-apidog-orders:
                          - date
                          - starts_at
                          - ends_at
                          - extra_period_ends_at
                        required:
                          - date
                        x-apidog-ignore-properties: []
                      description: Stages (names of months). Enumerated.
                      minItems: 1
                      uniqueItems: true
                      readOnly: true
                    starts_at:
                      type: string
                      format: date-time
                      examples:
                        - '2026-04-01T00:00:00.000000+02:00'
                      readOnly: true
                      description: >-
                        The actual time (reflecting the Customer's timezone and
                        start hour of the Edition) when the Edition starts.
                    ends_at:
                      type: string
                      format: date-time
                      examples:
                        - '2026-11-31T23:59:59.999999+01:00'
                      readOnly: true
                      description: >-
                        The actual time (reflecting the Customer's timezone,
                        start hour of the Edition and the extra days) when the
                        Edition ends.
                    nominal_ends_at:
                      type: string
                      format: date-time
                      examples:
                        - '2026-11-31T23:59:59.999999+01:00'
                      readOnly: true
                      description: >-
                        The actual nominal (end of month) time (reflecting the
                        Customer's timezone, start hour of the Edition) when the
                        Edition ends.
                    stages_streak_goal:
                      type: integer
                      minimum: 1
                      examples:
                        - 3
                      description: >-
                        Number of subsequently completed stages required for
                        member to get a reward
                    monthly_attendances_goal:
                      type: integer
                      description: >-
                        Number of the attendances completed during a stage
                        required to have this stage completed by a member
                      minimum: 1
                      examples:
                        - 8
                    daily_value_goal:
                      type: number
                      description: >-
                        Total amount money on scanned (and verified) receipts
                        made by member on a single day to mark the day as
                        completed
                      minimum: 0.01
                      examples:
                        - 100
                    entries_limit:
                      type: integer
                      description: >-
                        Maximum number of entries of a single member to the
                        Edition. When null, there is no limit.
                      minimum: 1
                      default: 1
                      examples:
                        - 2
                      nullable: true
                    first_stage_reward_id:
                      description: >-
                        ID of MPC exclusive Offer granted to Member when he
                        completes his first stage of the Edition 
                      examples:
                        - 5513
                      anyOf:
                        - &ref_3
                          $ref: '#/components/schemas/id'
                          description: >-
                            ID of MPC exclusive Offer granted to Member when he
                            completes histfirst stage of the Edition 
                        - type: 'null'
                    first_stage_reward_name:
                      type: string
                      readOnly: true
                      description: Name of MPC exclusive Offer
                    streak_reward_value:
                      type: integer
                      description: >-
                        Amount of money granted to Member after completing the
                        streak
                      examples:
                        - 150
                      minimum: 1
                    title: &ref_0
                      $ref: '#/components/schemas/LocalizedContent'
                    rules: *ref_0
                    onboarding_description: *ref_0
                    bee_email_json:
                      type: object
                      properties: {}
                      x-apidog-orders: []
                      description: >-
                        Bee JSON template for email messages sent within the
                        Edition. It should contain `{{content}}` merge tag for
                        dynamic content.

                        See: [Templating System](doc-354486)
                      x-apidog-ignore-properties: []
                    active:
                      type: boolean
                      default: true
                      description: If false, the Edition is not visible on public endpoints
                    start_hour:
                      type: integer
                      default: 0
                      minimum: 0
                      examples:
                        - 9
                      description: >-
                        Determines the hour of the day at which the each stage
                        (and therefore, Edition) starts and ends
                      nullable: true
                    extra_days:
                      type: integer
                      description: >-
                        The number of additional days after end of the month
                        that allow to fulfill daily goals from the previous
                        month
                      default: 0
                      minimum: 0
                      examples:
                        - 10
                      maximum: 30
                      nullable: true
                    slots_total:
                      type: integer
                      minimum: 1
                      examples:
                        - 100
                      description: Number of members that can participate in the Edition
                    slots_taken:
                      type: integer
                      examples:
                        - 95
                      minimum: 0
                      readOnly: true
                      description: >-
                        Current number of members that participate in the
                        Edition. 
                    excluded_store_ids:
                      type: array
                      items:
                        type: integer
                        examples:
                          - 553
                        minimum: 1
                      description: >-
                        ID of MPC
                        [Stores](https://api.developer.placewise.com/doc-341692.md)
                        that are be excluded from the challenge
                    created_at: &ref_4
                      $ref: '#/components/schemas/date_time.created_at'
                    updated_at: &ref_5
                      $ref: '#/components/schemas/date_time.updated_at'
                    archived_at:
                      anyOf:
                        - &ref_6
                          $ref: '#/components/schemas/date_time.archived_at'
                        - type: 'null'
                    simulation_offset:
                      type: integer
                      description: (Internal) Minutes to speed up the course of the Edition
                      minimum: 1
                      examples:
                        - 3600
                    current_time:
                      type: string
                      format: date-time
                      examples:
                        - '2026-12-10T23:59:59.999999+01:00'
                      readOnly: true
                      description: >-
                        (Internal) Current time for the Edition taking the
                        simulation offset into consideration. 
                  required:
                    - id
                    - start_date
                    - end_date
                    - stages
                    - starts_at
                    - ends_at
                    - stages_streak_goal
                    - monthly_attendances_goal
                    - daily_value_goal
                    - entries_limit
                    - first_stage_reward_id
                    - first_stage_reward_name
                    - streak_reward_value
                    - rules
                    - onboarding_description
                    - bee_email_json
                    - active
                    - start_hour
                    - slots_total
                    - slots_taken
                    - excluded_store_ids
                    - created_at
                    - updated_at
                    - archived_at
                  x-apidog-ignore-properties:
                    - id
                    - start_date
                    - end_date
                    - stages
                    - starts_at
                    - ends_at
                    - nominal_ends_at
                    - stages_streak_goal
                    - monthly_attendances_goal
                    - daily_value_goal
                    - entries_limit
                    - first_stage_reward_id
                    - first_stage_reward_name
                    - streak_reward_value
                    - title
                    - rules
                    - onboarding_description
                    - bee_email_json
                    - active
                    - start_hour
                    - extra_days
                    - slots_total
                    - slots_taken
                    - excluded_store_ids
                    - created_at
                    - updated_at
                    - archived_at
                    - simulation_offset
                    - current_time
              x-apidog-orders:
                - edition
              required:
                - edition
              x-apidog-ignore-properties: []
            example: ''
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  edition: *ref_1
                required:
                  - edition
                x-apidog-orders:
                  - edition
                x-apidog-ignore-properties: []
          headers: {}
          x-apidog-name: Success
        '422':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    examples:
                      - Invalid parameters
                    const: Invalid parameters
                  details:
                    type: object
                    properties: {}
                    x-apidog-orders: []
                    description: 'See: [Params Validation](doc-341637)'
                    additionalProperties: true
                    x-apidog-ignore-properties: []
                required:
                  - error
                  - details
                x-apidog-orders:
                  - error
                  - details
                x-apidog-ignore-properties: []
          headers: {}
          x-apidog-name: Invalid Parameters
      security: []
      x-apidog-folder: API Reference/Management API/AttendanceChallenge/Editions
      x-apidog-status: released
      x-run-in-apidog: https://app.eu.apidog.com/web/project/346351/apis/api-4351907-run
components:
  schemas:
    date_time.archived_at:
      type: string
      description: Time of the record archivization
      format: date-time
      examples:
        - '2022-11-15T16:25:58.099512Z'
      readOnly: true
      nullable: true
      x-apidog-folder: ''
    date_time.updated_at:
      type: string
      description: Time of the last record update
      format: date-time
      examples:
        - '2022-11-15T16:25:58.099512Z'
      readOnly: true
      x-apidog-folder: ''
    date_time.created_at:
      type: string
      description: Time of record creation
      format: date-time
      examples:
        - '2022-11-05T16:25:58.099512Z'
      readOnly: true
      x-apidog-folder: ''
    LocalizedContent:
      type: object
      properties: {}
      x-apidog-orders: []
      title: ''
      examples:
        - en: Text
      additionalProperties:
        type: string
        description: >-
          The actual set of languages depends on LC configuration. See:
          [Localization](doc-341959)
        examples:
          - Tekst
        nullable: true
      x-apidog-ignore-properties: []
      nullable: true
      x-apidog-folder: ''
    id:
      type: integer
      title: ''
      description: Identifier
      examples:
        - 1
      minimum: 1
      x-apidog-folder: ''
    id1:
      type: integer
      description: Primary identifier of the record
      format: uint64
      readOnly: true
      examples:
        - 1
      x-apidog-folder: ''
    Edition:
      type: object
      properties:
        id: *ref_2
        start_date: &ref_7
          type: string
          description: The month determining the start of the Edition
          format: regex
          minLength: 1
          pattern: ^(0[1-9]|1[0-2])-\d{4}$
          examples:
            - 2026-04
        end_date: &ref_8
          type: string
          description: The month determining the end of the Edition
          format: regex
          minLength: 1
          pattern: ^(0[1-9]|1[0-2])-\d{4}$
          examples:
            - 2026-11
        stages:
          type: array
          items:
            type: object
            properties:
              date: &ref_9
                type: string
                description: The month of the Edition
                minLength: 1
                pattern: ^(0[1-9]|1[0-2])-\d{4}$
                examples:
                  - 2026-05
              starts_at: &ref_10
                type: string
                format: date-time
                examples:
                  - '2026-04-01T00:00:00.000000+02:00'
                readOnly: true
                description: >-
                  The actual time (reflecting the Customer's timezone and start
                  hour of the Edition) when the Edition starts.
              ends_at: &ref_11
                type: string
                format: date-time
                examples:
                  - '2026-11-31T23:59:59.999999+01:00'
                readOnly: true
                description: >-
                  The actual time (reflecting the Customer's timezone and start
                  hour of the Edition) when the Edition ends.
              extra_period_ends_at: &ref_12
                type: string
                format: date-time
                examples:
                  - '2026-12-10T23:59:59.999999+01:00'
                readOnly: true
                description: >-
                  The time (reflecting the Customer's timezone and start hour of
                  the Edition) when the extra period ends.
            x-apidog-orders: &ref_13
              - date
              - starts_at
              - ends_at
              - extra_period_ends_at
            required:
              - date
            x-apidog-ignore-properties: []
          description: Stages (names of months). Enumerated.
          minItems: 1
          uniqueItems: true
          readOnly: true
        starts_at: &ref_14
          type: string
          format: date-time
          examples:
            - '2026-04-01T00:00:00.000000+02:00'
          readOnly: true
          description: >-
            The actual time (reflecting the Customer's timezone and start hour
            of the Edition) when the Edition starts.
        ends_at: &ref_15
          type: string
          format: date-time
          examples:
            - '2026-11-31T23:59:59.999999+01:00'
          readOnly: true
          description: >-
            The actual time (reflecting the Customer's timezone, start hour of
            the Edition and the extra days) when the Edition ends.
        nominal_ends_at: &ref_16
          type: string
          format: date-time
          examples:
            - '2026-11-31T23:59:59.999999+01:00'
          readOnly: true
          description: >-
            The actual nominal (end of month) time (reflecting the Customer's
            timezone, start hour of the Edition) when the Edition ends.
        stages_streak_goal: &ref_17
          type: integer
          minimum: 1
          examples:
            - 3
          description: >-
            Number of subsequently completed stages required for member to get a
            reward
        monthly_attendances_goal: &ref_18
          type: integer
          description: >-
            Number of the attendances completed during a stage required to have
            this stage completed by a member
          minimum: 1
          examples:
            - 8
        daily_value_goal: &ref_19
          type: number
          description: >-
            Total amount money on scanned (and verified) receipts made by member
            on a single day to mark the day as completed
          minimum: 0.01
          examples:
            - 100
        entries_limit: &ref_20
          type: integer
          description: >-
            Maximum number of entries of a single member to the Edition. When
            null, there is no limit.
          minimum: 1
          default: 1
          examples:
            - 2
          nullable: true
        first_stage_reward_id:
          description: >-
            ID of MPC exclusive Offer granted to Member when he completes his
            first stage of the Edition 
          examples: &ref_21
            - 5513
          anyOf:
            - *ref_3
            - &ref_22
              type: 'null'
        first_stage_reward_name: &ref_23
          type: string
          readOnly: true
          description: Name of MPC exclusive Offer
        streak_reward_value: &ref_24
          type: integer
          description: Amount of money granted to Member after completing the streak
          examples:
            - 150
          minimum: 1
        title: *ref_0
        rules: *ref_0
        onboarding_description: *ref_0
        bee_email_json:
          type: object
          properties: {}
          x-apidog-orders: []
          description: >-
            Bee JSON template for email messages sent within the Edition. It
            should contain `{{content}}` merge tag for dynamic content.

            See: [Templating System](doc-354486)
          x-apidog-ignore-properties: []
        active:
          type: boolean
          default: true
          description: If false, the Edition is not visible on public endpoints
        start_hour:
          type: integer
          default: 0
          minimum: 0
          examples:
            - 9
          description: >-
            Determines the hour of the day at which the each stage (and
            therefore, Edition) starts and ends
          nullable: true
        extra_days:
          type: integer
          description: >-
            The number of additional days after end of the month that allow to
            fulfill daily goals from the previous month
          default: 0
          minimum: 0
          examples:
            - 10
          maximum: 30
          nullable: true
        slots_total:
          type: integer
          minimum: 1
          examples:
            - 100
          description: Number of members that can participate in the Edition
        slots_taken:
          type: integer
          examples:
            - 95
          minimum: 0
          readOnly: true
          description: 'Current number of members that participate in the Edition. '
        excluded_store_ids:
          type: array
          items:
            type: integer
            examples:
              - 553
            minimum: 1
          description: >-
            ID of MPC
            [Stores](https://api.developer.placewise.com/doc-341692.md) that are
            be excluded from the challenge
        created_at: *ref_4
        updated_at: *ref_5
        archived_at:
          anyOf:
            - *ref_6
            - type: 'null'
        simulation_offset:
          type: integer
          description: (Internal) Minutes to speed up the course of the Edition
          minimum: 1
          examples:
            - 3600
        current_time:
          type: string
          format: date-time
          examples:
            - '2026-12-10T23:59:59.999999+01:00'
          readOnly: true
          description: >-
            (Internal) Current time for the Edition taking the simulation offset
            into consideration. 
      x-apidog-orders:
        - id
        - 01KV63N0K1HDN8EPJE32Q6YK56
        - title
        - rules
        - onboarding_description
        - bee_email_json
        - active
        - start_hour
        - extra_days
        - slots_total
        - slots_taken
        - excluded_store_ids
        - created_at
        - updated_at
        - archived_at
        - simulation_offset
        - current_time
      required:
        - id
        - start_date
        - end_date
        - stages
        - starts_at
        - ends_at
        - stages_streak_goal
        - monthly_attendances_goal
        - daily_value_goal
        - entries_limit
        - first_stage_reward_id
        - first_stage_reward_name
        - streak_reward_value
        - rules
        - onboarding_description
        - bee_email_json
        - active
        - start_hour
        - slots_total
        - slots_taken
        - excluded_store_ids
        - created_at
        - updated_at
        - archived_at
      x-apidog-refs:
        01KV63N0K1HDN8EPJE32Q6YK56:
          $ref: '#/components/schemas/Edition%20Core'
      x-apidog-ignore-properties:
        - start_date
        - end_date
        - stages
        - starts_at
        - ends_at
        - nominal_ends_at
        - stages_streak_goal
        - monthly_attendances_goal
        - daily_value_goal
        - entries_limit
        - first_stage_reward_id
        - first_stage_reward_name
        - streak_reward_value
      x-apidog-folder: ''
    Edition Core:
      type: object
      properties:
        start_date: *ref_7
        end_date: *ref_8
        stages:
          type: array
          items:
            type: object
            properties:
              date: *ref_9
              starts_at: *ref_10
              ends_at: *ref_11
              extra_period_ends_at: *ref_12
            x-apidog-orders: *ref_13
            required:
              - date
            x-apidog-ignore-properties: []
          description: Stages (names of months). Enumerated.
          minItems: 1
          uniqueItems: true
          readOnly: true
        starts_at: *ref_14
        ends_at: *ref_15
        nominal_ends_at: *ref_16
        stages_streak_goal: *ref_17
        monthly_attendances_goal: *ref_18
        daily_value_goal: *ref_19
        entries_limit: *ref_20
        first_stage_reward_id:
          description: >-
            ID of MPC exclusive Offer granted to Member when he completes his
            first stage of the Edition 
          examples: *ref_21
          anyOf:
            - *ref_3
            - *ref_22
        first_stage_reward_name: *ref_23
        streak_reward_value: *ref_24
      x-apidog-orders:
        - start_date
        - end_date
        - stages
        - starts_at
        - ends_at
        - nominal_ends_at
        - stages_streak_goal
        - monthly_attendances_goal
        - daily_value_goal
        - entries_limit
        - first_stage_reward_id
        - first_stage_reward_name
        - streak_reward_value
      required:
        - start_date
        - end_date
        - stages
        - starts_at
        - ends_at
        - stages_streak_goal
        - monthly_attendances_goal
        - daily_value_goal
        - entries_limit
        - first_stage_reward_id
        - first_stage_reward_name
        - streak_reward_value
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
  securitySchemes: {}
servers:
  - url: https://api.mpc.dev.placewise.com
    description: Staging
security: []

```