Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/PDNMX/s1_backend/llms.txt

Use this file to discover all available pages before exploring further.

The /v1/search endpoint is the primary way to retrieve asset declaration records from the PDN. Unlike /v1/summary, which fans out to multiple providers, this endpoint routes to exactly one provider identified by supplier_id and returns the full paginated record payload that provider returns. The gateway normalises your request through two middleware stages — createQuery and createOrder — that map flat input fields to the nested structure expected by upstream providers before forwarding the request.

Endpoint

POST /v1/search
Content-Type: application/json

Request Body

Required Fields

supplier_id
string
required
Identifies the target data provider. Must match a supplier_id value from GET /v1/providers. The request fails with HTTP 500 if this field is missing or does not match any configured provider.

Pagination Fields

page
number
Page number to retrieve. Defaults to 1 if omitted, null, or non-numeric.
pageSize
number
Number of records per page. Defaults to 10 if omitted, null, or non-numeric.

Query Filters

All filter fields are passed inside a query object. Omitting the query object (or passing an empty object) returns all records subject only to pagination.
query
object
An object containing one or more filter criteria. All fields are optional. Empty strings, null, and the string "0" are treated as absent.

Sort Options

sort
object
An object specifying sort direction for one or more fields. Use 1 for ascending and -1 for descending. Omitting this object returns results in the provider’s default order.

Example Request

curl -X POST http://localhost:3101/v1/search \
  -H "Content-Type: application/json" \
  -d '{
    "supplier_id": "EDOMEX",
    "page": 1,
    "pageSize": 10,
    "query": {
      "nombres": "Juan",
      "primerApellido": "García"
    },
    "sort": {
      "primerApellido": 1
    }
  }'

Response

On success, the gateway returns HTTP 200 OK with the provider’s full response payload passed through. The response is enriched with supplier_id, supplier_name, levels, and endpoint_type by the upstream fetch layer.

Error Responses

Both error conditions below return HTTP 500. Ensure supplier_id is always provided and matches a value from GET /v1/providers before calling this endpoint.
Missing supplier_id:
HTTP 500
{
  "error": "Debe proporcionar un proveedor de información"
}
supplier_id not found in configured providers:
HTTP 500
{
  "error": "Proveedor de información no disponible"
}

Build docs developers (and LLMs) love