Walking through the purely claim integration


Note: This walkthrough is intended to simply get you an example to get up and running quickly to experiment and started. More depth around individual API calls and concepts can be found in the API documentation.

Getting Started

Our scenario is that you have already configured an email to send right away when a claim is pushed into receeve. That setup and the details around it we won't go into here. Those things you or your operational team will have configured before you send any data via the API. The commands here are done from the terminal, but you can also use the Postman collection posted here.

1. Authenticate

The first thing you will need to do is get your OAuth credentials from Customer Success. You should have the following pieces of information.

  • apiURL.- for example: https://api.receeve-demo.com
  • clientId.- for example: 41764642-94c4-486c-8c5b-7f6971d532cd
  • apiClient.- for example: API_CLIENT
  • apiSecret.- for example: API_SECRET
  1. Calculate the token using base64, for this example:
$ echo -n "API_CLIENT:API_SECRET" | base64
  1. Request an access_token using the endpoint /v1/oauth2/token

For example:

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Basic QVBJX0NMSUVOVDpBUElfU0VDUkVU" https://api.receeve-demo.com/v1/oauth2/token

Where:

  • QVBJX0NMSUVOVDpBUElfU0VDUkVU === base64(apiClient:apiSecret)

You should get a response that looks like:

{
    "access_token": "ACCESS_TOKEN",
    "expires_in": 3600,
    "token_type": "Bearer"
}

Copy the ACCESS_TOKEN. It will expire in the number of seconds listed, but you will have enough time to use it for sending in some data.

2. Sending in a claim

You have an OAuth token and so now you are ready to go. Make sure to replace the clientId, the ACCESS_TOKEN, and then then email address in the call below.

curl -X POST https://api.receeve-demo.com/v1/{clientId}/create_claims -H 'Content-Type: application/json' -H 'Authorization: ACCESS_TOKEN' -d '{"claim-1-Id": {"amount": 13025,"currency": "EUR","portfolioReference": "yourPortfolioReference1","productReference": "yourProductReference","totalFees": 9727,"originalDueDate": "2019-05-28","currentDueDate": "2019-06-28","paymentReference": "yourPaymentReference1","accountNumber": "accountNumberReference1","accountReference": "accountReference1","meta": {"mySampleScore": "AAA"},"fees": [{"name": "Interest","amount": 120}],"primaryDebtor": {"birthday": "1980-06-28","gender": "M","firstName": "John","lastName": "White","middleName": "Benedict","title": "Doctor","companyName": "Acme Brick Co.","debtorReference": "string","contactInformation": {"country": "DE","city": "Delbrück","mobileNumber": 495555555555,"postalCode": 33129,"addressLine1": "Boikweg 24","addressLine2": "c/o Acme","addressLine3": "additional information","landLine": 495555555555,"state": "Dortmund","email": "testEmail@example.com"}}}}'

You should get a response that looks like:

{
    "claim-1-Id": {
        "success": true,
        "messages": []
    }
}

And that's it. The claim is now executing the strategy that was configured. If you set it to send an email right away, then you should receive that email shortly.

3. Stop the claim

Now imagine that someone paid the money to you in cash. So there was no digital record of it captured by receeve directly. You would want to tell receeve that the claim is now paid and to stop the process. You need one more API call to do so:

curl -X POST https://api.receeve-demo.com/v1/{clientId}/resolve_claims -H 'Content-Type: application/json' -H 'Authorization: ACCESS_TOKEN' -d '[{"ref": "claim-1-Id","reason": "CLAIM_PAID"}]'

You should get a response that looks like:

{
    "claim-1-Id": {
        "success": true,
        "messages": []
    }
}

Recap

You've now authenticated yourself, and simply sent in a claim. Once it was paid, you stopped the processing on it. There are a variety of use cases that you may want to implement for your organization, but you now have the basics to get up and running in order to do so. You can test sending different meta data, amounts, or whatever you would like to test out in the strategy by modifying the payload in the above example. Or feel free to use the Postman collection in order to save different scenarios to test and integrate.