Skip to main content

Get Order Data from FBPI Webhooks

Use this flow when your system receives an FBPI order webhook and you need to fetch full order and customer details using order_nr.

This guide builds on the Event Notifications model: your endpoint receives an event, validates it, and then your integration calls FBPI APIs for complete order data.

Prerequisites

Before you start:

Integration Steps

1. Receive the webhook event

Your webhook receives the Event Notifications envelope. The business payload inside the event contains the order reference (order_nr) that you will use in API calls.

Why this step exists:

  • Event Notifications is push-based and at-least-once.
  • You should validate and parse the event before making downstream API calls.

Webhook payload reference (example):

{
"event_schema_version": 1,
"event_type": "FBPI::ORDER_CREATED",
"metadata": {
"published_at": "2026-04-09T08:42:15Z",
"project_code": "<project_code>"
},
"payload": {
"order_nr": "NFBO123456789"
}
}

In this flow, treat order_nr as the identifier for your downstream processing and API retrieval.

2. Extract and validate order_nr

Parse the webhook body and extract order_nr from the event payload. If it is missing or invalid, return a non-success response and log the payload for investigation.

Why this step exists:

  • order_nr is the key identifier needed by FBPI order retrieval APIs.

Validation checklist:

  • order_nr is present.
  • order_nr format matches your expected internal validation rules.
  • The payload can be mapped to your internal order processing state.

3. Call Get FBPI Order API

Use the extracted order_nr to retrieve order-level details.

Method + path

GET /fbpi/v1/fbpi-order/:fbpi_order_nr/get

Reference: Get FBPI Order API

Why this step exists:

  • The webhook notifies you an order event happened; this API returns the latest order details from FBPI.

Request examples:

These examples assume you already have an active session from the service-account flow (sign a JWT, call login, then reuse the session cookie or an HTTP client that stores cookies). For setup and copy-paste examples in several languages, see Authenticating your requests.

// Implement getAuthenticatedClient() using https://noon-docs.noonpartners.dev/docs/authentication/authenticating-requests.
const orderNr = '<order_nr>';
const client = await getAuthenticatedClient();

const response = await client.fetch(`https://noon-api-gateway.noon.partners/fbpi/v1/fbpi-order/${orderNr}/get`, {
method: 'GET',
credentials: 'include',
headers: {
'User-Agent': 'YourAppName/1.0.0',
'Content-Type': 'application/json',
},
});

if (!response.ok) {
throw new Error(`Get order failed: ${response.status}`);
}

const order = await response.json();

Expected response shape:

  • Order-level object for the provided FBPI order.
  • Includes identifiers and fulfillment-relevant order data required for downstream steps.

Failure/retry notes:

  • If the order is not yet available, retry with exponential backoff.
  • Keep retries idempotent by keying processing on order_nr.

4. Call Get FBPI Order Customer Details API

After retrieving the order, fetch customer-specific details for the same order_nr.

Method + path

GET /fbpi/v1/fbpi-order/:fbpi_order_nr/customer-details/get

Reference: Get FBPI Order Customer Data API

Why this step exists:

  • Customer details may be needed for fulfillment operations, communication, and internal processing.

Request examples:

Use the same authenticated session as in the Get Order examples above.

// Implement getAuthenticatedClient() using https://noon-docs.noonpartners.dev/docs/authentication/authenticating-requests.
const orderNr = '<order_nr>';
const client = await getAuthenticatedClient();

const response = await client.fetch(
`https://noon-api-gateway.noon.partners/fbpi/v1/fbpi-order/${orderNr}/customer-details/get`,
{
method: 'GET',
credentials: 'include',
headers: {
'User-Agent': 'YourAppName/1.0.0',
'Content-Type': 'application/json',
},
}
);

if (!response.ok) {
throw new Error(`Get customer details failed: ${response.status}`);
}

const customerDetails = await response.json();

Expected response shape:

  • Customer-details object associated with the FBPI order.
  • Fields are scoped to the provided order_nr.

Failure/retry notes:

  • Treat temporary failures as retryable with backoff.
  • Persist both success and failure states for observability.

Use this sequence in your webhook worker:

  1. Receive webhook event.
  2. Extract order_nr.
  3. Call Get FBPI Order API.
  4. Call Get FBPI Order Customer Data API.
  5. Store merged order + customer result in your system.
  6. Mark processing status and logs for monitoring/replay.

Next Steps

  • Continue the operational flow in Step 3: Managing Your Orders.
  • Use your internal monitoring to track webhook delivery retries and API call outcomes end-to-end.