1.0.1 • Published 2 months ago

@taprsvp/iso20022_external_codes v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
2 months ago

ISO20022 External Code Sets

This package provides a collection of ISO20022 external code sets used in financial messaging, converted to both JSON format and TypeScript enums for easy integration into modern applications.

It is designed to make it easy to map the Transaction Authorization Protocol into usecases where swift is currently working.

npm version License: MIT

Overview

ISO20022 financial messaging defines numerous external code sets that are maintained outside the schema itself. These code sets define standardized values for various elements within financial messages, such as purpose codes, party types, and other categorization schemes.

This package: 1. Extracts all the external code sets from the ISO20022 specifications 2. Structures them as individual, well-formatted JSON files 3. Generates corresponding TypeScript enum definitions 4. Includes descriptions for each code value where available

Data Source

The data is based on the official ISO20022 External Code Sets publication.

Installation

npm install @taprsvp/iso20022_external_codes

Usage

TypeScript

import { Purpose, ServiceLevel, CategoryPurpose } from '@taprsvp/iso20022_external_codes';

// Use the enums in your code
const purpose = Purpose.CASH;  // "CASH"
const serviceLevel = ServiceLevel.SDVA; // "SDVA"

// Access descriptions via JSDoc in your IDE
// Purpose.CASH will show: "Transaction is a general cash management instruction."

JSON Files

The package also includes JSON files for each code set, which you can use if you need the raw data:

{
  "description": "Specifies the external purpose code in the format of character string with a maximum length of 4 characters.",
  "name": "ExternalPurpose1Code",
  "codes": {
    "ACCT": "Transaction moves funds between 2 accounts of same account holder at the same bank.",
    "CASH": "Transaction is a general cash management instruction.",
    ...
  }
}

Available Code Sets

The package includes 128 code sets from ISO20022, including:

  • Purpose (ExternalPurpose1Code) - Purpose codes for payments
  • CategoryPurpose (ExternalCategoryPurpose1Code) - Category purpose codes
  • ServiceLevel (ExternalServiceLevel1Code) - Service level codes
  • DocumentType (ExternalDocumentType1Code) - Document type codes
  • And many more...

Each code set is available both as a TypeScript enum and as a JSON file.

Full List of Supported Code Sets

Below is a complete list of all supported ISO20022 external code sets. For each code set, links to both the JSON file and TypeScript enum are provided.

