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

# Create own order

> Buat order baru milik akun sendiri lewat User API.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/me/orders
openapi: 3.1.0
info:
  title: LeuwongRR User API
  version: 1.1.0
  description: >-
    Dokumentasi publik LeuwongRR REST API v1 untuk public safe endpoint dan User
    API. API ini hanya menampilkan endpoint yang aman untuk member/user dan
    tidak memuat route operasional, credential provider, callback sistem,
    maintenance, debug, atau konfigurasi server.


    Supports Sandbox API Key (`lrrs_v1_`) and Production API Key (`lrrp_v1_`).
servers:
  - url: https://leuwongrr.online
    description: Production
security: []
tags:
  - name: Health
    description: Endpoint public untuk mengecek status API.
  - name: Auth
    description: Endpoint validasi User API Token.
  - name: Catalog
    description: >-
      Endpoint public ringan untuk katalog produk dan metode pembayaran yang
      aman ditampilkan.
  - name: Articles
    description: Endpoint public untuk daftar dan detail artikel.
  - name: User
    description: Endpoint khusus user/member dengan User API Token.
  - name: Balance
    description: Endpoint untuk membaca saldo dan mutasi saldo milik user sendiri.
  - name: Orders
    description: Endpoint untuk membaca dan membuat order milik user sendiri.
  - name: Invoices
    description: Endpoint untuk membaca invoice milik user sendiri.
  - name: Deposits
    description: Endpoint untuk membaca deposit milik user sendiri.
paths:
  /api/v1/me/orders:
    post:
      tags:
        - Orders
      summary: Create own order
      description: >-
        Membuat order baru untuk akun pemilik User API Token. Harga, diskon,
        invoice, status, dan total transaksi dihitung oleh server LeuwongRR.
      operationId: createOwnOrder
      parameters:
        - name: Idempotency-Key
          in: header
          required: false
          description: >-
            Kunci unik dari bot/client untuk mencegah double order saat request
            terulang. Gunakan nilai unik per order.
          schema:
            type: string
            example: discord-123456789-order-001
        - name: X-Discord-User-ID
          in: header
          required: false
          description: >-
            Wajib dikirim jika payment_method=balance dari Discord bot. Isinya
            Discord user ID yang sudah terhubung ke akun web pemilik User API
            Token. Tidak diperlukan untuk payment_method=invoice/gateway.
          schema:
            type: string
            example: '1262024148939440249'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - order_type
                - roblox_username
                - place_id
                - roblox_pass_id
              properties:
                order_type:
                  type: string
                  enum:
                    - gamepass
                    - vip_server
                  example: gamepass
                roblox_username:
                  type: string
                  example: LeuwongUser
                place_id:
                  type: integer
                  example: 123456789
                roblox_pass_id:
                  type: integer
                  example: 987654321
                payment_method:
                  type: string
                  description: >-
                    Default invoice. Gunakan balance hanya dari Discord bot yang
                    sudah link akun web dan wajib menyertakan header
                    X-Discord-User-ID. Sandbox hanya boleh invoice.
                  example: balance
                client_reference:
                  type: string
                  description: Referensi opsional dari bot/client kamu.
                  example: discord-order-001
            example:
              order_type: gamepass
              roblox_username: LeuwongUser
              place_id: 123456789
              roblox_pass_id: 987654321
              payment_method: invoice
              client_reference: bot-order-001
      responses:
        '200':
          description: Order yang sama ditemukan dari Idempotency-Key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse'
        '201':
          description: Order berhasil dibuat
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse'
              example:
                success: true
                message: Order berhasil dibuat.
                data:
                  invoice:
                    invoice_code: INV20260429123456001
                    type: order
                    payment_status: pending
                    amount: 15000
                    formatted_amount: Rp15.000
                    currency: IDR
                    payment_method: ''
                    payment_url: ''
                    invoice_url: https://leuwongrr.online/user/invoice/INV20260429123456001
                    order:
                      status: pending
                      order_type: gamepass
                      roblox_username: LeuwongUser
                      robux_amount: 100
                  gateway: null
                  idempotent: false
        '401':
          description: Token tidak valid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validasi gagal
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                forbiddenFields:
                  value:
                    success: false
                    message: >-
                      Request berisi field yang tidak diizinkan untuk User API:
                      user_id.
                    error:
                      code: FORBIDDEN_FIELDS
                      fields:
                        - user_id
                robloxFailed:
                  value:
                    success: false
                    message: Validasi resmi Roblox gagal.
                    error:
                      code: ROBLOX_VALIDATION_FAILED
        '429':
          description: Request terlalu sering
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - userBearerAuth: []
components:
  schemas:
    SuccessResponse:
      type: object
      required:
        - success
        - message
        - data
      properties:
        success:
          type: boolean
          example: true
        message:
          type: string
          example: OK
        data:
          type: object
          additionalProperties: true
    ErrorResponse:
      type: object
      required:
        - success
        - message
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
          example: Unauthorized API token.
  securitySchemes:
    userBearerAuth:
      type: http
      scheme: bearer
      bearerFormat: User API Token
      x-default: YOUR_USER_API_TOKEN
      description: >-
        Masukkan User API Token dari halaman
        https://leuwongrr.online/user/api-access. Gunakan tanpa prefix Bearer
        jika field playground sudah otomatis menambahkan Bearer.

````