Create Ledger Entry

POST {{baseUrl}}/ledger-entries

Create a Ledger Entry

Request Body

{"data"=>{"ledgerEntries"=>[{"buyer"=>{"externalBuyerId"=>"795fce4a-f13e-450d-a384-718577e1cde4"}, "seller"=>{"externalSellerId"=>"8f4a3a95-5cd5-4b70-8c25-0a0c7ef9e1e9"}, "customerRole"=>"Seller", "documentType"=>"Invoice", "externalLedgerEntryId"=>"c9c75d82-4572-438d-9a67-a8461b199a50", "documentNumber"=>"INV001", "documentStatus"=>{"value"=>"Delivered"}, "documentDate"=>"2022-07-26", "documentUploadDate"=>"2022-07-26", "documentUpdatedDateTime"=>"2022-07-26T09:00:00Z", "documentCreatedDateTime"=>"2022-07-26T09:00:00Z", "documentDueDate"=>"2022-08-26", "forecastPayDate"=>"2022-08-26", "originalAmount"=>{"currency"=>"USD", "amount"=>"10000.00"}, "netAmount"=>{"currency"=>"USD", "amount"=>"9000.00"}, "goodsDescription"=>"10,000 widgets", "fundedStatus"=>{"value"=>"None"}, "payments"=>[{"type"=>"Buyer", "paymentAmount"=>{"currency"=>"USD", "amount"=>"5000.00"}, "paidDate"=>"2022-08-26", "paymentCreatedDateTime"=>"2022-08-26T09:00:00Z"}, {"type"=>"Buyer", "paymentAmount"=>{"currency"=>"USD", "amount"=>"4000.00"}, "paidDate"=>"2022-08-20", "paymentCreatedDateTime"=>"2022-08-20T09:00:00Z"}], "context"=>"OnboardingAssessment"}, {"buyer"=>{"externalBuyerId"=>"795fce4a-f13e-450d-a384-718577e1cde4"}, "seller"=>{"externalSellerId"=>"8f4a3a95-5cd5-4b70-8c25-0a0c7ef9e1e9"}, "customerRole"=>"Seller", "documentType"=>"Invoice", "externalLedgerEntryId"=>"c5aaf566-bcd2-4d7e-ba16-55a76510ddc2", "documentNumber"=>"INV001", "documentStatus"=>{"value"=>"Delivered"}, "documentDate"=>"2022-07-26", "documentUploadDate"=>"2022-07-26", "documentUpdatedDateTime"=>"2022-07-26T09:00:00Z", "documentCreatedDateTime"=>"2022-07-26T09:00:00Z", "documentDueDate"=>"2022-08-26", "forecastPayDate"=>"2022-08-26", "originalAmount"=>{"currency"=>"USD", "amount"=>"10000.00"}, "netAmount"=>{"currency"=>"USD", "amount"=>"7000.00"}, "goodsDescription"=>"8,000 widgets", "fundedStatus"=>{"value"=>"None"}, "payments"=>[{"type"=>"Buyer", "paymentAmount"=>{"currency"=>"USD", "amount"=>"5000.00"}, "paidDate"=>"2022-08-26", "paymentCreatedDateTime"=>"2022-08-26T09:00:00Z"}, {"type"=>"Buyer", "paymentAmount"=>{"currency"=>"USD", "amount"=>"4000.00"}, "paidDate"=>"2022-08-20", "paymentCreatedDateTime"=>"2022-08-20T09:00:00Z"}], "context"=>"OnboardingAssessment"}]}}

HEADERS

KeyDatatypeRequiredDescription
AuthorizationstringAuthorization Header
X-HSBC-Request-Correlation-Idstring(Required) Correlation Id
X-HSBC-Request-Idempotency-Keystring(Required) Idempotency Key
X-HSBC-CountryCodestring(Required) ISO Country Code
X-HSBC-PROFILEIDstring(Required) Partner Profile Id
Obo-Profile-Idstring(Required) Customer Profile Id
X-HSBC-E2E-Trust-Tokenstring(Required)
Content-Typestring
Acceptstring

RESPONSES

status: Created

{"data":{"ledgerEntries":[{"ledgerEntryId":"8657df64-16c9-11ed-861d-0242ac120002","buyer":{"externalBuyerId":"795fce4a-f13e-450d-a384-718577e1cde4"},"seller":{"externalSellerId":"8f4a3a95-5cd5-4b70-8c25-0a0c7ef9e1e9"},"customerRole":"Seller","documentType":"Invoice","externalLedgerEntryId":"c9c75d82-4572-438d-9a67-a8461b199a50","documentNumber":"INV001","documentStatus":{"value":"Delivered"},"documentDate":"2022-07-26","documentUploadDate":"2022-07-26","documentUpdatedDateTime":"2022-07-26T09:00:00Z","documentCreatedDateTime":"2022-07-26T09:00:00Z","documentDueDate":"2022-08-26","forecastPayDate":"2022-08-26","originalAmount":{"currency":"USD","amount":"10000.00"},"netAmount":{"currency":"USD","amount":"9000.00"},"goodsDescription":"10,000 widgets","fundedStatus":{"value":"None"},"payments":[{"type":"Buyer","paymentAmount":{"currency":"USD","amount":"5000.00"},"paidDate":"2022-08-26","paymentCreatedDateTime":"2022-08-26T09:00:00Z"},{"type":"Buyer","paymentAmount":{"currency":"USD","amount":"4000.00"},"paidDate":"2022-08-20","paymentCreatedDateTime":"2022-08-20T09:00:00Z"}],"context":"OnboardingAssessment"},{"buyer":{"externalBuyerId":"795fce4a-f13e-450d-a384-718577e1cde4"},"seller":{"externalSellerId":"8f4a3a95-5cd5-4b70-8c25-0a0c7ef9e1e9"},"customerRole":"Seller","documentType":"Invoice","externalLedgerEntryId":"c5aaf566-bcd2-4d7e-ba16-55a76510ddc2","documentNumber":"INV002","documentStatus":{"value":"Delivered"},"documentDate":"2022-08-26","documentUploadDate":"2022-08-26","documentCreatedDateTime":"2022-08-26T09:00:00Z","documentUpdatedDateTime":"2022-08-26T09:00:00Z","documentDueDate":"2022-09-26","forecastPayDate":"2022-09-26","originalAmount":{"currency":"USD","amount":"8000.00"},"netAmount":{"currency":"USD","amount":"7000.00"},"goodsDescription":"8,000 widgets","fundedStatus":{"value":"None"},"payments":[{"type":"Buyer","paymentAmount":{"currency":"USD","amount":"5000.00"},"paidDate":"2022-08-26","paymentCreatedDateTime":"2022-08-26T09:00:00Z"},{"type":"Buyer","paymentAmount":{"currency":"USD","amount":"4000.00"},"paidDate":"2022-08-20","paymentCreatedDateTime":"2022-08-20T09:00:00Z"}],"context":"OnboardingAssessment"}]},"meta":{"totalItems":2},"links":{"self":{"href":"/ledger-entries"}}}