---
title: "Create a payment"
url: "https://kongair.terwilligar.com/apis/payments-api/versions/f6b27cfe-b147-4a9e-af56-9802bfc4bc86/operations/createPayment"
---

> Full API specification: https://kongair.terwilligar.com/apis/payments-api/versions/f6b27cfe-b147-4a9e-af56-9802bfc4bc86.md

# Create a payment

`POST` `/payments`

Operation ID: `createPayment`

## Request body (required)

Content types: `application/json`

## Responses

- `201` - Payment created

## OpenAPI definition

```yaml
openapi: 3.0.3
info:
  title: Payments API
  version: 1.0.1
servers:
  - url: https://api.example.com
paths:
  /payments:
    post:
      summary: Create a payment
      operationId: createPayment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/NewPayment"
      responses:
        "201":
          description: Payment created
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Payment"
components:
  schemas:
    NewPayment:
      type: object
      required:
        - amount
        - currency
      properties:
        amount:
          type: number
          format: float
          example: 49.99
        currency:
          type: string
          example: USD
    Payment:
      type: object
      required:
        - id
        - amount
        - currency
        - status
      properties:
        id:
          type: string
          example: pay_12345
        amount:
          type: number
          format: float
          example: 49.99
        currency:
          type: string
          example: USD
        status:
          type: string
          enum:
            - pending
            - completed
            - failed
        created_at:
          type: string
          format: date-time
```
