Submit list of invoices to get an optimized payment.
POST {{baseUrl}}/buyer-payment-agents/:ica/payment-recommendations
This endpoint allows you to create a payment recommendation.
Request Body
{"buyer"=>{"legalBusinessName"=>"Fresh Foods Inc", "organisationIdentifications"=>[{"identification"=>"822981874", "type"=>"TXID"}], "preferences"=>{"decisionEngine"=>{"algorithm"=>"HIERARCHICAL", "configuration"=>{"priorities"=>["MAXIMIZE_DISCOUNTS_REBATES", "MINIMIZE_COSTS", "MAXIMIZE_DPO"]}}, "paymentMethods"=>[{"type"=>"CARD", "rank"=>1, "rebatePercentage"=>0.1}, {"type"=>"TRF", "localInstrument"=>"CCD", "rank"=>2}]}}, "supplier"=>{"legalBusinessName"=>"Organic Farms LLC", "organisationIdentifications"=>[{"identification"=>"822981873", "type"=>"TXID"}], "preferences"=>{"acceptedPaymentMethods"=>[{"type"=>"TRF"}, {"type"=>"CARD", "paymentControls"=>[{"conditions"=>{"referredDocumentInformation"=>[{"time"=>{"maxDaysAfterRelatedDate"=>20}, "type"=>"CINV"}]}, "decision"=>"REJECT"}]}]}}, "remittanceInformation"=>{"structured"=>[{"referredDocumentInformation"=>[{"number"=>50, "paymentDueDate"=>"2031-11-01", "referredDocumentAmount"=>{"duePayableAmount"=>1507, "remittedAmount"=>1506}, "relatedDate"=>"2031-11-22", "type"=>"CINV"}, {"number"=>49, "paymentDueDate"=>"2031-11-01", "referredDocumentAmount"=>{"duePayableAmount"=>1533, "remittedAmount"=>1532}, "relatedDate"=>"2031-11-22", "type"=>"CINV"}, {"number"=>48, "paymentDueDate"=>"2031-11-02", "referredDocumentAmount"=>{"duePayableAmount"=>1322, "remittedAmount"=>1321}, "relatedDate"=>"2031-11-22", "type"=>"CINV"}]}]}}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string | ||
Accept | string |
RESPONSES
status: OK
{"paymentRecommendationId":"123e4567-e89b-12d3-a456-426614174000","buyer":{"legalBusinessName":"Buyer Company","organisationIdentifications":[{"type":"TXID","identification":"822981873"},{"type":"TXID","identification":"822981873"}]},"supplier":{"legalBusinessName":"Organic Meats LLC","organisationIdentifications":[{"type":"TXID","identification":"822981873"},{"type":"TXID","identification":"822981873"}]},"recommendedPaymentInstructions":[{"paymentMethod":"CARD","localInstrument":"CCD","remittanceInformation":{"structured":[{"referredDocumentInformation":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}}]},"executionDate":"1997-01-15","potentialEconomics":{"discount":-28322283.89851381,"rebates":-42709126.16044984,"cost":-11128774.045980856,"daysPayableOutstanding":73405593}},{"paymentMethod":"CARD","localInstrument":"CCD","remittanceInformation":{"structured":[{"referredDocumentInformation":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}}]},"executionDate":"1981-07-12","potentialEconomics":{"discount":39830364.247561395,"rebates":8429701.555539459,"cost":-33700932.27955935,"daysPayableOutstanding":-36964926}}],"excludedRemittanceInformation":[{"reason":{"code":"PAST_DUE_DATE","description":"This invoice was past it's due date and therefore was not considered."},"structured":[{"referredDocumentInformation":[{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}]},{"referredDocumentInformation":[{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}]}]},{"reason":{"code":"PAST_DUE_DATE","description":"This invoice was past it's due date and therefore was not considered."},"structured":[{"referredDocumentInformation":[{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}]},{"referredDocumentInformation":[{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}]}]}],"potentialEconomics":{"discount":-55412905.92845347,"rebates":-66304826.2486698,"cost":36319085.06211427,"daysPayableOutstanding":86796091}}