An API emulator for trying out the RTGS.global payment workflows.
Contracts and behaviours match the real RTGS.global API, but are entirely simulated and do not interact with any external systems. Endpoints are asynchronous in nature and results are posted back to a webhook with a CloudEvent message schema.
Production systems use EventGrid to provide result messages. If you choose to integrate using webhooks then result payloads are representative.
You'll need an API endpoint (webhook) that the emulator can invoke.
Either:
Note: you cannot use a self-signed certificate so either use HTTP or HTTPS with a trusted SSL certificate.
Retrieve the latest image using the command:
docker pull rtgsglobal/gateway-emulator
Start the container, passing the webhook urls as environment variables ParticipantWebhookUrl and CounterpartyWebhookUrl:
docker run -it -p 3001:8080/tcp -e "ParticipantWebhookUrl=[your-initiating-bank-webhook-url]" -e "CounterpartyWebhookUrl=[your-partner-bank-webhook-url]" rtgsglobal/gateway-emulator
Open the Swagger documentation / invoke the endpoints by navigating to http://localhost:3001/swagger/index.html
A valid POST request to an endpoint will cause a 202 ACCEPTED response to be returned. One or more result messages will be issued as POST requests to the configured ParticipantWebhookUrl and CounterpartyWebhookUrl.
The webhook handling the result message should respond with a 2xx status code. Non-2xx responses will be retried a further 4 times with exponential back-off, starting at 1 second.
OpenAPI/Swagger documentation including detailed request/response contracts are available at: /swagger/index.html
When using request catcher, it is recommended to create a single subdomain and use different paths for the participant and counterparty webhooks. For example;
docker run -it -p 3001:8080/tcp -e "ParticipantWebhookUrl=https://[subdomain].requestcatcher.com/participant/" -e "CounterpartyWebhookUrl=https://[subdomain].requestcatcher.com/counterparty/" rtgsglobal/gateway-emulator
To emulate a defund workflow, include defund in the EndToEndId field of the request.
To emulate a fund workflow, include fund in the EndToEndId field of the request.
Funds performs synchronous validation checks on the shape of the incoming message. Failure of any initial validation checks will cause a 400 BAD REQUEST response to be returned containing details of the failure:
{
"FICdtTrf.CdtTrfTxInf[0]": [
"'FICdtTrf.CdtTrfTxInf[0]' is missing child properties."
],
"FICdtTrf.CdtTrfTxInf[0].IntrBkSttlmAmt": [
"'IntrBkSttlmAmt' must not be empty."
]
}
Assuming that initial validation has succeeded, subsequent status updates will be provided via the webhook mechanism described above.
The main response code is returned by the TransactionStatus field. It indicates high level status of the operation:
More detailed information on possible responses can be found in the table below:
| TransactionStatus | ISO Code | Testing Code | Proprietary | Additional Information | Used in Funds when |
|---|---|---|---|---|---|
| PDNG | Pending | Pending | Request acknowledged, request pending further checks. | ||
| ACSP | SettlementInProgress | Request sent to scheme or account provider | Request has been successfully validated and transaction is in progress. | ||
| ACSC | AcceptedSettlementCompleted | Accepted settlement completed debitor account | Instructing participant debited and instructed participant credited, and payment instruction sent to instructed participant. | ||
| RJCT | AC02 | AC02 | InvalidDebtorAccountNumber | The network account (debtor account) is not owned by the participant. | |
| RJCT | AC03 | AC03 | InvalidCreditorAccountNumber | The network account (creditor account) is not owned by the participant. | |
| RJCT | AC10 | AC10 | InvalidDebtorAccountCurrency | Invalid Creditor Identification Code. | |
| RJCT | AM01 | AM01 | Specified message amount is equal to zero. | ||
| RJCT | AM04 | AM04 | Insufficient Funds | Amount of funds available to cover specified message amount is insufficient. | |
| RJCT | BE17 | BE17 | Settlement failed | An error occurred when attempting to settle the transaction. | |
| RJCT | ED05 | ED05 | The currency of the debtor account is not enabled for the debit currency. | ||
| RJCT | RF01 | RF01 | Not Unique E2E TransactionReference (UETR) | The UETR of the request is not unique. | |
| RJCT | ZZ01 | ValidationFailed | The FinancialInstitutionCreditTransfer request was invalid. | ||
| RJCT | ZZ02 | SignatureInvalid | Request signature validation failed. |
Payaway performs synchronous validation checks on the shape of the incoming message. Failure of any initial validation checks will cause a 400 BAD REQUEST response to be returned containing details of the failure:
{
"FIToFICstmrCdtTrf.CdtTrfTxInf[0]": [
"'FIToFICstmrCdtTrf.CdtTrfTxInf[0]' is missing child properties."
],
"FIToFICstmrCdtTrf.CdtTrfTxInf[0].CdtrAgt.FinInstnId": [
"'BICFI' or 'LEI' must be provided."
],
"FIToFICstmrCdtTrf.CdtTrfTxInf[0].IntrBkSttlmAmt": [
"'IntrBkSttlmAmt' must not be empty."
]
}
Assuming that initial validation has succeeded, subsequent status updates will be provided via the webhook mechanism described above.
The main response code is returned by the TransactionStatus field. It indicates high level status of the operation:
More detailed information on possible responses can be found in the table below:
| TransactionStatus | ISO Code | Proprietary | Additional Information | Used in Payaway when |
|---|---|---|---|---|
| PDNG | Pending | Pending | Request acknowledged, request pending further checks. | |
| ACSC | NetworkTransferComplete | Network accounts settlement complete | Instructing participant debited and instructed participant credited, and payment instruction sent to instructed participant. | |
| ACCC | BeneficiaryCredited | Beneficiary account credited | Instructed participant has confirmed that payment is complete. | |
| RJCT | InstructingAgentAccountUnavailable | Instructing Agent account not available | The instructing agent's account is not Active. | |
| RJCT | InstructedAgentAccountUnavailable | Instructed Agent account not available | The instructed agent's account is not Active. | |
| RJCT | AM04 | Insufficient Funds | Amount of funds available to cover specified message amount is insufficient. | |
| RJCT | RF01 | Not Unique E2E TransactionReference (UETR) | The UETR of the request is not unique. | |
| RJCT | InvalidInstructingRTGS.globalID | Invalid Instructing RTGS.global ID | The instructing RTGS.global ID cannot be matched to a participant. | |
| RJCT | InvalidInstructedRTGS.globalID | Invalid Instructed RTGS.global ID | The instructed RTGS.global ID cannot be matched to a participant. | |
| RJCT | InstructingDoesNotOwnRTGS.globalID | RTGS.global ID of Instructing Agent not associated with Participant | The instructing RTGS.global ID provided is not owned by the calling participant. | |
| RJCT | InstructedParticipantUnavailable | Instructed participant not available | The instructed participant is not Online. | |
| RJCT | InstructingParticipantUnavailable | Instructing participant not available | The instructing participant is not Online. | |
| RJCT | InstructingBICRTGS.globalIDMismatch | BIC not associated with Instructing Agent RTGS.global ID | Instructing participant's BIC does not match the provided value. | |
| RJCT | InstructedBICRTGS.globalIDMismatch | BIC not associated with Instructed Agent RTGS.global ID | Instructed participant's BIC does not match the provided value. | |
| RJCT | InstructingLEIRTGS.globalIDMismatch | LEI not associated with Instructing Agent RTGS.global ID | Instructing participant's LEI does not match the provided value. | |
| RJCT | InstructedLEIRTGS.globalIDMismatch | LEI not associated with Instructed Agent RTGS.global ID | Instructed participant's LEI does not match the provided value. | |
| RJCT | CounterpartyVerificationFailed | Verification failed at Instructed gateway | The message could not be verified by the Counterparty. | |
| RJCT | InvalidInstructedCurrency | Currency cannot be processed by Instructed Agent | Mismatch between the specified currency and either the currency of the Creditor Agent Account or Debtor Agent Account . | |
| RJCT | ActiveRelationshipRequired | Active relationship required between Instructing and Instructed Agent | No active relationship exists where the instructing participant is the requestor and the instructed participant is the approver. |
The high level LinkAndSettle request status is returned in the TransactionStatus field, the possible values are:
The following table identifies all the different transaction statuses and related status reasons returned on notifications:
| Used when | TransactionStatus | Code | Proprietary | ISO Code Name |
| Request completed - All debits / credits are settled to accounts | ACCC | LinkSettled | ||
| Link is created (2 requests are linked by Link Identifiers and Counterparties) | ACSP | LinkCreated | ||
| Request received and awaiting counterparty request | PDNG | LinkPending | ||
| Requires counterparty to send a request with the same Link Identifiers | PDNG | LinkRequest | ||
| Requires the participant to fund their own account | ACWP | OwnInsufficientFunds | ||
| Requires the counterparty to fund their account | ACWP | CounterpartyInsufficientFunds | ||
| Link request verification failed | RJCT | VerificationFailed | ||
| Link Identifiers have already been used in a request which is pending | RJCT | DU03 | DuplicateTransaction | |
| UETR has already been used by the participant | RJCT | RF01 | NotUniqueTransactionReference | |
| The network account (debtor account) is not owned by the participant | RJCT | AC02 | InvalidDebtorAccountNumber | |
| The network account (creditor account) is not owned by the participant | RJCT | AC03 | InvalidCreditorAccountNumber | |
| The currency of the debtor account is not enabled for the debit currency | RJCT | AC10 | InvalidDebtorAccountCurrency | |
| The currency of the creditor account is not enabled for the credit currency | RJCT | AC11 | InvalidCreditorAccountCurrency | |
| Counterparty in request cannot be found | RJCT | CounterpartyNotFound | ||
| Counterparty is invalid | RJCT | CounterpartyInvalid | ||
| Counterparty in request matches the participant | RJCT | OwnIdentifierInCounterpartyField | ||
| The credit / debit amounts specified by each participant do not match within the tolerance | ACWP | AM09 | WrongAmount | |
| Currencies in requests do not match | ACWP | CurrencyMismatch | ||
| Initiating party cancels a link | CANC | CancelledAsPerRequest | ||
| Counterparty cancels a link where no corresponding request has been sent | CANC | CounterpartyRequestCancelled | ||
| Counterparty cancels a link where a corresponding request has been sent but could not settle | PDNG | CounterpartyRequestCancelled | ||
| Cancel request verification failed | RJCT | VerificationFailed | ||
| Cancel request UETR or linkidentifiers not found | RJCT | LinkIdentifierOrUetrNotFound | ||
| When cancels a link that has been already settled | RJCT | LinkAlreadySettled |
To test out different error scenarios you can pass specific values as inputs in the request. The webhooks will be called with appropriate payloads.
There is 1 endpoint, v1/funds/move, for the move funds workflow.
Include any of Testing Code values from the Funds possible responses table above in the EndToEndId field of the request to trigger the corresponding error scenario.
There is 1 endpoint, v1/payaway, for the Payaway workflow.
Include any of StatusReason6Choice/Code values from the Payaway possible responses table above in the EndToEndId field of the request to trigger the corresponding error scenario.
The endpoint, v1/linkandsettle/link, is for the LinkAndSettle workflow.
Include any of StatusReason6Choice/Code values from the LinkAndSettle possible responses table on MsgId of the request to trigger the corresponding error scenario. In order to trigger error scenarios with proprietary reason, use any of the following values on MsgId:
The endpoint v1/linkandsettle/cancel is for the LinkAndSettle cancel workflow.
When cancelling a link with no corresponding link from a counterparty:
CANC status and CancelledAsPerRequest reason.CANC status and CounterpartyRequestCancelled reason.When cancelling a link where a corresponding request was sent from counterparty:
CANC status and CancelledAsPerRequest reason.PDNG status and CounterpartyRequestCancelled reason.Note: Debit and credit amounts and currencies are hard coded with dummy data for notifications sent as a part of cancel workflow.
To trigger cancelling a link where a corresponding request was sent from counterparty but failed to settle, include any of the following as the Identification field in the body of the message.
Debit and credit amounts and currencies will be hardcoded in the status update
To trigger the corresponding error scenario for the cancel endpoint, include any of the following as the Identification field in the body of the message.
The endpoint, 'v1/credit/transfer', is for the FICreditTransfer workflow.
At the moment, it just implements validation and will return either 202 if the post request is valid, or 400 if the request is invalid.
Four POST endpoints exist for requesting and receiving FX quotes:
plus there is an additional GET endpoint for retrieving supported currency pairs:
Terminology used:
Expected message flow and sequence:
The initiating participant issues a quote request identifying desired counterparty participants.
The counterparties field will accept any RTGS.global id, except RTGS:B:12345BAD. Including RTGS:B:12345BAD will trigger an invalid RTGS.global id validation error.
The symbol specified in the quote request must match one of the currency pairs returned by the '/v1/quote/currency-pairs' endpoint, otherwise a validation error will be returned.
Some or all counterparty participants respond to the quote request with their quote.
The initiating participant examines the set of received quotes and calls the New Order (single) endpoint with the details of the quote that suits them best.
The counterparty participant who received the New Order (single) event responds with the Execution report to signify whether the order is confirmed and can be settled, or cancelled and will not go ahead.
For end to end processing, please use the same identifier across your quote, order and settlement messages. Where you are the quote requester, QuoteReqId > ClOrdId > LinkId, and where you are the responder, QuoteId > OrderId > LinkId
More detailed endpoint documentation can be found here: https://rtgs-global.gitbook.io/participant-and-central-bank-guide/participant-guide/api-and-documentation/api-documentation
If you need any support getting up and running please contact the RTGS.global team.
Content type
Image
Digest
sha256:6647a2901…
Size
95.8 MB
Last updated
1 day ago
docker pull rtgsglobal/gateway-emulator