Skip to main content

Get All Document Types API

Overview

Retrieve all document types with optional filtering and pagination support. Document types define the specific types of documents that can be uploaded and validated in the system, such as passports, driver's licenses, national IDs, etc.

API Details

Endpoint

GET https://api.gafapay.com:8443/gafapay/v3/user/document_type

Headers

authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJlNDk0Njg3N2YxODk0NmIyOTlmZGRmMGYyMTMzZGNiYSIsInJvbGVzIjpbIlJPTEVfQURNSU4iXSwiZXhwIjoxNzU3NzMyNzA2fQ.EinJZTo8_g00dl_DFIQVttQFnDLyq8n0C-uDYb9_n3c
companyid: 59388167894b4d10a04fe5da3b8a2104
requestid: b35d332f-131e-44c1-892f-8322e022da74

Query Parameters

Required Parameters

  • company_id (String): Company identifier (passed in header)

Optional Parameters

  • user_type (Integer): Type of user this document type applies to
    • 2 = Customer
    • 3 = Merchant
    • 5 = Agent
  • document_type (Integer): Document type filter
    • 1 = Document
    • 2 = Selfie
  • document_category (Integer): Document category filter
    • 1 = KYC (Know Your Customer)
    • 2 = Business
  • dynamic_category_key (String): Dynamic category key filter
    • Example: "KYC", "selfie_1_2"
  • expiry_date_required (Boolean): Filter for documents requiring expiry date
  • business_types (String): Business types filter (comma-separated)
  • skip (Integer): Number of records to skip (pagination)
    • Default: 0
    • Example: 0, 10, 20
  • limit (Integer): Maximum number of records to return (pagination)
    • Default: 10
    • Example: 10, 25, 50
  • search_keyword (String): Search data using any keyword
  • sorting (String): Sorting criteria (JSON format)
    • Example: {"created_date": "DESC"}
  • start_date (Long): Start date filter (epoch timestamp)
  • end_date (Long): End date filter (epoch timestamp)
  • is_active (Boolean): Active status filter

Response

{
"success": 1,
"error": [],
"data": {
"document_type": [
{
"is_active": false,
"created_by": "b87d383d91fe48e58024f8344ba3273c",
"created_date": 1678713421,
"updated_by": "640b793d04e2428dbf19ab10399f4edb",
"updated_date": 1700543406,
"id": "761b7d7b2b5d49e29de4ad559838d1dc",
"document_type_title": "selfi",
"document_user_type": 3,
"document_side_type": 1,
"is_mandatory": null,
"document_extra_fields": null,
"document_type": 2,
"document_category": 1,
"dynamic_category_key": "KYC",
"business_types": null,
"expiry_date_required": false
},
{
"is_active": false,
"created_by": "b87d383d91fe48e58024f8344ba3273c",
"created_date": 1677062988,
"updated_by": "640b793d04e2428dbf19ab10399f4edb",
"updated_date": 1700543409,
"id": "a1220665235c41b98ebc98ae40a66072",
"document_type_title": "OterId",
"document_user_type": 3,
"document_side_type": 1,
"is_mandatory": null,
"document_extra_fields": [
"mer_doc_id_no"
],
"document_type": 1,
"document_category": 1,
"dynamic_category_key": "KYC",
"business_types": null,
"expiry_date_required": false
}
]
}
}

Response Fields

  • success (integer): Response status indicator
    • 1 = Success
    • 0 = Failure
  • error (array): Array of error messages (empty on success)
  • data (object): Response data object
    • document_type (array): Array of document type objects

Document Type Object Fields

  • id (string): Document type unique identifier
  • document_type_title (string): Display name of the document type
  • document_user_type (integer): Type of user this document applies to
    • 2 = Customer
    • 3 = Merchant
    • 5 = Agent
  • document_side_type (integer): Document side type
    • 1 = Front
    • 2 = Back
    • 3 = Both
    • 4 = Document
  • is_mandatory (boolean|null): Whether this document is mandatory
  • document_extra_fields (array|null): Additional validation fields required
  • document_type (integer): Document type classification
    • 1 = Document
    • 2 = Selfie
  • document_category (integer): Document category
    • 1 = KYC (Know Your Customer)
    • 2 = Business
  • dynamic_category_key (string): Key linking to dynamic category
  • business_types (array|null): Applicable business types
  • expiry_date_required (boolean): Whether expiry date is required
  • is_active (boolean): Document type active status
  • created_date (long): Creation timestamp (epoch)
  • created_by (string): ID of the user who created the document type
  • updated_by (string|null): ID of the user who last updated the document type
  • updated_date (long|null): Last update timestamp (epoch)

Example Usage

Basic Request

curl --location 'https://api.gafapay.com:8443/gafapay/v3/user/document_type?document_category=1&dynamic_category_key=KYC' \
--header 'authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJlNDk0Njg3N2YxODk0NmIyOTlmZGRmMGYyMTMzZGNiYSIsInJvbGVzIjpbIlJPTEVfQURNSU4iXSwiZXhwIjoxNzU3NzMyNzA2fQ.EinJZTo8_g00dl_DFIQVttQFnDLyq8n0C-uDYb9_n3c' \
--header 'companyid: 59388167894b4d10a04fe5da3b8a2104' \
--header 'requestid: b35d332f-131e-44c1-892f-8322e022da74'

Request with User Type Filter

curl --location 'https://api.gafapay.com:8443/gafapay/v3/user/document_type?user_type=3&document_category=1' \
--header 'authorization: Token YOUR_TOKEN_HERE' \
--header 'companyid: YOUR_COMPANY_ID' \
--header 'requestid: YOUR_REQUEST_ID'
curl --location 'https://api.gafapay.com:8443/gafapay/v3/user/document_type?document_category=1&skip=0&limit=10&search_keyword=passport' \
--header 'authorization: Token YOUR_TOKEN_HERE' \
--header 'companyid: YOUR_COMPANY_ID' \
--header 'requestid: YOUR_REQUEST_ID'

Document Side Type Constants

  • Front = 1: Front side of document (e.g., front of ID card)
  • Back = 2: Back side of document (e.g., back of ID card)
  • Both = 3: Both sides required
  • Document = 4: Single document (no side distinction)

Document Type Constants

  • Document = 1: Regular document uploads (passport, ID, etc.)
  • Selfie = 2: Selfie/photo verification

Document Category Constants

  • KYC = 1: Know Your Customer verification documents
  • Business = 2: Business verification documents

User Type Constants

  • Customer = 2: Regular customer users
  • Merchant = 3: Merchant/business users
  • Agent = 5: Agent/representative users

Notes

  • Dynamic Category Integration: Document types are linked to dynamic categories for better organization
  • Business Type Support: Document types can be restricted to specific business types
  • Expiry Date Management: Some documents may require expiry date validation
  • Pagination: Use skip and limit parameters for efficient data retrieval