This example shows how to partially pay an invoice. To do so, we use the s2cor package exposed by Financials as a resource via the APEX REST API.


To try out the steps in this section, install Postman and open the Postman collection we have prepared for you. In the collection, open the Partially pay an invoice request and replace variables with actual values.

Download Postman Open Postman Collection


Step 1: Create a POST request

Configure your application to send the following request:

POST https://{your_Salesforce_domain}/services/apexrest/s2cor/api/1.0/transaction?recordIds=["a1x1N000002tFaOQAU"]&selectedType=Partial&amountToCredit=250.00&productId=01t1N00000EqLDzQAN&documentDate=2018-02-20&totalAmount=1000.00&tagsMap=[{"Id":"a141N000004SC6vQAG"}]

where


Step 2: Configure authorization

Make sure your request uses OAuth 2.0. Authorization data must be included in the request URL.


Step 3: Configure headers

Configure the request headers to include the following key-value pairs:

Key Value
Authorization Bearer {access_token}
Example:
Bearer 00D0N000000h6Yq!AR0AQObORnk9lCldrMydk1Y3cuyqpscqcU.T1xvoM1uWkWrr8MLu2ehJLKp7Mz3Qeu.eQGI13qlH_HfGEEMxV_J8FdI1TwdR
Content-Type application/json

Step 4: Send your request

Send your request to partially pay the invoice.