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

# Create Payment

> The payments API allows you to add payments for your referrals/leads. If you want to track a one-off payment, just don't specify `subscription_id`, `interval` and `interval_count`.



## OpenAPI

````yaml POST /v1/payments
openapi: 3.1.0
info:
  title: Reditus API - Payments
  description: API specification for managing payments in Reditus.
  version: 1.0.0
servers:
  - url: https://api.getreditus.com/api
security: []
paths:
  /v1/payments:
    post:
      summary: Referral Payment
      description: >-
        The payments API allows you to add payments for your referrals/leads. If
        you want to track a one-off payment, just don't specify
        `subscription_id`, `interval` and `interval_count`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentRequest'
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentResponse'
        '400':
          description: >-
            Bad Request - Validation error, rejected/expired referral or
            partnership terminated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBadRequest'
        '404':
          description: Not Found - Referral not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseReferralNotFound'
      security:
        - BearerAuth: []
components:
  schemas:
    PaymentRequest:
      type: object
      properties:
        referral_uid:
          type: string
          description: '**required** - Your internal ID of the referral/user'
        referral_email:
          type: string
          description: >-
            **required** if `referral_id` / `referral_uid` not set - Email of
            the referral/lead
        referral_id:
          type: string
          description: >-
            **required** if `referral_email` / `referral_uid` not set - Reditus
            id of the referral/lead
        amount:
          type: integer
          description: Payment amount (in cents)
        currency:
          type: string
          description: Payment currency - (lowercase, i.e. **usd**)
        idempotency_key:
          type: string
          description: >-
            A unique string to identify this payment. Used to prevent double
            payments.
        subscription_id:
          type: string
          description: >-
            Should be the id of the subscription on your side. Used to associate
            subsequent payments to this subscription.
        interval:
          type: string
          description: Subscription interval ('month'/'year')
        interval_count:
          type: integer
          description: 'Number of intervals the payment is made (default: 1)'
      required:
        - idempotency_key
        - amount
        - currency
    PaymentResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            id:
              type: string
            type:
              type: string
            attributes:
              $ref: '#/components/schemas/PaymentRequest'
    ErrorResponseBadRequest:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              title:
                type: string
              details:
                type: object
                description: Field-specific error messages
                additionalProperties:
                  type: array
                  items:
                    type: string
                example:
                  amount:
                    - must be an integer
                  idempotency_key:
                    - has already been taken
    ErrorResponseReferralNotFound:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              title:
                type: string
              details:
                type: string
                example: Referral not found
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````