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 Scope

This guide covers business_registration (entity documents) and identity_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 ⚙️

  1. Query pending update requests: Call the query endpoint to retrieve the document update requests that need to be processed, then confirm document_type, status, and update_request_id.
  2. 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.
  3. Submit the update information: Call the submission endpoint with update_request_id, files, and new_expiry_date.
  4. Wait for the review result: After a successful submission, the request enters in_review; once the review is completed, the status changes to completed, or to rejected if the request is not approved.

Query Document Update Requests 🔍

GET /v2/openapi/openapi/entity-document-update-requests
ParameterLocationRequiredDescription
AuthorizationheaderYesBearer Token
dgp-entity-idheaderNoSub-account (entity) ID. If provided, only requests under that sub-account are returned
statusqueryNoRequest 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

FieldDescription
update_request_idDocument update request ID, which is the {id} of the submission endpoint
entity_idSub-account ID that owns the request
document_typeDocument type: business_registration or identity_document
statusRequest status: pending_submission, in_review, rejected, completed
expiry_dateCurrent document expiry date in YYYY-MM-DD format, read-only
can_submitWhether the current status allows submitting files
reject_reasonRejection 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
ParameterLocationRequiredDescription
AuthorizationheaderYesBearer Token
dgp-entity-idheaderNoSub-account (entity) ID. If provided, the request only applies to that sub-account
idpathYesupdate_request_id from the query result
filesbodyYesArray of file_id values returned by the upload file endpoint
new_expiry_datebodyYesNew 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 StatusSubmittableStatus After Submission
pending_submissionYesin_review
rejectedYesin_review
in_reviewNoNo transition; returns 409 REVIEW_IN_PROGRESS
completedNoNo transition; returns 409 UPDATE_ALREADY_COMPLETED

Error Code Summary 📊

HTTP StatusBusiness Error CodeScenario
400NoneInvalid update_request_id, missing files or new_expiry_date, or invalid date format
401NoneMissing or invalid token
404NoneUpdate request not found, or the request belongs to another account
40940901UPDATE_WINDOW_NOT_OPEN
40940902REVIEW_IN_PROGRESS
40940904UPDATE_ALREADY_COMPLETED
42242203FILE_VALIDATION_FAILED

Core Constraints and Rules 🛡️

Only pending_submission and rejected Can Be Submitted

in_review and completed requests cannot be submitted. Resubmitting a request under review returns 409 REVIEW_IN_PROGRESS, and resubmitting a completed request returns 409 UPDATE_ALREADY_COMPLETED.

⚠️

The Submission Endpoint Is Not Replay-Idempotent

The request enters in_review immediately after a successful submission. If the request is already under review, resubmitting does not return the previous successful result; instead, it directly returns 409 REVIEW_IN_PROGRESS.

🚧

files Must Be File IDs Returned by the Upload Endpoint

The files array can only contain file_id values 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 all file_id values must belong to the current API customer.


Typical Scenarios 💡

ScenarioProcessing FlowExpected Result
Newly generated update requestQuery pending_submission -> upload file -> submitReturns 202, status changes to in_review
Resubmission after rejectionQuery rejected -> replace file based on reject_reason -> submitReturns 202, status changes to in_review again
Duplicate submission under reviewSubmit again with the same update_request_idReturns 409 REVIEW_IN_PROGRESS
Duplicate submission of a completed requestSubmit a completed request againReturns 409 UPDATE_ALREADY_COMPLETED
Incorrect file ownershipSubmit a file_id owned by another accountReturns 422 FILE_VALIDATION_FAILED

Did this page help you?