> ## 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.

# Finish Draw

> Finish draw and select winners



## OpenAPI

````yaml PUT /open-api/v1.0/gifting/draw/{id}/finish
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/gifting/draw/{id}/finish:
    put:
      tags:
        - Gifting
      summary: Finish draw
      description: Finish draw and select winners
      operationId: finish-draw
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/com.fourthwall.app.openapi.endpoint.DrawFinishedRequest
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/com.fourthwall.openapi.model.GiftDraftV1'
        '400':
          description: >-
            Possible errors: `GIVEAWAY_DRAW_ALREADY_FINISHED`,
            `GIVEAWAY_DRAW_FINISHED_DATA_MISMATCH`,
            `GIVEAWAY_DRAW_UNSUPPORTED_PLATFORM_OPERATION`
          content:
            application/json:
              examples:
                giveaway-draw-already-finished:
                  value:
                    code: GIVEAWAY_DRAW_ALREADY_FINISHED
                    drawId: <giveawaydrawid>
                giveaway-draw-finished-data-mismatch:
                  value:
                    code: GIVEAWAY_DRAW_FINISHED_DATA_MISMATCH
                    availableGifts: <int>
                    participants: <int>
                giveaway-draw-unsupported-platform-operation:
                  value:
                    code: GIVEAWAY_DRAW_UNSUPPORTED_PLATFORM_OPERATION
                    platform: <giveawaydraw.platform>
        '404':
          description: >-
            Possible errors: `GIVEAWAY_DRAW_NOT_FOUND`,
            `GIVEAWAY_NOT_FOUND_FOR_DRAW_ID`, `OFFER_NOT_FOUND_ERROR`,
            `OFFER_VARIANT_NOT_FOUND_ERROR`,
            `SHOP_TEAM_MEMBER_SHOP_NOT_FOUND_ERROR`
          content:
            application/json:
              examples:
                giveaway-draw-not-found:
                  value:
                    code: GIVEAWAY_DRAW_NOT_FOUND
                    drawId: <giveawaydrawid>
                giveaway-not-found-for-draw-id:
                  value:
                    code: GIVEAWAY_NOT_FOUND_FOR_DRAW_ID
                    shopId: <shopid>
                    drawId: <giveawaydrawid>
                offer-not-found-error:
                  value:
                    code: OFFER_NOT_FOUND_ERROR
                    offerId: <offerid>
                offer-variant-not-found-error:
                  value:
                    code: OFFER_VARIANT_NOT_FOUND_ERROR
                    offerVariantId: <offervariantid>
                shop-team-member-shop-not-found-error:
                  value:
                    code: SHOP_TEAM_MEMBER_SHOP_NOT_FOUND_ERROR
                    shopId: <shopid>
      security:
        - basicAuth: []
      externalDocs:
        url: https://docs.fourthwall.com/api-reference/platform/gifting/finish-draw
