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

# Create Invoice

## Overview

Create an invoice for a customer. Invoices allow you to bill customers and track payments. This endpoint creates a new invoice that can be sent to customers for payment.


## OpenAPI

````yaml POST /v1/invoices
openapi: 3.1.0
info:
  title: API
  version: 1.0.0
  description: >-
    Platnova's Business API allows businesses to issue virtual accounts and
    cards to their employees, vendors, or retail customers. It allows businesses
    to streamline the process of issuing cards, manage spending, and track
    transactions. The API documentation provides information on how to integrate
    our virtual card issuing system into a business's existing systems and
    outlines the features and functionalities of the API, including card and
    account creation, management, and reporting. It also provides technical
    specifications, such as API requests, responses, and authentication
    processes.


    The API documentation is intended for developers and IT teams to use in
    order to effectively implement Platnova solutions into their business
    processes.


    # Authentication/Authorization


    To access any of the resources on the `{BaseUrl}/v1/`, the client has to
    pass pre-defined headers for authentication and authorization.


    The API is secure and only authorized clients can consume the service. There
    are API keys assigned to every business and JWT tokens assigned to every
    account for authentication/authorization.


    ## Bearer Token


    Requests may accept jwt tokens as below.


    ``` json

    Authorization: Bearer <jwt token>

     ```

    ## API Key


    Requests may acccept an api key either in the request headers or as a query
    parameter. Some requests cannot be authorized using an API key.


    ``` json

    X-API-KEY: <api key>

     ```

    OR


    ``` json

    ?api-key=<api key>

     ```

    # Base URL


    [https://sandbox.api.platnova.co](https://sandbox.api.platnova.co)


    # Errors


    Unauthorized API key


    ``` json

    {
        "status": false,
        "data": {},
        "error": [],
        "message": "unauthorized access"
    }

     ```

    Permission Denied


    ``` json

    {
        "status": false,
        "data": {},
        "error": [],
        "message": "unauthorized access: permission denied"
    }

     ```
servers:
  - url: https://api.platnova.com
    description: Production server
  - url: https://sandbox.api.platnova.co
    description: Development server
security:
  - apiKeyAuth: []
tags:
  - name: Customer
    description: Create and manage customers
  - name: Virtual Account
    description: Create and manage virtual accounts
  - name: Card
    description: Create and manage cards
  - name: Wallet
    description: List and manage wallets
  - name: Payment
    description: Send and verify payments
  - name: Transaction
    description: List transactions and generate receipts
  - name: Checkout
    description: Create and retrieve checkout sessions
  - name: Payment Link
    description: Create and manage payment links
  - name: Invoice
    description: Create and manage invoices
paths:
  /v1/invoices:
    post:
      tags:
        - Invoice
      summary: Create invoice
      operationId: createInvoice
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateInvoiceRequest'
            example:
              email: customer@example.com
              note: Thank you for your business
              items:
                - name: Consulting
                  unit_price: 150
                  quantity: 2
                  currency: NGN
                  total: 300
                - name: Setup fee
                  unit_price: 50
                  quantity: 1
                  currency: NGN
                  total: 50
              charges:
                discount:
                  amount: '0'
                  type: flat
                  enabled: false
                tax:
                  amount: '7.5'
                  type: percentage
                  enabled: true
                fee:
                  amount: '0'
                  type: flat
                  enabled: false
                shipping:
                  amount: '0'
                  type: flat
                  enabled: false
              payment_schedule:
                type: one_time
                due_date: '2026-02-15T23:59:59Z'
                send_date: '2026-01-30T00:00:00Z'
                payment_methods:
                  - id: bank_transfer
                    value: '058'
                reminders: true
                reminder_timing:
                  type: before_due_date
                  days: 3
      responses:
        '200':
          description: Invoice created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        description: Invoice UID
                      invoice_number:
                        type: string
                      items:
                        type: array
                        items:
                          type: object
                      subtotal:
                        type: string
                      total:
                        type: string
                      charges:
                        type: object
                      note:
                        type: string
                      status:
                        type: string
                        enum:
                          - pending
                          - paid
                          - cancelled
                      payment_schedule:
                        type: object
                      created_at:
                        type: string
                        format: date-time
                  error:
                    type: array
                    items: {}
                  message:
                    type: string
        '400':
          description: >-
            Bad request (user not found, payment methods required, invalid
            payment method)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError422'
              example:
                error:
                  email:
                    - This field is required
                  items:
                    - This field is required
                  payment_schedule:
                    - This field is required
components:
  schemas:
    CreateInvoiceRequest:
      type: object
      required:
        - email
        - items
        - payment_schedule
      properties:
        email:
          type: string
          format: email
          description: Email of the user (customer) in the entity to invoice
        items:
          type: array
          minItems: 1
          items:
            type: object
            properties:
              name:
                type: string
              unit_price:
                type: number
              quantity:
                type: integer
              currency:
                type: string
              total:
                type: number
                description: Usually unit_price * quantity
        charges:
          type: object
          properties:
            discount:
              $ref: '#/components/schemas/InvoiceCharge'
            tax:
              $ref: '#/components/schemas/InvoiceCharge'
            fee:
              $ref: '#/components/schemas/InvoiceCharge'
            shipping:
              $ref: '#/components/schemas/InvoiceCharge'
        note:
          type: string
        payment_schedule:
          type: object
          required:
            - payment_methods
          properties:
            type:
              type: string
              enum:
                - one_time
                - re_occurring
              description: one_time or re_occurring
            repeat:
              type: integer
              description: For re_occurring
            interval:
              type: string
              enum:
                - daily
                - weekly
                - monthly
                - yearly
              description: For re_occurring
            end:
              type: string
              description: End condition for re_occurring
            send_date:
              type: string
              format: date-time
            due_date:
              type: string
              format: date-time
            payment_methods:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                    description: e.g. bank_transfer
                  value:
                    type: string
                    description: e.g. bank code
            reminders:
              type: boolean
            reminder_timing:
              type: object
              properties:
                type:
                  type: string
                  enum:
                    - on_due_date
                    - before_due_date
                    - after_due_date
                days:
                  type: integer
    Error:
      type: object
      properties:
        status:
          type: boolean
        data:
          type: object
        error:
          type: array
          items: {}
        message:
          type: string
          description: Error message
    ValidationError422:
      type: object
      description: Validation error response (422). Keys are request body field names.
      properties:
        error:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: Field name to list of error messages
    InvoiceCharge:
      type: object
      properties:
        amount:
          type: string
        type:
          type: string
          enum:
            - flat
            - percentage
        enabled:
          type: boolean
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: API key for authentication.

````