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

# Create SR

> Initiate a draft service request with enhanced validation and detailed response. Provides comprehensive requirements validation and detailed feedback to begin the authentication process.



## OpenAPI

````yaml /openapi.json post /api/v2/sr
openapi: 3.1.0
info:
  title: Legitmark Partner API
  description: Comprehensive partner integration API for Legitmark authentication platform
  version: 2.0.0
  contact:
    name: Legitmark Support
    email: support@legitmark.com
    url: https://legitmark.com
servers:
  - url: https://api.legitmark.com
    description: Production API
security:
  - BearerAuth: []
tags:
  - name: Service Requests
    description: Create, retrieve, and manage authentication service requests.
  - name: Media Management
    description: Upload images for service request authentication.
  - name: Taxonomy
    description: Browse categories, types, brands, models, and services to build requests.
paths:
  /api/v2/sr:
    post:
      tags:
        - Service Requests
      summary: Create SR
      description: >-
        Initiate a draft service request with enhanced validation and detailed
        response. Provides comprehensive requirements validation and detailed
        feedback to begin the authentication process.
      operationId: createServiceRequest
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ServiceRequest'
            example:
              reference_id: ITEM-2024-0891
              service: 31670fe9-9272-11ef-b98d-06fb0f2a63e5
              item:
                category: cc30b104-7c47-11ef-a623-02595575faeb
                type: 95e42d6b-7c4f-11ef-a623-02595575faeb
      responses:
        '200':
          description: Service request created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Service request initiated successfully.
                  sr:
                    type: object
                    description: Created service request
                    properties:
                      uuid:
                        type: string
                        format: uuid
                        description: Service request identifier
                      active:
                        type: boolean
                        description: Whether the service request is active
                      migrated:
                        type: boolean
                        description: Whether migrated from legacy system
                      micro_id:
                        type: string
                        description: Short numeric identifier
                      legacy_id:
                        type: string
                        nullable: true
                        description: Legacy system identifier
                      external_id:
                        type: string
                        nullable: true
                        description: External reference ID from partner system
                      tab:
                        type: string
                        enum:
                          - DRAFT
                          - QC
                          - UNDERWAY
                          - COMPLETE
                          - CANCELLED
                        description: Current tab/workflow state
                      source:
                        type: string
                        description: Source application
                      partner_code:
                        type: string
                        nullable: true
                        description: Partner code if submitted via partner integration
                      state:
                        type: object
                        properties:
                          primary:
                            type: string
                            enum:
                              - DRAFT
                              - QC
                              - UNDERWAY
                              - COMPLETE
                              - CANCELLED
                            description: Primary workflow state
                          supplement:
                            type: string
                            nullable: true
                            description: Secondary state
                      summary:
                        type: object
                        properties:
                          style:
                            type: string
                            nullable: true
                            description: Item style/type name
                          style_id:
                            type: string
                            format: uuid
                            nullable: true
                            description: Item style/type UUID
                      user:
                        type: string
                        format: uuid
                        description: User UUID who created the SR
                      service:
                        type: string
                        format: uuid
                        description: Service UUID
                      created_at:
                        type: string
                        format: date-time
                      updated_at:
                        type: string
                        format: date-time
                      drafted_at:
                        type: string
                        format: date-time
                        nullable: true
                        description: Timestamp when the SR was drafted
              example:
                success: true
                message: Service request initiated successfully.
                sr:
                  uuid: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                  active: true
                  migrated: false
                  micro_id: '998001'
                  legacy_id: null
                  external_id: ITEM-2024-0891
                  tab: DRAFT
                  source: api
                  partner_code: null
                  state:
                    primary: DRAFT
                    supplement: null
                  summary:
                    style: Crossbody
                    style_id: 95e42d6b-7c4f-11ef-a623-02595575faeb
                  user: user-uuid
                  service: 31670fe9-9272-11ef-b98d-06fb0f2a63e5
                  created_at: '2026-01-15T10:30:00.000Z'
                  updated_at: '2026-01-15T10:30:00.000Z'
                  drafted_at: '2026-01-15T10:30:00.000Z'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded
          headers:
            X-RateLimit-Limit-Partner:
              schema:
                type: string
              description: Partner-level request limit
            X-RateLimit-Remaining-Partner:
              schema:
                type: string
              description: Remaining partner requests
            X-RateLimit-Reset-Partner:
              schema:
                type: string
              description: Partner rate limit reset timestamp
            X-RateLimit-Limit-User:
              schema:
                type: string
              description: User-level request limit
            X-RateLimit-Remaining-User:
              schema:
                type: string
              description: Remaining user requests
            X-RateLimit-Reset-User:
              schema:
                type: string
              description: User rate limit reset timestamp
            Retry-After:
              schema:
                type: integer
              description: Seconds to wait before retrying
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: typescript
          label: SDK
          source: |-
            import { Legitmark } from 'legitmark';

            const legitmark = new Legitmark('leo_your_api_key');

            const { sr } = await legitmark.sr.create({
              reference_id: 'ITEM-2024-0891',
              service: '31670fe9-9272-11ef-b98d-06fb0f2a63e5', // optional — auto-resolved if omitted
              item: {
                category: 'cc30b104-7c47-11ef-a623-02595575faeb', // Bag
                type: '95e42d6b-7c4f-11ef-a623-02595575faeb',    // Crossbody
              },
            });

            console.log(sr.uuid); // e.g. "a1b2c3d4-e5f6-..."
            console.log(sr.micro_id); // e.g. "998001" 
        - lang: python
          label: Python
          source: |-
            import requests

            response = requests.post(
                'https://api.legitmark.com/api/v2/sr',
                headers={
                    'Authorization': 'Bearer leo_your_api_key',
                    'Content-Type': 'application/json',
                },
                json={
                    'reference_id': 'ITEM-2024-0891',
                    'service': '31670fe9-9272-11ef-b98d-06fb0f2a63e5',
                    'item': {
                        'category': 'cc30b104-7c47-11ef-a623-02595575faeb',  # Bag
                        'type': '95e42d6b-7c4f-11ef-a623-02595575faeb',     # Crossbody
                    },
                },
            )

            sr = response.json()['sr']
            print(f"Created: {sr['uuid']}")
        - lang: curl
          label: cURL
          source: |-
            curl -X POST https://api.legitmark.com/api/v2/sr \
              -H 'Authorization: Bearer leo_your_api_key' \
              -H 'Content-Type: application/json' \
              -d '{
                "reference_id": "ITEM-2024-0891",
                "service": "31670fe9-9272-11ef-b98d-06fb0f2a63e5",
                "item": {
                  "category": "cc30b104-7c47-11ef-a623-02595575faeb",
                  "type": "95e42d6b-7c4f-11ef-a623-02595575faeb"
                }
              }'