Code SetJSONTypeScriptOriginal ISO20022 Name
AcceptedReasonJSONTypeScriptExternalAcceptedReason1Code
AccountIdentificationJSONTypeScriptExternalAccountIdentification1Code
AgentInstructionJSONTypeScriptExternalAgentInstruction1Code
AgreementTypeJSONTypeScriptExternalAgreementType1Code
AuthenticationChannelJSONTypeScriptExternalAuthenticationChannel1Code
AuthenticationMethodJSONTypeScriptExternalAuthenticationMethod1Code
AuthorityExchangeReasonJSONTypeScriptExternalAuthorityExchangeReason1Code
AuthorityIdentificationJSONTypeScriptExternalAuthorityIdentification1Code
BalanceSubTypeJSONTypeScriptExternalBalanceSubType1Code
BalanceTypeJSONTypeScriptExternalBalanceType1Code
BenchmarkCurveNameJSONTypeScriptExternalBenchmarkCurveName1Code
BillingBalanceTypeJSONTypeScriptExternalBillingBalanceType1Code
BillingCompensationTypeJSONTypeScriptExternalBillingCompensationType1Code
BillingRateIdentificationJSONTypeScriptExternalBillingRateIdentification1Code
CalculationAgentJSONTypeScriptExternalCalculationAgent1Code
CancellationReasonJSONTypeScriptExternalCancellationReason1Code
CashAccountTypeJSONTypeScriptExternalCashAccountType1Code
CashClearingSystemJSONTypeScriptExternalCashClearingSystem1Code
CategoryPurposeJSONTypeScriptExternalCategoryPurpose1Code
ChannelJSONTypeScriptExternalChannel1Code
ChargeTypeJSONTypeScriptExternalChargeType1Code
ChequeCancellationReasonJSONTypeScriptExternalChequeCancellationReason1Code
ChequeCancellationStatusJSONTypeScriptExternalChequeCancellationStatus1Code
ClaimNonReceiptRejectionJSONTypeScriptExternalClaimNonReceiptRejection1Code
ClearingSystemIdentificationJSONTypeScriptExternalClearingSystemIdentification1Code
ContractBalanceTypeJSONTypeScriptExternalContractBalanceType1Code
ContractClosureReasonJSONTypeScriptExternalContractClosureReason1Code
CorporateActionEventTypeJSONTypeScriptExternalCorporateActionEventType1Code
CreditorAgentInstructionJSONTypeScriptExternalCreditorAgentInstruction1Code
CreditorEnrolmentAmendmentReasonJSONTypeScriptExternalCreditorEnrolmentAmendmentReason1Code
CreditorEnrolmentCancellationReasonJSONTypeScriptExternalCreditorEnrolmentCancellationReason1Code
CreditorEnrolmentStatusReasonJSONTypeScriptExternalCreditorEnrolmentStatusReason1Code
CreditorReferenceTypeJSONTypeScriptExternalCreditorReferenceType1Code
DateFrequencyJSONTypeScriptExternalDateFrequency1Code
DateTypeJSONTypeScriptExternalDateType1Code
DebtorActivationAmendmentReasonJSONTypeScriptExternalDebtorActivationAmendmentReason1Code
DebtorActivationCancellationReasonJSONTypeScriptExternalDebtorActivationCancellationReason1Code
DebtorActivationStatusReasonJSONTypeScriptExternalDebtorActivationStatusReason1Code
DebtorAgentInstructionJSONTypeScriptExternalDebtorAgentInstruction1Code
DeviceOperatingSystemTypeJSONTypeScriptExternalDeviceOperatingSystemType1Code
DiscountAmountTypeJSONTypeScriptExternalDiscountAmountType1Code
DocumentAmountTypeJSONTypeScriptExternalDocumentAmountType1Code
DocumentFormatJSONTypeScriptExternalDocumentFormat1Code
DocumentLineTypeJSONTypeScriptExternalDocumentLineType1Code
DocumentPurposeJSONTypeScriptExternalDocumentPurpose1Code
DocumentTypeJSONTypeScriptExternalDocumentType1Code
EffectiveDateParameterJSONTypeScriptExternalEffectiveDateParameter1Code
EmissionAllowanceSubProductTypeJSONTypeScriptExternalEmissionAllowanceSubProductType1Code
EncryptedElementIdentificationJSONTypeScriptExternalEncryptedElementIdentification1Code
EnquiryRequestTypeJSONTypeScriptExternalEnquiryRequestType1Code
EntryStatusJSONTypeScriptExternalEntryStatus1Code
FinancialInstrumentIdentificationTypeJSONTypeScriptExternalFinancialInstrumentIdentificationType1Code
GarnishmentTypeJSONTypeScriptExternalGarnishmentType1Code
IncotermsJSONTypeScriptExternalIncoterms1Code
InformationTypeJSONTypeScriptExternalInformationType1Code
InstructedAgentInstructionJSONTypeScriptExternalInstructedAgentInstruction1Code
InvestigationActionJSONTypeScriptExternalInvestigationAction1Code
InvestigationActionReasonJSONTypeScriptExternalInvestigationActionReason1Code
InvestigationExecutionConfirmationJSONTypeScriptExternalInvestigationExecutionConfirmation1Code
InvestigationInstrumentJSONTypeScriptExternalInvestigationInstrument1Code
InvestigationReasonJSONTypeScriptExternalInvestigationReason1Code
InvestigationReasonSubTypeJSONTypeScriptExternalInvestigationReasonSubType1Code
InvestigationServiceLevelJSONTypeScriptExternalInvestigationServiceLevel1Code
InvestigationStatusJSONTypeScriptExternalInvestigationStatus1Code
InvestigationStatusReasonJSONTypeScriptExternalInvestigationStatusReason1Code
InvestigationSubTypeJSONTypeScriptExternalInvestigationSubType1Code
InvestigationTypeJSONTypeScriptExternalInvestigationType1Code
LetterTypeJSONTypeScriptExternalLetterType1Code
LocalInstrumentJSONTypeScriptExternalLocalInstrument1Code
MandateReasonJSONTypeScriptExternalMandateReason1Code
MandateStatusJSONTypeScriptExternalMandateStatus1Code
MandateSuspensionReasonJSONTypeScriptExternalMandateSuspensionReason1Code
MarketAreaJSONTypeScriptExternalMarketArea1Code
MarketInfrastructureJSONTypeScriptExternalMarketInfrastructure1Code
MessageFunctionJSONTypeScriptExternalMessageFunction1Code
ModelFormIdentificationJSONTypeScriptExternalModelFormIdentification1Code
NarrativeTypeJSONTypeScriptExternalNarrativeType1Code
NotificationSubTypeJSONTypeScriptExternalNotificationSubType1Code
NotificationTypeJSONTypeScriptExternalNotificationType1Code
OrganisationIdentificationJSONTypeScriptExternalOrganisationIdentification1Code
PackagingTypeJSONTypeScriptExternalPackagingType1Code
PaymentCancellationRejectionJSONTypeScriptExternalPaymentCancellationRejection1Code
PaymentCompensationReasonJSONTypeScriptExternalPaymentCompensationReason1Code
PaymentControlRequestTypeJSONTypeScriptExternalPaymentControlRequestType1Code
PaymentGroupStatusJSONTypeScriptExternalPaymentGroupStatus1Code
PaymentModificationRejectionJSONTypeScriptExternalPaymentModificationRejection1Code
PaymentRoleJSONTypeScriptExternalPaymentRole1Code
PaymentTransactionStatusJSONTypeScriptExternalPaymentTransactionStatus1Code
PendingProcessingReasonJSONTypeScriptExternalPendingProcessingReason1Code
PersonIdentificationJSONTypeScriptExternalPersonIdentification1Code
PostTradeEventTypeJSONTypeScriptExternalPostTradeEventType1Code
ProductTypeJSONTypeScriptExternalProductType1Code
ProxyAccountTypeJSONTypeScriptExternalProxyAccountType1Code
PurposeJSONTypeScriptExternalPurpose1Code
RatesAndTenorsJSONTypeScriptExternalRatesAndTenors1Code
RePresentmentReasonJSONTypeScriptExternalRePresentmentReason1Code
ReceivedReasonJSONTypeScriptExternalReceivedReason1Code
RejectedReasonJSONTypeScriptExternalRejectedReason1Code
RelativeToJSONTypeScriptExternalRelativeTo1Code
ReportingSourceJSONTypeScriptExternalReportingSource1Code
RequestStatusJSONTypeScriptExternalRequestStatus1Code
ReservationTypeJSONTypeScriptExternalReservationType1Code
ReturnReasonJSONTypeScriptExternalReturnReason1Code
ReversalReasonJSONTypeScriptExternalReversalReason1Code
SecuritiesPurposeJSONTypeScriptExternalSecuritiesPurpose1Code
ServiceLevelJSONTypeScriptExternalServiceLevel1Code
ShipmentConditionJSONTypeScriptExternalShipmentCondition1Code
StatusReasonJSONTypeScriptExternalStatusReason1Code
SystemBalanceTypeJSONTypeScriptExternalSystemBalanceType1Code
SystemErrorHandlingJSONTypeScriptExternalSystemErrorHandling1Code
SystemEventTypeJSONTypeScriptExternalSystemEventType1Code
SystemMemberTypeJSONTypeScriptExternalSystemMemberType1Code
SystemPartyTypeJSONTypeScriptExternalSystemPartyType1Code
TaxAmountTypeJSONTypeScriptExternalTaxAmountType1Code
TechnicalInputChannelJSONTypeScriptExternalTechnicalInputChannel1Code
TradeMarketJSONTypeScriptExternalTradeMarket1Code
TradeTransactionConditionJSONTypeScriptExternalTradeTransactionCondition1Code
TypeOfPartyJSONTypeScriptExternalTypeOfParty1Code
UnableToApplyIncorrectDataJSONTypeScriptExternalUnableToApplyIncorrectData1Code
UnableToApplyMissingDataJSONTypeScriptExternalUnableToApplyMissingData1Code
UnderlyingTradeTransactionTypeJSONTypeScriptExternalUnderlyingTradeTransactionType1Code
UndertakingAmountTypeJSONTypeScriptExternalUndertakingAmountType1Code
UndertakingDocumentTypeJSONTypeScriptExternalUndertakingDocumentType1Code
UndertakingStatusCategoryJSONTypeScriptExternalUndertakingStatusCategory1Code
UndertakingTypeJSONTypeScriptExternalUndertakingType1Code
UnitOfMeasureJSONTypeScriptExternalUnitOfMeasure1Code
ValidationRuleIdentificationJSONTypeScriptExternalValidationRuleIdentification1Code
VerificationReasonJSONTypeScriptExternalVerificationReason1Code

Benefits

  • Type Safety: Use TypeScript enums for compile-time validation
  • Documentation: Each code includes its official description as JSDoc comments
  • Consistency: Ensures your application uses ISO20022-compliant codes
  • Easy Integration: Simple import and use in your TypeScript/JavaScript applications

Development

The code sets are generated from the ISO20022 external code sets using Python scripts:

  • process_code_sets.py - Processes the ISO20022 external code sets and generates JSON files
  • generate_ts_enums.py - Generates TypeScript enums from the JSON files

To regenerate the code sets (if you have updated source data):

python3 process_code_sets.py
python3 generate_ts_enums.py
npm run build

License

This package is MIT licensed. The ISO20022 data is published by ISO and is used in accordance with their terms.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Related

1.0.1

2 months ago

1.0.0

4 months ago