Skip to main content
POST
/
purchase-orders
/
create
Create Purchase Orders
curl --request POST \
  --url https://api-v2.production.higg.org/pic-api/v1/purchase-orders/create \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --header 'x-developer-request-token: <api-key>' \
  --data '
{
  "productId": "<string>",
  "purchaseOrder": {
    "purchaseOrderId": "<string>",
    "purchaseDate": "<string>",
    "amountPurchase": 123,
    "assembly": {
      "femId": "<string>"
    }
  }
}
'
import requests

url = "https://api-v2.production.higg.org/pic-api/v1/purchase-orders/create"

payload = {
    "productId": "<string>",
    "purchaseOrder": {
        "purchaseOrderId": "<string>",
        "purchaseDate": "<string>",
        "amountPurchase": 123,
        "assembly": { "femId": "<string>" }
    }
}
headers = {
    "x-api-key": "<api-key>",
    "x-developer-request-token": "<api-key>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {
    'x-api-key': '<api-key>',
    'x-developer-request-token': '<api-key>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    productId: '<string>',
    purchaseOrder: {
      purchaseOrderId: '<string>',
      purchaseDate: '<string>',
      amountPurchase: 123,
      assembly: {femId: '<string>'}
    }
  })
};

fetch('https://api-v2.production.higg.org/pic-api/v1/purchase-orders/create', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api-v2.production.higg.org/pic-api/v1/purchase-orders/create",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'productId' => '<string>',
    'purchaseOrder' => [
        'purchaseOrderId' => '<string>',
        'purchaseDate' => '<string>',
        'amountPurchase' => 123,
        'assembly' => [
                'femId' => '<string>'
        ]
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json",
    "x-api-key: <api-key>",
    "x-developer-request-token: <api-key>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api-v2.production.higg.org/pic-api/v1/purchase-orders/create"

	payload := strings.NewReader("{\n  \"productId\": \"<string>\",\n  \"purchaseOrder\": {\n    \"purchaseOrderId\": \"<string>\",\n    \"purchaseDate\": \"<string>\",\n    \"amountPurchase\": 123,\n    \"assembly\": {\n      \"femId\": \"<string>\"\n    }\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<api-key>")
	req.Header.Add("x-developer-request-token", "<api-key>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api-v2.production.higg.org/pic-api/v1/purchase-orders/create")
  .header("x-api-key", "<api-key>")
  .header("x-developer-request-token", "<api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"productId\": \"<string>\",\n  \"purchaseOrder\": {\n    \"purchaseOrderId\": \"<string>\",\n    \"purchaseDate\": \"<string>\",\n    \"amountPurchase\": 123,\n    \"assembly\": {\n      \"femId\": \"<string>\"\n    }\n  }\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api-v2.production.higg.org/pic-api/v1/purchase-orders/create")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["x-developer-request-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"productId\": \"<string>\",\n  \"purchaseOrder\": {\n    \"purchaseOrderId\": \"<string>\",\n    \"purchaseDate\": \"<string>\",\n    \"amountPurchase\": 123,\n    \"assembly\": {\n      \"femId\": \"<string>\"\n    }\n  }\n}"

response = http.request(request)
puts response.read_body
{
  "productId": "<string>",
  "purchaseOrder": [
    {
      "_id": "<string>",
      "assembly": {
        "isDefault": true,
        "femId": "<string>",
        "facilityName": "<string>",
        "finalAssemblyRawText": "<string>",
        "surveyVersion": "<string>",
        "finalAssemblyImpacts": 123,
        "printingProductDyeingImpacts": 123,
        "totalNormalizedImpacts": 123,
        "sipfacilitytype": [
          "<string>"
        ],
        "annualProd": "<string>",
        "country": "<string>",
        "femDescriptor": "<string>",
        "year": 123,
        "finishedProductImpacts": 123
      },
      "purchaseOrderId": "<string>",
      "purchaseDate": 123,
      "impactPerUnit": 123,
      "totalImpactPerUnit": 123,
      "pmVersion": "<string>",
      "msiVersion": "<string>",
      "version": "<string>",
      "amountPurchase": 123,
      "isOutdated": true,
      "impactsPerUnitMultiPack": {
        "materialImpact": 123,
        "tier1Impact": 123,
        "packagingImpact": 123,
        "logisticsImpactsUpstreamTD": 123,
        "logisticsImpactsDTImpact": 123,
        "logisticsImpactsDCImpact": 123,
        "logisticsImpactsRetailImpact": 123,
        "productCareImpacts": 123,
        "endOfUseImpact": 123,
        "totalProductImpacts": 123,
        "componentImpact": 123
      },
      "totalImpactsMultiPack": {
        "materialImpact": 123,
        "tier1Impact": 123,
        "packagingImpact": 123,
        "logisticsImpactsUpstreamTD": 123,
        "logisticsImpactsDTImpact": 123,
        "logisticsImpactsDCImpact": 123,
        "logisticsImpactsRetailImpact": 123,
        "productCareImpacts": 123,
        "endOfUseImpact": 123,
        "totalProductImpacts": 123,
        "componentImpact": 123
      },
      "impactsPerUnit": {
        "materialImpact": 123,
        "tier1Impact": 123,
        "packagingImpact": 123,
        "logisticsImpactsUpstreamTD": 123,
        "logisticsImpactsDTImpact": 123,
        "logisticsImpactsDCImpact": 123,
        "logisticsImpactsRetailImpact": 123,
        "productCareImpacts": 123,
        "endOfUseImpact": 123,
        "totalProductImpacts": 123,
        "componentImpact": 123
      },
      "totalImpacts": {
        "materialImpact": 123,
        "tier1Impact": 123,
        "packagingImpact": 123,
        "logisticsImpactsUpstreamTD": 123,
        "logisticsImpactsDTImpact": 123,
        "logisticsImpactsDCImpact": 123,
        "logisticsImpactsRetailImpact": 123,
        "productCareImpacts": 123,
        "endOfUseImpact": 123,
        "totalProductImpacts": 123,
        "componentImpact": 123
      }
    }
  ],
  "createdOn": "<string>"
}
Use this endpoint to create a new purchase order and associate it with an existing product in your PIC library. Purchase orders track sourcing records and enable Scope 3 impact calculations. Purchases can optionally be linked to a Tier 1 FEM assessment by providing the assessment identifier in the purchaseOrder.assembly.femId field.

PIC - Create a Purchase Order

Request body params

NameTypeDescription
productIdstring[REQUIRED] The ID of the product to associate this purchase order with.
purchaseOrderobject[REQUIRED] The purchase order data.
purchaseOrder.purchaseOrderIdstringYour external purchase order identifier.
purchaseOrder.purchaseDatestringExpected purchase date in YYYY-MM-DD format; the field is a plain string in the API contract.
purchaseOrder.amountPurchasenumberThe quantity purchased.
purchaseOrder.assemblyobjectOptional FEM linking data.
purchaseOrder.assembly.femIdstringThe FEM assessment ID to link for Scope 3 calculations. Use Search Tier 1 Facilities to find available FEMs.

Implementation Details

  • Product association: The purchase order is added to the specified product. The product must exist and belong to your account.
  • FEM linking constraints: Products imported from the Higg Product Module cannot be linked to a FEM. This endpoint only accepts purchaseOrder.assembly.femId for FEM linking; any flags such as isDefault are derived by the server and may appear only in responses.
  • Date format: The expected format for purchaseDate is YYYY-MM-DD. The field is a plain string in the API contract.

Authorizations

x-api-key
string
header
required
x-developer-request-token
string
header
required

Body

application/json
productId
string
required
purchaseOrder
object
required

Response

200 - application/json

Ok

productId
string
required
purchaseOrder
object[]
required
createdOn
string
required