Skip to main content
Update a purchase order
curl --request PATCH \
  --url https://api.cf.ovrsea.com/v1/purchaseOrders \
  --header 'Content-Type: application/json' \
  --data '
{
  "product_lines": [
    {
      "ordered_quantity": 24,
      "product": {
        "sku": "REF0123458",
        "hs_code": "96032930",
        "description": "blue shirt with a T shape",
        "is_hazardous": "false",
        "hazardous_description": "UN1993",
        "custom_parameters": [
          {
            "name": "parameter1",
            "value": "value1"
          }
        ]
      },
      "reference": "Delivery #1",
      "unit_price": {
        "amount": 150357.99,
        "currency": "USD"
      },
      "volume": 15,
      "volume_unit": "m3"
    }
  ],
  "reference": "PO5792303"
}
'
import requests

url = "https://api.cf.ovrsea.com/v1/purchaseOrders"

payload = {
"product_lines": [
{
"ordered_quantity": 24,
"product": {
"sku": "REF0123458",
"hs_code": "96032930",
"description": "blue shirt with a T shape",
"is_hazardous": "false",
"hazardous_description": "UN1993",
"custom_parameters": [
{
"name": "parameter1",
"value": "value1"
}
]
},
"reference": "Delivery #1",
"unit_price": {
"amount": 150357.99,
"currency": "USD"
},
"volume": 15,
"volume_unit": "m3"
}
],
"reference": "PO5792303"
}
headers = {"Content-Type": "application/json"}

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

print(response.text)
const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
product_lines: [
{
ordered_quantity: 24,
product: {
sku: 'REF0123458',
hs_code: '96032930',
description: 'blue shirt with a T shape',
is_hazardous: 'false',
hazardous_description: 'UN1993',
custom_parameters: [{name: 'parameter1', value: 'value1'}]
},
reference: 'Delivery #1',
unit_price: {amount: 150357.99, currency: 'USD'},
volume: 15,
volume_unit: 'm3'
}
],
reference: 'PO5792303'
})
};

fetch('https://api.cf.ovrsea.com/v1/purchaseOrders', 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.cf.ovrsea.com/v1/purchaseOrders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'product_lines' => [
[
'ordered_quantity' => 24,
'product' => [
'sku' => 'REF0123458',
'hs_code' => '96032930',
'description' => 'blue shirt with a T shape',
'is_hazardous' => 'false',
'hazardous_description' => 'UN1993',
'custom_parameters' => [
[
'name' => 'parameter1',
'value' => 'value1'
]
]
],
'reference' => 'Delivery #1',
'unit_price' => [
'amount' => 150357.99,
'currency' => 'USD'
],
'volume' => 15,
'volume_unit' => 'm3'
]
],
'reference' => 'PO5792303'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);

$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.cf.ovrsea.com/v1/purchaseOrders"

payload := strings.NewReader("{\n \"product_lines\": [\n {\n \"ordered_quantity\": 24,\n \"product\": {\n \"sku\": \"REF0123458\",\n \"hs_code\": \"96032930\",\n \"description\": \"blue shirt with a T shape\",\n \"is_hazardous\": \"false\",\n \"hazardous_description\": \"UN1993\",\n \"custom_parameters\": [\n {\n \"name\": \"parameter1\",\n \"value\": \"value1\"\n }\n ]\n },\n \"reference\": \"Delivery #1\",\n \"unit_price\": {\n \"amount\": 150357.99,\n \"currency\": \"USD\"\n },\n \"volume\": 15,\n \"volume_unit\": \"m3\"\n }\n ],\n \"reference\": \"PO5792303\"\n}")

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

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.patch("https://api.cf.ovrsea.com/v1/purchaseOrders")
.header("Content-Type", "application/json")
.body("{\n \"product_lines\": [\n {\n \"ordered_quantity\": 24,\n \"product\": {\n \"sku\": \"REF0123458\",\n \"hs_code\": \"96032930\",\n \"description\": \"blue shirt with a T shape\",\n \"is_hazardous\": \"false\",\n \"hazardous_description\": \"UN1993\",\n \"custom_parameters\": [\n {\n \"name\": \"parameter1\",\n \"value\": \"value1\"\n }\n ]\n },\n \"reference\": \"Delivery #1\",\n \"unit_price\": {\n \"amount\": 150357.99,\n \"currency\": \"USD\"\n },\n \"volume\": 15,\n \"volume_unit\": \"m3\"\n }\n ],\n \"reference\": \"PO5792303\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.cf.ovrsea.com/v1/purchaseOrders")

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

request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"product_lines\": [\n {\n \"ordered_quantity\": 24,\n \"product\": {\n \"sku\": \"REF0123458\",\n \"hs_code\": \"96032930\",\n \"description\": \"blue shirt with a T shape\",\n \"is_hazardous\": \"false\",\n \"hazardous_description\": \"UN1993\",\n \"custom_parameters\": [\n {\n \"name\": \"parameter1\",\n \"value\": \"value1\"\n }\n ]\n },\n \"reference\": \"Delivery #1\",\n \"unit_price\": {\n \"amount\": 150357.99,\n \"currency\": \"USD\"\n },\n \"volume\": 15,\n \"volume_unit\": \"m3\"\n }\n ],\n \"reference\": \"PO5792303\"\n}"

response = http.request(request)
puts response.read_body
{
  "reference": "<string>"
}
{}

Body

application/json
product_lines
object[]
required
reference
string
required
Example:

"PO5792303"

Response

Purchase order updated

Purchase order updated

reference
string