---
title: "Process payment for an order"
url: "https://kongair.terwilligar.com/apis/hot-diggity-dog/versions/7450374c-0e43-4067-b83d-ec33667f4a58/operations/processPayment"
---

> Full API specification: https://kongair.terwilligar.com/apis/hot-diggity-dog/versions/7450374c-0e43-4067-b83d-ec33667f4a58.md

# Process payment for an order

`POST` `/orders/{orderId}/payment`

Operation ID: `processPayment`

Processes payment for a specific order.

## Path parameters

- `orderId` (string, uuid, required) - ID of the order to process payment for

## Request body (required)

Content types: `application/json`

## Responses

- `200` - Payment processed successfully
- `400` - Invalid request
- `404` - Order not found

## OpenAPI definition

```yaml
openapi: 3.1.0
info:
  title: Hot Dog Stand API
  version: 1.0.0
servers:
  - url: https://hotdog.example.com/api/v1
    description: Main server
paths:
  /orders/{orderId}/payment:
    post:
      summary: Process payment for an order
      description: Processes payment for a specific order.
      operationId: processPayment
      tags:
        - Orders
      parameters:
        - name: orderId
          in: path
          required: true
          description: ID of the order to process payment for
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PaymentInfo"
      responses:
        "200":
          description: Payment processed successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: Status of the payment
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: Order not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
components:
  schemas:
    PaymentInfo:
      type: object
      properties:
        payment_method:
          type: string
          enum:
            - credit_card
            - paypal
            - cash
          description: Payment method used
        amount:
          type: number
          format: float
          description: Amount to be paid
      example:
        payment_method: credit_card
        amount: 10
    Error:
      type: object
      properties:
        code:
          type: string
          description: Error code
        message:
          type: string
          description: Error message
      example:
        code: 400
        message: Invalid request
```
