From 457f6faee7fd79fb1482375ab9e7e270e2d3e0c6 Mon Sep 17 00:00:00 2001 From: Tom Robinson Date: Wed, 24 Jul 2024 09:43:13 +0100 Subject: [PATCH 1/2] Implement initial version of WebhookBlock --- .../docs/gbp-accounts/manage-accounts.mdx | 2 + data/webhooks/AccountClosureCompletedV1.json | 32 + data/webhooks/AccountClosureFailedV1.json | 44 + data/webhooks/AccountCreatedV1.json | 101 +++ data/webhooks/AccountDisabledV1.json | 51 ++ data/webhooks/Accounts.AccountCreatedV1.json | 202 +++++ data/webhooks/Accounts.AccountUpdatedV1.json | 258 ++++++ .../Accounts.VirtualAccountCreatedV1.json | 107 +++ .../Accounts.VirtualAccountUpdatedV1.json | 174 ++++ data/webhooks/BacsCreditContraReceivedV1.json | 5 + data/webhooks/BacsCreditContraReceivedV2.json | 5 + data/webhooks/BacsCreditContraReceivedV3.json | 161 ++++ .../BacsCreditPaymentNotSettledV1.json | 5 + .../BacsCreditPaymentNotSettledV2.json | 5 + .../BacsCreditPaymentNotSettledV3.json | 159 ++++ data/webhooks/BacsDebitContraReceivedV1.json | 5 + data/webhooks/BacsDebitContraReceivedV2.json | 5 + data/webhooks/BacsDebitContraReceivedV3.json | 159 ++++ .../BacsDebitPaymentNotSettledV1.json | 5 + .../BacsDebitPaymentNotSettledV2.json | 5 + .../BacsDebitPaymentNotSettledV3.json | 159 ++++ ...csDirectCreditInboundPaymentCreatedV1.json | 5 + ...csDirectCreditInboundPaymentCreatedV2.json | 142 ++++ .../BacsDirectCreditInboundPaymentHeldV1.json | 100 +++ .../BacsDirectCreditInboundPaymentHeldV2.json | 135 +++ .../BacsDirectCreditInboundPaymentHeldV3.json | 145 ++++ ...irectCreditInboundPaymentNotSettledV1.json | 5 + ...sDirectCreditInboundPaymentRecalledV1.json | 5 + data/webhooks/BacsDirectCreditRecalledV1.json | 219 +++++ .../BacsDirectCreditReturnCreatedV1.json | 5 + .../BacsDirectCreditReturnCreatedV2.json | 5 + .../BacsDirectCreditReturnCreatedV3.json | 146 ++++ .../BacsDirectCreditReturnCreatedV4.json | 197 +++++ ...acsDirectDebitInboundPaymentCreatedV1.json | 5 + ...acsDirectDebitInboundPaymentCreatedV2.json | 142 ++++ ...DirectDebitInboundPaymentNotSettledV1.json | 5 + ...ectDebitIndemnityClaimReceivedEventV1.json | 5 + ...ectDebitIndemnityClaimReceivedEventV2.json | 5 + ...ectDebitIndemnityClaimReceivedEventV3.json | 185 ++++ .../BacsDirectDebitReturnCreatedV1.json | 5 + .../BacsDirectDebitReturnCreatedV2.json | 5 + .../BacsDirectDebitReturnCreatedV3.json | 151 ++++ .../BacsDirectDebitReturnCreatedV4.json | 172 ++++ .../BacsMandateCancellationFailedV1.json | 139 +++ data/webhooks/BacsMandateCancelledV1.json | 5 + data/webhooks/BacsMandateCancelledV2.json | 133 +++ data/webhooks/BacsMandateInitiatedV1.json | 5 + data/webhooks/BacsMandateInitiatedV2.json | 133 +++ .../BacsMandateInitiationFailedV1.json | 131 +++ data/webhooks/BacsMandateMigratedV1.json | 5 + data/webhooks/BacsMandateMigratedV2.json | 133 +++ data/webhooks/BacsMandateReturnFailedV1.json | 136 +++ data/webhooks/BacsMandateReturnedV1.json | 139 +++ .../BacsUnappliedCreditReceivedV1.json | 5 + .../BacsUnappliedCreditReceivedV2.json | 5 + .../BacsUnappliedCreditReceivedV3.json | 159 ++++ .../BacsUnpaidDirectDebitReceivedV1.json | 5 + .../BacsUnpaidDirectDebitReceivedV2.json | 5 + .../BacsUnpaidDirectDebitReceivedV3.json | 170 ++++ ...g001AccountSwitchInformationRequestV1.json | 5 + ...g001AccountSwitchInformationRequestV2.json | 700 +++++++++++++++ ...002AccountSwitchInformationResponseV1.json | 5 + ...002AccountSwitchInformationResponseV2.json | 672 +++++++++++++++ ...3AccountSwitchCancelExistingPaymentV1.json | 5 + ...3AccountSwitchCancelExistingPaymentV2.json | 416 +++++++++ ...g004AccountSwitchRequestRedirectionV1.json | 5 + ...g004AccountSwitchRequestRedirectionV2.json | 289 +++++++ ...AccountSwitchRequestBalanceTransferV1.json | 5 + ...AccountSwitchRequestBalanceTransferV2.json | 354 ++++++++ ...witchBalanceTransferAcknowledgementV1.json | 5 + ...witchBalanceTransferAcknowledgementV2.json | 489 +++++++++++ ...ntSwitchNotifyAccountSwitchCompleteV1.json | 5 + ...ntSwitchNotifyAccountSwitchCompleteV2.json | 159 ++++ ...ssMsg008AccountSwitchRequestPaymentV1.json | 5 + ...ssMsg008AccountSwitchRequestPaymentV2.json | 475 +++++++++++ ...sMsg009AccountSwitchPaymentResponseV1.json | 5 + ...sMsg009AccountSwitchPaymentResponseV2.json | 168 ++++ ...sMsg010AccountSwitchTerminateSwitchV1.json | 5 + ...sMsg010AccountSwitchTerminateSwitchV2.json | 181 ++++ ...g011AccountSwitchTechnicalRejectionV1.json | 5 + ...g011AccountSwitchTechnicalRejectionV2.json | 168 ++++ data/webhooks/ChequeNotPaidV1.json | 153 ++++ data/webhooks/ChequePaidV1.json | 144 ++++ data/webhooks/ChequeReconciledV1.json | 144 ++++ data/webhooks/Cop.InboundCopCheckV1.json | 102 +++ ...stomerAccounts.TransactionCompletedV1.json | 88 ++ data/webhooks/FITestEventV1.json | 5 + data/webhooks/FITestEventV2.json | 18 + data/webhooks/Fx.Trade.CancelledV1.json | 136 +++ data/webhooks/Fx.Trade.ExecutedV1.json | 179 ++++ data/webhooks/Fx.Trade.SettledV1.json | 344 ++++++++ .../Fx.Trade.Settlement.FailedV1.json | 157 ++++ data/webhooks/InboundHeldTransactionV1.json | 104 +++ data/webhooks/InterestPaidV1.json | 44 + .../MCCY.Statements.AccountStatementV1.json | 66 ++ ...CCY.Statements.InstitutionStatementV1.json | 58 ++ .../Mccy.InternalTransfers.CancelledV1.json | 136 +++ .../Mccy.InternalTransfers.SettledV1.json | 109 +++ data/webhooks/OutboundHeldTransactionV1.json | 102 +++ .../PaymentMessageAssesmentFailedV1.json | 194 +++++ .../PaymentMessageValidationFailedV1.json | 290 +++++++ ...yments.Mccy.PaymentAssessmentFailedV1.json | 226 +++++ ...yments.Mccy.PaymentValidationFailedV1.json | 229 +++++ .../Payments.Mccy.TransactionCancelledV1.json | 244 ++++++ .../Payments.Mccy.TransactionCreatedV1.json | 222 +++++ .../Payments.Mccy.TransactionSettledV1.json | 238 ++++++ .../Sepa.Ct.CustomerCreditTransferV1.json | 214 +++++ .../Sepa.Ct.InboundPayment.CompletedV1.json | 224 +++++ .../Sepa.Ct.InboundPayment.RecalledV1.json | 51 ++ ...a.Ct.InboundPayment.ReturnCompletedV1.json | 25 + ...Sepa.Ct.InboundPayment.ReturnFailedV1.json | 32 + .../Sepa.Ct.OutboundPayment.CompletedV1.json | 25 + .../Sepa.Ct.OutboundPayment.FailedV1.json | 32 + ....Ct.OutboundPayment.ReturnCompletedV1.json | 58 ++ .../Sepa.Ct.PaymentCancellationRequestV1.json | 51 ++ data/webhooks/Sepa.Ct.PaymentReturnV1.json | 51 ++ .../Sepa.Ct.PaymentStatusReportV1.json | 25 + .../Sepa.Instant.Payment.CancelledV1.json | 121 +++ .../Sepa.Instant.Payment.CreatedV1.json | 105 +++ .../Sepa.Instant.Payment.SettledV1.json | 111 +++ ...epa.Instant.RecallPayment.CancelledV1.json | 40 + .../Sepa.Instant.RecallPayment.CreatedV1.json | 35 + .../Sepa.Instant.RecallPayment.SettledV1.json | 35 + ...Sepa.Instant.RecallRequest.ReceivedV1.json | 45 + ...Sepa.Instant.RecallRequest.RejectedV1.json | 45 + .../Sepa.OutboundPayment.CancelledV1.json | 304 +++++++ .../Sepa.OutboundPayment.CreatedV1.json | 283 +++++++ .../Sepa.OutboundPayment.SettledV1.json | 290 +++++++ data/webhooks/Sepa.Payment.CancelledV1.json | 165 ++++ data/webhooks/Sepa.Payment.CreatedV1.json | 144 ++++ data/webhooks/Sepa.Payment.SettledV1.json | 151 ++++ data/webhooks/Sepa.Payment.SucceededV1.json | 182 ++++ .../Statements.AccountStatementV1.json | 66 ++ .../Statements.InstitutionStatementV1.json | 58 ++ .../Statements.ReadyForDownloadV1.json | 37 + ...merCreditTransfer.Inbound.CompletedV1.json | 277 ++++++ ...erCreditTransfer.Outbound.CompletedV1.json | 40 + ...tomerCreditTransfer.Outbound.FailedV1.json | 46 + ...et2.CustomerCreditTransfer.ReceivedV1.json | 115 +++ ...2.CustomerCreditTransfer.SendFailedV1.json | 41 + ...Target2.CustomerCreditTransfer.SentV1.json | 115 +++ ...stomerCreditTransferReturn.ReceivedV1.json | 115 +++ ...omerCreditTransferReturn.SendFailedV1.json | 41 + ...2.CustomerCreditTransferReturn.SentV1.json | 115 +++ ....FICreditTransfer.Inbound.CompletedV1.json | 221 +++++ ...FICreditTransfer.Outbound.CompletedV1.json | 40 + ...t2.FICreditTransfer.Outbound.FailedV1.json | 46 + .../Target2.FICreditTransfer.ReceivedV1.json | 115 +++ ...Target2.FICreditTransfer.SendFailedV1.json | 41 + .../Target2.FICreditTransfer.SentV1.json | 115 +++ ...et2.PaymentReturn.Inbound.CompletedV1.json | 273 ++++++ ...t2.PaymentReturn.Outbound.CompletedV1.json | 40 + ...rget2.PaymentReturn.Outbound.FailedV1.json | 46 + data/webhooks/TransactionRejectedV1.json | 5 + data/webhooks/TransactionRejectedV2.json | 676 +++++++++++++++ data/webhooks/TransactionSettledV1.json | 5 + data/webhooks/TransactionSettledV2.json | 5 + data/webhooks/TransactionSettledV3.json | 5 + data/webhooks/TransactionSettledV4.json | 5 + data/webhooks/TransactionSettledV5.json | 5 + data/webhooks/TransactionSettledV6.json | 797 ++++++++++++++++++ data/webhooks/VirtualAccountCreatedV1.json | 5 + data/webhooks/VirtualAccountCreatedV2.json | 85 ++ data/webhooks/VirtualAccountCreatedV3.json | 90 ++ .../VirtualAccountCreationFailedV1.json | 5 + .../VirtualAccountCreationFailedV2.json | 92 ++ .../VirtualAccountCreationFailedV3.json | 99 +++ data/webhooks/default.json | 1 - .../components/webhook-block-payload/index.ts | 1 + .../webhook-block-payload.styles.ts | 5 + .../webhook-block-payload.tsx | 188 +++++ .../webhook-block-payload.types.ts | 13 + src/components/webhook-block/index.ts | 1 + .../webhook-block/webhook-block.styles.ts | 73 ++ .../webhook-block/webhook-block.tsx | 185 ++++ .../webhook-block/webhook-block.types.ts | 31 + .../webhook-placeholder.tsx | 2 + src/templates/home.tsx | 16 +- .../account-closure-completed-webhook-v1.mdx | 3 + .../account-closure-failed-webhook-v1.mdx | 3 + webhooks/account-created-webhook-v1.mdx | 3 + 181 files changed, 19840 insertions(+), 15 deletions(-) create mode 100644 data/webhooks/AccountClosureCompletedV1.json create mode 100644 data/webhooks/AccountClosureFailedV1.json create mode 100644 data/webhooks/AccountCreatedV1.json create mode 100644 data/webhooks/AccountDisabledV1.json create mode 100644 data/webhooks/Accounts.AccountCreatedV1.json create mode 100644 data/webhooks/Accounts.AccountUpdatedV1.json create mode 100644 data/webhooks/Accounts.VirtualAccountCreatedV1.json create mode 100644 data/webhooks/Accounts.VirtualAccountUpdatedV1.json create mode 100644 data/webhooks/BacsCreditContraReceivedV1.json create mode 100644 data/webhooks/BacsCreditContraReceivedV2.json create mode 100644 data/webhooks/BacsCreditContraReceivedV3.json create mode 100644 data/webhooks/BacsCreditPaymentNotSettledV1.json create mode 100644 data/webhooks/BacsCreditPaymentNotSettledV2.json create mode 100644 data/webhooks/BacsCreditPaymentNotSettledV3.json create mode 100644 data/webhooks/BacsDebitContraReceivedV1.json create mode 100644 data/webhooks/BacsDebitContraReceivedV2.json create mode 100644 data/webhooks/BacsDebitContraReceivedV3.json create mode 100644 data/webhooks/BacsDebitPaymentNotSettledV1.json create mode 100644 data/webhooks/BacsDebitPaymentNotSettledV2.json create mode 100644 data/webhooks/BacsDebitPaymentNotSettledV3.json create mode 100644 data/webhooks/BacsDirectCreditInboundPaymentCreatedV1.json create mode 100644 data/webhooks/BacsDirectCreditInboundPaymentCreatedV2.json create mode 100644 data/webhooks/BacsDirectCreditInboundPaymentHeldV1.json create mode 100644 data/webhooks/BacsDirectCreditInboundPaymentHeldV2.json create mode 100644 data/webhooks/BacsDirectCreditInboundPaymentHeldV3.json create mode 100644 data/webhooks/BacsDirectCreditInboundPaymentNotSettledV1.json create mode 100644 data/webhooks/BacsDirectCreditInboundPaymentRecalledV1.json create mode 100644 data/webhooks/BacsDirectCreditRecalledV1.json create mode 100644 data/webhooks/BacsDirectCreditReturnCreatedV1.json create mode 100644 data/webhooks/BacsDirectCreditReturnCreatedV2.json create mode 100644 data/webhooks/BacsDirectCreditReturnCreatedV3.json create mode 100644 data/webhooks/BacsDirectCreditReturnCreatedV4.json create mode 100644 data/webhooks/BacsDirectDebitInboundPaymentCreatedV1.json create mode 100644 data/webhooks/BacsDirectDebitInboundPaymentCreatedV2.json create mode 100644 data/webhooks/BacsDirectDebitInboundPaymentNotSettledV1.json create mode 100644 data/webhooks/BacsDirectDebitIndemnityClaimReceivedEventV1.json create mode 100644 data/webhooks/BacsDirectDebitIndemnityClaimReceivedEventV2.json create mode 100644 data/webhooks/BacsDirectDebitIndemnityClaimReceivedEventV3.json create mode 100644 data/webhooks/BacsDirectDebitReturnCreatedV1.json create mode 100644 data/webhooks/BacsDirectDebitReturnCreatedV2.json create mode 100644 data/webhooks/BacsDirectDebitReturnCreatedV3.json create mode 100644 data/webhooks/BacsDirectDebitReturnCreatedV4.json create mode 100644 data/webhooks/BacsMandateCancellationFailedV1.json create mode 100644 data/webhooks/BacsMandateCancelledV1.json create mode 100644 data/webhooks/BacsMandateCancelledV2.json create mode 100644 data/webhooks/BacsMandateInitiatedV1.json create mode 100644 data/webhooks/BacsMandateInitiatedV2.json create mode 100644 data/webhooks/BacsMandateInitiationFailedV1.json create mode 100644 data/webhooks/BacsMandateMigratedV1.json create mode 100644 data/webhooks/BacsMandateMigratedV2.json create mode 100644 data/webhooks/BacsMandateReturnFailedV1.json create mode 100644 data/webhooks/BacsMandateReturnedV1.json create mode 100644 data/webhooks/BacsUnappliedCreditReceivedV1.json create mode 100644 data/webhooks/BacsUnappliedCreditReceivedV2.json create mode 100644 data/webhooks/BacsUnappliedCreditReceivedV3.json create mode 100644 data/webhooks/BacsUnpaidDirectDebitReceivedV1.json create mode 100644 data/webhooks/BacsUnpaidDirectDebitReceivedV2.json create mode 100644 data/webhooks/BacsUnpaidDirectDebitReceivedV3.json create mode 100644 data/webhooks/CassMsg001AccountSwitchInformationRequestV1.json create mode 100644 data/webhooks/CassMsg001AccountSwitchInformationRequestV2.json create mode 100644 data/webhooks/CassMsg002AccountSwitchInformationResponseV1.json create mode 100644 data/webhooks/CassMsg002AccountSwitchInformationResponseV2.json create mode 100644 data/webhooks/CassMsg003AccountSwitchCancelExistingPaymentV1.json create mode 100644 data/webhooks/CassMsg003AccountSwitchCancelExistingPaymentV2.json create mode 100644 data/webhooks/CassMsg004AccountSwitchRequestRedirectionV1.json create mode 100644 data/webhooks/CassMsg004AccountSwitchRequestRedirectionV2.json create mode 100644 data/webhooks/CassMsg005AccountSwitchRequestBalanceTransferV1.json create mode 100644 data/webhooks/CassMsg005AccountSwitchRequestBalanceTransferV2.json create mode 100644 data/webhooks/CassMsg006AccountSwitchBalanceTransferAcknowledgementV1.json create mode 100644 data/webhooks/CassMsg006AccountSwitchBalanceTransferAcknowledgementV2.json create mode 100644 data/webhooks/CassMsg007AccountSwitchNotifyAccountSwitchCompleteV1.json create mode 100644 data/webhooks/CassMsg007AccountSwitchNotifyAccountSwitchCompleteV2.json create mode 100644 data/webhooks/CassMsg008AccountSwitchRequestPaymentV1.json create mode 100644 data/webhooks/CassMsg008AccountSwitchRequestPaymentV2.json create mode 100644 data/webhooks/CassMsg009AccountSwitchPaymentResponseV1.json create mode 100644 data/webhooks/CassMsg009AccountSwitchPaymentResponseV2.json create mode 100644 data/webhooks/CassMsg010AccountSwitchTerminateSwitchV1.json create mode 100644 data/webhooks/CassMsg010AccountSwitchTerminateSwitchV2.json create mode 100644 data/webhooks/CassMsg011AccountSwitchTechnicalRejectionV1.json create mode 100644 data/webhooks/CassMsg011AccountSwitchTechnicalRejectionV2.json create mode 100644 data/webhooks/ChequeNotPaidV1.json create mode 100644 data/webhooks/ChequePaidV1.json create mode 100644 data/webhooks/ChequeReconciledV1.json create mode 100644 data/webhooks/Cop.InboundCopCheckV1.json create mode 100644 data/webhooks/CustomerAccounts.TransactionCompletedV1.json create mode 100644 data/webhooks/FITestEventV1.json create mode 100644 data/webhooks/FITestEventV2.json create mode 100644 data/webhooks/Fx.Trade.CancelledV1.json create mode 100644 data/webhooks/Fx.Trade.ExecutedV1.json create mode 100644 data/webhooks/Fx.Trade.SettledV1.json create mode 100644 data/webhooks/Fx.Trade.Settlement.FailedV1.json create mode 100644 data/webhooks/InboundHeldTransactionV1.json create mode 100644 data/webhooks/InterestPaidV1.json create mode 100644 data/webhooks/MCCY.Statements.AccountStatementV1.json create mode 100644 data/webhooks/MCCY.Statements.InstitutionStatementV1.json create mode 100644 data/webhooks/Mccy.InternalTransfers.CancelledV1.json create mode 100644 data/webhooks/Mccy.InternalTransfers.SettledV1.json create mode 100644 data/webhooks/OutboundHeldTransactionV1.json create mode 100644 data/webhooks/PaymentMessageAssesmentFailedV1.json create mode 100644 data/webhooks/PaymentMessageValidationFailedV1.json create mode 100644 data/webhooks/Payments.Mccy.PaymentAssessmentFailedV1.json create mode 100644 data/webhooks/Payments.Mccy.PaymentValidationFailedV1.json create mode 100644 data/webhooks/Payments.Mccy.TransactionCancelledV1.json create mode 100644 data/webhooks/Payments.Mccy.TransactionCreatedV1.json create mode 100644 data/webhooks/Payments.Mccy.TransactionSettledV1.json create mode 100644 data/webhooks/Sepa.Ct.CustomerCreditTransferV1.json create mode 100644 data/webhooks/Sepa.Ct.InboundPayment.CompletedV1.json create mode 100644 data/webhooks/Sepa.Ct.InboundPayment.RecalledV1.json create mode 100644 data/webhooks/Sepa.Ct.InboundPayment.ReturnCompletedV1.json create mode 100644 data/webhooks/Sepa.Ct.InboundPayment.ReturnFailedV1.json create mode 100644 data/webhooks/Sepa.Ct.OutboundPayment.CompletedV1.json create mode 100644 data/webhooks/Sepa.Ct.OutboundPayment.FailedV1.json create mode 100644 data/webhooks/Sepa.Ct.OutboundPayment.ReturnCompletedV1.json create mode 100644 data/webhooks/Sepa.Ct.PaymentCancellationRequestV1.json create mode 100644 data/webhooks/Sepa.Ct.PaymentReturnV1.json create mode 100644 data/webhooks/Sepa.Ct.PaymentStatusReportV1.json create mode 100644 data/webhooks/Sepa.Instant.Payment.CancelledV1.json create mode 100644 data/webhooks/Sepa.Instant.Payment.CreatedV1.json create mode 100644 data/webhooks/Sepa.Instant.Payment.SettledV1.json create mode 100644 data/webhooks/Sepa.Instant.RecallPayment.CancelledV1.json create mode 100644 data/webhooks/Sepa.Instant.RecallPayment.CreatedV1.json create mode 100644 data/webhooks/Sepa.Instant.RecallPayment.SettledV1.json create mode 100644 data/webhooks/Sepa.Instant.RecallRequest.ReceivedV1.json create mode 100644 data/webhooks/Sepa.Instant.RecallRequest.RejectedV1.json create mode 100644 data/webhooks/Sepa.OutboundPayment.CancelledV1.json create mode 100644 data/webhooks/Sepa.OutboundPayment.CreatedV1.json create mode 100644 data/webhooks/Sepa.OutboundPayment.SettledV1.json create mode 100644 data/webhooks/Sepa.Payment.CancelledV1.json create mode 100644 data/webhooks/Sepa.Payment.CreatedV1.json create mode 100644 data/webhooks/Sepa.Payment.SettledV1.json create mode 100644 data/webhooks/Sepa.Payment.SucceededV1.json create mode 100644 data/webhooks/Statements.AccountStatementV1.json create mode 100644 data/webhooks/Statements.InstitutionStatementV1.json create mode 100644 data/webhooks/Statements.ReadyForDownloadV1.json create mode 100644 data/webhooks/Target2.CustomerCreditTransfer.Inbound.CompletedV1.json create mode 100644 data/webhooks/Target2.CustomerCreditTransfer.Outbound.CompletedV1.json create mode 100644 data/webhooks/Target2.CustomerCreditTransfer.Outbound.FailedV1.json create mode 100644 data/webhooks/Target2.CustomerCreditTransfer.ReceivedV1.json create mode 100644 data/webhooks/Target2.CustomerCreditTransfer.SendFailedV1.json create mode 100644 data/webhooks/Target2.CustomerCreditTransfer.SentV1.json create mode 100644 data/webhooks/Target2.CustomerCreditTransferReturn.ReceivedV1.json create mode 100644 data/webhooks/Target2.CustomerCreditTransferReturn.SendFailedV1.json create mode 100644 data/webhooks/Target2.CustomerCreditTransferReturn.SentV1.json create mode 100644 data/webhooks/Target2.FICreditTransfer.Inbound.CompletedV1.json create mode 100644 data/webhooks/Target2.FICreditTransfer.Outbound.CompletedV1.json create mode 100644 data/webhooks/Target2.FICreditTransfer.Outbound.FailedV1.json create mode 100644 data/webhooks/Target2.FICreditTransfer.ReceivedV1.json create mode 100644 data/webhooks/Target2.FICreditTransfer.SendFailedV1.json create mode 100644 data/webhooks/Target2.FICreditTransfer.SentV1.json create mode 100644 data/webhooks/Target2.PaymentReturn.Inbound.CompletedV1.json create mode 100644 data/webhooks/Target2.PaymentReturn.Outbound.CompletedV1.json create mode 100644 data/webhooks/Target2.PaymentReturn.Outbound.FailedV1.json create mode 100644 data/webhooks/TransactionRejectedV1.json create mode 100644 data/webhooks/TransactionRejectedV2.json create mode 100644 data/webhooks/TransactionSettledV1.json create mode 100644 data/webhooks/TransactionSettledV2.json create mode 100644 data/webhooks/TransactionSettledV3.json create mode 100644 data/webhooks/TransactionSettledV4.json create mode 100644 data/webhooks/TransactionSettledV5.json create mode 100644 data/webhooks/TransactionSettledV6.json create mode 100644 data/webhooks/VirtualAccountCreatedV1.json create mode 100644 data/webhooks/VirtualAccountCreatedV2.json create mode 100644 data/webhooks/VirtualAccountCreatedV3.json create mode 100644 data/webhooks/VirtualAccountCreationFailedV1.json create mode 100644 data/webhooks/VirtualAccountCreationFailedV2.json create mode 100644 data/webhooks/VirtualAccountCreationFailedV3.json delete mode 100644 data/webhooks/default.json create mode 100644 src/components/webhook-block/components/webhook-block-payload/index.ts create mode 100644 src/components/webhook-block/components/webhook-block-payload/webhook-block-payload.styles.ts create mode 100644 src/components/webhook-block/components/webhook-block-payload/webhook-block-payload.tsx create mode 100644 src/components/webhook-block/components/webhook-block-payload/webhook-block-payload.types.ts create mode 100644 src/components/webhook-block/index.ts create mode 100644 src/components/webhook-block/webhook-block.styles.ts create mode 100644 src/components/webhook-block/webhook-block.tsx create mode 100644 src/components/webhook-block/webhook-block.types.ts diff --git a/content-new/docs/gbp-accounts/manage-accounts.mdx b/content-new/docs/gbp-accounts/manage-accounts.mdx index b3211e7ec..e0c94ce1c 100644 --- a/content-new/docs/gbp-accounts/manage-accounts.mdx +++ b/content-new/docs/gbp-accounts/manage-accounts.mdx @@ -8,6 +8,7 @@ import EndpointBlock from "src/components/endpoint-block"; import WebhookPlaceholder from 'src/components/webhook-placeholder' import WebhookSummary from 'src/components/webhook-summary' +import WebhookBlock from 'src/components/webhook-block' ## Real GBP accounts @@ -48,6 +49,7 @@ The balance of a real account is also held by ClearBank and can be viewed via th + @\\[\\\\\\]](|[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+!#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]|[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]{1,33}[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+!#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]])", + "maxLength": 35, + "minLength": 1 + }, + "Country": { + "title": "Country", + "type": ["string", "null"], + "pattern": "[A-Z]{2,2}", + "description": "Nation with its own government." + }, + "AddressLines": { + "title": "Address lines", + "type": ["array","null"], + "maxItems": 3, + "items": { + "$ref": "#/definitions/AddressLine" + } + } + }, + "AddressLine": { + "type": ["string", "null"], + "maxLength": 35, + "minLength": 1 + }, + "Account": { + "type": ["object", "null"], + "additionalProperties": true, + "properties": { + "Iban": { + "title" : "IBAN", + "type": ["string", "null"], + "description": "International Bank Account Number associated with the party", + "pattern": "[A-Z]{2,2}[0-9]{2,2}[a-zA-Z0-9]{1,30}" + } + } + } + } +} \ No newline at end of file diff --git a/data/webhooks/Target2.CustomerCreditTransfer.Outbound.CompletedV1.json b/data/webhooks/Target2.CustomerCreditTransfer.Outbound.CompletedV1.json new file mode 100644 index 000000000..eccd7e323 --- /dev/null +++ b/data/webhooks/Target2.CustomerCreditTransfer.Outbound.CompletedV1.json @@ -0,0 +1,40 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Target2CustomerCreditTransferOutboundCompletedWebHook", + "type": "object", + "additionalProperties": false, + "required": [ + "InstructionId", + "Uetr", + "TransactionId", + "PaymentId" + ], + "properties": { + "InstructionId": { + "title": "Customer internal identification", + "type": "string", + "Pattern": "[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+](|[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+]|[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+ ]{1,33}[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+])", + "description": "Unique identification, as assigned by an instructing party for an instructed party, to unambiguously identify the instruction." + }, + "Uetr": { + "title": "Unique end-to-end reference", + "type": "string", + "format": "guid", + "pattern": "[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}", + "description": "Universally unique UUID v4 identifier randomly generated to provide an end-to-end reference of a payment transaction." + }, + "TransactionId": { + "title": "Transaction id", + "type": "string", + "format": "guid", + "pattern": "[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}", + "description": "ID of the transaction used to move funds for this payment." + }, + "PaymentId": { + "title": "Payment id", + "type": "string", + "pattern": "[a-zA-Z0-9_-]{0,50}", + "description": "ClearBank internal identifier for this payment." + } + } +} \ No newline at end of file diff --git a/data/webhooks/Target2.CustomerCreditTransfer.Outbound.FailedV1.json b/data/webhooks/Target2.CustomerCreditTransfer.Outbound.FailedV1.json new file mode 100644 index 000000000..13eebf5fc --- /dev/null +++ b/data/webhooks/Target2.CustomerCreditTransfer.Outbound.FailedV1.json @@ -0,0 +1,46 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Target2CustomerCreditTransferOutboundFailedWebHook", + "type": "object", + "additionalProperties": false, + "required": [ + "InstructionId", + "Uetr", + "PaymentId", + "ErrorCode", + "AdditionalInformation" + ], + "properties": { + "InstructionId": { + "title": "Customer internal identification", + "type": "string", + "Pattern": "[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+](|[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+]|[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+ ]{1,33}[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+])", + "description": "Unique identification, as assigned by an instructing party for an instructed party, to unambiguously identify the instruction." + }, + "Uetr": { + "title": "Unique end-to-end reference", + "type": "string", + "format": "guid", + "pattern": "[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}", + "description": "Universally unique UUID v4 identifier randomly generated to provide an end-to-end reference of a payment transaction." + }, + "PaymentId": { + "title": "Payment id", + "type": "string", + "pattern": "[a-zA-Z0-9_-]{0,50}", + "description": "ClearBank internal identifier for this payment." + }, + "ErrorCode": { + "title": "Error Code", + "type": "string", + "description": "ISO20022/ClearBank code for why the payment failed", + "maxLength": 4, + "minLength": 1 + }, + "AdditionalInformation": { + "title": "Additional Information", + "type": "string", + "description": "Text description of why the payment failed." + } + } +} \ No newline at end of file diff --git a/data/webhooks/Target2.CustomerCreditTransfer.ReceivedV1.json b/data/webhooks/Target2.CustomerCreditTransfer.ReceivedV1.json new file mode 100644 index 000000000..2cc136d70 --- /dev/null +++ b/data/webhooks/Target2.CustomerCreditTransfer.ReceivedV1.json @@ -0,0 +1,115 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Target2CustomerCreditTransferReceived", + "type": "object", + "additionalProperties": false, + "required": [ + "SchemePaymentMethod", + "Uetr", + "EndToEndId", + "Debtor", + "Creditor", + "SettlementAmount", + "SettlementCurrencyCode" + ], + "properties": { + "SchemePaymentMethod": { + "title": "Payment method", + "type": "string", + "description": "Payment scheme used for submitting the transaction. Values: Target2.", + "maxLength": 50, + "minLength": 1 + }, + "Uetr": { + "title": "Unique end-to-end reference", + "type": "string", + "format": "guid", + "pattern": "[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}", + "description": "Universally unique UUID v4 identifier randomly generated to provide an end-to-end reference of a payment transaction." + }, + "EndToEndId": { + "title": "End to end ID", + "type": "string", + "description": "Unique identifier provided to ClearBank for each payment.", + "maxLength": 35, + "minLength": 1 + }, + "Debtor": { + "oneOf": [ + { + "$ref": "#/definitions/Debtor" + } + ] + }, + "Creditor": { + "oneOf": [ + { + "$ref": "#/definitions/Creditor" + } + ] + }, + "SettlementAmount": { + "title": "Settlement amount", + "type": "number", + "description": "Settlement payment amount.", + "format": "decimal" + }, + "SettlementCurrencyCode": { + "title": "Settlement currency code", + "type": "string", + "description": "Currency of the settlement amount.", + "maxLength": 3, + "minLength": 3 + } + }, + "definitions": { + "Debtor": { + "type": "object", + "additionalProperties": false, + "required": [ + "Name", + "Iban" + ], + "properties": { + "Name": { + "title": "Debtor name", + "type": "string", + "description": "The name used to identify the legal owner of the account from which to debit funds.", + "maxLength": 140, + "minLength": 1 + }, + "Iban": { + "title": "Debtor IBAN", + "type": "string", + "description": "International Bank Account Number associated with the debtor.", + "maxLength": 35, + "minLength": 1 + } + } + }, + "Creditor": { + "type": "object", + "additionalProperties": false, + "required": [ + "Name", + "Iban" + ], + "properties": { + "Name": { + "title": "Creditor name", + "type": "string", + "description": "The name used to identify the legal owner of the account from which to credit funds.", + "maxLength": 140, + "minLength": 1 + }, + "Iban": { + "title": "Creditor IBAN", + "type": "string", + "description": "International Bank Account Number associated with the creditor.", + "maxLength": 35, + "minLength": 1 + } + } + } + } +} \ No newline at end of file diff --git a/data/webhooks/Target2.CustomerCreditTransfer.SendFailedV1.json b/data/webhooks/Target2.CustomerCreditTransfer.SendFailedV1.json new file mode 100644 index 000000000..67efd9c99 --- /dev/null +++ b/data/webhooks/Target2.CustomerCreditTransfer.SendFailedV1.json @@ -0,0 +1,41 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Target2CustomerCreditTransferSendFailed", + "type": "object", + "additionalProperties": false, + "required": [ + "SchemePaymentMethod", + "Uetr", + "EndToEndId", + "FailureCode" + ], + "properties": { + "SchemePaymentMethod": { + "title": "Payment method", + "type": "string", + "description": "Payment scheme used for submitting the transaction. Values: Target2.", + "maxLength": 50, + "minLength": 1 + }, + "Uetr": { + "title": "Unique end-to-end reference", + "type": "string", + "format": "guid", + "pattern": "[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}", + "description": "Universally unique UUID v4 identifier randomly generated to provide an end-to-end reference of a payment transaction." + }, + "EndToEndId": { + "title": "End to end ID", + "type": "string", + "description": "Unique identifier provided to ClearBank for each payment.", + "maxLength": 35, + "minLength": 1 + }, + "FailureCode": { + "title": "Failure code", + "type": "string", + "description": "Failure code.", + "minLength": 1 + } + } +} \ No newline at end of file diff --git a/data/webhooks/Target2.CustomerCreditTransfer.SentV1.json b/data/webhooks/Target2.CustomerCreditTransfer.SentV1.json new file mode 100644 index 000000000..7306e24d3 --- /dev/null +++ b/data/webhooks/Target2.CustomerCreditTransfer.SentV1.json @@ -0,0 +1,115 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Target2CustomerCreditTransferSent", + "type": "object", + "additionalProperties": false, + "required": [ + "SchemePaymentMethod", + "Uetr", + "EndToEndId", + "Debtor", + "Creditor", + "SettlementAmount", + "SettlementCurrencyCode" + ], + "properties": { + "SchemePaymentMethod": { + "title": "Payment method", + "type": "string", + "description": "Payment scheme used for submitting the transaction. Values: Target2.", + "maxLength": 50, + "minLength": 1 + }, + "Uetr": { + "title": "Unique end-to-end reference", + "type": "string", + "format": "guid", + "pattern": "[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}", + "description": "Universally unique UUID v4 identifier randomly generated to provide an end-to-end reference of a payment transaction." + }, + "EndToEndId": { + "title": "End to End Id", + "type": "string", + "description": "Unique identifier provided to ClearBank for each payment.", + "maxLength": 35, + "minLength": 1 + }, + "Debtor": { + "oneOf": [ + { + "$ref": "#/definitions/Debtor" + } + ] + }, + "Creditor": { + "oneOf": [ + { + "$ref": "#/definitions/Creditor" + } + ] + }, + "SettlementAmount": { + "title": "Settlement amount", + "type": "number", + "description": "Settlement payment amount.", + "format": "decimal" + }, + "SettlementCurrencyCode": { + "title": "Settlement currency code", + "type": "string", + "description": "Currency of the settlement amount.", + "maxLength": 3, + "minLength": 3 + } + }, + "definitions": { + "Debtor": { + "type": "object", + "additionalProperties": false, + "required": [ + "Name", + "Iban" + ], + "properties": { + "Name": { + "title": "Debtor name", + "type": "string", + "description": "The name used to identify the legal owner of the account from which to debit funds.", + "maxLength": 140, + "minLength": 1 + }, + "Iban": { + "title": "Debtor IBAN", + "type": "string", + "description": "International Bank Account Number associated with the debtor.", + "maxLength": 35, + "minLength": 1 + } + } + }, + "Creditor": { + "type": "object", + "additionalProperties": false, + "required": [ + "Name", + "Iban" + ], + "properties": { + "Name": { + "title": "Creditor name", + "type": "string", + "description": "The name used to identify the legal owner of the account from which to credit funds.", + "maxLength": 140, + "minLength": 1 + }, + "Iban": { + "title": "Creditor IBAN", + "type": "string", + "description": "International Bank Account Number associated with the creditor.", + "maxLength": 35, + "minLength": 1 + } + } + } + } +} \ No newline at end of file diff --git a/data/webhooks/Target2.CustomerCreditTransferReturn.ReceivedV1.json b/data/webhooks/Target2.CustomerCreditTransferReturn.ReceivedV1.json new file mode 100644 index 000000000..ed78408ac --- /dev/null +++ b/data/webhooks/Target2.CustomerCreditTransferReturn.ReceivedV1.json @@ -0,0 +1,115 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Target2CustomerCreditTransferReturnReceived", + "type": "object", + "additionalProperties": false, + "required": [ + "SchemePaymentMethod", + "Uetr", + "EndToEndId", + "Debtor", + "Creditor", + "SettlementAmount", + "SettlementCurrencyCode" + ], + "properties": { + "SchemePaymentMethod": { + "title": "Payment method", + "type": "string", + "description": "Payment scheme used for submitting the transaction. Values: Target2.", + "maxLength": 50, + "minLength": 1 + }, + "Uetr": { + "title": "Unique end-to-end reference", + "type": "string", + "format": "guid", + "pattern": "[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}", + "description": "Universally unique UUID v4 identifier randomly generated to provide an end-to-end reference of a payment transaction." + }, + "EndToEndId": { + "title": "End to End Id", + "type": "string", + "description": "Unique identifier provided to ClearBank for each payment.", + "maxLength": 35, + "minLength": 1 + }, + "Debtor": { + "oneOf": [ + { + "$ref": "#/definitions/Debtor" + } + ] + }, + "Creditor": { + "oneOf": [ + { + "$ref": "#/definitions/Creditor" + } + ] + }, + "SettlementAmount": { + "title": "Settlement amount", + "type": "number", + "description": "Settlement payment amount.", + "format": "decimal" + }, + "SettlementCurrencyCode": { + "title": "Settlement currency code", + "type": "string", + "description": "Currency of the settlement amount.", + "maxLength": 3, + "minLength": 3 + } + }, + "definitions": { + "Debtor": { + "type": "object", + "additionalProperties": false, + "required": [ + "Name", + "Iban" + ], + "properties": { + "Name": { + "title": "Debtor name", + "type": "string", + "description": "The name used to identify the legal owner of the account from which to debit funds.", + "maxLength": 140, + "minLength": 1 + }, + "Iban": { + "title": "Debtor IBAN", + "type": "string", + "description": "International Bank Account Number associated with the debtor.", + "maxLength": 35, + "minLength": 1 + } + } + }, + "Creditor": { + "type": "object", + "additionalProperties": false, + "required": [ + "Name", + "Iban" + ], + "properties": { + "Name": { + "title": "Creditor name", + "type": "string", + "description": "The name used to identify the legal owner of the account from which to credit funds.", + "maxLength": 140, + "minLength": 1 + }, + "Iban": { + "title": "Creditor IBAN", + "type": "string", + "description": "International Bank Account Number associated with the creditor.", + "maxLength": 35, + "minLength": 1 + } + } + } + } +} \ No newline at end of file diff --git a/data/webhooks/Target2.CustomerCreditTransferReturn.SendFailedV1.json b/data/webhooks/Target2.CustomerCreditTransferReturn.SendFailedV1.json new file mode 100644 index 000000000..66c65168a --- /dev/null +++ b/data/webhooks/Target2.CustomerCreditTransferReturn.SendFailedV1.json @@ -0,0 +1,41 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Target2CustomerCreditTransferReturnSendFailed", + "type": "object", + "additionalProperties": false, + "required": [ + "SchemePaymentMethod", + "Uetr", + "EndToEndId", + "FailureCode" + ], + "properties": { + "SchemePaymentMethod": { + "title": "Payment method", + "type": "string", + "description": "Payment scheme used for submitting the transaction. Values: Target2.", + "maxLength": 50, + "minLength": 1 + }, + "Uetr": { + "title": "Unique end-to-end reference", + "type": "string", + "format": "guid", + "pattern": "[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}", + "description": "Universally unique UUID v4 identifier randomly generated to provide an end-to-end reference of a payment transaction." + }, + "EndToEndId": { + "title": "End to End Id", + "type": "string", + "description": "Unique identifier provided to ClearBank for each payment.", + "maxLength": 35, + "minLength": 1 + }, + "FailureCode": { + "title": "Failure code", + "type": "string", + "description": "Failure code.", + "minLength": 1 + } + } +} \ No newline at end of file diff --git a/data/webhooks/Target2.CustomerCreditTransferReturn.SentV1.json b/data/webhooks/Target2.CustomerCreditTransferReturn.SentV1.json new file mode 100644 index 000000000..a135f73f0 --- /dev/null +++ b/data/webhooks/Target2.CustomerCreditTransferReturn.SentV1.json @@ -0,0 +1,115 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Target2CustomerCreditTransferReturnSent", + "type": "object", + "additionalProperties": false, + "required": [ + "SchemePaymentMethod", + "Uetr", + "EndToEndId", + "Debtor", + "Creditor", + "SettlementAmount", + "SettlementCurrencyCode" + ], + "properties": { + "SchemePaymentMethod": { + "title": "Payment method", + "type": "string", + "description": "Payment scheme used for submitting the transaction. Values: Target2.", + "maxLength": 50, + "minLength": 1 + }, + "Uetr": { + "title": "Unique end-to-end reference", + "type": "string", + "format": "guid", + "pattern": "[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}", + "description": "Universally unique UUID v4 identifier randomly generated to provide an end-to-end reference of a payment transaction." + }, + "EndToEndId": { + "title": "End to end ID", + "type": "string", + "description": "Unique identifier provided to ClearBank for each payment.", + "maxLength": 35, + "minLength": 1 + }, + "Debtor": { + "oneOf": [ + { + "$ref": "#/definitions/Debtor" + } + ] + }, + "Creditor": { + "oneOf": [ + { + "$ref": "#/definitions/Creditor" + } + ] + }, + "SettlementAmount": { + "title": "Settlement amount", + "type": "number", + "description": "Settlement payment amount.", + "format": "decimal" + }, + "SettlementCurrencyCode": { + "title": "Settlement currency code", + "type": "string", + "description": "Currency of the settlement amount.", + "maxLength": 3, + "minLength": 3 + } + }, + "definitions": { + "Debtor": { + "type": "object", + "additionalProperties": false, + "required": [ + "Name", + "Iban" + ], + "properties": { + "Name": { + "title": "Debtor name", + "type": "string", + "description": "The name used to identify the legal owner of the account from which to debit funds.", + "maxLength": 140, + "minLength": 1 + }, + "Iban": { + "title": "Debtor IBAN", + "type": "string", + "description": "International Bank Account Number associated with the debtor.", + "maxLength": 35, + "minLength": 1 + } + } + }, + "Creditor": { + "type": "object", + "additionalProperties": false, + "required": [ + "Name", + "Iban" + ], + "properties": { + "Name": { + "title": "Creditor name", + "type": "string", + "description": "The name used to identify the legal owner of the account from which to credit funds.", + "maxLength": 140, + "minLength": 1 + }, + "Iban": { + "title": "Creditor IBAN", + "type": "string", + "description": "International Bank Account Number associated with the creditor.", + "maxLength": 35, + "minLength": 1 + } + } + } + } +} \ No newline at end of file diff --git a/data/webhooks/Target2.FICreditTransfer.Inbound.CompletedV1.json b/data/webhooks/Target2.FICreditTransfer.Inbound.CompletedV1.json new file mode 100644 index 000000000..813729eb6 --- /dev/null +++ b/data/webhooks/Target2.FICreditTransfer.Inbound.CompletedV1.json @@ -0,0 +1,221 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Target2FICreditTransferInboundCompletedWebHook", + "type": "object", + "additionalProperties": false, + "required": [ + "PaymentId", + "InstructionId", + "EndToEndId", + "Uetr", + "SettlementAmount", + "TransactionId" + ], + "properties": { + "PaymentId": { + "title": "Payment ID", + "type": "string", + "pattern": "[a-zA-Z0-9_-]{0,50}", + "description": "ClearBank internal identifier for this payment." + }, + "InstructionId": { + "title": "Customer internal identifier", + "type": "string", + "Pattern": "[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+](|[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+]|[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+ ]{1,33}[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+])", + "description": "Unique identification, as assigned by an instructing party for an instructed party, to unambiguously identify the instruction." + }, + "EndToEndId": { + "title": "End to end ID", + "type": "string", + "pattern": "[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+](|[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+]|[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+ ]{1,33}[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+])", + "description": "Unique identifier provided to ClearBank for each payment." + }, + "Uetr": { + "title": "Unique end-to-end reference", + "type": "string", + "format": "guid", + "pattern": "[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}", + "description": "Universally unique UUID v4 identifier randomly generated to provide an end-to-end reference of a payment transaction." + }, + "TransactionId": { + "title": "Transaction ID", + "type": "string", + "format": "guid", + "pattern": "[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}", + "description": "ID of the transaction used to move funds for this payment." + }, + "SettlementAmount": { + "oneOf": [ + { + "$ref": "#/definitions/SettlementAmount" + } + ] + }, + "Debtor": { + "oneOf": [ + {"type": "null"}, + {"$ref": "#/definitions/FinancialInstitutionId"} + ] + }, + "DebtorAccount": { + "oneOf": [ + {"type": "null"}, + {"$ref": "#/definitions/Account"} + ] + }, + "DebtorAgent": { + "oneOf": [ + {"type": "null"}, + {"$ref": "#/definitions/FinancialInstitutionId"} + ] + }, + "Creditor": { + "oneOf": [ + {"type": "null"}, + {"$ref": "#/definitions/FinancialInstitutionId"} + ] + }, + "CreditorAccount": { + "oneOf": [ + {"type": "null"}, + {"$ref": "#/definitions/Account"} + ] + }, + "CreditorAgent": { + "oneOf": [ + {"type": "null"}, + {"$ref": "#/definitions/FinancialInstitutionId"} + ] + }, + "PreviousInstructingAgents": { + "title": "Previous instructing agents", + "type": [ + "array", + "null" + ], + "maxItems": 3, + "items": [ + { + "$ref": "#/definitions/PreviousInstructingAgent" + } + ] + }, + "IntermediaryAgents": { + "title": "Intermediary agents", + "type": [ + "array", + "null" + ], + "maxItems": 3, + "items": [ + { + "$ref": "#/definitions/IntermediaryAgent" + } + ] + } + }, + "definitions": { + "PreviousInstructingAgent": { + "type": "object", + "properties": { + "type": {"$ref": "#/definitions/FinancialInstitutionId"}, + "type": {"$ref": "#/definitions/Account"} + } + }, + "IntermediaryAgent": { + "type": "object", + "properties": { + "type": {"$ref": "#/definitions/FinancialInstitutionId"}, + "type": {"$ref": "#/definitions/Account"} + } + }, + "SettlementAmount": { + "type": "object", + "additionalProperties": true, + "required": ["Amount", "Currency"], + "properties": { + "Amount": { + "title": "Amount", + "type": "number", + "description": "Settlement payment amount.", + "format": "decimal" + }, + "Currency": { + "title": "Currency", + "type": "string", + "description": "Currency of the settlement amount.", + "pattern": "[A-Z]{3,3}" + } + } + }, + "FinancialInstitutionId": { + "type": ["object","null"], + "additionalProperties": true, + "properties": { + "Name": { + "title": "name", + "type": ["string", "null"], + "description": "Name by which the financial institution is known and which is usually used to identify that party.", + "maxLength": 140, + "minLength": 1 + }, + "BicFI": { + "title": "BIC", + "type": ["string", "null"], + "pattern": "[A-Z0-9]{4,4}[A-Z]{2,2}[A-Z0-9]{2,2}[A-Z0-9]{3,3}", + "description": "Business identifier code of the organisation." + }, + "Address":{ + "oneOf": [ + { + "$ref": "#/definitions/Address" + } + ] + } + } + }, + "Address": { + "type": ["object","null"], + "additionalProperties": true, + "TownName": { + "title": "Town name", + "type": ["string", "null"], + "description": "Name of a built-up area, with defined boundaries, and a local government.", + "pattern": "[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+!#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]](|[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+!#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]|[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]{1,33}[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+!#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]])", + "maxLength": 35, + "minLength": 1 + }, + "Country": { + "title": "Country", + "type": ["string", "null"], + "pattern": "[A-Z]{2,2}", + "description": "Nation with its own government, represented by its ISO Alpha-2 country code." + }, + "AddressLines": { + "title": "Address lines", + "type": ["array","null"], + "maxItems": 3, + "items": { + "$ref": "#/definitions/AddressLine" + } + } + }, + "AddressLine": { + "type": ["string", "null"], + "maxLength": 35, + "minLength": 1 + }, + "Account": { + "type": ["object", "null"], + "additionalProperties": true, + "properties": { + "Iban": { + "title" : "IBAN", + "type": ["string", "null"], + "description": "International Bank Account Number associated with the party", + "pattern": "[A-Z]{2,2}[0-9]{2,2}[a-zA-Z0-9]{1,30}" + } + } + } + } +} \ No newline at end of file diff --git a/data/webhooks/Target2.FICreditTransfer.Outbound.CompletedV1.json b/data/webhooks/Target2.FICreditTransfer.Outbound.CompletedV1.json new file mode 100644 index 000000000..561edfb9a --- /dev/null +++ b/data/webhooks/Target2.FICreditTransfer.Outbound.CompletedV1.json @@ -0,0 +1,40 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Target2FICreditTransferOutboundCompletedWebHook", + "type": "object", + "additionalProperties": false, + "required": [ + "InstructionId", + "Uetr", + "TransactionId", + "PaymentId" + ], + "properties": { + "InstructionId": { + "title": "Customer internal identification", + "type": "string", + "Pattern": "[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+](|[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+]|[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+ ]{1,33}[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+])", + "description": "Unique identification, as assigned by an instructing party for an instructed party, to unambiguously identify the instruction." + }, + "Uetr": { + "title": "Unique end-to-end reference", + "type": "string", + "format": "guid", + "pattern": "[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}", + "description": "Universally unique UUID v4 identifier randomly generated to provide an end-to-end reference of a payment transaction." + }, + "TransactionId": { + "title": "Transaction id", + "type": "string", + "format": "guid", + "pattern": "[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}", + "description": "ID of the transaction used to move funds for this payment." + }, + "PaymentId": { + "title": "Payment id", + "type": "string", + "pattern": "[a-zA-Z0-9_-]{0,50}", + "description": "ClearBank internal identifier for this payment." + } + } +} \ No newline at end of file diff --git a/data/webhooks/Target2.FICreditTransfer.Outbound.FailedV1.json b/data/webhooks/Target2.FICreditTransfer.Outbound.FailedV1.json new file mode 100644 index 000000000..ec604a833 --- /dev/null +++ b/data/webhooks/Target2.FICreditTransfer.Outbound.FailedV1.json @@ -0,0 +1,46 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Target2FICreditTransferOutboundFailedWebHook", + "type": "object", + "additionalProperties": false, + "required": [ + "InstructionId", + "Uetr", + "PaymentId", + "ErrorCode", + "AdditionalInformation" + ], + "properties": { + "InstructionId": { + "title": "Customer internal identification", + "type": "string", + "Pattern": "[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+](|[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+]|[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+ ]{1,33}[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+])", + "description": "Unique identification, as assigned by an instructing party for an instructed party, to unambiguously identify the instruction." + }, + "Uetr": { + "title": "Unique end-to-end reference", + "type": "string", + "format": "guid", + "pattern": "[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}", + "description": "Universally unique UUID v4 identifier randomly generated to provide an end-to-end reference of a payment transaction." + }, + "PaymentId": { + "title": "Payment id", + "type": "string", + "pattern": "[a-zA-Z0-9_-]{0,50}", + "description": "ClearBank internal identifier for this payment." + }, + "ErrorCode": { + "title": "Error Code", + "type": "string", + "description": "ISO20022/ClearBank code for why the payment failed", + "maxLength": 4, + "minLength": 1 + }, + "AdditionalInformation": { + "title": "Additional Information", + "type": "string", + "description": "Text description of why the payment failed." + } + } +} \ No newline at end of file diff --git a/data/webhooks/Target2.FICreditTransfer.ReceivedV1.json b/data/webhooks/Target2.FICreditTransfer.ReceivedV1.json new file mode 100644 index 000000000..6f653453d --- /dev/null +++ b/data/webhooks/Target2.FICreditTransfer.ReceivedV1.json @@ -0,0 +1,115 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Target2FICreditTransferReceived", + "type": "object", + "additionalProperties": false, + "required": [ + "SchemePaymentMethod", + "Uetr", + "EndToEndId", + "Debtor", + "Creditor", + "SettlementAmount", + "SettlementCurrencyCode" + ], + "properties": { + "SchemePaymentMethod": { + "title": "Payment method", + "type": "string", + "description": "Payment scheme used to submit the transaction. Value: Target2.", + "maxLength": 50, + "minLength": 1 + }, + "Uetr": { + "title": "Unique end-to-end reference", + "type": "string", + "format": "guid", + "pattern": "[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}", + "description": "Universally unique UUID v4 identifier randomly generated to provide an end-to-end reference of a payment transaction." + }, + "EndToEndId": { + "title": "End to end ID", + "type": "string", + "description": "Unique identifier provided to ClearBank for each payment.", + "maxLength": 35, + "minLength": 1 + }, + "Debtor": { + "oneOf": [ + { + "$ref": "#/definitions/Debtor" + } + ] + }, + "Creditor": { + "oneOf": [ + { + "$ref": "#/definitions/Creditor" + } + ] + }, + "SettlementAmount": { + "title": "Settlement amount", + "type": "number", + "description": "Settlement payment amount.", + "format": "decimal" + }, + "SettlementCurrencyCode": { + "title": "Settlement currency code", + "type": "string", + "description": "Currency of the settlement amount. This is the 3-letter ISO currency code.", + "maxLength": 3, + "minLength": 3 + } + }, + "definitions": { + "Debtor": { + "type": "object", + "additionalProperties": false, + "required": [ + "Name", + "Iban" + ], + "properties": { + "Name": { + "title": "Debtor name", + "type": "string", + "description": "The name used to identify the legal owner of the account from which to debit funds.", + "maxLength": 140, + "minLength": 1 + }, + "Iban": { + "title": "Debtor IBAN", + "type": "string", + "description": "International Bank Account Number associated with the debtor.", + "maxLength": 35, + "minLength": 1 + } + } + }, + "Creditor": { + "type": "object", + "additionalProperties": false, + "required": [ + "Name", + "Iban" + ], + "properties": { + "Name": { + "title": "Creditor name", + "type": "string", + "description": "The name used to identify the legal owner of the account from which to credit funds.", + "maxLength": 140, + "minLength": 1 + }, + "Iban": { + "title": "Creditor IBAN", + "type": "string", + "description": "International Bank Account Number associated with the creditor.", + "maxLength": 35, + "minLength": 1 + } + } + } + } +} \ No newline at end of file diff --git a/data/webhooks/Target2.FICreditTransfer.SendFailedV1.json b/data/webhooks/Target2.FICreditTransfer.SendFailedV1.json new file mode 100644 index 000000000..a989d6cf3 --- /dev/null +++ b/data/webhooks/Target2.FICreditTransfer.SendFailedV1.json @@ -0,0 +1,41 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Target2FICreditTransferSendFailed", + "type": "object", + "additionalProperties": false, + "required": [ + "SchemePaymentMethod", + "Uetr", + "EndToEndId", + "FailureCode" + ], + "properties": { + "SchemePaymentMethod": { + "title": "Payment method", + "type": "string", + "description": "Payment scheme used to submit the transaction. Value: Target2.", + "maxLength": 50, + "minLength": 1 + }, + "Uetr": { + "title": "Unique end-to-end reference", + "type": "string", + "format": "guid", + "pattern": "[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}", + "description": "Universally unique UUID v4 identifier randomly generated to provide an end-to-end reference of a payment transaction." + }, + "EndToEndId": { + "title": "End to end ID", + "type": "string", + "description": "Unique identifier provided to ClearBank for each payment.", + "maxLength": 35, + "minLength": 1 + }, + "FailureCode": { + "title": "Failure code", + "type": "string", + "description": "Failure code.", + "minLength": 1 + } + } +} \ No newline at end of file diff --git a/data/webhooks/Target2.FICreditTransfer.SentV1.json b/data/webhooks/Target2.FICreditTransfer.SentV1.json new file mode 100644 index 000000000..c4ad3f6a5 --- /dev/null +++ b/data/webhooks/Target2.FICreditTransfer.SentV1.json @@ -0,0 +1,115 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Target2FICreditTransferSent", + "type": "object", + "additionalProperties": false, + "required": [ + "SchemePaymentMethod", + "Uetr", + "EndToEndId", + "Debtor", + "Creditor", + "SettlementAmount", + "SettlementCurrencyCode" + ], + "properties": { + "SchemePaymentMethod": { + "title": "Payment method", + "type": "string", + "description": "Payment scheme used to submit the transaction. Value: Target2.", + "maxLength": 50, + "minLength": 1 + }, + "Uetr": { + "title": "Unique end-to-end reference", + "type": "string", + "format": "guid", + "pattern": "[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}", + "description": "Universally unique UUID v4 identifier randomly generated to provide an end-to-end reference of a payment transaction." + }, + "EndToEndId": { + "title": "End to End Id", + "type": "string", + "description": "Unique identifier provided to ClearBank for each payment.", + "maxLength": 35, + "minLength": 1 + }, + "Debtor": { + "oneOf": [ + { + "$ref": "#/definitions/Debtor" + } + ] + }, + "Creditor": { + "oneOf": [ + { + "$ref": "#/definitions/Creditor" + } + ] + }, + "SettlementAmount": { + "title": "Settlement amount", + "type": "number", + "description": "Settlement payment amount.", + "format": "decimal" + }, + "SettlementCurrencyCode": { + "title": "Settlement currency code", + "type": "string", + "description": "Currency of the settlement amount.", + "maxLength": 3, + "minLength": 3 + } + }, + "definitions": { + "Debtor": { + "type": "object", + "additionalProperties": false, + "required": [ + "Name", + "Iban" + ], + "properties": { + "Name": { + "title": "Debtor name", + "type": "string", + "description": "The name used to identify the legal owner of the account from which to debit funds.", + "maxLength": 140, + "minLength": 1 + }, + "Iban": { + "title": "Debtor IBAN", + "type": "string", + "description": "International Bank Account Number associated with the debtor.", + "maxLength": 35, + "minLength": 1 + } + } + }, + "Creditor": { + "type": "object", + "additionalProperties": false, + "required": [ + "Name", + "Iban" + ], + "properties": { + "Name": { + "title": "Creditor name", + "type": "string", + "description": "The name used to identify the legal owner of the account from which to credit funds.", + "maxLength": 140, + "minLength": 1 + }, + "Iban": { + "title": "Creditor IBAN", + "type": "string", + "description": "International Bank Account Number associated with the creditor.", + "maxLength": 35, + "minLength": 1 + } + } + } + } +} \ No newline at end of file diff --git a/data/webhooks/Target2.PaymentReturn.Inbound.CompletedV1.json b/data/webhooks/Target2.PaymentReturn.Inbound.CompletedV1.json new file mode 100644 index 000000000..5b495ec98 --- /dev/null +++ b/data/webhooks/Target2.PaymentReturn.Inbound.CompletedV1.json @@ -0,0 +1,273 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Target2PaymentReturnInboundCompletedWebHook", + "type": "object", + "additionalProperties": false, + "required": [ + "PaymentReturnId", + "OriginalEndToEndId", + "OriginalUetr", + "ReturnedSettlementAmount", + "TransactionId", + "ReturnReason" + ], + "properties": { + "PaymentReturnId": { + "title": "Payment ID", + "type": "string", + "pattern": "[a-zA-Z0-9_-]{0,50}", + "description": "ClearBank internal identifier for this payment." + }, + "OriginalInstructionId": { + "title": "Customer internal identifier", + "type": ["string","null"], + "Pattern": "[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+](|[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+]|[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+ ]{1,33}[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+])", + "description": "Unique identification, as assigned by an instructing party for an instructed party, to unambiguously identify the instruction." + }, + "OriginalEndToEndId": { + "title": "End to end ID", + "type": "string", + "pattern": "[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+](|[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+]|[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+ ]{1,33}[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+])", + "description": "Unique identifier provided to ClearBank for each payment." + }, + "OriginalUetr": { + "title": "Unique end-to-end reference", + "type": "string", + "format": "guid", + "pattern": "[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}", + "description": "Universally unique UUID v4 identifier randomly generated to provide an end-to-end reference of a payment transaction." + }, + "TransactionId": { + "title": "Transaction ID", + "type": "string", + "format": "guid", + "pattern": "[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}", + "description": "ID of the transaction used to move funds for this payment." + }, + "ReturnReason": { + "title": "Return reasons", + "type": "object", + "description": "Provides detailed information on the return reason.", + "required": ["Code"], + "properties": { + "Code": { + "title": "Return reason Code", + "type": "string", + "description": "Return reason code (as defined in ISO 20022).", + "maxLength": 4, + "minLength": 1 + }, + "ReturnReasonAdditionalInformation": { + "title": "Return reason additional information", + "description": "Description associated with the return reason code.", + "type": ["array","null"], + "maxItems": 2, + "items": { + "type": "string" + } + } + } + }, + "OriginalSettlementAmount": { + "oneOf": [ + {"type": "null"}, + {"$ref": "#/definitions/SettlementAmount"} + ] + }, + "ReturnedSettlementAmount": { + "oneOf": [ + { + "$ref": "#/definitions/SettlementAmount" + } + ] + }, + "UltimateDebtor": { + "oneOf": [ + {"type": "null"}, + {"$ref": "#/definitions/PartyId"} + ] + }, + "UltimateCreditor": { + "oneOf": [ + {"type": "null"}, + {"$ref": "#/definitions/PartyId"} + ] + }, + "Creditor": { + "oneOf": [ + {"type": "null"}, + {"$ref": "#/definitions/ReturnParty"} + ] + }, + "CreditorAgent": { + "oneOf": [ + {"type": "null"}, + { "$ref": "#/definitions/FinancialInstitutionId" } + ] + }, + "Debtor": { + "oneOf": [ + {"type": "null"}, + {"$ref": "#/definitions/ReturnParty"} + ] + }, + "InitiatingParty": { + "oneOf": [ + {"type": "null"}, + {"$ref": "#/definitions/ReturnParty"} + ] + }, + "DebtorAgent": { + "oneOf": [ + {"type": "null"}, + { "$ref": "#/definitions/FinancialInstitutionId" } + ] + }, + "PreviousInstructingAgents": { + "title": "Previous instructing agents", + "type": ["array","null"], + "maxItems": 3, + "items": [ + { + "$ref": "#/definitions/FinancialInstitutionId" + } + ] + }, + "ReturnOriginator": { + "oneOf": [ + {"type": "null"}, + {"$ref": "#/definitions/PartyId"} + ] + } + }, + "definitions": { + "ReturnParty": { + "type": "object", + "anyOf": [ + {"Agent": {"$ref": "#/definitions/FinancialInstitutionId"}}, + {"Party": {"$ref": "#/definitions/PartyId"}} + ] + }, + "PreviousInstructingAgent": { + "type": "object", + "properties": { + "type": {"$ref": "#/definitions/FinancialInstitutionId"}, + "type": {"$ref": "#/definitions/Account"} + } + }, + "SettlementAmount": { + "type": "object", + "additionalProperties": true, + "required": ["Amount", "Currency"], + "properties": { + "Amount": { + "title": "Amount", + "type": "number", + "description": "Settlement payment amount.", + "format": "decimal" + }, + "Currency": { + "title": "Currency", + "type": "string", + "description": "Currency of the settlement amount.", + "pattern": "[A-Z]{3,3}" + } + } + }, + "PartyId": { + "type": ["object", "null"], + "additionalProperties": true, + "properties": { + "Name": { + "title": "name", + "type": ["string", "null"], + "description": "Name by which a party is known and which is usually used to identify that party.", + "maxLength": 140, + "minLength": 1 + }, + "Bic": { + "title": "BIC", + "type": ["string", "null"], + "pattern": "[A-Z0-9]{4,4}[A-Z]{2,2}[A-Z0-9]{2,2}[A-Z0-9]{3,3}", + "description": "Business identifier code of the organisation." + }, + "Address":{ + "oneOf": [ + { + "$ref": "#/definitions/Address" + } + ] + } + } + }, + "FinancialInstitutionId": { + "type": ["object","null"], + "additionalProperties": true, + "properties": { + "Name": { + "title": "name", + "type": ["string", "null"], + "description": "Name by which the financial institution is known and which is usually used to identify that party.", + "maxLength": 140, + "minLength": 1 + }, + "BicFI": { + "title": "BIC", + "type": ["string", "null"], + "pattern": "[A-Z0-9]{4,4}[A-Z]{2,2}[A-Z0-9]{2,2}[A-Z0-9]{3,3}", + "description": "Business identifier code of the organisation." + }, + "Address":{ + "oneOf": [ + { + "$ref": "#/definitions/Address" + } + ] + } + } + }, + "Address": { + "type": ["object","null"], + "additionalProperties": true, + "TownName": { + "title": "Town name", + "type": ["string", "null"], + "description": "Name of a built-up area, with defined boundaries, and a local government.", + "pattern": "[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+!#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]](|[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+!#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]|[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]{1,33}[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+!#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]])", + "maxLength": 35, + "minLength": 1 + }, + "Country": { + "title": "Country", + "type": ["string", "null"], + "pattern": "[A-Z]{2,2}", + "description": "Nation with its own government." + }, + "AddressLines": { + "title": "Address lines", + "type": ["array","null"], + "maxItems": 3, + "items": { + "$ref": "#/definitions/AddressLine" + } + } + }, + "AddressLine": { + "type": ["string", "null"], + "maxLength": 35, + "minLength": 1 + }, + "Account": { + "type": ["object", "null"], + "additionalProperties": true, + "properties": { + "Iban": { + "title" : "IBAN", + "type": ["string", "null"], + "description": "International Bank Account Number associated with the party", + "pattern": "[A-Z]{2,2}[0-9]{2,2}[a-zA-Z0-9]{1,30}" + } + } + } + } +} \ No newline at end of file diff --git a/data/webhooks/Target2.PaymentReturn.Outbound.CompletedV1.json b/data/webhooks/Target2.PaymentReturn.Outbound.CompletedV1.json new file mode 100644 index 000000000..cc4985d7a --- /dev/null +++ b/data/webhooks/Target2.PaymentReturn.Outbound.CompletedV1.json @@ -0,0 +1,40 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Target2PaymentReturnOutboundCompletedWebHook", + "type": "object", + "additionalProperties": false, + "required": [ + "ReturnInstructionId", + "Uetr", + "TransactionId", + "PaymentReturnId" + ], + "properties": { + "ReturnInstructionId": { + "title": "Customer internal identification", + "type": "string", + "Pattern": "[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+](|[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+]|[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+ ]{1,33}[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+])", + "description": "Unique identification, as assigned by an instructing party for an instructed party, to unambiguously identify the instruction." + }, + "Uetr": { + "title": "Unique end-to-end reference", + "type": "string", + "format": "guid", + "pattern": "[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}", + "description": "Universally unique UUID v4 identifier randomly generated to provide an end-to-end reference of a payment transaction." + }, + "TransactionId": { + "title": "Transaction id", + "type": "string", + "format": "guid", + "pattern": "[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}", + "description": "ID of the transaction used to move funds for this payment." + }, + "PaymentReturnId": { + "title": "Payment id", + "type": "string", + "pattern": "[a-zA-Z0-9_-]{0,50}", + "description": "ClearBank internal identifier for this payment." + } + } +} \ No newline at end of file diff --git a/data/webhooks/Target2.PaymentReturn.Outbound.FailedV1.json b/data/webhooks/Target2.PaymentReturn.Outbound.FailedV1.json new file mode 100644 index 000000000..71664696e --- /dev/null +++ b/data/webhooks/Target2.PaymentReturn.Outbound.FailedV1.json @@ -0,0 +1,46 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Target2PaymentReturnOutboundFailedWebHook", + "type": "object", + "additionalProperties": false, + "required": [ + "ReturnInstructionId", + "Uetr", + "PaymentReturnId", + "ErrorCode", + "AdditionalInformation" + ], + "properties": { + "ReturnInstructionId": { + "title": "Customer internal identification", + "type": "string", + "Pattern": "[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+](|[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+]|[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+ ]{1,33}[0-9a-zA-Z\/\\-\\?:\\(\\)\\.,'\\+])", + "description": "Unique identification, as assigned by an instructing party for an instructed party, to unambiguously identify the instruction." + }, + "Uetr": { + "title": "Unique end-to-end reference", + "type": "string", + "format": "guid", + "pattern": "[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}", + "description": "Universally unique UUID v4 identifier randomly generated to provide an end-to-end reference of a payment transaction." + }, + "PaymentReturnId": { + "title": "Payment id", + "type": "string", + "pattern": "[a-zA-Z0-9_-]{0,50}", + "description": "ClearBank internal identifier for this payment." + }, + "ErrorCode": { + "title": "Error Code", + "type": "string", + "description": "ISO20022/ClearBank code for why the payment failed", + "maxLength": 4, + "minLength": 1 + }, + "AdditionalInformation": { + "title": "Additional Information", + "type": "string", + "description": "Text description of why the payment failed." + } + } +} \ No newline at end of file diff --git a/data/webhooks/TransactionRejectedV1.json b/data/webhooks/TransactionRejectedV1.json new file mode 100644 index 000000000..90a290d16 --- /dev/null +++ b/data/webhooks/TransactionRejectedV1.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "AllowAll", + "type": "object" +} \ No newline at end of file diff --git a/data/webhooks/TransactionRejectedV2.json b/data/webhooks/TransactionRejectedV2.json new file mode 100644 index 000000000..b9052f247 --- /dev/null +++ b/data/webhooks/TransactionRejectedV2.json @@ -0,0 +1,676 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "TransactionRejectedV2", + "type": "object", + "additionalProperties": false, + "properties": { + "TransactionId": { + "title": "Transaction Id", + "type": "string", + "description": "Unique Identification of the Transaction.\r\nSpecial Character: Hyphen. \r\nExample format of a typical TransactionId: 073dca79-13b8-8bf2-b63b-148957caffe9", + "format": "guid", + "maxLength": 36, + "minLength": 0 + }, + "Status": { + "title": "Status", + "$ref": "#/definitions/TransactionStatus" + }, + "Scheme": { + "title": "Scheme", + "description": "Scheme Type (Optional)", + "oneOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/PaymentMethodType" + } + ] + }, + "EndToEndTransactionId": { + "title": "End To End Transaction Id", + "type": [ + "null", + "string" + ], + "description": "Unique Identifier supplied by you in your API request. For inbound transactions, this identifier may not be unique.", + "maxLength": 35, + "minLength": 0 + }, + "Amount": { + "title": "Amount", + "type": "number", + "description": "Transaction Amount", + "format": "decimal" + }, + "TimestampModified": { + "title": "Timestamp Modified", + "type": "string", + "description": "Date and Time Transaction Rejected. Time in UTC.", + "format": "date-time" + }, + "CurrencyCode": { + "title": "Currency Code", + "description": "Code of Transaction Currency (Optional)\r\n- GBP", + "oneOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/CurrencyCode" + } + ] + }, + "DebitCreditCode": { + "title": "Debit Credit Code", + "$ref": "#/definitions/DebitCreditCode" + }, + "Reference": { + "title": "Reference", + "type": [ + "null", + "string" + ], + "description": "Payment Transaction Reference", + "maxLength": 140, + "minLength": 0 + }, + "IsReturn": { + "title": "Is Return", + "type": "boolean", + "description": "Is the Transaction returned from Scheme?" + }, + "CancellationReason": { + "title": "Cancellation Reason", + "type": [ + "null", + "string" + ], + "description": "Textual representation of CancellationCode giving reason for rejection (Optional)" + }, + "CancellationCode": { + "title": "Cancellation Code", + "description": "Code of Cancellation – a combination of SWIFT and ClearBank codes (Optional).", + "oneOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/CancellationCode" + } + ] + }, + "Account": { + "title": "Account", + "oneOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/AccountIdentifiers" + } + ] + }, + "CounterpartAccount": { + "title": "Counterpart Account", + "description": "The account from, or to the Transaction occurred.", + "oneOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/AccountIdentifiers" + } + ] + } + }, + "definitions": { + "TransactionStatus": { + "type": "string", + "description": "", + "x-enumNames": [ + "Rejected" + ], + "enum": [ + "Rejected" + ] + }, + "PaymentMethodType": { + "type": "string", + "description": "", + "x-enumNames": [ + "Transfer", + "FasterPayments", + "Chaps" + ], + "enum": [ + "Transfer", + "FasterPayments", + "Chaps" + ] + }, + "CurrencyCode": { + "type": "string", + "description": "", + "x-enumNames": [ + "ALL", + "DZD", + "ARS", + "AUD", + "BSD", + "BHD", + "BDT", + "AMD", + "BBD", + "BMD", + "BTN", + "BOB", + "BWP", + "BZD", + "SBD", + "BND", + "MMK", + "BIF", + "KHR", + "CAD", + "CVE", + "KYD", + "LKR", + "CLP", + "CNY", + "COP", + "KMF", + "CRC", + "HRK", + "CUP", + "CZK", + "DKK", + "DOP", + "SVC", + "ETB", + "ERN", + "FKP", + "FJD", + "DJF", + "GMD", + "GIP", + "GTQ", + "GNF", + "GYD", + "HTG", + "HNL", + "HKD", + "HUF", + "ISK", + "INR", + "IDR", + "IRR", + "IQD", + "ILS", + "JMD", + "JPY", + "KZT", + "JOD", + "KES", + "KPW", + "KRW", + "KWD", + "KGS", + "LAK", + "LBP", + "LSL", + "LRD", + "LYD", + "MOP", + "MWK", + "MYR", + "MVR", + "MUR", + "MXN", + "MNT", + "MDL", + "MAD", + "OMR", + "NAD", + "NPR", + "ANG", + "AWG", + "VUV", + "NZD", + "NIO", + "NGN", + "NOK", + "PKR", + "PAB", + "PGK", + "PYG", + "PEN", + "PHP", + "QAR", + "RUB", + "RWF", + "SHP", + "SAR", + "SCR", + "SLL", + "SGD", + "VND", + "SOS", + "ZAR", + "SSP", + "SZL", + "SEK", + "CHF", + "SYP", + "THB", + "TOP", + "TTD", + "AED", + "TND", + "UGX", + "MKD", + "EGP", + "GBP", + "TZS", + "USD", + "UYU", + "UZS", + "WST", + "YER", + "TWD", + "MRU", + "STN", + "CUC", + "ZWL", + "BYN", + "TMT", + "GHS", + "VEF", + "SDG", + "UYI", + "RSD", + "MZN", + "AZN", + "RON", + "CHE", + "CHW", + "TRY", + "XAF", + "XCD", + "XOF", + "XPF", + "XBA", + "XBB", + "XBC", + "XBD", + "XAU", + "XDR", + "XAG", + "XPT", + "XTS", + "XPD", + "XUA", + "ZMW", + "SRD", + "MGA", + "COU", + "AFN", + "TJS", + "AOA", + "BGN", + "CDF", + "BAM", + "EUR", + "MXV", + "UAH", + "GEL", + "BOV", + "PLN", + "BRL", + "CLF", + "XSU", + "USN", + "XXX" + ], + "enum": [ + "ALL", + "DZD", + "ARS", + "AUD", + "BSD", + "BHD", + "BDT", + "AMD", + "BBD", + "BMD", + "BTN", + "BOB", + "BWP", + "BZD", + "SBD", + "BND", + "MMK", + "BIF", + "KHR", + "CAD", + "CVE", + "KYD", + "LKR", + "CLP", + "CNY", + "COP", + "KMF", + "CRC", + "HRK", + "CUP", + "CZK", + "DKK", + "DOP", + "SVC", + "ETB", + "ERN", + "FKP", + "FJD", + "DJF", + "GMD", + "GIP", + "GTQ", + "GNF", + "GYD", + "HTG", + "HNL", + "HKD", + "HUF", + "ISK", + "INR", + "IDR", + "IRR", + "IQD", + "ILS", + "JMD", + "JPY", + "KZT", + "JOD", + "KES", + "KPW", + "KRW", + "KWD", + "KGS", + "LAK", + "LBP", + "LSL", + "LRD", + "LYD", + "MOP", + "MWK", + "MYR", + "MVR", + "MUR", + "MXN", + "MNT", + "MDL", + "MAD", + "OMR", + "NAD", + "NPR", + "ANG", + "AWG", + "VUV", + "NZD", + "NIO", + "NGN", + "NOK", + "PKR", + "PAB", + "PGK", + "PYG", + "PEN", + "PHP", + "QAR", + "RUB", + "RWF", + "SHP", + "SAR", + "SCR", + "SLL", + "SGD", + "VND", + "SOS", + "ZAR", + "SSP", + "SZL", + "SEK", + "CHF", + "SYP", + "THB", + "TOP", + "TTD", + "AED", + "TND", + "UGX", + "MKD", + "EGP", + "GBP", + "TZS", + "USD", + "UYU", + "UZS", + "WST", + "YER", + "TWD", + "MRU", + "STN", + "CUC", + "ZWL", + "BYN", + "TMT", + "GHS", + "VEF", + "SDG", + "UYI", + "RSD", + "MZN", + "AZN", + "RON", + "CHE", + "CHW", + "TRY", + "XAF", + "XCD", + "XOF", + "XPF", + "XBA", + "XBB", + "XBC", + "XBD", + "XAU", + "XDR", + "XAG", + "XPT", + "XTS", + "XPD", + "XUA", + "ZMW", + "SRD", + "MGA", + "COU", + "AFN", + "TJS", + "AOA", + "BGN", + "CDF", + "BAM", + "EUR", + "MXV", + "UAH", + "GEL", + "BOV", + "PLN", + "BRL", + "CLF", + "XSU", + "USN", + "XXX" + ] + }, + "DebitCreditCode": { + "type": "string", + "description": "", + "x-enumNames": [ + "Credit", + "Debit" + ], + "enum": [ + "Credit", + "Debit" + ] + }, + "CancellationCode": { + "type": "string", + "description": "", + "x-enumNames": [ + "AC03", + "AC04", + "AC06", + "AC07", + "AC09", + "AC12", + "AG01", + "AG02", + "AG03", + "AM09", + "BE08", + "BE09", + "CB_AccountHoldersBankrupt", + "CB_AccountNameInvalid", + "CB_AccountSwitched", + "CB_AuthenticationFailure", + "CB_CancelledByBoEController", + "CB_CancelledByChapsMember", + "CB_CancelledCreditAccountDisabled", + "CB_CancelledDebitAccountDisabled", + "CB_CancelledQueuedCloseOfBusiness", + "CB_DupSttlmntOriginalIsQueued", + "CB_DupSttlmntOriginalWasRejected", + "CB_FailedModulusCheck", + "CB_InitiatingPartyActionRequired", + "CB_InitiatingPartyRequested", + "CB_InstructionCancelled", + "CB_InstructionCancelledByCustomer", + "CB_InstructionHasExpired", + "CB_InvalidProcessorState", + "CB_NewAccountUpdatedWithDDI", + "CB_SenderNotInTertiaryMode", + "COSE", + "CURR", + "CUTO", + "DDAT", + "DMON", + "DU05", + "ICAG", + "IVAG", + "MD01", + "MD07", + "OTHR", + "PY01", + "REFE", + "Other", + "Manual", + "BLBYTH", + "HOPRJ", + "MS03", + "MS02", + "AC05", + "MS01", + "CB_PaymentReferenceMissing", + "CB_PaymentReferenceIncorrect", + "CB_PaymentBeneficiaryNameMissing", + "CB_AccountNameAndNumberMismatch" + ], + "enum": [ + "AC03", + "AC04", + "AC06", + "AC07", + "AC09", + "AC12", + "AG01", + "AG02", + "AG03", + "AM09", + "BE08", + "BE09", + "CB_AccountHoldersBankrupt", + "CB_AccountNameInvalid", + "CB_AccountSwitched", + "CB_AuthenticationFailure", + "CB_CancelledByBoEController", + "CB_CancelledByChapsMember", + "CB_CancelledCreditAccountDisabled", + "CB_CancelledDebitAccountDisabled", + "CB_CancelledQueuedCloseOfBusiness", + "CB_DupSttlmntOriginalIsQueued", + "CB_DupSttlmntOriginalWasRejected", + "CB_FailedModulusCheck", + "CB_InitiatingPartyActionRequired", + "CB_InitiatingPartyRequested", + "CB_InstructionCancelled", + "CB_InstructionCancelledByCustomer", + "CB_InstructionHasExpired", + "CB_InvalidProcessorState", + "CB_NewAccountUpdatedWithDDI", + "CB_SenderNotInTertiaryMode", + "COSE", + "CURR", + "CUTO", + "DDAT", + "DMON", + "DU05", + "ICAG", + "IVAG", + "MD01", + "MD07", + "OTHR", + "PY01", + "REFE", + "Other", + "Manual", + "BLBYTH", + "HOPRJ", + "MS03", + "MS02", + "AC05", + "MS01", + "CB_PaymentReferenceMissing", + "CB_PaymentReferenceIncorrect", + "CB_PaymentBeneficiaryNameMissing", + "CB_AccountNameAndNumberMismatch" + ] + }, + "AccountIdentifiers": { + "type": "object", + "additionalProperties": false, + "properties": { + "BBAN": { + "title": "BBAN", + "type": [ + "null", + "string" + ], + "maxLength": 30, + "minLength": 0 + }, + "IBAN": { + "title": "IBAN", + "type": [ + "null", + "string" + ], + "maxLength": 34, + "minLength": 0 + } + } + } + } +} \ No newline at end of file diff --git a/data/webhooks/TransactionSettledV1.json b/data/webhooks/TransactionSettledV1.json new file mode 100644 index 000000000..90a290d16 --- /dev/null +++ b/data/webhooks/TransactionSettledV1.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "AllowAll", + "type": "object" +} \ No newline at end of file diff --git a/data/webhooks/TransactionSettledV2.json b/data/webhooks/TransactionSettledV2.json new file mode 100644 index 000000000..90a290d16 --- /dev/null +++ b/data/webhooks/TransactionSettledV2.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "AllowAll", + "type": "object" +} \ No newline at end of file diff --git a/data/webhooks/TransactionSettledV3.json b/data/webhooks/TransactionSettledV3.json new file mode 100644 index 000000000..90a290d16 --- /dev/null +++ b/data/webhooks/TransactionSettledV3.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "AllowAll", + "type": "object" +} \ No newline at end of file diff --git a/data/webhooks/TransactionSettledV4.json b/data/webhooks/TransactionSettledV4.json new file mode 100644 index 000000000..90a290d16 --- /dev/null +++ b/data/webhooks/TransactionSettledV4.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "AllowAll", + "type": "object" +} \ No newline at end of file diff --git a/data/webhooks/TransactionSettledV5.json b/data/webhooks/TransactionSettledV5.json new file mode 100644 index 000000000..90a290d16 --- /dev/null +++ b/data/webhooks/TransactionSettledV5.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "AllowAll", + "type": "object" +} \ No newline at end of file diff --git a/data/webhooks/TransactionSettledV6.json b/data/webhooks/TransactionSettledV6.json new file mode 100644 index 000000000..9caf3f4c1 --- /dev/null +++ b/data/webhooks/TransactionSettledV6.json @@ -0,0 +1,797 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "TransactionSettledV6", + "type": "object", + "additionalProperties": false, + "properties": { + "TransactionId": { + "title": "Transaction Id", + "type": "string", + "description": "Unique Identification of the Transaction.\r\nSpecial Character: Hyphen\r\nExample format of a typical TransactionId: CE25B426-9430-4A82-8EB8-9311DA2D3E12", + "format": "guid", + "maxLength": 36, + "minLength": 0 + }, + "Status": { + "title": "Status", + "description": "Transaction Status", + "oneOf": [ + { + "$ref": "#/definitions/TransactionStatus" + } + ] + }, + "Scheme": { + "title": "Scheme", + "description": "Scheme Type (Optional)", + "oneOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/PaymentMethodType" + } + ] + }, + "EndToEndTransactionId": { + "title": "End To End Transaction Id", + "type": [ + "null", + "string" + ], + "description": "Unique Identifier supplied by you in your API request. For inbound transactions, this identifier may not be unique.", + "maxLength": 35, + "minLength": 0 + }, + "Amount": { + "title": "Amount", + "type": "number", + "description": "Transaction Amount", + "format": "decimal" + }, + "TimestampSettled": { + "title": "Timestamp Settled", + "type": "string", + "description": "Date and Time Transaction settled. Time in UTC.", + "format": "date-time" + }, + "TimestampCreated": { + "title": "Timestamp Created", + "type": "string", + "description": "Date and Time Transaction created. Time in UTC.", + "format": "date-time" + }, + "CurrencyCode": { + "title": "Currency Code", + "description": "Code of Transaction Currency (Optional)\r\n- GBP", + "oneOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/CurrencyCode" + } + ] + }, + "DebitCreditCode": { + "title": "Debit Credit Code", + "$ref": "#/definitions/DebitCreditCode" + }, + "Reference": { + "title": "Reference", + "type": [ + "null", + "string" + ], + "description": "Payment Transaction Reference (Optional)", + "maxLength": 140, + "minLength": 0 + }, + "IsReturn": { + "title": "Is Return", + "type": "boolean", + "description": "Is the Transaction returned from Scheme?" + }, + "Account": { + "title": "Account", + "oneOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/AccountIdentifiersV2" + } + ] + }, + "CounterpartAccount": { + "title": "Counterpart Account", + "description": "The account from, or to the Transaction occurred.", + "oneOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/AccountIdentifiersV2CA" + } + ] + }, + "ActualEndToEndTransactionId": { + "title": "Actual End To End Transaction Id", + "type": [ + "null", + "string" + ], + "description": "Unique payment Identifier depending on Scheme Type\r\n- Faster Payments = FPID (FPID is the unique payment identifier generated by Faster Payments.)\r\n- Chaps = Field 20 (Field 20 is the unique payment identifier generated by the remitting bank.)", + "maxLength": 255, + "minLength": 0 + }, + "DirectDebitMandateId": { + "title": "Direct Debit Mandate Id", + "type": [ + "null", + "string" + ], + "description": "Unique Identification of a Direct Debit Instruction (Optional)", + "format": "guid", + "maxLength": 36, + "minLength": 0 + }, + "TransactionCode": { + "title": "Transaction Code", + "type": [ + "null", + "string" + ], + "description": "Direct Debit Transaction Code (Optional):\r\n- 01 - First collection\r\n- 17 - Regular collection\r\n- 18 - Re - presented collection\r\n- 19 - Final collection\r\nDirect Credit Transaction Code(Optional):\r\n- 99 - Standard Bank Giro Credit\r\n- 86 - Bank to bank settlement\r\n- Z4 - Interest payment\r\n- Z5 - Dividend payment", + "maxLength": 2, + "minLength": 0, + "pattern": "(01|17|18|19|U1|U7|U8|U9|99|Z4|Z5|86|RA)" + }, + "ServiceUserNumber": { + "title": "Service User Number", + "type": [ + "null", + "string" + ], + "description": "Service User's Unique Identifier registered with Bacs (Optional)", + "maxLength": 6, + "minLength": 0 + }, + "BacsTransactionId": { + "title": "Bacs Transaction Id", + "type": [ + "null", + "string" + ], + "format": "guid", + "maxLength": 36, + "minLength": 0 + }, + "BacsTransactionDescription": { + "title": "Bacs Transaction Description", + "oneOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/BacsTransactionDescriptionType" + } + ] + }, + "TransactionType": { + "title": "Transaction Type", + "oneOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/BacsTransactionType" + } + ] + }, + "TransactionSource": { + "title": "Transaction Source", + "type": [ + "null", + "string" + ], + "description": "Origination of the Transaction (Optional)\r\n- CardProcessor", + "maxLength": 50, + "minLength": 0 + }, + "SupplementaryData": { + "title": "Supplementary Data", + "type": [ + "array", + "null" + ], + "description": "Transaction supplementary data (Optional)\r\n- CHAPS\r\n It is an array with the following fields:\r\n Name (Tag/Field Number in the CHAPS message)\r\n Maximum Field Length: 5\r\n - 20\r\n - 13C\r\n - 23B\r\n - 23E\r\n - 26T\r\n - 32A\r\n - 33B\r\n - 36\r\n - 50a\r\n - 51A\r\n - 52a\r\n - 53a\r\n - 54a\r\n - 55a\r\n - 56a\r\n - 57a\r\n - 59a\r\n - 70\r\n - 71A\r\n - 71F\r\n - 71G\r\n - 72\r\n - 77B\r\n Value\r\n Maximum Field Length: 500\r\n There could be more than one Name and Value pair.\r\n\r\n- FPS\r\n It is an array with the following fields:\r\n Name (Fields in the FPS message)\r\n - Maximum Field Length: 33\r\n - AgencyAccountWithMember\r\n - AgencySortCodeWithMember\r\n - Amount\r\n - BeneficiaryCreditInstitution\r\n - BeneficiaryCustomerAccountAddress\r\n - BeneficiaryCustomerAccountName\r\n - BeneficiaryCustomerAccountNumber\r\n - ChargingInformation\r\n - Currency\r\n - DateSent\r\n - EndToEndReference\r\n - ExchangeRate\r\n - FileId\r\n - NumericReference\r\n - OriginalAmount\r\n - OriginalCurrency\r\n - OriginatingCreditInstitution\r\n - OriginatingCustomerAccountAddress\r\n - OriginatingCustomerAccountName\r\n - OriginatingCustomerAccountNumber\r\n - PaymentReturnCode\r\n - PaymentSubTypeCode\r\n - PaymentType\r\n - ProcessedAsynchronously\r\n - PurposeTransactionType\r\n - ReceivingMember\r\n - ReferenceInformation\r\n - RegulatoryReporting\r\n - RemittanceInformation\r\n - ReturnedPaymentFpId\r\n - SendingFpsInstitution\r\n - SettlementCycleId\r\n - SubmittingMember\r\n - TransactionReferenceNumber\r\n - TypeOfAccountCode\r\n Value\r\n Maximum Field Length: 500\r\n There could be more than one Name and Value pair.", + "items": { + "$ref": "#/definitions/SupplementaryData" + } + }, + "Iso20022XmlDocument": { + "title": "Iso20022 Xml Document (Optional)", + "type": [ + "null", + "string" + ], + "description": "Only appears if Scheme is set to Chaps and the message type received is in ISO 20022 (MX) format. Content of the Document node (payload) of the received payment message, to enable processing of ISO 20022 messages for CHAPS. This value can be very long: 0-80,000 characters." + } + }, + "definitions": { + "TransactionStatus": { + "type": "string", + "description": "", + "x-enumNames": [ + "Settled" + ], + "enum": [ + "Settled" + ] + }, + "PaymentMethodType": { + "type": "string", + "description": "", + "x-enumNames": [ + "Transfer", + "FasterPayments", + "Bacs", + "Chaps" + ], + "enum": [ + "Transfer", + "FasterPayments", + "Bacs", + "Chaps" + ] + }, + "CurrencyCode": { + "type": "string", + "description": "", + "x-enumNames": [ + "ALL", + "DZD", + "ARS", + "AUD", + "BSD", + "BHD", + "BDT", + "AMD", + "BBD", + "BMD", + "BTN", + "BOB", + "BWP", + "BZD", + "SBD", + "BND", + "MMK", + "BIF", + "KHR", + "CAD", + "CVE", + "KYD", + "LKR", + "CLP", + "CNY", + "COP", + "KMF", + "CRC", + "HRK", + "CUP", + "CZK", + "DKK", + "DOP", + "SVC", + "ETB", + "ERN", + "FKP", + "FJD", + "DJF", + "GMD", + "GIP", + "GTQ", + "GNF", + "GYD", + "HTG", + "HNL", + "HKD", + "HUF", + "ISK", + "INR", + "IDR", + "IRR", + "IQD", + "ILS", + "JMD", + "JPY", + "KZT", + "JOD", + "KES", + "KPW", + "KRW", + "KWD", + "KGS", + "LAK", + "LBP", + "LSL", + "LRD", + "LYD", + "MOP", + "MWK", + "MYR", + "MVR", + "MUR", + "MXN", + "MNT", + "MDL", + "MAD", + "OMR", + "NAD", + "NPR", + "ANG", + "AWG", + "VUV", + "NZD", + "NIO", + "NGN", + "NOK", + "PKR", + "PAB", + "PGK", + "PYG", + "PEN", + "PHP", + "QAR", + "RUB", + "RWF", + "SHP", + "SAR", + "SCR", + "SLL", + "SGD", + "VND", + "SOS", + "ZAR", + "SSP", + "SZL", + "SEK", + "CHF", + "SYP", + "THB", + "TOP", + "TTD", + "AED", + "TND", + "UGX", + "MKD", + "EGP", + "GBP", + "TZS", + "USD", + "UYU", + "UZS", + "WST", + "YER", + "TWD", + "MRU", + "STN", + "CUC", + "ZWL", + "BYN", + "TMT", + "GHS", + "VEF", + "SDG", + "UYI", + "RSD", + "MZN", + "AZN", + "RON", + "CHE", + "CHW", + "TRY", + "XAF", + "XCD", + "XOF", + "XPF", + "XBA", + "XBB", + "XBC", + "XBD", + "XAU", + "XDR", + "XAG", + "XPT", + "XTS", + "XPD", + "XUA", + "ZMW", + "SRD", + "MGA", + "COU", + "AFN", + "TJS", + "AOA", + "BGN", + "CDF", + "BAM", + "EUR", + "MXV", + "UAH", + "GEL", + "BOV", + "PLN", + "BRL", + "CLF", + "XSU", + "USN", + "XXX" + ], + "enum": [ + "ALL", + "DZD", + "ARS", + "AUD", + "BSD", + "BHD", + "BDT", + "AMD", + "BBD", + "BMD", + "BTN", + "BOB", + "BWP", + "BZD", + "SBD", + "BND", + "MMK", + "BIF", + "KHR", + "CAD", + "CVE", + "KYD", + "LKR", + "CLP", + "CNY", + "COP", + "KMF", + "CRC", + "HRK", + "CUP", + "CZK", + "DKK", + "DOP", + "SVC", + "ETB", + "ERN", + "FKP", + "FJD", + "DJF", + "GMD", + "GIP", + "GTQ", + "GNF", + "GYD", + "HTG", + "HNL", + "HKD", + "HUF", + "ISK", + "INR", + "IDR", + "IRR", + "IQD", + "ILS", + "JMD", + "JPY", + "KZT", + "JOD", + "KES", + "KPW", + "KRW", + "KWD", + "KGS", + "LAK", + "LBP", + "LSL", + "LRD", + "LYD", + "MOP", + "MWK", + "MYR", + "MVR", + "MUR", + "MXN", + "MNT", + "MDL", + "MAD", + "OMR", + "NAD", + "NPR", + "ANG", + "AWG", + "VUV", + "NZD", + "NIO", + "NGN", + "NOK", + "PKR", + "PAB", + "PGK", + "PYG", + "PEN", + "PHP", + "QAR", + "RUB", + "RWF", + "SHP", + "SAR", + "SCR", + "SLL", + "SGD", + "VND", + "SOS", + "ZAR", + "SSP", + "SZL", + "SEK", + "CHF", + "SYP", + "THB", + "TOP", + "TTD", + "AED", + "TND", + "UGX", + "MKD", + "EGP", + "GBP", + "TZS", + "USD", + "UYU", + "UZS", + "WST", + "YER", + "TWD", + "MRU", + "STN", + "CUC", + "ZWL", + "BYN", + "TMT", + "GHS", + "VEF", + "SDG", + "UYI", + "RSD", + "MZN", + "AZN", + "RON", + "CHE", + "CHW", + "TRY", + "XAF", + "XCD", + "XOF", + "XPF", + "XBA", + "XBB", + "XBC", + "XBD", + "XAU", + "XDR", + "XAG", + "XPT", + "XTS", + "XPD", + "XUA", + "ZMW", + "SRD", + "MGA", + "COU", + "AFN", + "TJS", + "AOA", + "BGN", + "CDF", + "BAM", + "EUR", + "MXV", + "UAH", + "GEL", + "BOV", + "PLN", + "BRL", + "CLF", + "XSU", + "USN", + "XXX" + ] + }, + "DebitCreditCode": { + "type": "string", + "description": "", + "x-enumNames": [ + "Credit", + "Debit" + ], + "enum": [ + "Credit", + "Debit" + ] + }, + "AccountIdentifiersV2": { + "type": "object", + "additionalProperties": false, + "properties": { + "BBAN": { + "title": "BBAN", + "type": [ + "null", + "string" + ], + "maxLength": 30, + "minLength": 0 + }, + "IBAN": { + "title": "IBAN", + "type": [ + "null", + "string" + ], + "maxLength": 34, + "minLength": 0 + }, + "OwnerName": { + "title": "Owner Name", + "type": [ + "null", + "string" + ], + "description": "Name of the beneficiary account holder registered with ClearBank\r\n- Faster Payments = Sender’s Account Name\r\n- Chaps = Ordering Customer’s Name", + "maxLength": 140, + "minLength": 0 + }, + "TransactionOwnerName": { + "title": "Transaction Owner Name", + "type": [ + "null", + "string" + ], + "description": "Beneficiary Account Holder, as specified by the remitter in the payment message. For outbound payments, as specified by ClearBank as the remitter name in the payment message.", + "maxLength": 140, + "minLength": 0 + }, + "InstitutionName": { + "title": "Institution Name", + "type": [ + "null", + "string" + ], + "description": "(InstitutionName\r\n- Chaps = Ordering Institution", + "maxLength": 128, + "minLength": 0 + } + } + }, + "AccountIdentifiersV2CA": { + "type": "object", + "additionalProperties": false, + "properties": { + "BBAN": { + "title": "BBAN", + "type": [ + "null", + "string" + ], + "maxLength": 30, + "minLength": 0 + }, + "IBAN": { + "title": "IBAN", + "type": [ + "null", + "string" + ], + "maxLength": 34, + "minLength": 0 + }, + "OwnerName": { + "title": "Owner Name", + "type": [ + "null", + "string" + ], + "description": "Populated with either the same name as TransactionOwnerName, or with “Not Provided” depending on what is provided in the payment message.\r\n- Faster Payments = Beneficiary’s Account Name\r\n- Chaps = Beneficiary’s Name", + "maxLength": 140, + "minLength": 0 + }, + "TransactionOwnerName": { + "title": "Transaction Owner Name", + "type": [ + "null", + "string" + ], + "description": "Populated by Scheme with the name provided in the payment message. For outbound payments, this is populated as the Beneficiary Name which is provided by you.", + "maxLength": 140, + "minLength": 0 + }, + "InstitutionName": { + "title": "Institution Name", + "type": [ + "null", + "string" + ], + "description": "InstitutionName\r\n- Chaps = Beneficiary Institution", + "maxLength": 128, + "minLength": 0 + } + } + }, + "BacsTransactionDescriptionType": { + "type": "string", + "description": "", + "x-enumNames": [ + "CreditTransactionSettled", + "DebitContraTransactionSettled", + "DebitTransactionSettled", + "CreditContraTransactionSettled", + "DirectDebitReceivedIndemnityClaimSettled" + ], + "enum": [ + "CreditTransactionSettled", + "DebitContraTransactionSettled", + "DebitTransactionSettled", + "CreditContraTransactionSettled", + "DirectDebitReceivedIndemnityClaimSettled" + ] + }, + "BacsTransactionType": { + "type": "string", + "description": "", + "x-enumNames": [ + "DirectCredit", + "DirectDebit", + "DirectDebitIndemnityClaim" + ], + "enum": [ + "DirectCredit", + "DirectDebit", + "DirectDebitIndemnityClaim" + ] + }, + "SupplementaryData": { + "type": "object", + "additionalProperties": false, + "properties": { + "Name": { + "title": "Name", + "type": [ + "null", + "string" + ], + "description": "CHAPS\r\nTag/Field Number in the CHAPS message\r\nMaximum Field Length: 5\r\n20\r\n13C\r\n23B\r\n23E\r\n26T\r\n32A\r\n33B\r\n36\r\n50a\r\n51A\r\n52a\r\n53a\r\n54a\r\n55a\r\n56a\r\n57a\r\n59a\r\n70\r\n71A\r\n71F\r\n71G\r\n72\r\n77B\r\n\r\nThere could be more than one Name and Value pair.\r\n\r\nFPS\r\nFields in the FPS message\r\nMaximum Field Length: 33\r\nAgencyAccountWithMember\r\nAgencySortCodeWithMember\r\nAmount\r\nBeneficiaryCreditInstitution\r\nBeneficiaryCustomerAccountAddress\r\nBeneficiaryCustomerAccountName\r\nBeneficiaryCustomerAccountNumber\r\nChargingInformation\r\nCurrency\r\nDateSent\r\nEndToEndReference\r\nExchangeRate\r\nFileId\r\nNumericReference\r\nOriginalAmount\r\nOriginalCurrency\r\nOriginatingCreditInstitution\r\nOriginatingCustomerAccountAddress\r\nOriginatingCustomerAccountName\r\nOriginatingCustomerAccountNumber\r\nPaymentReturnCode\r\nPaymentSubTypeCode\r\nPaymentType\r\nProcessedAsynchronously\r\nPurposeTransactionType\r\nReceivingMember\r\nReferenceInformation\r\nRegulatoryReporting\r\nRemittanceInformation\r\nReturnedPaymentFpId\r\nSendingFpsInstitution\r\nSettlementCycleId\r\nSubmittingMember\r\nTransactionReferenceNumber\r\nTypeOfAccountCode\r\n\r\nThere could be more than one Name and Value pair." + }, + "Value": { + "title": "Value", + "type": [ + "null", + "string" + ], + "maxLength": 500, + "minLength": 0 + } + } + }, + "Iso20022XmlDocument": { + "title": "Iso20022 Xml Document (Optional)", + "type": [ + "null", + "string" + ], + "description": "Only appears if Scheme is set to Chaps and the message type received is in ISO 20022 (MX) format. Content of the Document node (payload) of the received payment message, to enable processing of ISO 20022 messages for CHAPS. This value can be very long: 0-80,000 characters." + } + } +} \ No newline at end of file diff --git a/data/webhooks/VirtualAccountCreatedV1.json b/data/webhooks/VirtualAccountCreatedV1.json new file mode 100644 index 000000000..90a290d16 --- /dev/null +++ b/data/webhooks/VirtualAccountCreatedV1.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "AllowAll", + "type": "object" +} \ No newline at end of file diff --git a/data/webhooks/VirtualAccountCreatedV2.json b/data/webhooks/VirtualAccountCreatedV2.json new file mode 100644 index 000000000..eb5549969 --- /dev/null +++ b/data/webhooks/VirtualAccountCreatedV2.json @@ -0,0 +1,85 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "VirtualAccountCreatedV2", + "type": "object", + "additionalProperties": false, + "properties": { + "ClientMoneyAccountId": { + "title": "Client Money Account Id", + "type": "string", + "description": "Unique Identification of the General Segregated account or General Client account", + "format": "guid", + "maxLength": 36, + "minLength": 0 + }, + "VirtualAccountIdentifiers": { + "title": "Virtual Account Identifiers", + "oneOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/AccountIdentifiers" + } + ] + }, + "VirtualAccountId": { + "title": "Virtual Account Id", + "type": "string", + "description": "Unique Identification of the Virtual Account", + "format": "guid", + "maxLength": 36, + "minLength": 0 + }, + "TimestampCreated": { + "title": "Timestamp Created", + "type": "string", + "description": "Date and Time Virtual Account Created. Time in UTC.", + "format": "date-time" + } + }, + "definitions": { + "AccountIdentifiers": { + "type": "object", + "additionalProperties": false, + "properties": { + "BBAN": { + "title": "BBAN", + "type": [ + "null", + "string" + ], + "maxLength": 30, + "minLength": 0 + }, + "IBAN": { + "title": "IBAN", + "type": [ + "null", + "string" + ], + "maxLength": 34, + "minLength": 0 + }, + "AccountName": { + "title": "Account Name", + "type": [ + "null", + "string" + ], + "maxLength": 128, + "minLength": 0 + }, + "AccountHolderLabel": { + "title": "Account Holder Label", + "type": [ + "null", + "string" + ], + "maxLength": 100, + "minLength": 0 + } + } + } + } +} \ No newline at end of file diff --git a/data/webhooks/VirtualAccountCreatedV3.json b/data/webhooks/VirtualAccountCreatedV3.json new file mode 100644 index 000000000..37b04af75 --- /dev/null +++ b/data/webhooks/VirtualAccountCreatedV3.json @@ -0,0 +1,90 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "VirtualAccountCreatedV3", + "type": "object", + "additionalProperties": false, + "required": [ + "AccountId", + "VirtualAccountId", + "AccountIdentifier", + "TimestampCreated" + ], + "properties": { + "AccountId": { + "title": "Unique Account Id", + "type": "string", + "description": "Unique identifier for the real account associated with the virtual account.", + "format": "guid", + "minLength": 1 + }, + "VirtualAccountId": { + "title": "Unique Virtual Account Id", + "type": "string", + "description": "Account identifier used to uniquely identify the virtual account.", + "format": "guid", + "minLength": 1 + }, + "AccountIdentifier": { + "title": "Virtual Account Identifier", + "description": "Virtual account identifier details.", + "oneOf": [ + { + "$ref": "#/definitions/AccountIdentifiersDto" + } + ] + }, + "OwnerName": { + "title": "Account Owner Name", + "type": [ + "null", + "string" + ], + "description": "Name of the owner of the virtual account.", + "maxLength": 140, + "minLength": 0 + }, + "TimestampCreated": { + "title": "Virtual Account Creation Time", + "type": "string", + "description": "The date and time the virtual account was created.", + "format": "date-time", + "minLength": 1 + } + }, + "definitions": { + "AccountIdentifiersDto": { + "type": "object", + "additionalProperties": false, + "properties": { + "Iban": { + "title": "IBAN", + "type": [ + "null", + "string" + ], + "description": "IBAN associated with the virtual account.", + "pattern": "^([A-Z]{2})([0-9]{2})([A-Za-z]{4})([0-9]{6})([0-9]{8})$" + }, + "Bban": { + "title": "BBAN", + "type": [ + "null", + "string" + ], + "description": "BBAN associated with the virtual account.", + "pattern": "^([A-Za-z]{4})([0-9]{6})([0-9]{8})$" + }, + "ExternalIdentifier": { + "title": "External Virtual Account Identifier", + "type": [ + "null", + "string" + ], + "description": "Unique identifier specified at the time of creating a virtual account.", + "maxLength": 50, + "minLength": 0 + } + } + } + } +} diff --git a/data/webhooks/VirtualAccountCreationFailedV1.json b/data/webhooks/VirtualAccountCreationFailedV1.json new file mode 100644 index 000000000..90a290d16 --- /dev/null +++ b/data/webhooks/VirtualAccountCreationFailedV1.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "AllowAll", + "type": "object" +} \ No newline at end of file diff --git a/data/webhooks/VirtualAccountCreationFailedV2.json b/data/webhooks/VirtualAccountCreationFailedV2.json new file mode 100644 index 000000000..21f642cf9 --- /dev/null +++ b/data/webhooks/VirtualAccountCreationFailedV2.json @@ -0,0 +1,92 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "VirtualAccountCreationFailedV2", + "type": "object", + "additionalProperties": false, + "required": [ + "VirtualAccountIdentifiers" + ], + "properties": { + "VirtualAccountId": { + "title": "Virtual Account Id", + "type": "string", + "description": "Unique Identification of the Virtual Account", + "format": "guid", + "maxLength": 36, + "minLength": 0 + }, + "ClientMoneyAccountId": { + "title": "Client Money Account Id", + "type": "string", + "description": "Unique Identification of the General Segregated account or General Client account", + "format": "guid", + "maxLength": 36, + "minLength": 0 + }, + "VirtualAccountIdentifiers": { + "title": "Virtual Account Identifiers", + "$ref": "#/definitions/AccountIdentifiers" + }, + "Errors": { + "title": "Errors", + "type": [ + "null", + "object" + ], + "description": "One or more errors that occurred during the processing of the request.\r\n- None\r\n- ClientMoneyAccount\r\n- ClientMoneyAccountId\r\n- ClientMoneyAccountIban\r\n- InstitutionId\r\n- AccountIban\r\n- AccountIbanSortCode\r\n- AccountIbanAccountNumber\r\n- AccountBban\r\n- AccountBbanSortCode\r\n- AccountBbanAccountNumber\r\n- AccountIdentifiers\r\n- AccountName\r\n- AccountHolderLabel\r\n- AccountCuid\r\n- AccountUpic\r\n- AccountIbanBankCode\r\n- AccountBbanBankCode\r\n- ClientMoneyAccountIdMissing\r\n- InstitutionIdMissing\r\n- VirtualAccountIdMissing\r\n- AccountModulusFailed\r\n- SortCodeDoesNotBelongToInstitution\r\n- SortCodeTypeIsIncorrect", + "additionalProperties": { + "type": "string" + } + }, + "Timestamp": { + "title": "Timestamp", + "type": "string", + "description": "Date and Time. Time in UTC.", + "format": "date-time" + } + }, + "definitions": { + "AccountIdentifiers": { + "type": "object", + "additionalProperties": false, + "properties": { + "BBAN": { + "title": "BBAN", + "type": [ + "null", + "string" + ], + "maxLength": 30, + "minLength": 0 + }, + "IBAN": { + "title": "IBAN", + "type": [ + "null", + "string" + ], + "maxLength": 34, + "minLength": 0 + }, + "AccountName": { + "title": "Account Name", + "type": [ + "null", + "string" + ], + "maxLength": 128, + "minLength": 0 + }, + "AccountHolderLabel": { + "title": "Account Holder Label", + "type": [ + "null", + "string" + ], + "maxLength": 100, + "minLength": 0 + } + } + } + } +} \ No newline at end of file diff --git a/data/webhooks/VirtualAccountCreationFailedV3.json b/data/webhooks/VirtualAccountCreationFailedV3.json new file mode 100644 index 000000000..ff28a92d1 --- /dev/null +++ b/data/webhooks/VirtualAccountCreationFailedV3.json @@ -0,0 +1,99 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "VirtualAccountCreationFailedV3", + "type": "object", + "additionalProperties": false, + "required": [ + "AccountId", + "VirtualAccountId", + "AccountIdentifier", + "Errors", + "Timestamp" + ], + "properties": { + "AccountId": { + "title": "Unique Account Id", + "type": "string", + "description": "Unique identifier for the real account associated with the virtual account.", + "format": "guid", + "minLength": 1 + }, + "VirtualAccountId": { + "title": "Unique Virtual Account Id", + "type": "string", + "description": "Account identifier used to uniquely identify the virtual account.", + "format": "guid", + "minLength": 1 + }, + "AccountIdentifier": { + "title": "Virtual Account Identifier", + "description": "Virtual account identifier details.", + "oneOf": [ + { + "$ref": "#/definitions/AccountIdentifiersDto" + } + ] + }, + "OwnerName": { + "title": "Account Owner Name", + "type": [ + "null", + "string" + ], + "description": "Name of the owner of the virtual account.", + "maxLength": 140, + "minLength": 0 + }, + "Errors": { + "title": "Virtual Account Creation Errors", + "type": "object", + "description": "Error(s) which caused the virtual account creation to fail.", + "additionalProperties": { + "type": "string" + } + }, + "Timestamp": { + "title": "Virtual Account Creation Failure Time", + "type": "string", + "description": "The date and time the virtual account creation failed.", + "format": "date-time", + "minLength": 1 + } + }, + "definitions": { + "AccountIdentifiersDto": { + "type": "object", + "additionalProperties": false, + "properties": { + "Iban": { + "title": "IBAN", + "type": [ + "null", + "string" + ], + "description": "IBAN associated with the virtual account.", + "pattern": "^([A-Z]{2})([0-9]{2})([A-Za-z]{4})([0-9]{6})([0-9]{8})$" + }, + "Bban": { + "title": "BBAN", + "type": [ + "null", + "string" + ], + "description": "BBAN associated with the virtual account.", + "pattern": "^([A-Za-z]{4})([0-9]{6})([0-9]{8})$" + }, + "ExternalIdentifier": { + "title": "External Virtual Account Identifier", + "type": [ + "null", + "string" + ], + "description": "Unique identifier specified at the time of creating a virtual account.", + "maxLength": 50, + "minLength": 0 + } + } + } + } +} diff --git a/data/webhooks/default.json b/data/webhooks/default.json deleted file mode 100644 index 0967ef424..000000000 --- a/data/webhooks/default.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/src/components/webhook-block/components/webhook-block-payload/index.ts b/src/components/webhook-block/components/webhook-block-payload/index.ts new file mode 100644 index 000000000..ba844681c --- /dev/null +++ b/src/components/webhook-block/components/webhook-block-payload/index.ts @@ -0,0 +1 @@ +export { default } from './webhook-block-payload' diff --git a/src/components/webhook-block/components/webhook-block-payload/webhook-block-payload.styles.ts b/src/components/webhook-block/components/webhook-block-payload/webhook-block-payload.styles.ts new file mode 100644 index 000000000..644cd91b5 --- /dev/null +++ b/src/components/webhook-block/components/webhook-block-payload/webhook-block-payload.styles.ts @@ -0,0 +1,5 @@ +export { + FlexContainer, + DataListWrapper, + CodeblockWrapper +} from '../../webhook-block.styles' diff --git a/src/components/webhook-block/components/webhook-block-payload/webhook-block-payload.tsx b/src/components/webhook-block/components/webhook-block-payload/webhook-block-payload.tsx new file mode 100644 index 000000000..b6ad799eb --- /dev/null +++ b/src/components/webhook-block/components/webhook-block-payload/webhook-block-payload.tsx @@ -0,0 +1,188 @@ +import React, { ReactElement } from 'react' + +import * as DataRow from 'src/components/data-row/data-row.styles' + +import * as Types from './webhook-block-payload.types' +import * as Styles from './webhook-block-payload.styles' + +import WebhookData from '../../../../../data/webhooks.json' +import { Collapse, CollapseItem } from "../../../clearbank-ui" +import EndpointBlockContent from "../../../endpoint-block/components/endpoint-block-content" + +const WebhookBlockPayload: React.FunctionComponent = ({ + webhookName +}): ReactElement => { + + // whitelisted attributes + const additionalAttributes = [ + //"minimum", + //"maximum", + "minLength", + "maxLength", + "pattern", + //"enum", + ] + const attributeNameMap = { + //maximum: "Maximum", + //minimum: "Minimum", + minLength: "Minimum length", + maxLength: "Maximum length", + pattern: "Pattern", + //enum: "Enum array", + } + + const requiredProperties = WebhookData[webhookName]['required']; + + return ( + <> + + Payload + + + + + + {!!WebhookData[webhookName] && + Object.entries(WebhookData[webhookName]['properties']).map(([key, currentProperty]: [string, any]) => { + const { + type, + description, + title, + oneOf + } = currentProperty + + const isOneOf = oneOf && Array.isArray(oneOf) && oneOf.length > 0 + + // Merge properties and required into one object + if (isOneOf) { + // required = oneOf.reduce( + // (output: Array, choice: Types.OneOfProps) => + // output.concat(choice.required || []), + // [] + // ) + // properties = oneOf.reduce( + // (output: Array, choice: Types.OneOfProps) => + // Object.assign(output, choice.properties), + // {} + // ) + } + + const hasAdditionalAttributes = additionalAttributes.some( + (additionalAttribute) => additionalAttribute in currentProperty + ) + let showAdditionalAttributes = true + + const required = requiredProperties ? requiredProperties.includes(key) : false; + + const hasSchemaType = !!type; + + //const hasNestedProperties = !!properties + const hasNestedProperties = !!isOneOf + + //const hasNestedItems = !!items && !!items.properties + const hasNestedItems = isOneOf + + // This will be used to then seed the display with information on mutually + // exclusive groups. Note this doesn't currently deal with recursion i.e. a oneOf + // nested within a oneOf - that needs some thought + const oneOfPropertyGroups: object = (isOneOf ? oneOf : []).reduce( + (output: object, choice: Types.OneOfProps, index: number) => { + if (choice.properties) { + Object.keys(choice.properties).forEach((prop) => { + output[prop] = (output[prop] || []).concat([index]) + }) + } + + return output + }, + {} + ) + + return ( + + + {key} {title && '(' + title + ')'} + + {type && ( + <> + {type} + + )} + {required && ( + <> + {hasSchemaType && <>,{' '}} + Required + + )} + {description && ( + {description} + )} + {showAdditionalAttributes && + additionalAttributes.map((additionalAttribute) => { + // const targetAttributes = hasAnyOf + // ? allOfSchema + // : currentProperty + const targetAttributes = currentProperty; + const hasAttributeFromList = + additionalAttribute in targetAttributes + + if (!hasAttributeFromList) { + return null + } + + const attributeKey = + additionalAttribute in attributeNameMap + ? attributeNameMap[additionalAttribute] + : additionalAttribute // fallback + const attributeValue = targetAttributes[additionalAttribute] + const isComplexType = Array.isArray(attributeValue) + + return ( + + + {attributeKey} + + + {isComplexType + ? attributeValue.join(", ") + : attributeValue} + + + ) + })} + {(hasNestedProperties || hasNestedItems) && ( + + + + {/*{hasNestedProperties && (*/} + {/* */} + {/*)}*/} + {/*{hasNestedItems && (*/} + {/* */} + {/*)}*/} + + + + )} + + ) + })} + + + + + + ) +} + +export default WebhookBlockPayload diff --git a/src/components/webhook-block/components/webhook-block-payload/webhook-block-payload.types.ts b/src/components/webhook-block/components/webhook-block-payload/webhook-block-payload.types.ts new file mode 100644 index 000000000..345368110 --- /dev/null +++ b/src/components/webhook-block/components/webhook-block-payload/webhook-block-payload.types.ts @@ -0,0 +1,13 @@ +import { CodeblockType } from 'src/global.types' + +export interface WebhookBlockPayloadProps { + webhookName: string + //parameters: any + // codeblocks?: CodeblockType[] +} + +export interface OneOfProps { + type: string, + required: Array, + properties: Object, +} diff --git a/src/components/webhook-block/index.ts b/src/components/webhook-block/index.ts new file mode 100644 index 000000000..9dff6e4d3 --- /dev/null +++ b/src/components/webhook-block/index.ts @@ -0,0 +1 @@ +export { default } from './webhook-block' diff --git a/src/components/webhook-block/webhook-block.styles.ts b/src/components/webhook-block/webhook-block.styles.ts new file mode 100644 index 000000000..674b85287 --- /dev/null +++ b/src/components/webhook-block/webhook-block.styles.ts @@ -0,0 +1,73 @@ +import styled from 'styled-components' +import { Box } from 'rebass' + +import { breakpoints, fonts, heights } from 'src/components/theme' + +// export const Title: any = styled.h3` +// margin: 0; +// font-family: ${fonts.heading}; +// scroll-margin-top: ${heights.header}; +// font-size: 30px; +// font-weight: 700; +// line-height: 34px; +// ` +// export const Container: any = styled(Box)`` + +export const FlexContainer: any = styled.div` + display: flex; + flex-wrap: wrap; + + @media screen and (min-width: ${breakpoints.large}) { + flex-wrap: nowrap; + } +` + +// export const EndpointWrapper = styled.div` +// flex: 1 1 0; +// min-width: 100%; + +// @media screen and (min-width: ${breakpoints.large}) { +// min-width: 0; +// } +// ` + +export const DataListWrapper = styled.div` + flex: 1 1 0; + min-width: 100%; + + @media screen and (min-width: ${breakpoints.large}) { + margin-right: 35px; + min-width: 0; + } + + ul > li { + padding-right: 20px; + } +` + +export const CodeblockWrapper = styled.div` + flex: 1 1 0; + width: 100%; + display: none; + + @media screen and (min-width: ${breakpoints.xLarge}) { + display: block; + min-width: 0; + flex: 1 1 0; + } +` + +// export const DropdownWrapper = styled.div` +// margin-bottom: 15px; +// width: 100%; +// ` + +export const Type: any = styled.span` + padding-right: 10px; + text-transform: uppercase; +` +export const Path: any = styled.span`` + +export const SubTitle: any = styled.p`` + +export const Description: any = styled.p`` diff --git a/src/components/webhook-block/webhook-block.tsx b/src/components/webhook-block/webhook-block.tsx new file mode 100644 index 000000000..afd999d50 --- /dev/null +++ b/src/components/webhook-block/webhook-block.tsx @@ -0,0 +1,185 @@ +import React, { ReactElement, useState } from 'react' + +import { SelectDropdown, SelectOption } from 'src/components/select-dropdown' +import { SectionType } from 'src/global.types' + +// import EndpointBlockModel from './components/endpoint-block-model' +// import EndpointBlockRespsonse from './components/endpoint-block-response' +// import EndpointBlockParameters from './components/endpoint-block-parameters' +// import EndpointBlockWebhooks from './components/endpoint-block-webhooks' +import CodeSnippet from 'src/components/code-snippet' + +import * as Types from './webhook-block.types' +// import * as Styles from './endpoint-block.styles' +// import * as Helpers from './endpoint-block.helpers' +import { getAllWebhooks } from 'src/hooks/allWebhooks' + +import APIFiles from '../../../data/endpoints.json' +import kebabCase from 'lodash.kebabcase' + +// const renderDescription = (descriptionApi: any, descriptionProps: any) => ( +// <> +// +// {descriptionProps} +// +// ) + +// const getCodeBlocks = ( +// section: SectionType, +// codeblocks: Types.Codeblock[] = [], +// content: any +// ) => { +// const customCodeblocksForSection = codeblocks.filter( +// (codeblock: Types.Codeblock) => codeblock.section === section +// ) + +// if (customCodeblocksForSection.length >= 1) { +// return customCodeblocksForSection +// } + +// return Helpers.generateDefaultCodeblocks(section, content) +// } + +// const renderVersionDropdown = ( +// endpoints: any, +// setCurrentVersion: any, +// currentVersion: any +// ) => ( +// setCurrentVersion(value)} +// value={currentVersion} +// placeholder='API Version' // Avoids flash of Mandarin/Cantonese placeholder +// > +// {endpoints.map( +// (endpoint: any, index: number): React.ReactNode => { +// const { version } = endpoint +// const versionFormatted = parseInt(version, 10) +// .toString() +// .padStart(3, '\u00A0') +// const label = `API Version ${versionFormatted}` + +// return +// } +// )} +// +// ) + +// const getRelatedWebhooks = (webhooks: string[] = []) => { +// const allWebhooks: any = getAllWebhooks() + +// if (typeof allWebhooks === 'undefined') { +// return [] +// } + +// return webhooks.map(webhookTitle => { +// const { allMdx } = allWebhooks +// const { frontmatter } = Helpers.getWebhook(allMdx.edges, `/${webhookTitle}`) +// const { title } = frontmatter + +// return title +// }) +// } + +const WebhookBlock: React.FunctionComponent = ({ + title, + message, + children, + type, + endpoints, + boxProps, + description: descriptionProps +}): ReactElement => { + // const [currentVersion, setCurrentVersion] = useState(0) + // const hasCustomContent = !!children + // const currentEndpoint = endpoints[currentVersion] + + // if (!endpoints.length || typeof currentEndpoint === 'undefined') { + // return null + // } + + // const { + // path, + // codeblocks, + // version, + // webhooks + // } = currentEndpoint + + // const { + // summary, + // description: descriptionApi, + // parameters, + // requestBody, + // responses + // } = APIFiles[version].paths[path][type] + + // const apiURL = ( + // <> + // {type} + // + // {path} + // + // + // ) + + // const titleTransformed = kebabCase(title.toLowerCase()) + // const relatedWebhooks = getRelatedWebhooks(webhooks) + + // if (hasCustomContent) { + // return children(APIFiles[version].paths[path][type]) + // } + + return ( +

