Record a transaction (purchase, payment or rebate) on a credit line in real time
Path Parameters
- Type: string Format: uuidcredit
Line Id requiredCredit line UUID
Body
required
application/json
- Type: integeramountgreater than:0min:-9007199254740991max:9007199254740991required
Transaction amount in cents
- Type: string Format: datetransaction
Date requiredTransaction date (YYYY-MM-DD)
- enumtyperequired
Transaction type. purchase = customer spend (rejected while the line is suspended or the period is closed); payment = customer money (applies fees-first, counts toward the minimum, can auto-reactivate a suspended line); rebate = partner-funded credit (reduces the balance only — never fees, never the minimum)
values- purchase
- payment
- rebate
- Type: string nullabledescription
Transaction description
- Type: stringexternal
Id Partner-side transaction identifier for reconciliation
Responses
- application/json
- application/json
- application/json
- application/json
- application/json
- application/json
- application/json
- application/json
Request Example for post/credit-lines/{creditLineId}/transactions
curl https://api-sandbox.tryslatehq.com/credit-lines/123e4567-e89b-12d3-a456-426614174000/transactions \
--request POST \
--header 'Content-Type: application/json' \
--header 'x-api-key: YOUR_SECRET_TOKEN' \
--data '{
"type": "purchase",
"amount": 50000,
"transactionDate": "2025-01-01",
"externalId": "txn_abc123",
"description": "Fuel purchase"
}'
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"creditLineId": "123e4567-e89b-12d3-a456-426614174000",
"periodId": "123e4567-e89b-12d3-a456-426614174000",
"type": "payment",
"amount": 50000,
"transactionDate": "2025-01-01",
"description": null,
"notes": null,
"createdAt": "2025-01-01T00:00:00Z"
}