List Orders

Retrieves a list of orders.

HTTP Request

GET https://api.cdr.fyi/v1/orders

Query Parameters

ParameterTypeDescription
entityFilterTypeStringFilter by entity (Supplier, Marketplace, Purchaser)
entityFilterIdStringFilter by entity ID

Custom Headers

  • x-page: The page number (default is 1)
  • x-limit: Number of items per page (max 100, default is 10)

Example Request

curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.cdr.fyi/orders?entityFilterType=Supplier&entityFilterId=123"

Create or Update an Order

This endpoint creates a new order or updates an existing one by upserting based on the order_id.

HTTP Request

POST https://api.cdr.fyi/v1/orders

Request Headers

  • Authorization: Bearer YOUR_ACCESS_TOKEN
  • Content-Type: application/json

Request Body Parameters

ParameterTypeDescriptionRequired
order_idStringUnique identifier for the orderNo
purchaser_idStringIdentifier for the purchaserYes
supplier_idStringIdentifier for the supplierYes
marketplace_idStringIdentifier for the marketplaceNo
statusStringCurrent status of the order (MOU/LOI, Undelivered, Partial, Delivered)Yes
delivery_status_sourceStringSource of the delivery statusNo
delivery_verifiedBooleanWhether the delivery is verifiedNo
delivery_forecastStringForecast of the deliveryNo
delivery_verification_sourceStringSource for verifying the deliveryNo
methodStringMethod through which the order was placedNo
tons_purchasedDecimalTons purchased in the orderNo
price_usdDecimalPrice of the order in USDNo
latest_delivery_dateDateTimeLatest date by which the delivery should be completedNo
durability_yearsIntegerDurability of the product in yearsNo
announcement_dateDateTimeDate of the announcementNo
announcement_linkStringLink to the announcementNo
source_typeStringType of source for the orderNo
notesStringAdditional notes, max 500 charactersNo
parent_idStringReference to a previous order, either as a decomposition of a previously deleted order or as lineage for a resaleNo
is_resaleBooleanIndicates that the order was a resaleNo
linkStringLink to more informationNo
marketplace_purchaser_idStringIdentifier for the marketplace purchaserNo
tons_deliveredDecimalTons delivered in the orderNo
type_of_agreementDecimalThe type of agreement, either ‘Credit Sale’, ‘MOU/LOI’ or ‘Delivery Agreement’No

Example Request

curl -X GET https://api.cdr.fyi/v1/orders \
     -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
     -H "Content-Type: application/json" \

Example Response

{
  "orders": [{
    "order_id": "ord_sample",
    "purchaser_id": "pur_sample",
    "supplier_id": "sup_sample",
    "marketplace_id": "mkt_sample",
    "status": "active",
    "method": "online",
    "tons_purchased": 20.5,
    "price_usd": 100.5,
    "durability_years": 5,
    "announcement_date": "2023-08-28T00:00:00.000Z"
  }]
}

Error Responses

If the request is not successful, you will receive a 400 Bad Request or 401 Unauthorized response along with an error message indicating the issue.