Salv Aml API
This section contains all operations managing the state of persons and transactions. There are three endpoints for creating or modifying a person, make sure to choose the right one for your task: * [Create new person](#tag/aml/operation/addPersonV2) will create a new person if a person with the same ID does not already exist in our system. * [Patch person](#tag/aml/operation/patchPersonV2) partially updates an existing person if this person exists in the system. A request to this endpoint will only update or add attributes which are provided in the request. Use this endpoint to update selected attributes of a person or to add new attributes without changing attributes not present in the request payload. This endpoint may also be used to update person type. * [Update person](#tag/aml/operation/updatePersonV2) updates an existing person if this person exists in the system. A request to this endpoint must contain both person type and attributes. A request to this endpoint overwrites both person type and attributes with the values given in the request. ID of a person or a transaction is a case-sensitive text field in our system. Salv does not transform the ID in any way. Only the following characters are allowed: Alphanumerics `a-zA-Z0-9`, hyphens `-`, underscores `_`, colons `:`, dots `.`. All requests must use ISO-8601 formatted timestamps. That includes defined fields (e.g. timestamp property in "Create new transaction" request) and custom key-value pairs (e.g. under attributes property in "Create new person" request). For any data passed in person or transaction objects, the keys must adhere to the following rules: - It must not contain a "**.**" - It must not consist of whitespaces ## Example: Uploading person and transaction This example shows how to upload data to use it later for monitoring or screening. ### 1. Add a person if not already added Add a new person, according to the documentation at [addPerson(POST)](#operation/addPersonV2). If the person has already been added to Salv, then skip this step. #### With cURL ``` curl --request POST \ --url https://app.salv.com/api/v2/persons \ --header 'Authorization: Bearer {yourBearerToken}' \ --header 'Content-Type: application/json' \ --data '{ "id": "bbt12345", "type": "INDIVIDUAL", "attributes": { "first_name": "Sheldon", "last_name": "Cooper", "dob": "1983-05-12", "city": "Pasadena", "street_address": "2311 North Los Robles Avenue", "country": "US", "onboarding_date": "2019-04-16", "email": "sheldon.cooper@gmail.com", "phone_number": "+1582693582", "id_document": "passport", "id_country": "US", "gender": "F" } }' ``` #### With Python Requests ``` import requests url = "https://app.salv.com/api/v2/persons" payload = { "id": "bbt12345", "type": "INDIVIDUAL", "attributes": { "first_name": "Sheldon", "last_name": "Cooper", "dob": "1983-05-12", "city": "Pasadena", "street_address": "2311 North Los Robles Avenue", "country": "US", "onboarding_date": "2019-04-16", "email": "sheldon.cooper@gmail.com", "phone_number": "+1582693582", "id_document": "passport", "id_country": "US", "gender": "F" } } headers = { "Content-Type": "application/json", "Authorization": "{yourBearerToken}" } response = requests.request("POST", url, json=payload, headers=headers) print(response.text) ``` ### 2. Add a transaction Add a new transaction, according to the documentation at [addTransaction(POST)](#operation/addTransaction). #### With cURL ``` curl --request POST \ --url https://app.salv.com/api/v1/persons/bbt12345/transactions \ --header 'Authorization: Bearer {yourBearerToken}' \ --header 'Content-Type: application/json' \ --data '{ "id": "aeio-1234567", "attributes": { "sender_name": "Sheldon Cooper", "sender_account": "GB123456789", "receiver_name": "Leonard Hofstadter", "receiver_account": "DE987654321", "amount": "15678.34", "type": "wire_transfer", "direction": "I", "timestamp": "2022-01-20T08:48:39.000Z" } }' ``` #### With Python Requests ``` import requests url = "https://app.salv.com/api/v1/persons/bbt12345/transactions" payload = { "id": "aeio-1234567", "attributes": { "sender_name": "Sheldon Cooper", "sender_account": "GB123456789", "receiver_name": "Leonard Hofstadter", "receiver_account": "DE987654321", "amount": "15678.34", "type": "wire_transfer", "direction": "I", "timestamp": "2022-01-20T08:48:39.000Z" } } headers = { "Content-Type": "application/json", "Authorization": "{yourBearerToken}" } response = requests.request("POST", url, json=payload, headers=headers) print(response.text) ```