hello world

+ // + // + // {title} + // + // + // + // {renderVersionDropdown(endpoints, setCurrentVersion, currentVersion)} + // + // {message} + + // {summary && {summary}} + + // {renderDescription(descriptionApi, descriptionProps)} + + // + // + // + // + // + // + // + // + // + ) +} + +export default WebhookBlock diff --git a/src/components/webhook-block/webhook-block.types.ts b/src/components/webhook-block/webhook-block.types.ts new file mode 100644 index 000000000..26ca5c251 --- /dev/null +++ b/src/components/webhook-block/webhook-block.types.ts @@ -0,0 +1,31 @@ +import { ReactElement } from 'react' +import { BoxProps } from 'rebass' +import { CodeblockType } from 'src/global.types' + +export interface EndpointProps { + path: string + title: string + message?: string + type: string + dynamic?: boolean + boxProps?: BoxProps + codeblocks?: CodeblockType[] + children?: (any) => ReactElement + description?: ReactElement + endpoints?: any[] + webhooks?: string[] +} + +// export type Codeblock = CodeblockType + +// export enum SectionTypeEnum { +// REQUEST = 'request', +// RESPONSE = 'response' +// } + +// export enum BlockStatusColourEnum { +// 'Success' = '#678D4B', +// 'Bad Request' = '#F00000', +// 'Request' = '#000000', +// 'Default' = '#000000' +// } diff --git a/src/components/webhook-placeholder/webhook-placeholder.tsx b/src/components/webhook-placeholder/webhook-placeholder.tsx index a5aa0e51a..7b21f7e84 100644 --- a/src/components/webhook-placeholder/webhook-placeholder.tsx +++ b/src/components/webhook-placeholder/webhook-placeholder.tsx @@ -10,6 +10,8 @@ import * as Types from './webhook-placeholder.types' import * as Hooks from './webhook-placeholder.hooks' import * as Styles from './webhook-placeholder.styles' + + const renderTitle = (title: string) => title && {title} diff --git a/src/templates/home.tsx b/src/templates/home.tsx index d402f05e3..2cafeff72 100644 --- a/src/templates/home.tsx +++ b/src/templates/home.tsx @@ -24,25 +24,13 @@ export default Home // TODO: Use fragments for these page queries // and share them between the doc template and this homepage export const pageQuery = graphql` - query($repositoryName: String!, $repositoryOwner: String!) { + query { site { siteMetadata { title docsLocation } } - github { - repository(name: $repositoryName, owner: $repositoryOwner) { - pullRequests(first: 100, orderBy: { field: CREATED_AT, direction: DESC }) { - totalCount - nodes { - title - state - createdAt - url - } - } - } - } + } ` diff --git a/webhooks/account-closure-completed-webhook-v1.mdx b/webhooks/account-closure-completed-webhook-v1.mdx index 39c2a7149..fdc10a522 100644 --- a/webhooks/account-closure-completed-webhook-v1.mdx +++ b/webhooks/account-closure-completed-webhook-v1.mdx @@ -4,6 +4,8 @@ version: 1 webhook: true --- +import WebhookBlockPayload from '../src/components/webhook-block/components/webhook-block-payload' + This webhook confirms the account has been closed. #### Request body @@ -17,6 +19,7 @@ This webhook confirms the account has been closed. } ``` + #### Payload | Element | Description | diff --git a/webhooks/account-closure-failed-webhook-v1.mdx b/webhooks/account-closure-failed-webhook-v1.mdx index ff69f02d2..b1edb3d9a 100644 --- a/webhooks/account-closure-failed-webhook-v1.mdx +++ b/webhooks/account-closure-failed-webhook-v1.mdx @@ -4,6 +4,8 @@ version: 1 webhook: true --- +import WebhookBlockPayload from '../src/components/webhook-block/components/webhook-block-payload' + This webhook confirms the account has not been closed. #### Request body @@ -17,6 +19,7 @@ This webhook confirms the account has not been closed. } ``` + #### Payload | Element | Description | diff --git a/webhooks/account-created-webhook-v1.mdx b/webhooks/account-created-webhook-v1.mdx index 0c76ab095..7ab9a281b 100644 --- a/webhooks/account-created-webhook-v1.mdx +++ b/webhooks/account-created-webhook-v1.mdx @@ -4,6 +4,8 @@ version: 1 webhook: true --- +import WebhookBlockPayload from '../src/components/webhook-block/components/webhook-block-payload' + This webhook confirms the account has been created. #### Request body @@ -17,6 +19,7 @@ This webhook confirms the account has been created. } ``` + #### Payload | Element | Description | From 4f89fd0d3010ae24827f8d9259b5bc6287a41d02 Mon Sep 17 00:00:00 2001 From: Tom Robinson Date: Wed, 24 Jul 2024 11:06:36 +0100 Subject: [PATCH 2/2] Show patterns in code blocks --- .../webhook-block-payload/webhook-block-payload.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/components/webhook-block/components/webhook-block-payload/webhook-block-payload.tsx b/src/components/webhook-block/components/webhook-block-payload/webhook-block-payload.tsx index b6ad799eb..dfbf44546 100644 --- a/src/components/webhook-block/components/webhook-block-payload/webhook-block-payload.tsx +++ b/src/components/webhook-block/components/webhook-block-payload/webhook-block-payload.tsx @@ -145,9 +145,16 @@ const WebhookBlockPayload: React.FunctionComponent - {isComplexType - ? attributeValue.join(", ") - : attributeValue} + {attributeKey === 'Pattern' && ( + {attributeValue} + )} + + + {attributeKey === 'Pattern' + ? null + : isComplexType + ? attributeValue.join(", ") + : attributeValue} )