Download OpenAPI specification:
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:
See Important Concepts in the sidebar for the terminology and flows referenced throughout the rest of this documentation.
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 a single data block using streaming. Batch will auto-process when final data block is received.
| batchId required | string |
| dataBlockNumber required | integer <int32> |
Stream of data containing batch payload. Supported object types: COMPANY, COMPANY_CODE, PAYMENT_REQUEST, INVOICE
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 |
{- "companyRelations": [
- {
- "paymentTerm": {
- "installments": [
- {
- "dueDays": 0,
- "percentage": 0,
- "dueDateType": "RELATIVE_DAYS",
- "fixedDayOfMonth": 0,
- "monthsShift": 0,
- "sequence": 0
}
], - "baselineType": "INVOICE_DATE",
- "asap": true,
- "name": "string",
- "description": "string",
- "referenceId": "string"
}, - "relationshipType": "SUPPLIER",
- "referenceId": "string",
- "companyReferenceId": "string",
- "paymentMethod": "string",
- "companyCodeReferenceId": "string"
}
], - "contacts": [
- {
- "referenceId": "CONT-001",
- "firstName": "John",
- "lastName": "Doe",
- "department": "Accounts Payable",
- "title": "Senior Accountant",
- "emailAddress": "john.doe@example.com",
- "phone": "+1-555-123-4567"
}
], - "addresses": [
- {
- "referenceId": "ADDR-001",
- "name": "Headquarters",
- "line1": 123,
- "line2": "Suite 400",
- "city": "San Francisco",
- "region": "CA",
- "postalCode": 94105,
- "country": "US",
- "isPrimary": false
}
], - "corporateIdentifiers": [
- {
- "type": "LEI",
- "value": "213800ABCD1234567890",
- "source": "LEI"
}
], - "bankAccounts": [
- {
- "referenceId": "sap_bank_123",
- "name": "Primary Business Account",
- "bankCountry": "US",
- "bankCode": 121000248,
- "bankName": "Wells Fargo Bank",
- "bankSwiftCode": "WFBIUS6S",
- "accountHolderName": "Acme Corp",
- "accountNumber": "string",
- "accountIban": "GB82WEST12345698765432",
- "currency": "USD or USDC",
- "digitalCurrencyCustodianProvider": "CIRCLE",
- "digitalCurrencyNetworkProvider": "ETHEREUM",
- "digitalCurrencyWalletAddress": "0x742d35Cc6635C0532925a3b8D73c442e8ddbd0ec",
- "priority": 100,
- "validFrom": "2019-08-24T14:15:22Z",
- "validTo": "2019-08-24T14:15:22Z"
}
], - "name": "string",
- "number": "string",
- "referenceId": "string",
- "registeredCountry": "string",
- "registeredState": "string"
}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.
| batchId required | string |
curl -X POST "https://api.tereina.com/api/integration/v1/batch/{batchId}/confirm-transfer-receipt" \ -H "Authorization: Bearer $TOKEN"
Creates a new batch job and returns data block transfer parameters. Batch will auto-process when all data blocks are uploaded.
| clientRefId required | string Client reference ID |
| referenceId required | string Reference ID for the batch |
| 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 |
{- "clientRefId": "client_123",
- "referenceId": "batch_sap_20241006",
- "payloadObjectType": "COMPANY_CODE",
- "totalPayloadSize": 104857600,
- "totalLineItemCount": 200,
- "inputDataFormat": "JSON"
}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.
| clientRefId required | string |
| referenceId required | string |
| payloadObjectType required | string |
| totalLineItemCount required | integer <int32> |
| totalPayloadSize required | integer <int64> |
| inputDataFormat required | string |
Stream of data containing batch payload. Supported object types: COMPANY, COMPANY_CODE, PAYMENT_REQUEST, INVOICE
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 |
{- "companyRelations": [
- {
- "paymentTerm": {
- "installments": [
- {
- "dueDays": 0,
- "percentage": 0,
- "dueDateType": "RELATIVE_DAYS",
- "fixedDayOfMonth": 0,
- "monthsShift": 0,
- "sequence": 0
}
], - "baselineType": "INVOICE_DATE",
- "asap": true,
- "name": "string",
- "description": "string",
- "referenceId": "string"
}, - "relationshipType": "SUPPLIER",
- "referenceId": "string",
- "companyReferenceId": "string",
- "paymentMethod": "string",
- "companyCodeReferenceId": "string"
}
], - "contacts": [
- {
- "referenceId": "CONT-001",
- "firstName": "John",
- "lastName": "Doe",
- "department": "Accounts Payable",
- "title": "Senior Accountant",
- "emailAddress": "john.doe@example.com",
- "phone": "+1-555-123-4567"
}
], - "addresses": [
- {
- "referenceId": "ADDR-001",
- "name": "Headquarters",
- "line1": 123,
- "line2": "Suite 400",
- "city": "San Francisco",
- "region": "CA",
- "postalCode": 94105,
- "country": "US",
- "isPrimary": false
}
], - "corporateIdentifiers": [
- {
- "type": "LEI",
- "value": "213800ABCD1234567890",
- "source": "LEI"
}
], - "bankAccounts": [
- {
- "referenceId": "sap_bank_123",
- "name": "Primary Business Account",
- "bankCountry": "US",
- "bankCode": 121000248,
- "bankName": "Wells Fargo Bank",
- "bankSwiftCode": "WFBIUS6S",
- "accountHolderName": "Acme Corp",
- "accountNumber": "string",
- "accountIban": "GB82WEST12345698765432",
- "currency": "USD or USDC",
- "digitalCurrencyCustodianProvider": "CIRCLE",
- "digitalCurrencyNetworkProvider": "ETHEREUM",
- "digitalCurrencyWalletAddress": "0x742d35Cc6635C0532925a3b8D73c442e8ddbd0ec",
- "priority": 100,
- "validFrom": "2019-08-24T14:15:22Z",
- "validTo": "2019-08-24T14:15:22Z"
}
], - "name": "string",
- "number": "string",
- "referenceId": "string",
- "registeredCountry": "string",
- "registeredState": "string"
}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.
| batchId required | string |
curl -X GET "https://api.tereina.com/api/integration/v1/batch/{batchId}/transfer" \ -H "Authorization: Bearer $TOKEN"
{- "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",
- "status": "OPEN",
- "reasonCode": "REJ_004",
- "additionalInfo": "Error due to missing amount",
- "payerReference": "INSTR-001",
- "paymentInfoId": "PMTINF-001"
}Returns current status of the batch job including data block transfer progress, missing data blocks, and processing state.
| batchId required | string |
curl -X GET "https://api.tereina.com/api/integration/v1/batch/{batchId}/status" \ -H "Authorization: Bearer $TOKEN"
Returns current status of the batch job by external reference ID, including data block transfer progress, missing data blocks, and processing state.
| referenceId required | string |
curl -X GET "https://api.tereina.com/api/integration/v1/batch/reference/{referenceId}/status" \ -H "Authorization: Bearer $TOKEN"
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).
| payloadObjectType | any (PayloadObjectType) Enum: "COMPANY_CODE" "COMPANY" "INVOICE" "PURCHASE_ORDER" "PAYMENT_REQUEST" "PAYMENT_STATUS" "BANK_STATEMENT" Payload objects supported by the integration service |
curl -X GET "https://api.tereina.com/api/integration/v1/batch/outbound/pending" \ -H "Authorization: Bearer $TOKEN"
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.
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.
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.
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.
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.
PAIN 001 (pain.001.001.03) 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 (pain.002.001.03) 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 (camt.053.001.02) 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.
The following endpoints work together to enable ERP systems to pull outbound batches (e.g., PAIN 002 payment status reports, CAMT 053 bank statements):
GET /batch/outbound/pending — Poll for ready batchesReturns 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.
GET /batch/{batchId}/transfer — Download a batchRetrieves 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.
POST /batch/{batchId}/confirm-transfer-receipt — Acknowledge receiptConfirms 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.