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

# Create payment session

> Initiates a payment. The server validates the body with the provider, records the transaction, and returns a redirect URL or a success message. Use `type: balance` to add credit or `type: items` to pay for listed items. The `mannco` provider only supports `type: items`.

**Permission:** Connected + API.



## OpenAPI

````yaml /openapi.json post /payment/{provider}
openapi: 3.1.0
info:
  title: Mannco.store API
  description: >-
    Complete API documentation for Mannco.store - Buy and sell TF2, CS:GO, Dota
    2, Rust and Steam community items. All routes use the `api` filter. Every
    endpoint requires an `Authorization: Bearer <jwt>` token obtained from POST
    /user/login. The only exception is the login endpoint itself, which is used
    to obtain the token.
  version: 1.0.0
servers:
  - url: https://api.mannco.store
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Auth
    description: Authentication and login
  - name: Items
    description: Item details, listings, pricing, and sales graphs
  - name: Offers
    description: Create, manage, and respond to trade offers
  - name: Buy Orders
    description: Create, update, and manage buy orders
  - name: Payment
    description: Checkout sessions for balance and cart payments
  - name: Inventory
    description: 'Manage user inventory: list, price, and withdraw'
  - name: Cart
    description: Manage the shopping cart
  - name: Listing
    description: Deposit Steam items and instant sell
  - name: Trading
    description: Active and historical trades
  - name: User Account
    description: Account, balance, sessions, and history
paths:
  /payment/{provider}:
    post:
      tags:
        - Payment
      summary: Create payment session
      description: >-
        Initiates a payment. The server validates the body with the provider,
        records the transaction, and returns a redirect URL or a success
        message. Use `type: balance` to add credit or `type: items` to pay for
        listed items. The `mannco` provider only supports `type: items`.


        **Permission:** Connected + API.
      operationId: createPayment
      parameters:
        - name: provider
          in: path
          required: true
          description: payviox (card / external checkout) or mannco (on-site balance)
          schema:
            type: string
            enum:
              - payviox
              - mannco
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - type
                - tos_timestamp
              properties:
                type:
                  type: string
                  enum:
                    - balance
                    - items
                  description: balance (add credit) or items (pay for listed items)
                tos_timestamp:
                  type: integer
                  description: Client timestamp of Terms of Service acceptance
                value:
                  type: integer
                  description: 'For type=balance: amount in cents to add'
                items:
                  type: string
                  description: 'For type=items: comma-separated Steam assetId values'
                payment_method:
                  type: string
                  description: Optional provider-specific payment method id
            examples:
              balance:
                summary: Balance deposit
                value:
                  type: balance
                  value: 10000
                  tos_timestamp: 1706745600
                  payment_method: null
              items:
                summary: Pay for items
                value:
                  type: items
                  items: 987654321,987654322
                  tos_timestamp: 1706745600
      responses:
        '200':
          description: Payment initiated
          content:
            application/json:
              examples:
                redirect:
                  summary: Redirect URL
                  value:
                    err: false
                    success: true
                    content:
                      url: https://payment-provider.example/checkout/...
                processed:
                  summary: Processed immediately
                  value:
                    err: false
                    success: true
                    content:
                      message: Payment processed successfully
              schema:
                $ref: '#/components/schemas/ApiError'
        '300':
          $ref: '#/components/responses/BusinessError'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    ApiError:
      type: object
      description: >-
        Standard Mannco.store response envelope. `err` and `success` flag the
        outcome; the payload (or error message) is always under `content`.
      required:
        - err
        - success
      properties:
        err:
          type: boolean
          description: True when the request failed.
        success:
          type: boolean
          description: True when the request succeeded.
        content:
          description: Payload on success, or an error message/object on failure.
  responses:
    BusinessError:
      description: >-
        Business error. The request was understood but rejected by domain rules
        (HTTP 300).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          example:
            err: true
            success: false
            content: Error message
    Forbidden:
      description: >-
        Forbidden. Missing/invalid JWT, blocked country, or insufficient
        permissions.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          example:
            err: true
            success: false
            content: forbidden
    NotFound:
      description: The requested resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          example:
            err: true
            success: false
            content: Not found
    ServerError:
      description: Internal server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          example:
            err: true
            success: false
            content: Internal server error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT obtained from POST /user/login

````