components:
  schemas:
    ServiceRequest:
      type: object
      required:
        - reference_id
        - item
      properties:
        uuid:
          type: string
          format: uuid
          description: Service request identifier
        reference_id:
          type: string
          description: >-
            Your internal identifier for the item (e.g., SKU, inventory ID, or
            product code) used to look up the item in your system
          example: ITEM-2024-0891
        service:
          type: string
          format: uuid
          description: >-
            Service UUID (luxury, sneakers, etc.). Optional — if omitted,
            auto-resolved based on your organization and item type.
          example: 31670fe9-9272-11ef-b98d-06fb0f2a63e5
        item:
          type: object
          required:
            - category
            - type
          properties:
            category:
              type: string
              format: uuid
              description: Category UUID from taxonomy
              example: cc30b104-7c47-11ef-a623-02595575faeb
            type:
              type: string
              format: uuid
              description: Type UUID from taxonomy
              example: 95e42d6b-7c4f-11ef-a623-02595575faeb
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          properties:
            code:
              type: integer
            timestamp:
              type: string
              format: date-time
            message:
              type: string
            details:
              type: string
    RateLimitErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          properties:
            code:
              type: integer
              example: 429
            timestamp:
              type: string
              format: date-time
            message:
              type: string
              example: Rate limit exceeded
            details:
              type: object
              properties:
                limit_type:
                  type: string
                  enum:
                    - partner_level
                    - user_level
                    - endpoint_specific
                  example: partner_level
                current_usage:
                  type: integer
                  example: 1001
                limit:
                  type: integer
                  example: 1000
                reset_time:
                  type: string
                  format: date-time
                  example: '2024-01-01T00:01:00.000Z'
                retry_after_seconds:
                  type: integer
                  example: 60
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer token authentication. Use your API key in the format: Bearer
        leo_xxxxxxxx
      x-default: leo_your_api_key_here

````