components:
  schemas:
    com.fourthwall.app.openapi.endpoint.DrawFinishedRequest:
      type: object
      properties:
        participants:
          type: array
          items:
            oneOf:
              - $ref: >-
                  #/components/schemas/com.fourthwall.app.openapi.endpoint.DrawFinishedRequest.Participant.Twitch
      required:
        - participants
      title: Draw Finished Request
    com.fourthwall.openapi.model.GiftDraftV1:
      type: object
      properties:
        id:
          type: string
          example: gdr_EdJvIXu3SEiXe_QkPavHSA
        type:
          type: string
          enum:
            - INITIAL
            - REDO
        giveawayId:
          type: string
          example: giv_EdJvIXu3SEiXe_QkPavHSA
        giveawayFriendlyId:
          type: string
          example: D3XZFWPP
        shopId:
          type: string
          example: sh_c689d374-22ca-43d3-8d29-9ef0805cc4cb
        offer:
          $ref: >-
            #/components/schemas/com.fourthwall.openapi.model.OfferAbstractV1.OfferGiftPurchaseV1
        amounts:
          $ref: >-
            #/components/schemas/com.fourthwall.openapi.model.GiftDraftV1.Amounts
        email:
          type: string
          example: supporter@fourthwall.com
        username:
          type: string
          example: Johnny123
        message:
          type: string
          example: Sample message
        gifts:
          type: array
          items:
            oneOf:
              - $ref: >-
                  #/components/schemas/com.fourthwall.openapi.model.GiftDraftV1.Gift.Available
              - $ref: >-
                  #/components/schemas/com.fourthwall.openapi.model.GiftDraftV1.Gift.Cancelled
              - $ref: >-
                  #/components/schemas/com.fourthwall.openapi.model.GiftDraftV1.Gift.ChangedToGiftCard
              - $ref: >-
                  #/components/schemas/com.fourthwall.openapi.model.GiftDraftV1.Gift.ChangedToPromotion
              - $ref: >-
                  #/components/schemas/com.fourthwall.openapi.model.GiftDraftV1.Gift.Redeemed
        createdAt:
          type: string
          format: date-time
        durationSeconds:
          type: integer
          format: int64
      required:
        - amounts
        - createdAt
        - durationSeconds
        - email
        - gifts
        - giveawayFriendlyId
        - giveawayId
        - id
        - offer
        - shopId
        - type
      title: Gift Draft
    com.fourthwall.app.openapi.endpoint.DrawFinishedRequest.Participant.Twitch:
      allOf:
        - $ref: >-
            #/components/schemas/com.fourthwall.app.openapi.endpoint.DrawFinishedRequest.Participant
        - type: object
          properties:
            userId:
              type: string
            userName:
              type: string
      required:
        - userId
        - userName
      title: Twitch
    com.fourthwall.openapi.model.OfferAbstractV1.OfferGiftPurchaseV1:
      type: object
      properties:
        id:
          type: string
          example: 00aa4abd-5778-4199-8161-0b49b2f212e5
        name:
          type: string
          example: My t-shirt
        slug:
          type: string
          example: my-t-shirt
        description:
          type: string
          example: My t-shirt description
        primaryImage:
          $ref: '#/components/schemas/com.fourthwall.openapi.model.Image'
      required:
        - description
        - id
        - name
        - slug
      title: Offer Gift Purchase
    com.fourthwall.openapi.model.GiftDraftV1.Amounts:
      type: object
      properties:
        subtotal:
          $ref: '#/components/schemas/Money'
        total:
          $ref: '#/components/schemas/Money'
      required:
        - subtotal
        - total
      title: Amounts
    com.fourthwall.openapi.model.GiftDraftV1.Gift.Available:
      allOf:
        - $ref: '#/components/schemas/com.fourthwall.openapi.model.GiftDraftV1.Gift'
        - type: object
          properties:
            id:
              type: string
              example: gft_EdJvIXu3SEiXe_QkPavHSA
            winner:
              $ref: >-
                #/components/schemas/com.fourthwall.openapi.model.GiftDraftV1.Winner
        - type: object
          properties:
            status:
              type: string
              const: AVAILABLE
      required:
        - id
      title: Available
    com.fourthwall.openapi.model.GiftDraftV1.Gift.Cancelled:
      allOf:
        - $ref: '#/components/schemas/com.fourthwall.openapi.model.GiftDraftV1.Gift'
        - type: object
          properties:
            id:
              type: string
              example: gft_EdJvIXu3SEiXe_QkPavHSA
            winner:
              $ref: >-
                #/components/schemas/com.fourthwall.openapi.model.GiftDraftV1.Winner
        - type: object
          properties:
            status:
              type: string
              const: CANCELLED
      required:
        - id
      title: Cancelled
    com.fourthwall.openapi.model.GiftDraftV1.Gift.ChangedToGiftCard:
      allOf:
        - $ref: '#/components/schemas/com.fourthwall.openapi.model.GiftDraftV1.Gift'
        - type: object
          properties:
            id:
              type: string
              example: gft_EdJvIXu3SEiXe_QkPavHSA
            giftCardId:
              type: string
              example: gcrd_EdJvIXu3SEiXe_QkPavHSA
            winner:
              $ref: >-
                #/components/schemas/com.fourthwall.openapi.model.GiftDraftV1.Winner
        - type: object
          properties:
            status:
              type: string
              const: CHANGED_TO_GIFT_CARD
      required:
        - giftCardId
        - id
        - winner
      title: Changed To Gift Card
    com.fourthwall.openapi.model.GiftDraftV1.Gift.ChangedToPromotion:
      allOf:
        - $ref: '#/components/schemas/com.fourthwall.openapi.model.GiftDraftV1.Gift'
        - type: object
          properties:
            id:
              type: string
              example: gft_EdJvIXu3SEiXe_QkPavHSA
            promotionId:
              type: string
              example: prm_EdJvIXu3SEiXe_QkPavHSA
            winner:
              $ref: >-
                #/components/schemas/com.fourthwall.openapi.model.GiftDraftV1.Winner
        - type: object
          properties:
            status:
              type: string
              const: CHANGED_TO_PROMOTION
      required:
        - id
        - promotionId
        - winner
      title: Changed To Promotion
    com.fourthwall.openapi.model.GiftDraftV1.Gift.Redeemed:
      allOf:
        - $ref: '#/components/schemas/com.fourthwall.openapi.model.GiftDraftV1.Gift'
        - type: object
          properties:
            id:
              type: string
              example: gft_EdJvIXu3SEiXe_QkPavHSA
            orderId:
              type: string
              example: 00aa4abd-5778-4199-8161-0b49b2f212e5
            orderFriendlyId:
              type: string
              example: D3XZFWPP
            winner:
              $ref: >-
                #/components/schemas/com.fourthwall.openapi.model.GiftDraftV1.Winner
        - type: object
          properties:
            status:
              type: string
              const: REDEEMED
      required:
        - id
        - orderFriendlyId
        - orderId
        - winner
      title: Redeemed
    com.fourthwall.app.openapi.endpoint.DrawFinishedRequest.Participant:
      discriminator:
        propertyName: service
      properties:
        service:
          type: string
      required:
        - service
      title: Participant
    com.fourthwall.openapi.model.Image:
      type: object
      properties:
        id:
          type: string
          example: 00aa4abd-5778-4199-8161-0b49b2f212e5
        url:
          type: string
          example: https://fourthwall.com/image.png
        width:
          type: integer
          format: int32
          description: The original width of the image in pixels.
          example: 800
        height:
          type: integer
          format: int32
          description: The original height of the image in pixels.
          example: 600
        transformedUrl:
          type: string
          description: >-
            Transformed URL with applied image processing (e.g., resizing,
            optimization)
          example: https://fourthwall.com/image.png
      required:
        - height
        - id
        - transformedUrl
        - url
        - width
      title: Image
    Money:
      type: object
      properties:
        value:
          type: number
          example: 10
          minimum: 0
        currency:
          type: string
          example: USD
      required:
        - currency
        - value
      title: Money
    com.fourthwall.openapi.model.GiftDraftV1.Gift:
      type: object
      discriminator:
        propertyName: status
        mapping:
          REDEEMED:
            $ref: >-
              #/components/schemas/com.fourthwall.openapi.model.GiftDraftV1.Gift.Redeemed
          AVAILABLE:
            $ref: >-
              #/components/schemas/com.fourthwall.openapi.model.GiftDraftV1.Gift.Available
          CANCELLED:
            $ref: >-
              #/components/schemas/com.fourthwall.openapi.model.GiftDraftV1.Gift.Cancelled
          CHANGED_TO_PROMOTION:
            $ref: >-
              #/components/schemas/com.fourthwall.openapi.model.GiftDraftV1.Gift.ChangedToPromotion
          CHANGED_TO_GIFT_CARD:
            $ref: >-
              #/components/schemas/com.fourthwall.openapi.model.GiftDraftV1.Gift.ChangedToGiftCard
      properties:
        id:
          type: string
        status:
          type: string
      required:
        - id
        - status
      title: Gift
    com.fourthwall.openapi.model.GiftDraftV1.Winner:
      type: object
      properties:
        email:
          type: string
          example: supporter@fourthwall.com
        username:
          type: string
          example: Johnny123
        selectedAt:
          type: string
          format: date-time
          example: '2020-08-13T09:05:36.939Z'
        redeemUri:
          type: string
      required:
        - redeemUri
        - selectedAt
      title: Winner
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic

````