Skip to main content
The pn-paper-channel-tenderAPILambda Lambda function provides read-only access to pn-paper-channel data without going through the REST back-office API. You invoke it directly using the AWS SDK or CLI, passing a JSON payload that specifies an operation and its parameters.
Use this Lambda when you need programmatic or internal access to tender data from within the AWS ecosystem (e.g., from other Lambda functions, scripts, or automation pipelines). For back-office user-facing operations and write access, use the back-office REST API instead.

Function name

pn-paper-channel-tenderAPILambda
Replace X in the AWS SSO profile sso_pn-core-X with the appropriate environment identifier (e.g., dev, uat, prod).

Invocation pattern

All operations share the same invocation pattern. Set operation in the payload to select which operation to run.
aws lambda \
  --profile sso_pn-core-X \
  invoke \
  --function-name pn-paper-channel-tenderAPILambda \
  --payload '<payload-json>' \
  response.json
The --payload value must be a JSON string. On some systems you may need to base64-encode it: --payload $(echo '<json>' | base64).

Operations

Returns a paginated list of tenders. You can narrow results with an optional date range filter.

Payload

operation
string
required
Must be "GET_TENDERS".
page
number
required
Zero-based page number to retrieve (integer).
size
number
required
Number of items per page (integer).
from
string
Start of the date range filter. ISO 8601 UTC format, e.g. 2024-01-01T08:00:00.000Z.
to
string
End of the date range filter. ISO 8601 UTC format, e.g. 2024-12-31T23:59:59.999Z.

Response

statusCode
number
required
200 on success, 400 on input validation error.
description
string
required
Human-readable description of the result.
content
PaperChannelTender[]
Paginated list of tender objects. Empty array when no tenders match the filter.

Status codes

CodeDescription
200Tenders filtered by the provided query parameters
400Input data format error

AWS CLI example

aws lambda \
  --profile sso_pn-core-X \
  invoke \
  --function-name pn-paper-channel-tenderAPILambda \
  --payload '{"operation":"GET_TENDERS","page":0,"size":10,"from":"2024-01-01T00:00:00.000Z","to":"2024-12-31T23:59:59.999Z"}' \
  response.json
Returns the single tender that is currently active. Returns 404 if no active tender exists.

Payload

operation
string
required
Must be "GET_TENDER_ACTIVE".

Response

statusCode
number
required
200 on success, 400 on input error, 404 if no active tender is found.
description
string
required
Human-readable description of the result.
content
object
The currently active tender.

Status codes

CodeDescription
200Currently active tender returned
400Input data format error
404No active tender found

AWS CLI example

aws lambda \
  --profile sso_pn-core-X \
  invoke \
  --function-name pn-paper-channel-tenderAPILambda \
  --payload '{"operation":"GET_TENDER_ACTIVE"}' \
  response.json
Returns all costs associated with a tender. You can filter by product, lot, zone, or delivery driver.

Payload

operation
string
required
Must be "GET_COSTS".
tenderId
string
required
Unique identifier of the tender whose costs you want to retrieve.
product
string
Filter by product type (e.g., AR, RS, 890).
lot
string
Filter by lot identifier.
zone
string
Filter by delivery zone.
deliveryDriverId
string
Filter by delivery driver identifier.

Response

statusCode
number
required
200 on success, 400 on input error, 404 if the tender is not found.
description
string
required
Human-readable description of the result.
content
PaperChannelTenderCosts[]
List of cost records matching the filter.

Status codes

CodeDescription
200Costs associated with the tender ID
400Input data format error
404Tender not found

AWS CLI example

aws lambda \
  --profile sso_pn-core-X \
  invoke \
  --function-name pn-paper-channel-tenderAPILambda \
  --payload '{"operation":"GET_COSTS","tenderId":"tender-abc-123","product":"AR"}' \
  response.json
Returns a single cost record identified by tender ID, product type, and geokey.

Payload

operation
string
required
Must be "GET_COST".
tenderId
string
required
Unique identifier of the tender.
product
string
required
Product type (e.g., AR, RS, 890).
geokey
string
required
Geographic key identifying the delivery area (CAP code or international zone).

Response

statusCode
number
required
200 on success, 400 on input error, 404 if the tender or geokey is not found.
description
string
required
Human-readable description of the result.
content
object
The matching cost record.

Status codes

CodeDescription
200Cost for the specified tender, product, and geokey
400Input data format error
404Tender or geokey not found

AWS CLI example

aws lambda \
  --profile sso_pn-core-X \
  invoke \
  --function-name pn-paper-channel-tenderAPILambda \
  --payload '{"operation":"GET_COST","tenderId":"tender-abc-123","product":"AR","geokey":"00100"}' \
  response.json
Returns all historical versions of a geokey for a given tender and product combination. This is useful for auditing coverage changes over time.

Payload

operation
string
required
Must be "GET_GEOKEY".
tenderId
string
required
Unique identifier of the tender.
product
string
required
Product type (e.g., AR, RS, 890).
geokey
string
required
Geographic key to look up (CAP code or international zone identifier).

Response

statusCode
number
required
200 on success, 400 on input error.
description
string
required
Human-readable description of the result.
content
PaperChannelGeokey[]
List of geokey version records.

Status codes

CodeDescription
200List of geokey versions
400Input data format error

AWS CLI example

aws lambda \
  --profile sso_pn-core-X \
  invoke \
  --function-name pn-paper-channel-tenderAPILambda \
  --payload '{"operation":"GET_GEOKEY","tenderId":"tender-abc-123","product":"AR","geokey":"00100"}' \
  response.json
Returns a list of all delivery drivers registered in the system.

Payload

operation
string
required
Must be "GET_DELIVERY_DRIVERS".

Response

statusCode
number
required
200 on success, 400 on input error.
description
string
required
Human-readable description of the result.
content
PaperChannelDeliveryDriver[]
List of all delivery driver records.

Status codes

CodeDescription
200List of delivery drivers
400Input data format error

AWS CLI example

aws lambda \
  --profile sso_pn-core-X \
  invoke \
  --function-name pn-paper-channel-tenderAPILambda \
  --payload '{"operation":"GET_DELIVERY_DRIVERS"}' \
  response.json

Lambda vs REST API

CapabilityLambdaBack-office REST API
Read tendersYesYes
Read costs and geokeysYesYes (costs only)
Read delivery driversYesYes
Create / update / deleteNoYes
AuthenticationAWS IAM / SSO profilex-api-key header
Best forInternal automation, scripts, other Lambda functionsBack-office UI, external integrations
The Lambda function is read-only. For any write operations (creating or updating tenders, drivers, or costs), use the back-office REST API.

Build docs developers (and LLMs) love