Tereina Integration Service API (1.0.0)

Download OpenAPI specification:

Tereina Development Team: support@tereina.com License: Proprietary

What is this doc for?

The Integration Service connects client ERP systems to the Tereina platform. It lets SAP customers plug their procurement and accounts-payable processes into Tereina's global B2B payment infrastructure using ISO 20022 messaging (with a few Tereina-specific extensions, detailed later in these docs) — without building bespoke integrations per bank or payment rail.

At a high level, the API lets ERPs:

  • Send payment instructions into Tereina for processing.
  • Receive payment status updates and bank statements once Tereina has executed and reconciled those payments.

See Important Concepts in the sidebar for the terminology and flows referenced throughout the rest of this documentation.

Data Retention

Platform-only data-retention SPI (platform service account)

Set or clear a retention hold on specific rows (internal retention SPI)

Request Body schema: application/json
required
objectType
required
any (RetentionObjectType)
Enum: "CLIENT" "PAYLOAD_BATCH" "PAYMENT_STATUS_STATE"

Which retention-governed type the ids belong to

ids
required
Array of strings non-empty

Ids of the rows to hold/unhold

holdUntil
string <date-time>

Hold instant; null clears the hold

Responses

Request samples

Content type
application/json
{
  • "objectType": "CLIENT",
  • "ids": [
    ],
  • "holdUntil": "2035-01-01T00:00:00Z"
}

Bulk physical-delete retention-expired objects (internal retention SPI)

Request Body schema: application/json
required
organizationId
required
string non-empty

Organization whose governed rows are swept

objectType
required
any (RetentionObjectType)
Enum: "CLIENT" "PAYLOAD_BATCH" "PAYMENT_STATUS_STATE"

Which retention-governed entity to sweep

beforeDate
required
string <date-time>

Anchor cutoff; rows with anchor < this are eligible

Responses

Request samples

Content type
application/json
{
  • "organizationId": "ACC-12345",
  • "objectType": "CLIENT",
  • "beforeDate": "2016-07-16T00:00:00Z"
}

Bulk-archive retention-expired objects (internal retention SPI)

Request Body schema: application/json
required
organizationId
required
string non-empty

Organization whose governed rows are swept

objectType
required
any (RetentionObjectType)
Enum: "CLIENT" "PAYLOAD_BATCH" "PAYMENT_STATUS_STATE"

Which retention-governed entity to sweep

beforeDate
required
string <date-time>

Anchor cutoff; rows with anchor < this are eligible

Responses

Request samples

Content type
application/json
{
  • "organizationId": "ACC-12345",
  • "objectType": "CLIENT",
  • "beforeDate": "2016-07-16T00:00:00Z"
}

SPII

SaaS Provider Integration Interface callbacks invoked by UCL to drive the SAP S/4HANA Cloud integration wave flow.

Receive a UCL Tenant Mapping Notification (one wave of the SPII handshake)

Validates and acknowledges the notification with 202 Accepted, then processes the wave asynchronously. The resulting status report is sent to the URL in the request's Location header.

header Parameters
Location
string
Request Body schema: application/json
required
object (NotificationContext)

Notification context: formation id and lifecycle operation.

object (ReceiverTenant)

