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",
  "totalAmount": 10000,
  "externalPaymentReference": {
    "sourceName": "XYZ Company",
    "sourceType": "CARD",
    "transactionNumber": "TXN123",
    "description": "Card payment"
  },
  "lineItemRecords": [
    {
      "togaiId": "inv.234.12efwe",
      "order": 1,
      "amount": 1000,
      "type": "INVOICE"
    },
    {
      "togaiId": "inv.236.12efwe",
      "order": 2,
      "amount": 500,
      "type": "INVOICE"
    },
    {
      "togaiId": "cred.236.12efwe",
      "order": 3,
      "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",
      "order": 1
    },
    {
      "togaiId": "inv.235.12efwe",
      "amount": 600,
      "type": "INVOICE",
      "order": 2
    },
    {
      "togaiId": "cred.236.12efwe",
      "amount": 100,
      "type": "CREDIT",
      "order": 3
    }
  ],
  "totalAmount": 1700,
  "version": 1,
  "createdBy": "user123",
  "createdAt": "2023-01-01T12:00:00"
}

Authorizations

Authorization
string
header
required

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

Body

application/json
Payload to create a payment

payload to create payment

accountId
string
required
Maximum length: 512
Example:

"ACC001"

externalPaymentReference
object
required

external payment reference object

lineItemRecords
object[]
required

payment line item record object

currency
string
required
Maximum length: 512
Example:

"USD"

totalAmount
number
required
description
string

A brief description of the payment

Maximum length: 512
Example:

"Payment for Invoice inv.234.23afv"

notes
string

A detailed note about the payment

Maximum length: 512
Example:

"Payment for purchase of credits"

Response

201
application/json
Response for POST payments requests

Payment object

id
string
required
Example:

"pay.w123rwe.1231"

accountId
string
required
Example:

"ACC001"

externalPaymentReferences
object
required

external payment reference object

lineItemRecords
object[]
required

payment line item record object

totalAmount
number
required
currency
string
required
version
number
required
createdBy
string
required
createdAt
string
required
description
string
notes
string