POST
/
payments
curl --request POST \
  --url https://api.togai.com/payments \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "description": "Payment for services",
  "notes": "Invoice payment",
  "currency": "USD",
  "accountId": "acc123",
  "externalPaymentReference": {
    "sourceName": "XYZ Company",
    "sourceType": "CARD",
    "transactionNumber": "TXN123",
    "description": "Card payment"
  },
  "lineItemRecords": [
    {
      "togaiId": "inv.234.12efwe",
      "amount": 1000,
      "type": "INVOICE"
    },
    {
      "togaiId": "inv.236.12efwe",
      "amount": 500,
      "type": "INVOICE"
    },
    {
      "togaiId": "cred.236.12efwe",
      "amount": 200,
      "type": "CREDIT"
    }
  ]
}'
{
  "id": "payment.1223dfs.234ds",
  "description": "Payment for services",
  "notes": "Invoice payment",
  "accountId": "acc123",
  "currency": "USD",
  "externalPaymentReferences": [
    {
      "sourceName": "XYZ Company",
      "sourceType": "CARD",
      "transactionNumber": "TXN123",
      "description": "Card payment"
    }
  ],
  "lineItemRecords": [
    {
      "togaiId": "inv.234.12efwe",
      "amount": 1000,
      "type": "INVOICE",
      "source": "MANUAL"
    },
    {
      "togaiId": "inv.235.12efwe",
      "amount": 600,
      "type": "INVOICE",
      "source": "MANUAL"
    },
    {
      "togaiId": "cred.236.12efwe",
      "amount": 100,
      "type": "CREDIT",
      "source": "MANUAL"
    }
  ],
  "totalAmount": 1700,
  "version": 1,
  "isLatest": true,
  "createdBy": "user123",
  "createdAt": "2023-01-01T12:00:00"
}

Authorizations

Authorization
string
headerrequired

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
description
string

A brief description of the payment

notes
string

A detailed note about the payment

accountId
string
required
externalPaymentReference
object
required

external payment reference object

lineItemRecords
object[]
required
currency
string
required
totalAmount
number
required

Response

201 - application/json
id
string
required
description
string
notes
string
accountId
string
required
externalPaymentReferences
object

external payment reference object

lineItemRecords
object[]
required
totalAmount
number
required
currency
string
required
version
number
required
createdBy
string
required
createdAt
string
required