The tenant receiving the notification (this service's tenant).

object (AssignedTenant)

The tenant on the other side of the integration (e.g. SAP S/4HANA Cloud).

Responses

Request samples

Content type
application/json
{
  • "context": {
    },
  • "receiverTenant": {
    },
  • "assignedTenant": {
    }
}

Endpoints

APIs for customer payment integration and status tracking. This includes endpoints for receiving payment instructions from ERPs and sending payment status updates back to ERPs.

Upload data block

Upload a single data block using streaming. Batch will auto-process when final data block is received.

path Parameters
batchId
required
string
dataBlockNumber
required
integer <int32>
Request Body schema:

Stream of data containing batch payload. Supported object types: COMPANY, COMPANY_CODE, PAYMENT_REQUEST, INVOICE

One of
required
Array of objects (CompanyRelationRequestPayload) non-empty

List of company relationships with company codes

Array of objects (ContactRequestPayload)

List of contacts for the company

Array of objects (AddressRequestPayload)

List of addresses for the company

Array of objects (CorporateIdentifierRequestPayload)

List of corporate identifiers for the company

Array of objects (BankAccountRequestPayload)

List of bank accounts for the company

name
string
number
string
referenceId
string
registeredCountry
string
registeredState
string

Responses

Request samples

Content type
Example
{
  • "companyRelations": [
    ],
  • "contacts": [
    ],
  • "addresses": [
    ],
  • "corporateIdentifiers": [
    ],
  • "bankAccounts": [
    ],
  • "name": "string",
  • "number": "string",
  • "referenceId": "string",
  • "registeredCountry": "string",
  • "registeredState": "string"
}

Confirm transfer receipt

Confirms that the client has successfully received and processed all items in an outbound batch. This marks all batch items as COMPLETE and the batch status as COMPLETE_SUCCESS. The batch is then removed from the pending queue.

path Parameters
batchId
required
string

Responses

Request samples

curl -X POST "https://api.tereina.com/api/integration/v1/batch/{batchId}/confirm-transfer-receipt" \
  -H "Authorization: Bearer $TOKEN"

Initiate batch job with data block transfer

Creates a new batch job and returns data block transfer parameters. Batch will auto-process when all data blocks are uploaded.

Request Body schema: application/json
required
clientRefId
required
string non-empty

Client reference ID

referenceId
required
string non-empty

Reference ID for the batch

messageId
string

Source banking message ID, unique per organization (bank statements only)

payloadObjectType
required
any (PayloadObjectType)
Enum: "COMPANY_CODE" "COMPANY" "INVOICE" "PURCHASE_ORDER" "PAYMENT_REQUEST" "PAYMENT_STATUS" "BANK_STATEMENT"

Type of payload object being uploaded

totalPayloadSize
required
integer <int64>

Total size of the payload in bytes

totalLineItemCount
integer <int32>

Total number of the line item objects in this batch

inputDataFormat
required
any (DataFormat)
Enum: "JSON" "CSV" "XML"

Input data format for the batch payload

Responses

Request samples

Content type
application/json
{
  • "clientRefId": "client_123",
  • "referenceId": "batch_sap_20241006",
  • "messageId": "MSG-2024-001",
  • "payloadObjectType": "COMPANY_CODE",
  • "totalPayloadSize": 104857600,
  • "totalLineItemCount": 200,
  • "inputDataFormat": "JSON"
}

Create and process a batch of records (single data block)

Accepts a complete batch of data in various formats (JSON, CSV, XML, ISO) using streaming. The format is determined by client configuration and validated against expected schema. For large payloads, use the data block transfer endpoints instead.

query Parameters
clientRefId
required
string
referenceId
required
string
payloadObjectType
required
string
totalLineItemCount
required
integer <int32>
totalPayloadSize
required
integer <int64>
inputDataFormat
required
string
Request Body schema:

Stream of data containing batch payload. Supported object types: COMPANY, COMPANY_CODE, PAYMENT_REQUEST, INVOICE

One of
required
Array of objects (CompanyRelationRequestPayload) non-empty

List of company relationships with company codes

Array of objects (ContactRequestPayload)

List of contacts for the company

Array of objects (AddressRequestPayload)

List of addresses for the company

Array of objects (CorporateIdentifierRequestPayload)

List of corporate identifiers for the company

Array of objects (BankAccountRequestPayload)

List of bank accounts for the company

name
string
number
string
referenceId
string
registeredCountry
string
registeredState
string

Responses

Request samples

Content type
Example
{
  • "companyRelations": [
    ],
  • "contacts": [
    ],
  • "addresses": [
    ],
  • "corporateIdentifiers": [
    ],
  • "bankAccounts": [
    ],
  • "name": "string",
  • "number": "string",
  • "referenceId": "string",
  • "registeredCountry": "string",
  • "registeredState": "string"
}

Get batch for transfer

Retrieves the complete batch with all pending items and their transformed payloads for client pickup. Only returns batches in PENDING status that are ready for transfer.

path Parameters
batchId
required
string

Responses

Request samples

curl -X GET "https://api.tereina.com/api/integration/v1/batch/{batchId}/transfer" \
  -H "Authorization: Bearer $TOKEN"

Response samples

Content type
application/json
{
  • "id": "124ABCDEF",
  • "createdDate": "2023-12-01T10:15:30+01:00[Europe/Paris]",
  • "lastUpdatedDate": "2023-12-02T10:15:30+01:00[Europe/Paris]",
  • "lastUpdatedBy": "1234ABCXYZ",
  • "version": 0,
  • "referenceId": "payment_request_123",
  • "groupReferenceId": "payment_group_123",
  • "sourceBatchReferenceId": "batch_sap_20241006",
  • "status": "OPEN",
  • "reasonCode": "REJ_004",
  • "additionalInfo": "Error due to missing amount",
  • "payerReference": "INSTR-001",
  • "paymentInfoId": "PMTINF-001",
  • "statementGroupingId": "1710-ABTN1-USDC",
  • "instructedAmount": "5000.00",
  • "instructedAmountCurrency": "EUR",
  • "requestedExecutionDate": "2026-07-20",
  • "remittanceInformation": "Invoice 12345",
  • "structuredRemittance": [
    ],
  • "creditorName": "Acme GmbH",
  • "creditorAccount": "DE89370400440532013000",
  • "debtorName": "Buyer LLC",
  • "originalNumberOfTransactions": "12",
  • "originalControlSum": "15000.00"
}

Get batch job status by batch ID

Returns current status of the batch job including data block transfer progress, missing data blocks, and processing state.

path Parameters
batchId
required
string

Responses

Request samples

curl -X GET "https://api.tereina.com/api/integration/v1/batch/{batchId}/status" \
  -H "Authorization: Bearer $TOKEN"

Get batch job status by reference ID

Returns current status of the batch job by external reference ID, including data block transfer progress, missing data blocks, and processing state.

path Parameters
referenceId
required
string

Responses

Request samples

curl -X GET "https://api.tereina.com/api/integration/v1/batch/reference/{referenceId}/status" \
  -H "Authorization: Bearer $TOKEN"

Get pending outbound batches

Returns all outbound batches in PENDING or PARTIAL_PENDING status that are waiting for the client to pick up. Optionally filter by payload object type (e.g., COMPANY, INVOICE).

query Parameters
payloadObjectType
any (PayloadObjectType)
Enum: "COMPANY_CODE" "COMPANY" "INVOICE" "PURCHASE_ORDER" "PAYMENT_REQUEST" "PAYMENT_STATUS" "BANK_STATEMENT"

Payload objects supported by the integration service

Responses

Request samples

curl -X GET "https://api.tereina.com/api/integration/v1/batch/outbound/pending" \
  -H "Authorization: Bearer $TOKEN"

Important Concepts

This section introduces the vocabulary used throughout the rest of this documentation — both the Tereina-specific concepts you'll only see on this platform and the industry-standard ISO 20022 message types the service speaks with ERPs. Skim it once; each endpoint below assumes you're comfortable with these terms.

Tereina's Terminology

Payload Batch

A payload batch is the unit of transfer between an ERP and the Integration Service. Each batch groups a related set of records (e.g., payment requests, payment statuses, bank statements) and tracks their lifecycle from upload through processing.

Data Block

A data block is a chunk of a payload batch used for transferring large files. When a batch payload exceeds the maximum single-upload size, it is split into multiple data blocks that are uploaded individually and reassembled server-side. The number of data blocks is calculated automatically based on the total payload size and the configured maximum data block size.

Direction (Inbound / Outbound)

Every payload batch has a direction. Inbound batches flow from the ERP into Tereina (e.g., PAIN 001 payment instructions). Outbound batches flow from Tereina to the ERP (e.g., PAIN 002 status reports, CAMT 053 statements) and are pulled by the client on their own cadence.

Payload Object Type

The payload object type identifies what kind of records a batch contains — for example, PAYMENT_REQUEST for inbound payment instructions, or PAYMENT_STATUS and BANK_STATEMENT for outbound files. It is used to filter and route batches at nearly every endpoint below.

Common Terminology

PAIN 001 (Customer Credit Transfer Initiation)

PAIN 001 (pain.001.001.09) is an ISO 20022 XML message used by a debtor (payer) to instruct their bank to initiate one or more credit transfers to creditors (payees). In the Integration Service, inbound PAIN 001 files are parsed into PaymentRequest objects — each CdtTrfTxInf element in the XML becomes one payment request. The XML is validated, transformed to JSON, and dispatched to the Payment Request Service for processing.

PAIN 002 (Payment Status Report)

PAIN 002 (pain.002.001.10) is an ISO 20022 XML message used to report the status of previously submitted payment instructions back to the initiating party. In the Integration Service, PAIN 002 files are generated as outbound messages that inform ERP systems whether each original payment request was accepted, rejected, or is pending. Each transaction status references the original EndToEndId and optionally the InstrId from the corresponding PAIN 001 submission.

CAMT 053 (Bank-to-Customer Statement)

CAMT 053 (camt.053.001.08) is an ISO 20022 XML message that provides a detailed end-of-day bank statement. It contains balance information and individual transaction entries for a given account and period. In the Integration Service, CAMT 053 files are generated as outbound messages to deliver bank statement data back to ERP systems.


Outbound Batch Transfer Flow

The following endpoints work together to enable ERP systems to pull outbound batches (e.g., PAIN 002 payment status reports, CAMT 053 bank statements):

1. GET /batch/outbound/pending — Poll for ready batches

Returns all outbound batches in PENDING or PARTIAL_PENDING status that are waiting for client pickup. Optionally filter by payload object type (e.g., PAYMENT_STATUS, BANK_STATEMENT). Use this endpoint to discover which batches are available for transfer.

2. GET /batch/{batchId}/transfer — Download a batch

Retrieves the complete batch payload with all pending items and their transformed data. Only returns batches that are in PENDING status and ready for transfer. The response includes the batch metadata and all individual items with their payloads.

3. POST /batch/{batchId}/confirm-transfer-receipt — Acknowledge receipt

Confirms that the client has successfully received and processed all items in the batch. This marks all batch items as COMPLETE and transitions the batch status to COMPLETE_SUCCESS. The batch is then removed from the pending queue. This step is required — without confirmation, the batch remains in the pending queue and will continue to appear in polling results.

Inbound Webhook Events

Search captured inbound webhooks by RSQL filter (payload never included)

query Parameters
filter
string

RSQL filter over the registered fields, e.g. source==CROSS_RIVER;receivedAt=ge=2026-08-01T00:00:00Z. A filter that does not constrain receivedAt has the configured lookback applied, so the partitioned table stays pruned.

page
integer <int32>
Default: 0
limit
integer <int32>
Default: 25

Responses

Request samples

curl -X GET "https://api.tereina.com/api/paymentprocessor/v1/inbound-webhook-event/search" \
  -H "Authorization: Bearer $TOKEN"

Search captured inbound webhooks by RSQL filter (payload never included)

Request Body schema: application/json
required
filter
string

RSQL filter query string

Array of objects (SortField)

Sort fields with direction

page
integer <int32> >= 0

Page number (0-based)

limit
integer <int32> [ 1 .. 100 ]

Maximum number of records to return

Responses

Request samples

Content type
application/json
{
  • "filter": "createdDate=le=2026-04-15",
  • "sort": [
    ],
  • "page": 0,
  • "limit": 1
}

Re-run captured webhook bodies to create processor events payment-execution lacks

Request Body schema: application/json
required
ids
Array of strings

Exact inbound webhook event ids to replay. Mutually exclusive with the window form.

source
string

Capture source to replay, as stored: a PaymentProcessor name.

receivedFrom
string <date-time>

Inclusive lower bound on receivedAt (UTC)

receivedTo
string <date-time>

Exclusive upper bound on receivedAt (UTC)

limit
integer <int32> >= 1

Caller's cap on rows selected by the window form; clamped by the configured maximum

Responses

Request samples

Content type
application/json
{
  • "ids": [
    ],
  • "source": "CROSS_RIVER",
  • "receivedFrom": "2026-08-01T00:00:00Z",
  • "receivedTo": "2026-08-02T00:00:00Z",
  • "limit": 1
}

Fetch one captured inbound webhook, optionally decrypting its payload (audited)

path Parameters
id
required
string
query Parameters
includePayload
boolean
Default: false

Decrypt and return the raw body. Emits a DECRYPT encryption-audit entry.

Responses

Request samples

curl -X GET "https://api.tereina.com/api/paymentprocessor/v1/inbound-webhook-event/{id}" \
  -H "Authorization: Bearer $TOKEN"

search-registry-controller

getAll

Responses

Request samples

curl -X GET "https://api.tereina.com/api/v1/organization/search/registry" \
  -H "Authorization: Bearer $TOKEN"

getByEntity

path Parameters
entity
required
string

Responses

Request samples

curl -X GET "https://api.tereina.com/api/v1/organization/search/registry/{entity}" \
  -H "Authorization: Bearer $TOKEN"