sFOX API
Sign InOpen Account
Connect API
Connect API
  • Introduction
    • Welcome
    • Getting Started
    • Resources
      • Terminology
      • Systems & Operations
      • Integration Options
    • Guides
      • End User Onboarding & KYC
        • Individuals
        • Businesses
        • Enhanced Due Diligence
  • REST API
    • REST Endpoints
    • Authentication
    • End Users
      • Create End User Account
      • Request Verification Code
      • Confirm Verification Code
      • Create User Auth Token(s)
      • Get End User(s)
      • Get EDD Requests
      • Get EDD Prompts
      • Create EDD Responses
        • Uploading Files as Responses
      • Submit Documents
      • Deactivate User
    • Payments
      • Create Bank Account (Plaid)
      • Create Bank Account
      • Get Bank Account
      • Get Plaid Processors
      • Amend Plaid Processors
      • Verify Bank Account
      • Delete Bank Account
      • Get Wire Instructions
      • Get ACH Agreement Status
      • Request ACH Onboarding
      • Get ACH Deposit Limit
    • Withdrawals
      • Confirm Withdrawal
      • Resend Confirmation Code
      • Cancel Withdrawal
    • Transfers
      • Create Transfer
      • Confirm Transfer
      • Resend Confirmation Code
      • Cancel Transfer
      • Get Transfer Permissions
      • Get Transfer History
    • Monetization
      • Create Setting
      • Update Setting
      • Delete Setting
      • Get Settings
      • Get Permissions
      • Get Monetization History
  • WebSocket API
    • Connecting
    • Authentication
    • Subscribing & Unsubscribing
    • Message Format
    • End Users
      • Onboarding
      • Balances
      • Orders
      • Trades
    • Market Data
      • Order Book
      • Trades
      • Ticker
  • Single Sign-On
    • Overview
      • IdP Initiated SSO
    • IdP Data
    • SAML Response Data
  • Errors
    • Error Codes
Powered by GitBook
On this page
  • Request
  • Body Parameters (Form Data)
  • Example Requests
  • Responses
  1. REST API
  2. End Users

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}\"}"'
// Submit a single document
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
let data = new FormData();
data.append('files', fs.createReadStream('${PATH_TO_FILE}'));
data.append('user_id', '${USER_ID}');
data.append('file_types', '{"${FILE_NAME}":"${DOCUMENT_TYPE}"}');

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.sfox.com/v1/enterprise/ddq/upload',
  headers: { 
    'Authorization': 'Bearer ${ENTERPRISE_API_KEY}'
    ...data.getHeaders()
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});
// Submit a single document
import requests

url = "https://api.sfox.com/v1/enterprise/ddq/upload"

payload = {'user_id': '${USER_ID}',
'file_types': '{"${FILE_NAME}":"${DOCUMENT_TYPE}"}'}
files=[
  ('files',('${FILE_NAME}',open('${PATH_TO_FILE}','rb'),'${MIME_TYPE}'))
]
headers = {
  'Authorization': 'Bearer ${ENTERPRISE_API_KEY}'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)

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."
}
PreviousUploading Files as ResponsesNextDeactivate User

Last updated 1 day ago