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

# Withdraw User Points

> Creates a withdrawal record for a user's earned points in a specific campaign. Validates user existence, campaign bundle, and optionally checks balance before processing.



## OpenAPI

````yaml /openapi.yaml post /user/withdraw
openapi: 3.0.0
info:
  title: claimr API
  version: 1.0.0
  description: >-
    Advanced features of claimr for business partners. This API provides a
    seamless integration with claimr services
  termsOfService: https://claimr.io/terms-of-service/
  contact:
    name: claimr support team
    email: support@claimr.io
servers:
  - url: https://prod.claimr.io/api/v1
    description: Production server
  - url: https://prod.claimr.io/api/v1
    description: Development server
security: []
tags: []
paths:
  /user/withdraw:
    post:
      tags:
        - User
      summary: Withdraw User Points
      description: >-
        Creates a withdrawal record for a user's earned points in a specific
        campaign. Validates user existence, campaign bundle, and optionally
        checks balance before processing.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - account
                - platform
                - pid
                - id
                - xp
              properties:
                account:
                  type: string
                  description: User account identifier
                  example: user123
                platform:
                  type: string
                  description: Platform identifier where the user account exists
                  example: steam
                pid:
                  type: string
                  description: Campaign ID
                  example: campaign_abc123
                id:
                  type: string
                  description: >-
                    Unique withdraw transaction ID (must be unique per
                    user/campaign)
                  example: withdraw_xyz789
                kind:
                  type: string
                  description: Withdraw kind
                  example: items_shop
                xp:
                  type: number
                  description: Amount of experience points to withdraw
                  minimum: 0
                  example: 100
                strict:
                  type: boolean
                  description: >-
                    When true, verifies user has sufficient balance before
                    allowing withdrawal
                  default: false
                  example: true
      responses:
        '200':
          description: Withdrawal processed successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                        format: int32
                        default: 400
                      message:
                        type: string
                        default: bad request
              examples:
                missing_fields:
                  summary: Missing required fields
                  value:
                    error: >-
                      Missing required parameters: id, pid, account, platform,
                      or xp
                user_not_found:
                  summary: User not found
                  value:
                    error: User not found for the specified account and platform
                campaign_not_found:
                  summary: Campaign bundle not found
                  value:
                    error: >-
                      Campaign bundle not found for the specified pid and
                      environment
                entry_not_found:
                  summary: User campaign entry not found
                  value:
                    error: User has no entry for the specified campaign
                insufficient_balance:
                  summary: Insufficient balance (strict mode)
                  value:
                    error: Insufficient balance for withdrawal
                duplicate_withdrawal:
                  summary: Duplicate withdrawal ID
                  value:
                    error: Withdrawal with this ID already exists
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/access_denied'
        '500':
          $ref: '#/components/responses/internal_error'
      security:
        - bearer: []
components:
  responses:
    unauthorized:
      description: Unauthorized request
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
              error:
                type: object
                properties:
                  code:
                    type: integer
                    format: int32
                    default: 401
                  message:
                    type: string
                    default: unauthorized
    access_denied:
      description: Access denied
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
              error:
                type: object
                properties:
                  code:
                    type: integer
                    format: int32
                    default: 403
                  message:
                    type: string
                    default: access denied
    internal_error:
      description: Internal server error
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
              error:
                type: object
                properties:
                  code:
                    type: integer
                    format: int32
                    default: 500
                  message:
                    type: string
                    default: internal error
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````