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

# Create single payment for specific invoice

> Create single payment for specific invoice



## OpenAPI

````yaml post /payments
openapi: 3.0.0
info:
  version: 1.0.0
  title: splose public API
  description: "\nWelcome to the splose API documentation. splose serves as a comprehensive Allied Health & NDIS practice management software designed to streamline administrative tasks and foster the growth of your practice.\n\n# Introduction\nThe splose API follows a REST architectural style, offering JSON-encoded responses, standard HTTP response codes, easily understandable resource-oriented URLs, and robust authentication mechanisms.\n\n# Authentication\n### API Key Authentication\nThe splose API employs API keys for request authentication. Workspace owners can apply for and manage API keys through the splose dashboard. It's crucial to safeguard the API key, as it grants the same permissions as the associated user.\n\n### Bearer Authentication\nAuthentication for API access is achieved via Bearer Authentication. Include the API key in the request header using the format: `Authorization: Bearer your_api_key`.\n\n### Secure Communication\nAll API requests must be conducted over HTTPS. Requests made over plain HTTP will not succeed. Additionally, unauthenticated API requests will result in failure.\n\n# Rate limit\nThere are limits to the number of API calls that your application can make with one API key.\n\n+ Minute Limit: 60 calls per minute\n\n# Error\nsplose uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. \nCodes in the 4xx range indicate an error that failed given the information provided. Codes in the 5xx range indicate an error with splose's servers.\n\nError types:\n+ 400 - Bad request: the request failed due to missing or invalid parameters.\n+ 401 - Unauthorized: No valid API key provided.\n+ 404 - Not Found: \tThe requested resource doesn't exist.\n+ 429 - Too Many Requests: Too many requests hit the API too quickly.\n+ 500 - Internal Server Error : Something went wrong on splose's end.\n\n# Datetime\nAll datetime values provided in request parameters and responses are in Coordinated Universal Time (UTC). The accepted datetime formats are outlined below:\n+ 2023-07-01\n+ 2023-07-01T00:00:00Z\n+ 2023-07-01T00:00:00.000Z\n\n# Pagination\n\n### Pagination for Multiple Objects\nFor endpoints returning multiple objects, pagination is in place to manage response sizes. Each response is limited to a certain number of objects. \nAdditionally, the response includes a `links` field that provides URLs for fetching the next and/or previous pages, if applicable.\n\n### Manual Positioning\nYou have the option to manually specify the `id_gt` or `id_lt` value as a request parameter. This allows you to retrieve objects starting from a specific position. If neither of these values is provided, the initial page of objects will be returned by default.\n+ `id_gt`: Request for next page of objects with id greater than the specified value. \n+ `id_lt`: Request for previous page of objects with id less than the specified value. \n\n# Realtime feed\nCertain users may require real-time data retrieval. Given the substantial data volume, retrieving the complete dataset may not be efficient. To address this, we offer the option to retrieve data based on its update timestamp. This approach necessitates fetching the entire dataset only during the initial request. Subsequent retrievals involve fetching solely the modified data to replace outdated information.\n+ `update_gt`: Request for objects updated after the specified datetime. \n+ `update_lt`: Request for objects updated before the specified datetime. \n\n# Change log\n+ 2024-04-10: add payment method and payment endpoints\n+ 2024-02-28: add availability endpoint\n"
  contact:
    email: support@splose.com
servers:
  - url: https://api.splose.com/v1
security: []
externalDocs:
  description: Find out more about splose
  url: https://splose.com
paths:
  /payments:
    post:
      tags:
        - payment
      summary: Create single payment for specific invoice
      description: Create single payment for specific invoice
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                patientId:
                  type: integer
                  minimum: 0
                  exclusiveMinimum: true
                  description: Patient id
                  example: 1
                locationId:
                  type: integer
                  minimum: 0
                  exclusiveMinimum: true
                  description: Location id
                  example: 1
                paymentMethodId:
                  type: integer
                  minimum: 0
                  exclusiveMinimum: true
                  description: Payment method id
                  example: 1
                amount:
                  type: number
                  nullable: true
                  description: >-
                    Total payment amount, it should be the same as the sum of
                    all paymentInvoice amount
                  example: 193.99
                paymentDate:
                  anyOf:
                    - type: string
                    - type: string
                  description: Payment date
                  example: '2024-03-01T00:00:00.000Z'
                paymentInvoices:
                  type: array
                  items:
                    type: object
                    properties:
                      invoiceId:
                        type: integer
                        minimum: 0
                        exclusiveMinimum: true
                        description: Invoice id
                        example: 1
                      amount:
                        type: number
                        nullable: true
                        description: Amount paid
                        example: 193.99
                      xeroId:
                        type: string
                        description: Xero payment id, only applicable for Xero payment
                    required:
                      - invoiceId
                      - amount
                  description: Payments made to invoices
                xeroId:
                  type: string
                  format: uuid
                  description: >-
                    Xero batch payment id, only applicable for Xero batch
                    payment
              required:
                - patientId
                - locationId
                - paymentMethodId
                - amount
                - paymentDate
                - paymentInvoices
      responses:
        '200':
          description: Object with payment data.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: integer
                    minimum: 0
                    exclusiveMinimum: true
                    description: Payment id
                    example: 1
                  paymentNumber:
                    type: string
                    description: Payment number
                    example: RCPT-0001
                  amount:
                    type: number
                    nullable: true
                    description: Total payment amount. 0 for credit allocation
                    example: 193.99
                  patientId:
                    type: integer
                    minimum: 0
                    exclusiveMinimum: true
                    description: The payment patient id
                    example: 1
                  locationId:
                    type: integer
                    minimum: 0
                    exclusiveMinimum: true
                    description: The payment location id
                    example: 1
                  paymentMethodId:
                    type: integer
                    nullable: true
                    minimum: 0
                    exclusiveMinimum: true
                    description: The payment method id, null for credit allocation
                    example: 1
                  paymentDate:
                    anyOf:
                      - type: string
                      - type: string
                    description: Payment date
                    example: '2023-07-30T09:00:00.000Z'
                  paymentInvoices:
                    type: array
                    items:
                      type: object
                      properties:
                        invoiceId:
                          type: integer
                          minimum: 0
                          exclusiveMinimum: true
                          description: Invoice id
                          example: 1
                        amount:
                          type: number
                          nullable: true
                          description: Amount paid
                          example: 193.99
                        xeroId:
                          type: string
                          nullable: true
                          format: uuid
                          description: Xero payment id
                      required:
                        - invoiceId
                        - amount
                        - xeroId
                    description: Payments made to invoices
                  creditAllocations:
                    type: array
                    items:
                      type: object
                      properties:
                        invoiceId:
                          type: integer
                          minimum: 0
                          exclusiveMinimum: true
                          description: Invoice id
                          example: 1
                        amount:
                          type: number
                          nullable: true
                          description: Amount paid
                          example: 193.99
                      required:
                        - invoiceId
                        - amount
                    description: Credit allocated to invoices
                    example: []
                  xeroId:
                    type: string
                    nullable: true
                    format: uuid
                    description: Xero batch payment id
                  archivedAt:
                    anyOf:
                      - type: string
                      - type: string
                      - nullable: true
                    description: Payment archive date time
                    example: null
                  archived:
                    type: boolean
                    nullable: true
                    default: false
                    description: Whether the payment has been archived
                required:
                  - id
                  - paymentNumber
                  - amount
                  - patientId
                  - locationId
                  - paymentMethodId
                  - paymentDate
                  - paymentInvoices
                  - creditAllocations
                  - xeroId
                  - archivedAt
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````