upload_file
POST  - Add a file
In the scope of merchant and guarantor contract, to build beam of evidence, adding supporting document can be mandatory.
upload_file action let transmit documents. If the files are required by merchant parameters, the transmission must occur before create_mandate action
On usage, verification processing of the various provided parts (files) of this beam of evidence can take place. These checks may result in some of the files being rejected. This control process is driven by the "Verification Mode", which makes it possible, amongst other things, to force the upload in case the document may not be readable.
When creating a mandate, all the parts are automaticaly linked with the mandate. If the mandate already exists, the parts are directly linked to it. In case of a mandate renewal, the parts must be sent again.
| Argument | Description | Type - Length | Example | Mandatory |
|---|---|---|---|---|
| safedebit_consumer_reference | Safedebit consumer reference | String - 35 | YES | |
| file_data * | File in base64 | String | base64Binary | YES |
| file_type * | File type | Char - 1 | 1: mandate 2 : Identity 3 : IBAN 4 : KBIS 5 : Other | YES |
| file_description ** | File description | String - 256 | NO | |
| file_verif | Verification mode | String - 256 | 1 : Failure : No upload in case of a check failure 2 : Read failure : Upload continues unless read failure. Result of check is transfered in verif parameter. The default behavior depends on the merchant settings (1 if service available, no check if service not available). | NO |
* Authorized extensions : gif,jpeg,jpg,png,pdf.
** Alphanumeric characters only. Can be used to give more details on the type of file (example : CNI recto, verso...)Kbis ( result check )
| Argument | Description | Type |
|---|---|---|
| readable | File readable | true or false |
| valid | KBis verified as per Infogreffe | true or false |
| expired | Expired KBis (more than 3 months) | true or false |
| social_reference | Valid corporate name | true or false |
| siren | Valid SIREN | true or false |
Request
POST /xxxx/upload_file HTTP/1.1
Host: xxx.xxxxxxxx.fr
Authorization: Basic JQheySHkalSNuakkmSmm==
Content-Type: application/json
Accept: application/json
{
"safedebit_consumer_reference": "XXXXXX",
"file_type": "2",
"file_data": "XjljSHJKhbJSHjkS...........",
"file_description": "CNI"}
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"result" : true,
"file_key" : "xxxxxx"
}
If addition failed
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"result" : false,
"code" : "XXXX"
}
| Argument | Description |
|---|---|
| result | true or false : true : action succeeded false : action failed |
| file_key | A unique key for each file to be used for fetching of the latter |
| code | See (error codes in annex). |
| verif | Json table of details of the result of the verification Only present if the verification has taken place |
Request
HTTP/1.1 200 OK
POST /ssp/upload_file HTTP/1.1
Host: xxx.safedebit.fr
Authorization: Basic JQheySHkalSNuakkmSmm==
Content-Type: application/json
Accept: application/json