# Just In Time

Just in time allows you to Create or Update Debt Accounts on demand. This feature allows Organizations to send fresh or missing information as soon as they are requested by incoming Customer.

Currently supported Customer flows:

  • IVR - after Customer is identified

# Receive a JIT request

Fresh Debt Account information is synchronously requested by Tratta from your System through GET request via endpoint provided by your Organization. Debt Account debt_account_external_id is appended as a query parameter.

GET https://your-system.tld/whatever-you-want?debt_account_external_id=123456

# Parameters

debt_account_external_id string

External debt account id

# Respond to a JIT request

Your system must respond with HTTP Status code 200 and with json payload that will be used to update or create Debt Account, Customer and Location. Resources must be nested under the data parameter. Respond to JIT request has a default timeout of 10 seconds.

Although location and customer parameters are optional, it's easier to always provide a full payload and let Tratta decide based on the data it has, what resources should be updated or created. If resource already exists in the system it will be updated. If we're seeing it for the first time, it will be created.

Resources are uniquely identified using external_id of your system or uuid previously generated by Tratta. Individual resource definitions comply with update or create pages of Debt Account, Customer and Location. If you're creating or updating a Nested Debt Account make sure to pass along and array of child_debt_accounts objects. These children will be linked to parent using parent_external_id that corresponds to external_id of Parent Debt Account.

  "data": {
    "location": { // optional
      "external_id": "location-123",
      "name": "Test Location"
    "customer": { // optional
      "external_id": "customer-123",
      "name": "Test Customer"
    "debt_account": { // required
      "external_id": "debt-account-123",
      "balance": 2000,
      "current_balance": 2000
    "child_debt_accounts": [{ // optional
      "external_id": "debt-account-124",
      "parent_external_id": "debt-account-123",
      "balance": 1000,
      "current_balance": 1000

# Create a JIT endpoint

POST https://<org-uuid>.production.tratta.io/api/v1/just-in-time

curl https://<org-uuid>.production.tratta.io/api/v1/just-in-ime \
 -H "Authorization: Bearer eyJ0eXA3asdk..." \
 -d url="just-in-time-url"

# Parameters

url required|url

Url of your application Tratta will request on just in time updates from.

# Testing a JIT endpoint

After you Create a JIT endpoint you can start testing your integration. You can trigger a JIT request and pass along the external_id which Tratta will subsequently use in it's JIT request.

POST https://<org-uuid>.production.tratta.io/api/v1/just-in-time/trigger

curl https://<org-uuid>.production.tratta.io/api/v1/just-in-time/trigger \
 -H "Authorization: Bearer eyJ0eXA3asdk..." \
 -d debt_account_external_id="debt-account-external-id"

Triggering a JIT request is also synchronous and respond to this request is result of the JIT action. If something goes wrong on your side, we'll relay your server's response and status code here. We'll also include validation messages from our side. If all goes well, we'll respond with a json that contains updated or created Customer, Location, Debt Account and Child Debt Accounts.