Rentberry Payments API

Payments

OpenAPI Specification

rentberry-payments-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Rentberry Payments API
  description: Renting Done Right. Finally.
  version: 4
tags:
- name: Payments
  description: Payments
paths:
  /v{version}/payments/onboarding/account:
    post:
      tags:
      - Payments
      summary: Create payment account for onboarding
      description: Available since API version 1. Creates a Stripe account for the user and returns an onboarding URL to complete setup.
      operationId: post_api_v1_payments_onboarding_create_account
      parameters:
      - name: version
        in: path
        required: true
        schema:
          type: string
          pattern: \d+
      responses:
        '200':
          description: Account link URL for completing onboarding
          content:
            application/json:
              schema:
                description: Stripe onboarding URL
                type: string
              example: https://connect.stripe.com/setup/s/acct_1234567890
        '401':
          description: Unauthorized - Missing or invalid authentication token
        '405':
          description: (Real code 23005) Illegal Stripe account ID
      security:
      - XAuthToken: []
  /v{version}/payments/onboarding/finish:
    post:
      tags:
      - Payments
      summary: Finish payment onboarding
      description: Available since API version 1. Completes the payment onboarding process for the authenticated user.
      operationId: post_api_v1_payments_onboarding_finish
      parameters:
      - name: version
        in: path
        required: true
        schema:
          type: string
          pattern: \d+
      responses:
        '200':
          description: Onboarding completed successfully
          content:
            application/json:
              schema:
                description: Onboarding completion data
                type: object
        '401':
          description: Unauthorized - Missing or invalid authentication token
        '405':
          description: (Real code 23001) User payment account ID not set
      security:
      - XAuthToken: []
  /v{version}/user/feature/payment/stripe/feature/{type}:
    post:
      tags:
      - Payments
      summary: Create Stripe payment for feature.
      description: Available since API version 1. Creates a Stripe payment intent for purchasing a feature.
      operationId: post_api_v1_feature_create_stripe_payment
      parameters:
      - name: type
        in: path
        description: Feature type
        required: true
        schema:
          type: string
          pattern: \w+
      - name: version
        in: path
        required: true
        schema:
          type: string
          pattern: \d+
      requestBody:
        required: false
        content:
          application/json:
            schema:
              properties:
                screening_reference:
                  description: Screening request reference (required for screening feature)
                  type: string
              type: object
      responses:
        '200':
          description: Payment intent created successfully.
          content:
            application/json:
              schema:
                properties:
                  stripe_payment:
                    $ref: '#/components/schemas/StripePayment'
                  feature_payment:
                    $ref: '#/components/schemas/FeaturePayment'
                  clientSecret:
                    description: Stripe client secret for payment confirmation
                    type: string
                type: object
        '400':
          description: Invalid feature type
        '404':
          description: Screening request not found
        '409':
          description: Screening request already paid
components:
  schemas:
    StripePayment:
      properties:
        id:
          type: integer
        amount:
          type: string
          default: '0'
        status:
          type: string
        cancellationReason:
          type: string
        errorMessage:
          type: string
        internalType:
          type: string
        last4Digits:
          type: string
        paymentMethod:
          type: string
          default: card
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      type: object
    FeatureTicket:
      properties:
        id:
          type: integer
        code:
          type: string
        type:
          type: string
        usedAt:
          type: string
          format: date-time
        isUsed:
          type: boolean
          default: false
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      type: object
    FeaturePayment:
      properties:
        id:
          type: integer
        amount:
          type: string
        currency:
          type: string
        status:
          type: integer
          default: 1
        type:
          type:
          - string
          - 'null'
        ticket:
          $ref: '#/components/schemas/FeatureTicket'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      type: object