HomeGuidesAPI Reference
Log In
API Reference

paymentMade schema definition

Here find the expected payload for the paymentMade event type.

The paymentMade event type is designed to convey detailed information about a financial transaction. Sending paymentMade events allows spektr to monitor transactional behavior, detect anomalies, and contribute to a comprehensive risk assessment of your customers.

When sending paymentMade events, ensure they are encapsulated within the events array of the overall request body to the /v1/events/import endpoint.

Event Structure

Each paymentMade event within the events array adheres to the following structure:

Field NameTypeDescriptionRequired
workspaceIdstringYour spektr Workspace ID. This identifies the specific workspace within Spektr to which the event belongs.Yes
spektrIdstringspektr's internal identifier for the customer. If you have previously created a customer in Spektr and received a spektrId, use it here to directly link the event. If customerData.internalId is provided instead, spektr will attempt to resolve the customer.Yes
createdAtnumberTimestamp of when the event occurred/was created in your system (Unix timestamp in milliseconds). This represents the actual time the payment happened, not when it was sent to spektr.Yes
sourcestringIdentifier of the system or origin from which the event was generated. E.g., "core-banking-system", "payment-gateway", "mobile-app".No
customerDataobjectAn object containing identifying information about the customer related to this event.No
eventDataobjectContains the specific details of the payment transaction. See eventData sub-fields below for details.Yes
typestringAlways "paymentMade" for this event type.Yes

eventData Sub-fields (Payment Details)

Field NameTypeDescriptionRequired
transaction_idstringA unique identifier for the transaction within your system. This is crucial for tracking and de-duplication.No
typestringThe high-level type of payment. Common values include: deposit, withdrawal, transfer, purchase, refund, fee.Yes
subtypestringA more specific categorization of the payment type. Examples: wireTransfer, ach, sepa, creditCard, debitCard, paypal, crypto.Yes
statusstringThe current status of the transaction. Common values: completed, pending, failed, cancelled, refunded.Yes
amountnumberThe monetary value of the transaction. Use the smallest currency unit (e.g., cents for USD, yen for JPY) to avoid floating-point issues, or ensure consistent decimal representation.No
currencystringThe 3-letter ISO 4217 currency code (e.g., "USD", "EUR", "GBP").Yes
source_accountobjectDetails of the account from which the payment originated. See Account Details sub-fields below. Mandatory for OUT direction.Yes
destination_accountobjectDetails of the account to which the payment was sent. See Account Details sub-fields below. Mandatory for IN direction.Yes
directionstringThe direction of the payment relative to your customer. IN for incoming payments to your customer, OUT for outgoing payments from your customer.Yes
channelstringThe channel through which the payment was initiated or processed. Examples: SWIFT, API, WEB, MOBILE, POS.Yes
descriptionstringA brief textual description of the payment.Yes
referencestringAn optional reference number or identifier provided by the payer/payee.No
categorystringA categorization of the transaction purpose. Examples: SALARY, RENT, UTILITIES, FOOD AND BEVERAGES, TRAVEL. Consistent categorization aids in pattern analysis.No
feeobjectOptional. Details about a fee associated with this transaction. See Fee Details sub-fields below.No
related_transactionsarrayAn array of strings, where each string is the transaction_id of another related transaction (e.g., original payment for a refund).Yes
card_detailsobjectOptional. Details specific to card-based transactions. See Card Details sub-fields below.No

Account Details Sub-fields (for source_account and destination_account)

Both source_account and destination_account objects share the following structure. All fields within these objects are required.

Field NameTypeDescriptionRequired
ibanstringInternational Bank Account Number.Yes
holder_namestringThe name of the account holder.Yes
bank_namestringThe name of the bank or financial institution.Yes
bicstringBank Identifier Code (SWIFT code).Yes

Card Details Sub-fields (for card_details)

If provided, the card_details object contains the following details for card-based transactions:

Field NameTypeDescriptionRequired
card_networkstringThe network of the card (e.g., "VISA", "MASTERCARD", "AMEX").Yes
card_last4stringThe last four digits of the card number.Yes
merchantstringDetails about the merchant involved in the transaction. See Merchant Details sub-fields below.Yes

Example Payload

{
  "events": [
    {
      "workspaceId": "your_spektr_workspace_id",
      "spektrId": "customer_spektr_id_optional",
      "createdAt": 1720435200000, // Example: July 8, 2024 10:00:00 AM UTC in milliseconds
      "source": "your_system_name",
      "customerData": {
        "internalId": "your_customer_internal_id"
      },
      "eventData": {
        "transaction_id": "TXN-789012345",
        "type": "transfer",
        "subtype": "sepa",
        "status": "completed",
        "amount": 250000, // Represents 2500.00 EUR (assuming smallest unit)
        "currency": "EUR",
        "source_account": {
          "iban": "DE12345678901234567890",
          "holder_name": "Alice Smith",
          "bank_name": "Example Bank AG",
          "bic": "EXABDEFFXXX"
        },
        "destination_account": {
          "iban": "FR0012345678901234567890",
          "holder_name": "Bob Johnson",
          "bank_name": "Another Bank France",
          "bic": "ANBFUS33XXX"
        },
        "direction": "OUT",
        "channel": "WEB",
        "description": "Payment for services rendered",
        "reference": "INV-2024-001",
        "category": "BUSINESS SERVICES",
        "fee": {
          "amount": 500, // 5.00 EUR
          "currency": "EUR",
          "description": "Processing Fee"
        },
        "related_transactions": [],
        "card_details": {
          "card_network": "VISA",
          "card_last4": "1234",
          "merchant": {
            "name": "Online Superstore",
            "category": "E-commerce",
            "country": "US"
          }
        }
      },
      "type": "paymentMade"
    }
  ]
}