Skip to main content

requestNSupply

@nmi-agro/fdm-source


@nmi-agro/fdm-source / fdm-calculator/src / requestNSupply

Function: requestNSupply()

requestNSupply(input): Promise<NSupplyResult>

Defined in: fdm-calculator/src/mineralization/nsupply.ts:57

Calls POST /bemestingsplan/nsupply with the pre-built request body and returns the parsed N supply curve as an NSupplyResult.

This is the uncached version. In most cases you should use getNSupply which adds DB-backed caching via withCalculationCache.

Error handling:

HTTP statusThrown error
401 / 403NmiApiError(status, "API-sleutel niet geconfigureerd of verlopen.")
422NmiApiError(422, "Onvoldoende bodemgegevens...")
503NmiApiError(503, "NMI API is tijdelijk niet beschikbaar.")
other 4xx/5xxNmiApiError(status, "Er is een fout opgetreden...")
invalid JSONError("Ongeldig antwoord van NMI API: ...")

Parameters

input

NSupplyComputeInput

Pre-assembled input bundle including the request body, field metadata, chosen method, and data completeness assessment.

Returns

Promise<NSupplyResult>

A fully populated NSupplyResult.

Throws

NmiApiError on API or HTTP errors.

Throws

Error if the response body fails Zod validation.