---
title: "Create payment"
method: POST
path: "/payments"
tags: ["Payments"]
---

# Create payment

`POST /payments`

Use when recording a payment against an invoice (e.g. after receiving funds via a gateway or manual entry).

## Request body

- CreatePaymentRequest
  - `amount` string, required
  - `cancel_url` string
  - `currency` string, required
  - `destination_id` string, required
  - `destination_type` 'INVOICE', required
  - `idempotency_key` string
  - `metadata` TypesMetadata
  - `payment_gateway` 'stripe' | 'razorpay' | 'nomod' | 'moyasar' | 'paddle' | 'whop'
  - `payment_method_id` string
  - `payment_method_type` 'CARD' | 'ACH' | 'OFFLINE' | 'CREDITS' | 'PAYMENT_LINK', required
  - `process_payment` boolean
  - `save_card_and_make_default` boolean
  - `success_url` string

## Response `201`

Created payment

- PaymentResponse
  - `amount` string
  - `attempts` PaymentAttemptResponse[]
    - `attempt_number` integer
    - `created_at` string, date-time
    - `created_by` string
    - `error_message` string
    - `id` string
    - `metadata` TypesMetadata
    - `payment_id` string
    - `tenant_id` string
    - `updated_at` string, date-time
    - `updated_by` string
  - `created_at` string, date-time
  - `created_by` string
  - `currency` string
  - `destination_id` string
  - `destination_type` 'INVOICE'
  - `error_message` string
  - `failed_at` string, date-time
  - `gateway_metadata` TypesMetadata
  - `gateway_payment_id` string
  - `gateway_tracking_id` string
  - `id` string
  - `idempotency_key` string
  - `invoice_number` string
  - `metadata` TypesMetadata
  - `payment_gateway` string
  - `payment_method_id` string
  - `payment_method_type` 'CARD' | 'ACH' | 'OFFLINE' | 'CREDITS' | 'PAYMENT_LINK'
  - `payment_status` 'INITIATED' | 'PENDING' | 'PROCESSING' | 'SUCCEEDED' | 'OVERPAID' | 'FAILED' | 'REFUNDED' | 'PARTIALLY_REFUNDED'
  - `payment_url` string
  - `refunded_at` string, date-time
  - `save_card_and_make_default` boolean
  - `succeeded_at` string, date-time
  - `tenant_id` string
  - `track_attempts` boolean
  - `updated_at` string, date-time
  - `updated_by` string

## Other responses

- `400` — Invalid request
- `500` — Server error

## Changes

- **2026-06-03** `7adf4f33ea1a` — 1 info
  - added the new `whop` enum value to the request property `payment_gateway`
- **2026-05-18** `8ec2edea6b20` — 4 warning
  - removed the optional property `details` from the response with the `400` status
  - removed the optional property `details` from the response with the `500` status
  - added the new `too_many_requests` enum value to the `code` response property for the response status `400`
  - added the new `too_many_requests` enum value to the `code` response property for the response status `500`
- **2026-04-06** `95af41a12111` — 4 warning, 8 info
  - removed the optional property `error` from the response with the `400` status
  - removed the optional property `error` from the response with the `500` status
  - removed the optional property `success` from the response with the `400` status
  - removed the optional property `success` from the response with the `500` status
  - …8 more
- **2026-03-20** `fdc2d8c76b76` — 1 info
  - added the new `paddle` enum value to the request property `payment_gateway`

[Change history](https://skmtc.dev/flexprice/apis/flexprice-api/changes/payments/post.md)

---

[API](https://skmtc.dev/flexprice/apis/flexprice-api.md) · [All operations](https://skmtc.dev/flexprice/apis/flexprice-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/flexprice/flexprice-api/revisions/2a40f94de722/schema)
