Effortless customer verification now available   View changelog
Sphere Paysphere
Onboarding

Upload Document

Uploads a document for a customer.

POST
/v2/document
AuthorizationBearer <token>

JWT Bearer token authentication

In: header

targetstring

The category of the document being uploaded.

Default"customer"
Value in"customer"
targetIdstring

The id of the target of which the document is being uploaded to.

Match^{customer|application|payout}_[a-z0-9]+$
documentTypestring

The type of the document being uploaded.

Value in"passport" | "id_card" | "drivers_license" | "residence_permit"
description?string

The description of the document being uploaded.

filestring

The file of the document being uploaded.

side?string

The side of the document being uploaded.

Value in"front" | "back"
countrystring

The country of the document being uploaded.

FormatISO-3166
Lengthlength <= 3

Response Body

curl -X POST "https://api.sandbox.spherepay.co/v2/document" \
  -F target="customer" \
  -F targetId="customer_287ds89789ds79cx7979797" \
  -F documentType="passport" \
  -F side="front" \
  -F country="USA" \
  -F file="binary_file_data" \
  -F description="Passport for identity verification"

{
  "target": "customer",
  "targetId": "customer_287ds89789ds79cx7979797",
  "documentType": "passport",
  "description": "Passport for identity verification",
  "fileName": "passport_john_doe.jpg",
  "fileSize": 2048576,
  "mimeType": "image/jpeg",
  "createdAt": "2025-05-23T11:45:00Z"
}

{
  "ts": "2025-04-20T00:09:16.870Z",
  "error": {
    "information": [
      "Required"
    ]
  }
}

{
  "ts": "2025-04-20T00:09:16.870Z",
  "error": {
    "general": "{{information}} Not Found"
  }
}