Skip to main content

Overview

The UBL Builder library provides two payment-related classes:
  • PaymentMeans - Describes the means or method of payment (e.g., bank transfer, credit card)
  • PaymentType - Describes actual payment transactions and their details
These classes are used in invoices and other commercial documents to specify how payment should be made or how payment was received.

PaymentMeans Class

Import

import { PaymentMeans } from 'ubl-builder/lib/ubl21/CommonAggregateComponents';

Constructor Parameters

paymentMeansCode
string | UdtCode
required
A code signifying the type of this means of payment (e.g., “30” for credit transfer, “48” for credit card)
payeeFinancialAccount
string | PayeeFinancialAccount
required
The payee’s financial account (bank account information)
id
string | UdtIdentifier
An identifier for this means of payment
paymentDueDate
string | UdtDate
The date on which payment is due for this means of payment
paymentChannelCode
string | UdtCode
A code signifying the payment channel for this means of payment
instructionID
string | UdtIdentifier
An identifier for the payment instruction
instructionNotes
string[] | UdtText[]
Free-form text conveying payment instructions
paymentID
string | UdtIdentifier
An identifier for a payment made using this means of payment

Common Payment Means Codes

  • 30 - Credit transfer
  • 31 - Debit transfer
  • 42 - Payment to bank account
  • 48 - Bank card
  • 49 - Direct debit
  • 58 - SEPA credit transfer

PaymentType Class

Import

import { PaymentType, PrepaidPayment } from 'ubl-builder/lib/ubl21/CommonAggregateComponents';

Constructor Parameters

id
string | UdtIdentifier
required
An identifier for this payment
paidAmount
string | UdtAmount
required
The amount of this payment
paidDate
string | UdtDate
required
The date on which this payment was made
paidTime
string | UdtTime
required
The time at which this payment was made
instructionID
string | UdtIdentifier
required
An identifier for the payment instruction
receivedDate
string | UdtDate
required
The date on which this payment was received

Usage Examples

import { PaymentMeans, PayeeFinancialAccount } from 'ubl-builder/lib/ubl21/CommonAggregateComponents';

const payeeAccount = new PayeeFinancialAccount({
  id: 'BE71096123456769',
  name: 'Acme Corporation',
  financialInstitutionBranch: {
    id: 'GEBABEBB'
  }
});

const paymentMeans = new PaymentMeans({
  paymentMeansCode: '30', // Credit transfer
  paymentDueDate: '2024-04-06',
  instructionNotes: ['Please include invoice number in payment reference'],
  payeeFinancialAccount: payeeAccount
});
PaymentType is also exported as PrepaidPayment to provide semantic clarity when representing advance payments or deposits. Both exports reference the same class implementation.

Payment Instructions Best Practices

  1. Payment Terms: Clearly specify payment due dates and terms
  2. Account Details: Provide complete and accurate bank account information
  3. References: Include instructions for payment references to ensure proper allocation
  4. Multiple Methods: You can specify multiple payment means to give customers options
  5. Prepaid Amounts: When recording prepaid amounts, ensure they’re properly reflected in the LegalMonetaryTotal
  • PayeeFinancialAccount - Bank account details for receiving payment
  • LegalMonetaryTotal - Includes prepaid amounts and payable amounts
  • PaymentTerms - Detailed payment terms and conditions
  • Invoice - Parent document containing payment information

UBL Schema References

Build docs developers (and LLMs) love