Skip to main content
POST
/
v1
/
customers
/
{id}
/
transactions
Create a transaction for a customer
curl --request POST \
  --url https://dev.flextell.ai/api/v1/customers/{id}/transactions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-Tenant: <x-tenant>' \
  --data '
{
  "transaction_date": "2023-11-07T05:31:56Z",
  "amount": 1.01,
  "currency_id": 123,
  "exchange_rate": 1,
  "description": "<string>",
  "invoice_number": "<string>",
  "account_id": 123,
  "is_installment": true,
  "installment_count": 7,
  "first_due_date": "2023-11-07T05:31:56Z",
  "installments": [
    {
      "amount": 1.01,
      "due_date": "2023-11-07T05:31:56Z",
      "description": "<string>"
    }
  ]
}
'
{
  "success": "<string>",
  "data": {
    "id": 123,
    "tenant_id": 123,
    "batch_uuid": "<string>",
    "customer_id": 123,
    "account_id": 123,
    "sale_id": 123,
    "currency_id": 123,
    "exchange_rate": 123,
    "debit": "<string>",
    "credit": "<string>",
    "amount": "<string>",
    "transaction_date": "2023-11-07T05:31:56Z",
    "type": "<string>",
    "description": "<string>",
    "invoice_number": "<string>",
    "is_installment": true,
    "due_date": "2023-11-07T05:31:56Z",
    "installment_number": 123,
    "total_installments": 123,
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z",
    "account": {
      "id": 123,
      "name": "<string>"
    },
    "currency": {
      "id": 123,
      "code": "<string>",
      "symbol": "<string>",
      "name": "<string>"
    }
  }
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Headers

X-Tenant
number
required

Tenant identifier. Send the Tenant ID in the X-Tenant header to scope API requests to a specific tenant.

Path Parameters

id
integer
required

The customer identifier

Body

application/json
type
enum<string>
required

The type.

Available options:
sale_invoice,
sale,
collection,
purchase_invoice,
payment,
opening_balance
transaction_date
string<date-time>
required

Transaction date (YYYY-MM-DD).

amount
number | null

Monetary amount.

Required range: x >= 0.01
currency_id
integer | null

The currency ID.

exchange_rate
number | null

Currency exchange rate.

Required range: x >= 0
payment_method
enum<string>

The payment method.

Available options:
bank_account,
transfer_cash,
other,
clinic_credit_card,
credit_card,
private_insurance,
sgk
description
string | null

The description.

Maximum string length: 65535
invoice_number
string | null

Invoice number.

Maximum string length: 255
debit_credit_code
enum<string> | null

Debit or credit code.

Available options:
debit,
credit
account_id
integer | null

Account ID.

is_installment
boolean | null

Whether this is an installment transaction.

installment_count
integer | null

Number of installments.

Required range: 2 <= x <= 12
first_due_date
string<date-time> | null

First installment due date (YYYY-MM-DD).

installments
object[] | null

List of installments.

Minimum array length: 2

Response

success
string
required
data
CustomerTransactionResource · object
required