Submit Documents

POST

https://api.sfox.com/v1/enterprise/ddq/upload

Submit a document or set of documents on behalf of an end user.


Document Requirements

  • The supported MIME types for document submission are image/jpeg, image/png, application/pdf .

  • File extension must be one of jpg, jpeg, png, pdf.

  • File names specified in the file_types object must exactly match the file name attached in the files array. (e.g. files = [.../id_front.png] and file_types = {"id_front.png":"ID"})

  • A valid document type must be submitted with the file name in file_types. Options are:

    • ID: Government issued IDs such as driver's licenses or passports.

    • PoR: Proof of residence documents such as bank statements or utility bills.

Request

Body Parameters (Form Data)

Parameter
Type
Description

user_id required

string

The unique user ID of the user that you are submitting a document or set of documents on behalf of.

files required

File[]

An array of the files you are uploading.

file_types required

string (JSON format)

The file name and document type of each file you are uploading in JSON format. e.g. {"<FILE_NAME>":"<DOCUMENT_TYPE>"} File names MUST include the file extension and MUST exactly match the the corresponding file in files. Possible document types: ID, PoR

ddq_id

string

The ID of the corresponding EDD request form that this submission is associated with.

Example Requests

// Submit a single document
curl --location 'https://api.sfox.com/v1/enterprise/ddq/upload' \
--header 'Authorization: Bearer ${ENTERPRISE_API_KEY}' \
--form 'files=@"${PATH_TO_FILE}"' \
--form 'user_id="${USER_ID}"' \
--form 'file_types="{\"${FILE_NAME}\":\"${DOCUMENT_TYPE}\"}"'

Responses

202 Accepted
// Request accepted, files uploaded successfully
{
    "message": "Files uploaded successfully"
}
401 Unauthorized
// Invalid Enterprise API Key or not specified.
{
    "error": "invalid token. check authorization header."
}
404 Not Found
// Invalid user_id or not specified
{
    "error": "user not found"
}
422 Unprocessable Entity
// Unsupported file type. The supported MIME types for document submission are image/jpeg, image/png, application/pdf.
{
    "error": "File extension <FILE_EXTENSION> is not allowed, invalid at file <FILE_NAME>"
}
// Invalid file name in file_types. File name must include the file extension and exactly match files.
{
    "error": "Invalid file name <FILE_NAME>"
}
// Invalid document type specified in file_types.
{
    "error": "Invalid file type <DOCUMENT_TYPE>, file_types must be one of PoR,ID"
}
// Unsupported MIM type. The supported MIME types for document submission are image/jpeg, image/png, application/pdf.
{
    "error": "File mime type <TYPE> is not allowed, invalid at file <FILE_NAME>"
}
500 Internal Server Error
// Internal error
{
    "error": "An unknown error has occurred. If this persists, please contact support."
}

Last updated