Entity Document Renewal Guide
When the system generates a document update request for an entity document (business_registration) or an entity person document (identity_document), the integrating party must first upload the new document file and then complete the document update through the query and submission endpoints.
Current ScopeThis guide covers
business_registration(entity documents) andidentity_document(entity person documents). Based on the current API definition, standalone personal entity documents are not included.
Core Interaction Flow 📊
sequenceDiagram
autonumber
actor User as User
participant Partner as Partner
participant DogPay as DogPay
Note over Partner, DogPay: 1. Query document update requests
Partner->>DogPay: GET /v2/openapi/openapi/entity-document-update-requests
DogPay-->>Partner: Return request list (with update_request_id)
Note over Partner, DogPay: 2. Upload the new document file
Partner->>DogPay: POST /open-api/v1/file/upload
DogPay-->>Partner: Return file_id
Note over Partner, DogPay: 3. Submit the document file and new expiry date
Partner->>DogPay: POST /v2/openapi/openapi/entity-document-update-requests/{id}/submit
DogPay-->>Partner: 202, request status changes to in_review
Note over Partner, DogPay: 4. Review result
Partner->>DogPay: Re-query the request status
DogPay-->>Partner: Return completed or rejected
Standard Workflow ⚙️
- Query pending update requests: Call the query endpoint to retrieve the document update requests that need to be processed, then confirm
document_type,status, andupdate_request_id. - Upload the new document file: Call the upload file endpoint to obtain the
file_id. Do not pass the local raw file directly to the submission endpoint. - Submit the update information: Call the submission endpoint with
update_request_id,files, andnew_expiry_date. - Wait for the review result: After a successful submission, the request enters
in_review; once the review is completed, the status changes tocompleted, or torejectedif the request is not approved.
Query Document Update Requests 🔍
GET /v2/openapi/openapi/entity-document-update-requests
| Parameter | Location | Required | Description |
|---|---|---|---|
Authorization | header | Yes | Bearer Token |
dgp-entity-id | header | No | Sub-account (entity) ID. If provided, only requests under that sub-account are returned |
status | query | No | Request status filter: pending_submission, in_review, rejected, completed |
Results are sorted by expiry date in ascending order, with requests that do not have an expiry date placed last, and then by creation time in descending order. If the status filter is omitted, all document update requests for the current account are returned. data is an empty array when there are no matching requests.
Response Fields
| Field | Description |
|---|---|
update_request_id | Document update request ID, which is the {id} of the submission endpoint |
entity_id | Sub-account ID that owns the request |
document_type | Document type: business_registration or identity_document |
status | Request status: pending_submission, in_review, rejected, completed |
expiry_date | Current document expiry date in YYYY-MM-DD format, read-only |
can_submit | Whether the current status allows submitting files |
reject_reason | Rejection reason, returned only when status = rejected |
Upload the New Document File 📤
Before submission, you must call the Upload File endpoint to obtain the file ID.
When uploading, fill in fileUseType according to the upload endpoint requirements and ensure that the uploaded file corresponds to the document_type of the current request. After a successful upload, save the returned file ID and pass it into the files array of the submission endpoint.
Submit Document Update Files 🚀
POST /v2/openapi/openapi/entity-document-update-requests/{id}/submit
| Parameter | Location | Required | Description |
|---|---|---|---|
Authorization | header | Yes | Bearer Token |
dgp-entity-id | header | No | Sub-account (entity) ID. If provided, the request only applies to that sub-account |
id | path | Yes | update_request_id from the query result |
files | body | Yes | Array of file_id values returned by the upload file endpoint |
new_expiry_date | body | Yes | New document expiry date in YYYY-MM-DD format |
Request example:
{
"files": [
"9f1c6d2a-3b4e-4f7a-8c1d-2e5b7a9c0d31"
],
"new_expiry_date": "2027-01-01"
}On success, the endpoint returns 202, data contains the latest request state, and status is in_review.
Status Transitions
| Current Status | Submittable | Status After Submission |
|---|---|---|
pending_submission | Yes | in_review |
rejected | Yes | in_review |
in_review | No | No transition; returns 409 REVIEW_IN_PROGRESS |
completed | No | No transition; returns 409 UPDATE_ALREADY_COMPLETED |
Error Code Summary 📊
| HTTP Status | Business Error Code | Scenario |
|---|---|---|
400 | None | Invalid update_request_id, missing files or new_expiry_date, or invalid date format |
401 | None | Missing or invalid token |
404 | None | Update request not found, or the request belongs to another account |
409 | 40901 | UPDATE_WINDOW_NOT_OPEN |
409 | 40902 | REVIEW_IN_PROGRESS |
409 | 40904 | UPDATE_ALREADY_COMPLETED |
422 | 42203 | FILE_VALIDATION_FAILED |
Core Constraints and Rules 🛡️
Only pending_submission and rejected Can Be Submitted
in_reviewandcompletedrequests cannot be submitted. Resubmitting a request under review returns409 REVIEW_IN_PROGRESS, and resubmitting a completed request returns409 UPDATE_ALREADY_COMPLETED.
The Submission Endpoint Is Not Replay-IdempotentThe request enters
in_reviewimmediately after a successful submission. If the request is already under review, resubmitting does not return the previous successful result; instead, it directly returns409 REVIEW_IN_PROGRESS.
files Must Be File IDs Returned by the Upload EndpointThe
filesarray can only containfile_idvalues returned by the upload file endpoint. Local file paths are not accepted. The array must be non-empty, contain no duplicates or blank values, and allfile_idvalues must belong to the current API customer.
Typical Scenarios 💡
| Scenario | Processing Flow | Expected Result |
|---|---|---|
| Newly generated update request | Query pending_submission -> upload file -> submit | Returns 202, status changes to in_review |
| Resubmission after rejection | Query rejected -> replace file based on reject_reason -> submit | Returns 202, status changes to in_review again |
| Duplicate submission under review | Submit again with the same update_request_id | Returns 409 REVIEW_IN_PROGRESS |
| Duplicate submission of a completed request | Submit a completed request again | Returns 409 UPDATE_ALREADY_COMPLETED |
| Incorrect file ownership | Submit a file_id owned by another account | Returns 422 FILE_VALIDATION_FAILED |
Updated about 2 hours ago
