Record a transaction (purchase, payment or rebate) on a credit line in real time

Path Parameters
  • creditLineId
    Type: string Format: uuid
    required

    Credit line UUID

Body
required
application/json
  • amount
    Type: integer
    greater than:  
    0
    min:  
    -9007199254740991
    max:  
    9007199254740991
    required

    Transaction amount in cents

  • transactionDate
    Type: string Format: date
    required

    Transaction date (YYYY-MM-DD)

  • type
    enum
    required

    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
  • description
    Type: string nullable

    Transaction description

  • externalId
    Type: string

    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"
}