On this page
Trade Finance - Seller Loans
- Version: v1
- Protocol: HTTPS
- URL Pre-Prod Test (UAT): Please speak to your Client Integration contact
- URL Production: Please speak to your Client Integration contact
On this page
Description
In this document, you'll find the steps your organization needs to take to use our API services. Also in this guide are details of request and response messages used to support your organization’s integration.
The intended audience for this document are Technical Architects, Development Engineers, Test Engineers, and Operation & Maintenance Engineers involved in development and support of your organization’s integration.
Setting up our API Services is best completed with the assistance of your organization’s IT team, or someone with experience and knowledge of application programming interfaces. This should include experience with - JSON payloads and security and public key infrastructure (PKI).
Quick Start Guide:
Click on the Left Menu to explore the following topics:
| Topics | This page will help you to: | References |
|---|---|---|
| API Specification |
|
|
| Securing a Connection |
|
|
| Making an API Request |
|
|
| Response Codes and Formats |
|
|
| Sandbox Access |
|
Version History
Change log and release history:
| Version | Release Date | Status | Description |
|---|---|---|---|
| v1 | December 2021 | To be deprecate | Seller Loans - First Release |
Sandbox Access
This page will help you to:
- Understand various types of Sandbox Response
- Making an API Request via Mock Sandbox
- Making an API Request via Smart Sandbox
- Test Scenarios
Sandbox Response
We support two types of response in the Trade Finance - Seller Loans Sandbox:
Mock Sandbox:
Returns a static mock response to the requested endpoint. These endpoints can be used for rapid testing whilst you are preparing your encryption module to use with the smart sandbox.
- Mock Sandbox requires only Plain JSON of the request and response payload.
- There are three response scenario that can be triggered by various value input in
requestIdheader.SUCCESS: To trigger a success scenario from the mock response.BAD_REQUEST: To trigger a bad request payload scenario from the mock response.INTERNAL_ERROR: To trigger an internal server error scenario from the mock response.
- PGP keys are not required.
Mock Sandbox URL: https://sandbox.corporate-api.hsbc.com/mock/twc/v1
Using Mock Sandbox:
Refer to Making a Mock Sandbox Request for step-by-step guidance on sending Mock Sandbox Request via command line, Open API Specification and Postman.
Smart Sandbox:
This is a full testing environment. It returns a validated response from the database based on the request body content.
- Smart Sandbox maintains the state of the data, i.e. new invoices inputs, etc.
- It requires message signing, encryption and Base64 encoding of the request and response payload.
- It uses the Client Credentials, Profile ID and Encryption keys provided in your Sandbox Project.
- The password for the client private key is available in client-pgp-keys.info file in your downloaded encryption keys zip file.
Smart Sandbox URL: https://sandbox.corporate-api.hsbc.com/twc/v1
Using Smart Sandbox:
Refer to Making a Smart Sandbox Request for step-by-step guidance on sending Sandbox Sandbox Request via Postman.
Smart Sandbox Test Scenarios
The following testing scenarios are available with the Trade Finance - Seller Loans Smart Sandbox:
- Submit Seller loan application to HSBC sandbox via
Submit Seller loan application API. - Extend Seller Loan Duration via
Submit Seller loan extension request API. - Enquire status of Seller Loans via
Request Trade Loan summary list API. - Settle Seller Loan via
Submit Seller loan settlement request API. - Enquire status of a specific Seller Loan via
Request Trade Loan detail API.
Pre-Requisites:
- You have created sandbox access for
Trade Finance - Seller Loansvia Dev Hub Project and retrievedHSBC Profile IDandcredentials. - You have setup your postman and client. Refer to Making a Smart Sandbox Request for details.
Scenario 1 - Submitting Seller Loan application to HSBC
You as a/ on-behalf of your customer PLT-CUSTID-001 (who is a seller), send loan application to HSBC via Submit Seller Loan Application API.
- Pre-Requisites
-
- Seller possess valid transaction account in HSBC.
- For Smart Sandbox testing, you may define your own transaction account number, e.g.
"tradeAccountNumber": "SGHSBC12345678912".
- For Smart Sandbox testing, you may define your own transaction account number, e.g.
- (Optional) Supporting documents have been submitted successfully via
Submit Supporting Documents API.
- Seller possess valid transaction account in HSBC.
- Preparing Unencrypted Request Body
-
Prepares the
Unencrypted RequestBody as per Example from POST Seller-loans/standard/Request body/Examples/Unencrypted Request.- API Authorisation:
HSBC authorises API requests by
extnlCustomerIdandtradeAccountNumbervalue pair.extnlCustomerId:- If you are a partner of HSBC making API requests on-behalf of your platform's customers, specify the unique logon id of your customer on your platform, e.g.
"extnlCustomerId":"PLT-CUSTID-001". (per agreed with HSBC during on-boarding) - If you are a direct client of HSBC, specify the API Profile ID assigned to you during on-boarding, e.g.
"extnlCustomerId":"Kdet5h221BWKOD5umjrg1fOH4j8iXdS" // HSBC Profile ID
- If you are a partner of HSBC making API requests on-behalf of your platform's customers, specify the unique logon id of your customer on your platform, e.g.
tradeAccountNumber:- Specify the applicant's HSBC current account number. e.g.
"tradeAccountNumber":"SGHSBC123456789123".
- Specify the applicant's HSBC current account number. e.g.
{ ... "extnlCustomerId": "PLT-CUSTID-001", "tradeAccountNumber": "SGHSBC123456789123", ... }The above value pair are also required for authorisations of other
linked operations. - Loan Details:
Specify terms, preference, amount, duration and related accounts like below example:
- Valued
SGD 1000.00, effective from2023-04-01. - Expected to be repaid in
SGDwithin30days from now, i.e.2023-04-30.
{ ... "loanNumber": "", "typeOfGoods": "GOODS", "goodsShipped": "Y", "loanStartDate": "2023-04-01", "tenor": "30", "loanMaturityDate": "2023-04-30", "paymentCurrency": "SGD", "paymentAmount": "1000.00", "loanCurrency": "SGD", "loanAmount": "1000.00", "loanRepaymentAccount": "", "interestRepaymentAccount": "SGHSBC123456789123", "chargesRepaymentAccount": "SGHSBC123456789123", "goodsDescription": "T-shirt", ... } - Valued
- Involved Parties:
Specify associated buyer(s) for this loan.
{ ... "buyerDetails": [ { "buyerName": "BUY-SG001 Holdings Plc.", "buyerCountry": "SG", "buyerAddressLine1": "BUY-SG001 Tower #01-01", "buyerAddressLine2": "1 BUY-SG001 Street", "buyerAddressLine3": "SINGAPORE 12345" } ], ... }It is possible to include multiple buyers.
{ ... "buyerDetails": [ { "buyerName": "BUY-SG001 Holdings Plc.", "buyerCountry": "SG", "buyerAddressLine1": "BUY-SG001 Tower #01-01", "buyerAddressLine2": "1 BUY-SG001 Street", "buyerAddressLine3": "SINGAPORE 12345" }, { "buyerName": "BUY-SG002 Holdings Plc.", "buyerCountry": "SG", "buyerAddressLine1": "BUY-SG001 Tower #01-01", "buyerAddressLine2": "1 BUY-SG002 Street", "buyerAddressLine3": "SINGAPORE 12345" } ], ... } - Payment Details:
Specify beneficiary's information.
{ ... "paymentDetails": { "beneficiaryName": "BEN-SG001 Holdings Plc.", "beneficiaryCountry": "SG", "beneficiaryAddressLine1": "BEN-SG001 Tower #01-01", "beneficiaryAddressLine2": "1 BEN-SG001 Street", "beneficiaryAddressLine3": "SINGAPORE 12345", "beneficiaryBankAccount": "AC-BEN-SG001", "beneficiaryBankName": "BANK-SG001 Holdings Plc.", "beneficiaryBankSwiftBicBranchCode": "HSBCSGS2001", "beneficiaryBankBranchName": "BRANCH001", "beneficiaryBankCountry": "SG", "beneficiaryBankAddressLine1": "BANK-SG001 Tower #01-01", "beneficiaryBankAddressLine2": "1 BANK-SG001 Street", "beneficiaryBankAddressLine3": "SINGAPORE 12345" }, ... } - Supporting Documents:
Specify supporting documents submitted prior to loan application if any.
{ ... "supportingDocuments": [ { "docId": "idd_500E9B7F-0000-C23C-AEAB-1B037067FE09", "docName": "HSBC-gif.GIF", "docCategory": "APP" } ], ... } - Instructions to bank::
Optionally you may specify any special instructions to Bank.
{ ... "instructionsToBank": "Input instructions here if any", ... } - Additional Information:
Optionally you may specify additional information needed. Please note these information needs to be specified as
JSON String.{ ... "miscStates": "{\"additionalInfo\":\"something\"}" } - Full Example:
{ "extnlCustomerId": "PLT-CUSTID-001", "tradeAccountNumber": "SGHSBC123456789123", "customerReference": "", "loanNumber": "", "typeOfGoods": "GOODS", "goodsShipped": "Y", "loanStartDate": "2023-04-01", "tenor": "30", "loanMaturityDate": "2023-04-30", "paymentCurrency": "SGD", "paymentAmount": "1000.00", "loanCurrency": "SGD", "loanAmount": "1000", "loanRepaymentAccount": "SGHSBC123456789123", "interestRepaymentAccount": "SGHSBC123456789123", "chargesRepaymentAccount": "SGHSBC123456789123", "goodsDescription": "T-shirt", "buyerDetails": [ { "buyerName": "BUY-SG001 Holdings Plc.", "buyerCountry": "SG", "buyerAddressLine1": "BUY-SG001 Tower #01-01", "buyerAddressLine2": "BUY-SG001 Street", "buyerAddressLine3": "SINGAPORE 12345" } ], "paymentDetails": { "beneficiaryName": "BEN-SG001 Holdings Plc.", "beneficiaryCountry": "SG", "beneficiaryAddressLine1": "BEN-SG001 Tower #01-01", "beneficiaryAddressLine2": "1 BEN-SSG001 Street", "beneficiaryAddressLine3": "SINGAPORE 12345", "beneficiaryBankAccount": "AC-BEN-SG001", "beneficiaryBankName": "BANK-SG001 Holdings Plc.", "beneficiaryBankSwiftBicBranchCode": "HSBCHKH2001", "beneficiaryBankBranchName": "BRANCH001", "beneficiaryBankCountry": "SG", "beneficiaryBankAddressLine1": "BANK-SG001 Tower #01-01", "beneficiaryBankAddressLine2": "BANK-SG001 Street", "beneficiaryBankAddressLine3": "SINGAPORE 12345" }, "supportingDocuments": [ { "docId": "idd_10349C86-0000-C515-AB9B-65B893B9744B", "docName": "test.tif", "docCategory": "APP" } ], "instructionsToBank": "message for your bank", "miscStates": "{\"additionalInfo\":\"something\"}" }
Tips: If you are using Sample Java Client provided, copy the above unencrypted request under
src/main/resources/stl/SubmitSellerLoanApplication.json - API Authorisation:
- Generating API Request
-
Encrypts the above request and base64 encodes it as per Making an API Request.
- Example of encrypted request body and JSON Web Token:
- Encrypted Request:
LS0tLS1CRUdJTiBQR1AgTUVTU0FHRS0tLS0tC... - JSON Web Token:
JWS eyJ2ZXIiOiIxLjAiLCJraWQiOiIy...
- Encrypted Request:
- Send API Request
- Send the request directly via Sample Java Client, run
SubmitSellerLoanApplicationRequest.javaundersrc/main/java/com.runner/stl - Send the request via Postman:
- Generate your encrypted request and JSON Web Token via
ClientSideTokenEncryption.javaundersrc/main/java/com.runner/ - Put the encrypted request string in under Body in Postman
LS0tLS1CRUdJTiBQR1AgTUVTU0FHRS0tLS0tC... - Specify Header. The JSON Web Token generated should be placed under
Authorisation.Authorization:JWS eyJ2ZXIiOiIxLjAiLCJraWQiOiIy... requestTime:2023-04-01 00:00:00 requestId:92aef07bdc4243e99afa9dc2af02c1cf Content-Type:application/json countryCode: SG schemaVersion:1.0 - Click Send next to the endpoint URL.
- Generate your encrypted request and JSON Web Token via
- Send the request directly via Sample Java Client, run
- Example of encrypted request body and JSON Web Token:
- Processing API Response
-
Upon a successful request, encrypted response in
base64 stringshall be received- Example of encrypted response:
- Encrypted Request:
LS0tLS1CRUdJTiBQR1AgTUVTU0FHRS0tLS0tC... - Decodes and decrypts the response as per Processing a response or via Sample Java Client.
- Encrypted Request:
- Upon successful decryption, you shall be able to obtain the
Unencrypted responseinJSONstructure, as per POST seller-loans/standard/Responses/200/Examples/Unencrypted Response - Success.{ "code": "EMKT200", "message": "Success", "repliedTime": "2023-04-01 00:00:43", "correlationId": "92aef07bdc4243e99afa9dc2af02c1cf", "responseData": { "customerReference": "CRSG23040101", "applicationId": "20230401SG02", "loanNumber": "LNSG23040102", "status": "Submitted" }, "errorDetails": null } - Congratulations! A loan application request is submitted successfully.
loanNumber=LNSG23030101applicationId=20230401SG02status=Submitted.- You may further process/ enquire this loan via following
linked operations.- Request extension of loan via Submit Loan Extension Request
- Request settlement of loan via Submit Loan Extension Request
- Enquire status of this and other loans via Request Trade Loan Summary List
- Enquire details of this loan via Request Trade Loan Detail
- Example of encrypted response:
Next, let's try enquiring detail of this loan LNSG23040102 via Request Trade Loan Detail .
Scenario 2 - Enquiring detail of a specific loans submitted from HSBC
You as a/ on-behalf of your customer PLT-CUSTID-001, request for details of an already submitted loan LNSG23040102.
- Pre-Requisites
-
- Seller possess valid transaction account in HSBC.
- For Smart Sandbox testing, you may define your own transaction account number, e.g.
"tradeAccountNumber": "SGHSBC12345678912".
- For Smart Sandbox testing, you may define your own transaction account number, e.g.
- Retrieved
loanNumberfrom loan application submission via:
- Seller possess valid transaction account in HSBC.
- Preparing Unencrypted Request Body
-
Prepares the
Unencrypted RequestBody as per Example from POST Seller-loans/standard/Request body/Examples/Unencrypted Request.- API Authorisation:
HSBC authorises API requests by
extnlCustomerIdandtradeAccountNumbervalue pair.extnlCustomerId:- If you are a partner of HSBC making API requests on-behalf of your platform's customers, specify the unique logon id of your customer on your platform, e.g.
"extnlCustomerId":"PLT-CUSTID-001". (per agreed with HSBC during on-boarding) - If you are a direct client of HSBC, specify the API Profile ID assigned to you during on-boarding, e.g.
"extnlCustomerId":"Kdet5h221BWKOD5umjrg1fOH4j8iXdS" // HSBC Profile ID
- If you are a partner of HSBC making API requests on-behalf of your platform's customers, specify the unique logon id of your customer on your platform, e.g.
tradeAccountNumber:- Specify the applicant's HSBC current account number. e.g.
"tradeAccountNumber":"SGHSBC123456789123".
- Specify the applicant's HSBC current account number. e.g.
loanNumber/applicationId:- Specify either
loanNumberorapplicationIdfor the specific loan you would like to enquire. e.g."loanNumber": "LNSG23040102"/"applicationId": "20230401SG02".
- Specify either
{ "extnlCustomerId": "PLT-CUSTID-001", "tradeAccountNumber": "SGHSBC123456789123", "applicationId": "" "loanNumber": "LNSG23040102" }
Tips: If you are using Sample Java Client provided, copy the above unencrypted request under
src/main/resources/stl/GetTradeLoanSummaryDetailRequest.json - API Authorisation:
- Generating API Request
-
Encrypts the above request and base64 encodes it as per Making an API Request.
- Example of encrypted request body and JSON Web Token:
- Encrypted Request:
LS0tLS1CRUdJTiBQR1AgTUVTU0FHRS0tLS0tC... - JSON Web Token:
JWS eyJ2ZXIiOiIxLjAiLCJraWQiOiIy...
- Encrypted Request:
- Send API Request
- Send the request directly via Sample Java Client, run
GetTradeLoanDetailRequest.javaundersrc/main/java/com.runner/stl - Send the request via Postman:
- Generate your encrypted request and JSON Web Token via
ClientSideTokenEncryption.javaundersrc/main/java/com.runner/ - Put the encrypted request string in under Body in Postman
LS0tLS1CRUdJTiBQR1AgTUVTU0FHRS0tLS0tC... - Specify Header. The JSON Web Token generated should be placed under
Authorisation.Authorization:JWS eyJ2ZXIiOiIxLjAiLCJraWQiOiIy... requestTime:2023-04-01 00:00:00 requestId:92aef07bdc4243e99afa9dc2af02c1cf Content-Type:application/json countryCode: SG schemaVersion:1.0 - Click Send next to the endpoint URL.
- Generate your encrypted request and JSON Web Token via
- Send the request directly via Sample Java Client, run
- Example of encrypted request body and JSON Web Token:
- Processing API Response
-
Upon a successful request, encrypted response in
base64 stringshall be received- Example of encrypted response:
- Encrypted Request:
LS0tLS1CRUdJTiBQR1AgTUVTU0FHRS0tLS0tC... - Decodes and decrypts the response as per Processing a response or via Sample Java Client.
- Encrypted Request:
- Upon successful decryption, you shall be able to obtain the
Unencrypted responseinJSONstructure, as per POST seller-loans/standard/Responses/200/Examples/Unencrypted Response - Success.{ "code": "EMKT200", "message": "Success", "repliedTime": "2023-04-01 00:00:43", "correlationId": "efbf054e8f9c477493bfb3d2a19781b2", "responseData": { "tradeAccountNumber": "SGHSBC123456789123", "customerReference": "", "loanNumber": "LNSG23040102", "productType": "Seller loan", "typeOfGoods": "GOODS", "loanStartDate": "2023-04-01", "tenor": "30", "loanMaturityDate": "2023-04-30", "paymentCurrency": "SGD", "paymentAmount": "1000.00", "loanAmountInPaymentCurrency": "1000.00", "loanCurrency": "SGD", "status": "Settled", "outstandingCurrency": "SGD", "outstandingAmount": "0.00", "loanAmountOutstanding": "0.00", "totalInterestPaid": "SGD 0.00", "interestOutstanding": "1000.00", "fixedOrVariableRateLoan": "Fixed", "currentInterestRate": "0%", "interestCalculationPreference": "S", "interestCollectionFrequency": "S", "loanRepaymentAccount": "SGHSBC123456789123", "interestRepaymentAccount": "SGHSBC123456789123", "chargesRepaymentAccount": "SGHSBC123456789123", "beneficiaryDetail": [ { "paymentMethod": "local payment", "amountCurrency": "", "amount": "", "beneficiaryName": "", "beneficiaryReferenceNumber": "", "beneficiaryCountry": "", "beneficiaryAddressLine1": "", "beneficiaryAddressLine2": "", "beneficiaryAddressLine3": "", "beneficiaryBankAccount": "AC-BEN-SG001", "beneficiaryBankName": "BANK-SG001 Holdings Plc.", "beneficiaryBankSwiftBicBranchCode": "HSBCSGS2001", "beneficiaryBankBranchName": "BRANCH001", "beneficiaryBankCountry": "SG", "beneficiaryBankAddressLine1": "BANK-SG001 Tower #01-01", "beneficiaryBankAddressLine2": "1 BANK-SG001 Street", "beneficiaryBankAddressLine3": "SINGAPORE 12345" } ], , "dateRecorded": "2023-04-01", "creationDateAndTime": "2023-04-01 00:00:43" }, "errorDetails": null } - Records matches filtering criteria in the request shall be listed. (Up to specified
pageSize) You may enquire summary of loans submitted via followinglinked operations.- Enquire summary list of this and other loan(s) via Request Trade Loan Summary List
- Example of encrypted response:
Next, let's try submitting extension request for this loan LNSG23040102 via Submit Seller Loan Extension Request .
Scenario 3 - Extending duration of loan submitted to HSBC
You as a/ on-behalf of your customer PLT-CUSTID-001, request for an extension of for loan LNSG23040102's duration from 30 days to 60 days. Hence, the new due date, i.e. loanExtensionMaturityDate to be changed from 2023-04-15 to 2023-05-14.
- Pre-Requisites
-
- Seller possess valid transaction account in HSBC.
- For Smart Sandbox testing, you may define your own transaction account number, e.g.
"tradeAccountNumber": "SGHSBC12345678912".
- For Smart Sandbox testing, you may define your own transaction account number, e.g.
- Retrieved corresponding
loanNumbervia:Submit Seller Loan Application Request APIduring application.Request Trade Loan Summary APIif you have saved correspondingloanNumberduring application.
statusof corresponding loan isDisbursed.- Corresponding
loanMaturityDateis larger or equal to current date.
- Seller possess valid transaction account in HSBC.
- Preparing Unencrypted Request Body
-
Prepares the
Unencrypted RequestBody as per Example from POST Seller-loans/standard/Request body/Examples/Unencrypted Request.- API Authorisation:
HSBC authorises API requests by
extnlCustomerIdandtradeAccountNumbervalue pair.extnlCustomerId:- If you are a partner of HSBC making API requests on-behalf of your platform's customers, specify the unique logon id of your customer on your platform, e.g.
"extnlCustomerId":"PLT-CUSTID-001". (per agreed with HSBC during on-boarding) - If you are a direct client of HSBC, specify the API Profile ID assigned to you during on-boarding, e.g.
"extnlCustomerId":"Kdet5h221BWKOD5umjrg1fOH4j8iXdS" // HSBC Profile ID
- If you are a partner of HSBC making API requests on-behalf of your platform's customers, specify the unique logon id of your customer on your platform, e.g.
tradeAccountNumber:- Specify the applicant's HSBC current account number. e.g.
"tradeAccountNumber":"SGHSBC123456789123".
- Specify the applicant's HSBC current account number. e.g.
loanNumber:- Specify the loan number for the specific loan you would like to extend. e.g.
"loanNumber": "LNSG23040102".
- Specify the loan number for the specific loan you would like to extend. e.g.
{ ... "extnlCustomerId": "PLT-CUSTID-001", "tradeAccountNumber": "SGHSBC123456789123", "loanNumber": "LNSG23040102", ... } - Extension Duration:
Specify the to-be duration and reason for loan extension. For example:
- Seller would like to extend the duration from
30days to60days. Hence, set"loanExtensionTenor": "60". - Optionally, specify the to-be maturity date, i.e.
"loanExtensionMaturityDate": "2023-05-29".
{ ... "loanExtensionTenor": "60", "loanExtensionMaturityDate": "", "reasonForLoanExtension": "extend loan date", "instructionsToBank": "message for your bank", ... } - Seller would like to extend the duration from
- Additional Information:
Optionally you may specify additional information needed. Please note these information needs to be specified as
JSON String.{ ... "miscStates": "{\"additionalInfo\":\"something\"}" } - Full Example:
{ "extnlCustomerId": "PLT-CUSTID-001", "tradeAccountNumber": "SGHSBC123456789123", "loanNumber": "LNSG23040102", "loanExtensionTenor": "60", "loanExtensionMaturityDate": "", "reasonForLoanExtension": "extend loan date", "instructionsToBank": "message for your bank", "miscStates": "" }
Tips: If you are using Sample Java Client provided, copy the above unencrypted request under
src/main/resources/stl/SubmitSellerLoanExtensionRequest.json - API Authorisation:
- Generating API Request
-
Encrypts the above request and base64 encodes it as per Making an API Request.
- Example of encrypted request body and JSON Web Token:
- Encrypted Request:
LS0tLS1CRUdJTiBQR1AgTUVTU0FHRS0tLS0tC... - JSON Web Token:
JWS eyJ2ZXIiOiIxLjAiLCJraWQiOiIy...
- Encrypted Request:
- Send API Request
- Send the request directly via Sample Java Client, run
SubmitSellerLoanExtensionRequest.javaundersrc/main/java/com.runner/stl - Send the request via Postman:
- Generate your encrypted request and JSON Web Token via
ClientSideTokenEncryption.javaundersrc/main/java/com.runner/ - Put the encrypted request string in under Body in Postman
LS0tLS1CRUdJTiBQR1AgTUVTU0FHRS0tLS0tC... - Specify Header. The JSON Web Token generated should be placed under
Authorisation.Authorization:JWS eyJ2ZXIiOiIxLjAiLCJraWQiOiIy... requestTime:2023-04-01 00:00:00 requestId:92aef07bdc4243e99afa9dc2af02c1cf Content-Type:application/json countryCode: SG schemaVersion:1.0 - Click Send next to the endpoint URL.
- Generate your encrypted request and JSON Web Token via
- Send the request directly via Sample Java Client, run
- Example of encrypted request body and JSON Web Token:
- Processing API Response
-
Upon a successful request, encrypted response in
base64 stringshall be received- Example of encrypted response:
- Encrypted Request:
LS0tLS1CRUdJTiBQR1AgTUVTU0FHRS0tLS0tC... - Decodes and decrypts the response as per Processing a response or via Sample Java Client.
- Encrypted Request:
- Upon successful decryption, you shall be able to obtain the
Unencrypted responseinJSONstructure, as per POST seller-loans/standard/Responses/200/Examples/Unencrypted Response - Success.{ "code": "EMKT200", "message": "Success", "repliedTime": "2023-04-01 00:00:43", "correlationId": "92aef07bdc4243e99afa9dc2af02c1cf", "responseData": { "applicationId": "46338647WB6W", "loanNumber": "LNSG23040102", "status": "Extension Submitted" }, "errorDetails": null } - Upon a loan extension request is submitted successfully,
statuswill be changed toExtension Submittedfor the corresponding loan. You may further process/ enquire this loan via followinglinked operations.- Request extension of loan via Submit Loan Extension Request
- Request settlement of loan via Submit Loan Extension Request
- Enquire status of this and other loans via Request Trade Loan Summary List
- Enquire details of this loan via Request Trade Loan Detail
- Example of encrypted response:
Next, let's try submitting settlement request for this loan LNSG23040102 via Submit Seller Loan Settlement Request.
Scenario 4 - Settling loan submitted to HSBC
You as a/ on-behalf of your customer PLT-CUSTID-001, request for settlement of loan LNSG23040102 valued SGD 1000.00 on 2023-05-29.
- Pre-Requisites
-
- Seller possess valid transaction account in HSBC.
- For Smart Sandbox testing, you may define your own transaction account number, e.g.
"tradeAccountNumber": "SGHSBC12345678912".
- For Smart Sandbox testing, you may define your own transaction account number, e.g.
- Retrieved corresponding
loanNumbervia:Submit Seller Loan Application Request APIduring application.Request Trade Loan Summary APIif you have saved correspondingloanNumberduring application.
statusof corresponding loan isDisbursed.- Corresponding
loanMaturityDateis larger or equal to current date.
- Seller possess valid transaction account in HSBC.
- Preparing Unencrypted Request Body
-
Prepares the
Unencrypted RequestBody as per Example from POST Seller-loans/standard/Request body/Examples/Unencrypted Request.- API Authorisation:
HSBC authorises API requests by
extnlCustomerIdandtradeAccountNumbervalue pair.extnlCustomerId:- If you are a partner of HSBC making API requests on-behalf of your platform's customers, specify the unique logon id of your customer on your platform, e.g.
"extnlCustomerId":"PLT-CUSTID-001". (per agreed with HSBC during on-boarding) - If you are a direct client of HSBC, specify the API Profile ID assigned to you during on-boarding, e.g.
"extnlCustomerId":"Kdet5h221BWKOD5umjrg1fOH4j8iXdS" // HSBC Profile ID
- If you are a partner of HSBC making API requests on-behalf of your platform's customers, specify the unique logon id of your customer on your platform, e.g.
tradeAccountNumber:- Specify the applicant's HSBC current account number. e.g.
"tradeAccountNumber":"SGHSBC123456789123".
- Specify the applicant's HSBC current account number. e.g.
loanNumber:- Specify the loan number for the specific loan you would like to settle. e.g.
"loanNumber": "LNSG23040102".
- Specify the loan number for the specific loan you would like to settle. e.g.
{ ... "extnlCustomerId": "PLT-CUSTID-001", "tradeAccountNumber": "SGHSBC123456789123", "loanNumber": "LNSG23040102", ... } - Repayment Details:
Specify the date and amount for loan settlement. For example:
- Repayment date
2023-05-29. Hence, specify"repaymentDate": "2023-05-29". - Loan valued
1000.00. Hence, specify"repaymentAmount": "1000.00".
{ ... "repaymentDate": "2023-05-29", "repaymentAmount": "1000.00", "repaymentAccountNumber": "SGHSBC123456789123", "interestAccountNumber": "SGHSBC123456789123", "chargesAccountNumber": "SGHSBC123456789123", "instructionsToBank": "message for your bank", ... } - Repayment date
- Additional Information:
Optionally you may specify additional information needed. Please note these information needs to be specified as
JSON String.{ ... "miscStates": "{\"additionalInfo\":\"something\"}" } - Full Example:
{ "extnlCustomerId": "PLT-CUSTID-001", "tradeAccountNumber": "SGHSBC123456789123", "repaymentDate": "2023-05-29", "repaymentAmount": "1000.00", "repaymentAccountNumber": "SGHSBC123456789123", "interestAccountNumber": "SGHSBC123456789123", "chargesAccountNumber": "SGHSBC123456789123", "instructionsToBank": "message for your bank", "miscStates": "" }
Tips: If you are using Sample Java Client provided, copy the above unencrypted request under
src/main/resources/stl/SubmitSellerLoanSettlementRequest.json - API Authorisation:
- Generating API Request
-
Encrypts the above request and base64 encodes it as per Making an API Request.
- Example of encrypted request body and JSON Web Token:
- Encrypted Request:
LS0tLS1CRUdJTiBQR1AgTUVTU0FHRS0tLS0tC... - JSON Web Token:
JWS eyJ2ZXIiOiIxLjAiLCJraWQiOiIy...
- Encrypted Request:
- Send API Request
- Send the request directly via Sample Java Client, run
SubmitSellerLoanSettlementRequest.javaundersrc/main/java/com.runner/stl - Send the request via Postman:
- Generate your encrypted request and JSON Web Token via
ClientSideTokenEncryption.javaundersrc/main/java/com.runner/ - Put the encrypted request string in under Body in Postman
LS0tLS1CRUdJTiBQR1AgTUVTU0FHRS0tLS0tC... - Specify Header. The JSON Web Token generated should be placed under
Authorisation.Authorization:JWS eyJ2ZXIiOiIxLjAiLCJraWQiOiIy... requestTime:2023-04-01 00:00:00 requestId:92aef07bdc4243e99afa9dc2af02c1cf Content-Type:application/json countryCode: SG schemaVersion:1.0 - Click Send next to the endpoint URL.
- Generate your encrypted request and JSON Web Token via
- Send the request directly via Sample Java Client, run
- Example of encrypted request body and JSON Web Token:
- Processing API Response
-
Upon a successful request, encrypted response in
base64 stringshall be received- Example of encrypted response:
- Encrypted Request:
LS0tLS1CRUdJTiBQR1AgTUVTU0FHRS0tLS0tC... - Decodes and decrypts the response as per Processing a response or via Sample Java Client.
- Encrypted Request:
- Upon successful decryption, you shall be able to obtain the
Unencrypted responseinJSONstructure, as per POST seller-loans/standard/Responses/200/Examples/Unencrypted Response - Success.{ "code": "EMKT200", "message": "Success", "repliedTime": "2023-04-01 00:00:43", "correlationId": "92aef07bdc4243e99afa9dc2af02c1cf", "responseData": { "applicationId": "46338647WB6W", "loanNumber": "LNSG23040102", "status": "Settlement Submitted" }, "errorDetails": null } - Upon a loan settlement request is submitted successfully,
statuswill be changed toSettlement Submittedfor the corresponding loan. You may further process/ enquire this loan via followinglinked operations.- Enquire status of this and other loans via Request Trade Loan Summary List
- Enquire details of this loan via Request Trade Loan Detail
- Example of encrypted response:
Next, let's try enquiring a summary list for all submitted/ processed loans via Request Trade Loan Summary .
Scenario 5 - Enquiring Status of Loans submitted from HSBC
You as a/ on-behalf of your customer PLT-CUSTID-001, request for a summary for already submitted loan applications.
- Pre-Requisites
-
- Seller possess valid transaction account in HSBC.
- For Smart Sandbox testing, you may define your own transaction account number, e.g.
"tradeAccountNumber": "SGHSBC12345678912".
- For Smart Sandbox testing, you may define your own transaction account number, e.g.
- Loan(s) had been submitted/ processed via:
statusof corresponding loan isDisbursed.- Corresponding
loanMaturityDateis larger or equal to current date.
- Seller possess valid transaction account in HSBC.
- Preparing Unencrypted Request Body
-
Prepares the
Unencrypted RequestBody as per Example from POST Seller-loans/standard/Request body/Examples/Unencrypted Request.- API Authorisation:
HSBC authorises API requests by
extnlCustomerIdandtradeAccountNumbervalue pair.extnlCustomerId:- If you are a partner of HSBC making API requests on-behalf of your platform's customers, specify the unique logon id of your customer on your platform, e.g.
"extnlCustomerId":"PLT-CUSTID-001". (per agreed with HSBC during on-boarding) - If you are a direct client of HSBC, specify the API Profile ID assigned to you during on-boarding, e.g.
"extnlCustomerId":"Kdet5h221BWKOD5umjrg1fOH4j8iXdS" // HSBC Profile ID
- If you are a partner of HSBC making API requests on-behalf of your platform's customers, specify the unique logon id of your customer on your platform, e.g.
tradeAccountNumber:- Specify the applicant's HSBC current account number. e.g.
"tradeAccountNumber":"SGHSBC123456789123".
- Specify the applicant's HSBC current account number. e.g.
{ ... "extnlCustomerId": "PLT-CUSTID-001", "tradeAccountNumber": "SGHSBC123456789123", ... } - Paginations:
Specify display properties for transactions to be Retrieved
- Assume that the enquiry page on your platform will be displaying up to 10 transactions (loans), set the
"pageSize": "10". - Here, set
"pageNumber": "1"so as to receive a response with up to the first 10 transactions matching all filtering criteria. - Filtering of
customerReference,loanNumber,statusandbeneficiaryNameare optional.
{ "pageSize": "10", "pageNumber": "1", ... "customerReference": "", "loanNumber": "", "status": "", "beneficiaryName": "" } - Assume that the enquiry page on your platform will be displaying up to 10 transactions (loans), set the
- Full Example:
{ "pageSize": "10", "pageNumber": "1", "extnlCustomerId": "PLT-CUSTID-001", "tradeAccountNumber": "SGHSBC123456789123", "customerReference": "", "loanNumber": "", "status": "", "beneficiaryName": "" }
Tips: If you are using Sample Java Client provided, copy the above unencrypted request under
src/main/resources/stl/ListTradeLoanSummaryRequest.json - API Authorisation:
- Generating API Request
-
Encrypts the above request and base64 encodes it as per Making an API Request.
- Example of encrypted request body and JSON Web Token:
- Encrypted Request:
LS0tLS1CRUdJTiBQR1AgTUVTU0FHRS0tLS0tC... - JSON Web Token:
JWS eyJ2ZXIiOiIxLjAiLCJraWQiOiIy...
- Encrypted Request:
- Send API Request
- Send the request directly via Sample Java Client, run
SubmitListTradeLoanSummaryRequest.javaundersrc/main/java/com.runner/stl - Send the request via Postman:
- Generate your encrypted request and JSON Web Token via
ClientSideTokenEncryption.javaundersrc/main/java/com.runner/ - Put the encrypted request string in under Body in Postman
LS0tLS1CRUdJTiBQR1AgTUVTU0FHRS0tLS0tC... - Specify Header. The JSON Web Token generated should be placed under
Authorisation.Authorization:JWS eyJ2ZXIiOiIxLjAiLCJraWQiOiIy... requestTime:2023-04-01 00:00:00 requestId:92aef07bdc4243e99afa9dc2af02c1cf Content-Type:application/json countryCode: SG schemaVersion:1.0 - Click Send next to the endpoint URL.
- Generate your encrypted request and JSON Web Token via
- Send the request directly via Sample Java Client, run
- Example of encrypted request body and JSON Web Token:
- Processing API Response
-
Upon a successful request, encrypted response in
base64 stringshall be received- Example of encrypted response:
- Encrypted Request:
LS0tLS1CRUdJTiBQR1AgTUVTU0FHRS0tLS0tC... - Decodes and decrypts the response as per Processing a response or via Sample Java Client.
- Encrypted Request:
- Upon successful decryption, you shall be able to obtain the
Unencrypted responseinJSONstructure, as per POST seller-loans/standard/Responses/200/Examples/Unencrypted Response - Success.{ "code": "EMKT200", "message": "Success", "repliedTime": "2023-04-01 00:00:43", "correlationId": "efbf054e8f9c477493bfb3d2a19781b2", "responseData": { "pageSize": "10", "pageNumber": "1", "totalCount": "7", "records": [ { "tradeAccountNumber": "SGHSBC12345678912", "productType": "Seller Loan", "beneficiaryName": "", "customerReference": "", "loanNumber": "LNSG23040102", "paymentCurrency": "", "loanAmountInPaymentCurrency": "", "loanCurrency": "SGD", "status": "Settlement Submitted", "loanStartDate": "2023-04-01", "loanMaturityDate": "2023-05-29", "tenor": "60", "outstandingCurrency": "SGD", "outstandingAmount": "1000.00", "creationDateAndTime": "" }, { "tradeAccountNumber": "SGHSBC12345678912", "productType": "Seller Loan", "beneficiaryName": "", "customerReference": "", "loanNumber": "LNSG23040101", "paymentCurrency": "", "loanAmountInPaymentCurrency": "", "loanCurrency": "HKD", "status": "Submitted", "loanStartDate": "2023-04-01", "loanMaturityDate": "2023-04-30", "tenor": "30", "outstandingCurrency": "HKD", "outstandingAmount": "1000.00", "creationDateAndTime": "" }, { "tradeAccountNumber": "SGHSBC12345678912", "productType": "Seller Loan", "beneficiaryName": "", "customerReference": "", "loanNumber": "LNSG23031502", "paymentCurrency": "", "loanAmountInPaymentCurrency": "", "loanCurrency": "USD", "status": "Extension Submitted", "loanStartDate": "2023-03-15", "loanMaturityDate": "2023-05-14", "tenor": "60", "outstandingCurrency": "USD", "outstandingAmount": "1000.00", "creationDateAndTime": "" }, { "tradeAccountNumber": "SGHSBC12345678912", "productType": "Seller Loan", "beneficiaryName": "", "customerReference": "", "loanNumber": "LNSG23031501", "paymentCurrency": "", "loanAmountInPaymentCurrency": "", "loanCurrency": "SGD", "status": "Disbursed", "loanStartDate": "2023-03-15", "loanMaturityDate": "2023-04-14", "tenor": "30", "outstandingCurrency": "SGD", "outstandingAmount": "1000.00", "creationDateAndTime": "" }, { "tradeAccountNumber": "SGHSBC12345678912", "productType": "Seller Loan", "beneficiaryName": "", "customerReference": "", "loanNumber": "LNSG23030103", "paymentCurrency": "", "loanAmountInPaymentCurrency": "", "loanCurrency": "HKD", "status": "Cancelled", "loanStartDate": "2023-03-01", "loanMaturityDate": "2023-03-30", "tenor": "30", "outstandingCurrency": "HKD", "outstandingAmount": "0.00", "creationDateAndTime": "" }, { "tradeAccountNumber": "SGHSBC12345678912", "productType": "Seller Loan", "beneficiaryName": "", "customerReference": "", "loanNumber": "LNSG23030102", "paymentCurrency": "", "loanAmountInPaymentCurrency": "", "loanCurrency": "GBP", "status": "Settlement Submitted", "loanStartDate": "2023-03-01", "loanMaturityDate": "2023-04-01", "tenor": "31", "outstandingCurrency": "GBP", "outstandingAmount": "1000.00", "creationDateAndTime": "" }, { "tradeAccountNumber": "SGHSBC12345678912", "productType": "Seller Loan", "beneficiaryName": "", "customerReference": "", "loanNumber": "LNSG23030101", "paymentCurrency": "", "loanAmountInPaymentCurrency": "", "loanCurrency": "JPY", "status": "Settled", "loanStartDate": "2023-03-01", "loanMaturityDate": "2023-03-30", "tenor": "30", "outstandingCurrency": "JPY", "outstandingAmount": "0.00", "creationDateAndTime": "" } ] } } - Records matches filtering criteria in the request shall be listed. (Up to specified
pageSize) You may enquire details of a specific loan via followinglinked operations.- Enquire details of a specific loan via Request Trade Loan Detail
- Example of encrypted response:
Congratulations for completing all testing scenarios. Refer to Go-Live for next steps.
Version History
Change log and release history:
| Version | Release Date | Status | Description |
|---|---|---|---|
| beta | March 2023 | Live | Trade Finance - Seller Loans - Beta Release |