Build Product Code
Uri: https://test-api.finerworks.com/v3/build_product_code
Method: POST
Create a product code based on a list of material ids. This is used for the product builder to build a product code that can be added to the cart. Note this endpoint does not check if the materials are active or valid for use, it simply builds a code based on the ids provided.
Body
| Name | Description | Type | Additional information |
|---|---|---|---|
| build |
Build object containing all the details needed to build a product code. The more details included, the more accurate the product code and price will be. However, even if only a few details are included, a product code will still be generated based on the details provided. |
build_product_code_obj |
None. |
Example JSON Body
application/json, text/json
{
"build": {
"CardStockID": 1,
"CardStyleID": 2,
"CardTypeID": 3,
"FrameID": 4,
"FrameW": 5.0,
"FrameH": 6.0,
"SheetW": 7.0,
"SheetH": 8.0,
"MatID": 9,
"Mat1WindowW": 10.0,
"Mat1WindowH": 11.0,
"MatID2": 12,
"Mat2WindowW": 13.0,
"Mat2WindowH": 14.0,
"GlassID": 15,
"PrintProductTypeID": 16,
"MediaID": 17,
"MountingID": 18,
"MountingSetID": 19,
"MountingAddOns": [
1,
2
],
"CanvasAddOns": [
1,
2
],
"CardOptions": [
1,
2
],
"Units": 20,
"PrintW": 21.0,
"PrintH": 22.0,
"PhotoItemID": 23,
"PhotoItemOptions": [
1,
2
],
"ColorCorrect": true
}
}
Sample Code Library
curl --location --request sample_method 'https://test-api.finerworks.comsample_endpoint' \
--header 'Content-Type: application/json' \
--header 'web_api_key: my-web-api-key-goes-here' \
--header 'app_key: my-app-key-goes-here' \
--data-raw '{
"build": {
"CardStockID": 1,
"CardStyleID": 2,
"CardTypeID": 3,
"FrameID": 4,
"FrameW": 5.0,
"FrameH": 6.0,
"SheetW": 7.0,
"SheetH": 8.0,
"MatID": 9,
"Mat1WindowW": 10.0,
"Mat1WindowH": 11.0,
"MatID2": 12,
"Mat2WindowW": 13.0,
"Mat2WindowH": 14.0,
"GlassID": 15,
"PrintProductTypeID": 16,
"MediaID": 17,
"MountingID": 18,
"MountingSetID": 19,
"MountingAddOns": [
1,
2
],
"CanvasAddOns": [
1,
2
],
"CardOptions": [
1,
2
],
"Units": 20,
"PrintW": 21.0,
"PrintH": 22.0,
"PhotoItemID": 23,
"PhotoItemOptions": [
1,
2
],
"ColorCorrect": true
}
}'
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://test-api.finerworks.comsample_endpoint');
$request->setMethod(HTTP_Request2::METHOD_sample_method);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'web_api_key' => 'my-web-api-key-goes-here',
'app_key' => 'my-app-key-goes-here'
));
$request->setBody('{
'build': {
'CardStockID': 1,
'CardStyleID': 2,
'CardTypeID': 3,
'FrameID': 4,
'FrameW': 5.0,
'FrameH': 6.0,
'SheetW': 7.0,
'SheetH': 8.0,
'MatID': 9,
'Mat1WindowW': 10.0,
'Mat1WindowH': 11.0,
'MatID2': 12,
'Mat2WindowW': 13.0,
'Mat2WindowH': 14.0,
'GlassID': 15,
'PrintProductTypeID': 16,
'MediaID': 17,
'MountingID': 18,
'MountingSetID': 19,
'MountingAddOns': [
1,
2
],
'CanvasAddOns': [
1,
2
],
'CardOptions': [
1,
2
],
'Units': 20,
'PrintW': 21.0,
'PrintH': 22.0,
'PhotoItemID': 23,
'PhotoItemOptions': [
1,
2
],
'ColorCorrect': true
}
}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
var client = new RestClient("https://test-api.finerworks.comsample_endpoint");
client.Timeout = -1;
var request = new RestRequest(Method.sample_method);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("web_api_key", "my-web-api-key-goes-here");
request.AddHeader("app_key", "my-app-key-goes-here");
request.AddParameter("application/json", "{
'build': {
'CardStockID': 1,
'CardStyleID': 2,
'CardTypeID': 3,
'FrameID': 4,
'FrameW': 5.0,
'FrameH': 6.0,
'SheetW': 7.0,
'SheetH': 8.0,
'MatID': 9,
'Mat1WindowW': 10.0,
'Mat1WindowH': 11.0,
'MatID2': 12,
'Mat2WindowW': 13.0,
'Mat2WindowH': 14.0,
'GlassID': 15,
'PrintProductTypeID': 16,
'MediaID': 17,
'MountingID': 18,
'MountingSetID': 19,
'MountingAddOns': [
1,
2
],
'CanvasAddOns': [
1,
2
],
'CardOptions': [
1,
2
],
'Units': 20,
'PrintW': 21.0,
'PrintH': 22.0,
'PhotoItemID': 23,
'PhotoItemOptions': [
1,
2
],
'ColorCorrect': true
}
}, ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
var settings = {
"url": "https://test-api.finerworks.comsample_endpoint",
"method": "sample_method",
"timeout": 0,
"headers": {
"Content-Type": "application/json",
"web_api_key": "my-web-api-key-goes-here",
"app_key": "my-app-key-goes-here"
},
"data": JSON.stringify({
'build': {
'CardStockID': 1,
'CardStyleID': 2,
'CardTypeID': 3,
'FrameID': 4,
'FrameW': 5.0,
'FrameH': 6.0,
'SheetW': 7.0,
'SheetH': 8.0,
'MatID': 9,
'Mat1WindowW': 10.0,
'Mat1WindowH': 11.0,
'MatID2': 12,
'Mat2WindowW': 13.0,
'Mat2WindowH': 14.0,
'GlassID': 15,
'PrintProductTypeID': 16,
'MediaID': 17,
'MountingID': 18,
'MountingSetID': 19,
'MountingAddOns': [
1,
2
],
'CanvasAddOns': [
1,
2
],
'CardOptions': [
1,
2
],
'Units': 20,
'PrintW': 21.0,
'PrintH': 22.0,
'PhotoItemID': 23,
'PhotoItemOptions': [
1,
2
],
'ColorCorrect': true
}
}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'sample_method',
'hostname': 'v2.api.finerworks.com',
'path': 'sample_endpoint',
'headers': {
'Content-Type': 'application/json',
'web_api_key': 'my-web-api-key-goes-here',
'app_key': 'my-app-key-goes-here'
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
var postData = JSON.stringify({
"build": {
"CardStockID": 1,
"CardStyleID": 2,
"CardTypeID": 3,
"FrameID": 4,
"FrameW": 5.0,
"FrameH": 6.0,
"SheetW": 7.0,
"SheetH": 8.0,
"MatID": 9,
"Mat1WindowW": 10.0,
"Mat1WindowH": 11.0,
"MatID2": 12,
"Mat2WindowW": 13.0,
"Mat2WindowH": 14.0,
"GlassID": 15,
"PrintProductTypeID": 16,
"MediaID": 17,
"MountingID": 18,
"MountingSetID": 19,
"MountingAddOns": [
1,
2
],
"CanvasAddOns": [
1,
2
],
"CardOptions": [
1,
2
],
"Units": 20,
"PrintW": 21.0,
"PrintH": 22.0,
"PhotoItemID": 23,
"PhotoItemOptions": [
1,
2
],
"ColorCorrect": true
}
});
req.write(postData);
req.end();
require "uri"
require "net/http"
url = URI("https://test-api.finerworks.comsample_endpoint")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::sample_method.new(url)
request["Content-Type"] = "application/json"
request["web_api_key"] = "my-web-api-key-goes-here"
request["app_key"] = "my-app-key-goes-here"
request.body = "{
'build': {
'CardStockID': 1,
'CardStyleID': 2,
'CardTypeID': 3,
'FrameID': 4,
'FrameW': 5.0,
'FrameH': 6.0,
'SheetW': 7.0,
'SheetH': 8.0,
'MatID': 9,
'Mat1WindowW': 10.0,
'Mat1WindowH': 11.0,
'MatID2': 12,
'Mat2WindowW': 13.0,
'Mat2WindowH': 14.0,
'GlassID': 15,
'PrintProductTypeID': 16,
'MediaID': 17,
'MountingID': 18,
'MountingSetID': 19,
'MountingAddOns': [
1,
2
],
'CanvasAddOns': [
1,
2
],
'CardOptions': [
1,
2
],
'Units': 20,
'PrintW': 21.0,
'PrintH': 22.0,
'PhotoItemID': 23,
'PhotoItemOptions': [
1,
2
],
'ColorCorrect': true
}
}"
response = https.request(request)
puts response.read_body
| Name | Description | Type | Additional information |
|---|---|---|---|
| product_code |
If it returns a product code string it is valid and can be used to submit an order. If it returns null, then the product code is not valid and cannot be used to submit an order. |
text |
None. |
| details | product_details |
None. |
|
| status | response_status |
None. |
Example JSON Response
application/json, text/json
{
"product_code": "sample string 1",
"details": {
"id": 1,
"monetary_format": "sample string 2",
"quantity": 3,
"quantity_in_stock": 4,
"track_inventory": true,
"sku": "sample string 6",
"product_code": "sample string 7",
"price_details": {
"product_qty": 1,
"product_sku": "sample string 2",
"product_code": "sample string 3",
"product_price": 4.1,
"add_frame_price": 5.1,
"add_mat_1_price": 6.1,
"add_mat_2_price": 7.1,
"add_glazing_price": 8.1,
"add_color_correct_price": 9.1,
"total_price": 10.1,
"geo_price": 11.1,
"info": "sample string 12",
"debug": {}
},
"per_item_price": 8.0,
"total_price": 9.0,
"asking_price": 10.0,
"geo_price": 11.0,
"name": "sample string 12",
"description_short": "sample string 13",
"description_long": "sample string 14",
"labels": [
{
"key": "sample string 1",
"value": "sample string 2",
"priority": 3
},
{
"key": "sample string 1",
"value": "sample string 2",
"priority": 3
}
],
"image_url_1": "sample string 15",
"image_url_2": "sample string 16",
"image_url_3": "sample string 17",
"image_url_4": "sample string 18",
"image_url_5": "sample string 19",
"image_guid": "a6ac8c67-34f2-4151-b92e-ae9f6e98f022",
"product_size": {
"width": 1.0,
"height": 2.0,
"depth": 3.0,
"ounces": 4.0,
"cubic_volume": 5.0,
"is_rigid": true
},
"third_party_integrations": {
"etsy_product_id": 1,
"shopify_product_id": 2,
"shopify_variant_id": 3,
"shopify_graphql_product_id": "sample string 4",
"shopify_graphql_variant_id": "sample string 5",
"squarespace_product_id": "sample string 6",
"squarespace_variant_id": "sample string 7",
"wix_inventory_id": "sample string 8",
"wix_product_id": "sample string 9",
"wix_variant_id": "sample string 10",
"woocommerce_product_id": 11,
"woocommerce_variant_id": 12
},
"framing_options": {
"collection_ids": [
1,
2
],
"allow_frames": true,
"allow_matting": true,
"allow_glazing": true,
"frame_required": true,
"allow_float_matting": true,
"require_float_matting": true
},
"product_guid": "8bffd136-7747-40d1-9877-6634e617255c",
"updated": "2026-06-14T12:15:45.744642-05:00",
"valid": true,
"debug": {}
},
"status": {
"success": true,
"status_code": 100,
"message": "sample string 2",
"debug": {},
"reference_id": "sample string 4",
"domain": "sample string 5"
}
}