Create a buy link
curl --request POST \
--url https://api.provenmetal.com/v1/buy-links \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"upload_id": "<string>",
"project_name": "<string>",
"source_url": "<string>",
"assembly": false,
"layers": 123,
"thickness_mm": 123,
"surface_finish": "<string>",
"solder_mask": "<string>",
"copper_oz": 123,
"material": "<string>",
"board": "<string>",
"skip_board_checks": false,
"itar": false
}
'import requests
url = "https://api.provenmetal.com/v1/buy-links"
payload = {
"upload_id": "<string>",
"project_name": "<string>",
"source_url": "<string>",
"assembly": False,
"layers": 123,
"thickness_mm": 123,
"surface_finish": "<string>",
"solder_mask": "<string>",
"copper_oz": 123,
"material": "<string>",
"board": "<string>",
"skip_board_checks": False,
"itar": False
}
headers = {
"X-API-Key": "<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>', 'Content-Type': 'application/json'},
body: JSON.stringify({
upload_id: '<string>',
project_name: '<string>',
source_url: '<string>',
assembly: false,
layers: 123,
thickness_mm: 123,
surface_finish: '<string>',
solder_mask: '<string>',
copper_oz: 123,
material: '<string>',
board: '<string>',
skip_board_checks: false,
itar: false
})
};
fetch('https://api.provenmetal.com/v1/buy-links', 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.provenmetal.com/v1/buy-links",
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([
'upload_id' => '<string>',
'project_name' => '<string>',
'source_url' => '<string>',
'assembly' => false,
'layers' => 123,
'thickness_mm' => 123,
'surface_finish' => '<string>',
'solder_mask' => '<string>',
'copper_oz' => 123,
'material' => '<string>',
'board' => '<string>',
'skip_board_checks' => false,
'itar' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <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.provenmetal.com/v1/buy-links"
payload := strings.NewReader("{\n \"upload_id\": \"<string>\",\n \"project_name\": \"<string>\",\n \"source_url\": \"<string>\",\n \"assembly\": false,\n \"layers\": 123,\n \"thickness_mm\": 123,\n \"surface_finish\": \"<string>\",\n \"solder_mask\": \"<string>\",\n \"copper_oz\": 123,\n \"material\": \"<string>\",\n \"board\": \"<string>\",\n \"skip_board_checks\": false,\n \"itar\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<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.provenmetal.com/v1/buy-links")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"upload_id\": \"<string>\",\n \"project_name\": \"<string>\",\n \"source_url\": \"<string>\",\n \"assembly\": false,\n \"layers\": 123,\n \"thickness_mm\": 123,\n \"surface_finish\": \"<string>\",\n \"solder_mask\": \"<string>\",\n \"copper_oz\": 123,\n \"material\": \"<string>\",\n \"board\": \"<string>\",\n \"skip_board_checks\": false,\n \"itar\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.provenmetal.com/v1/buy-links")
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["Content-Type"] = 'application/json'
request.body = "{\n \"upload_id\": \"<string>\",\n \"project_name\": \"<string>\",\n \"source_url\": \"<string>\",\n \"assembly\": false,\n \"layers\": 123,\n \"thickness_mm\": 123,\n \"surface_finish\": \"<string>\",\n \"solder_mask\": \"<string>\",\n \"copper_oz\": 123,\n \"material\": \"<string>\",\n \"board\": \"<string>\",\n \"skip_board_checks\": false,\n \"itar\": false\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"buy_url": "<string>",
"notes": [
"<string>"
]
}{
"error": "<string>",
"message": "<string>",
"ok": false,
"questions": [
{}
],
"known": {},
"parts": [
{}
],
"off_board_parts": [
{}
],
"retry_after_s": 123,
"checkout_url": "<string>",
"fields": [
{}
]
}{
"error": "<string>",
"message": "<string>",
"ok": false,
"questions": [
{}
],
"known": {},
"parts": [
{}
],
"off_board_parts": [
{}
],
"retry_after_s": 123,
"checkout_url": "<string>",
"fields": [
{}
]
}{
"error": "<string>",
"message": "<string>",
"ok": false,
"questions": [
{}
],
"known": {},
"parts": [
{}
],
"off_board_parts": [
{}
],
"retry_after_s": 123,
"checkout_url": "<string>",
"fields": [
{}
]
}Create a buy link
For a partner site’s Buy button: a permanent link where a shopper picks the quantity and destination, gets a live price and checks out. 100 a day per key.
POST
/
v1
/
buy-links
Create a buy link
curl --request POST \
--url https://api.provenmetal.com/v1/buy-links \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"upload_id": "<string>",
"project_name": "<string>",
"source_url": "<string>",
"assembly": false,
"layers": 123,
"thickness_mm": 123,
"surface_finish": "<string>",
"solder_mask": "<string>",
"copper_oz": 123,
"material": "<string>",
"board": "<string>",
"skip_board_checks": false,
"itar": false
}
'import requests
url = "https://api.provenmetal.com/v1/buy-links"
payload = {
"upload_id": "<string>",
"project_name": "<string>",
"source_url": "<string>",
"assembly": False,
"layers": 123,
"thickness_mm": 123,
"surface_finish": "<string>",
"solder_mask": "<string>",
"copper_oz": 123,
"material": "<string>",
"board": "<string>",
"skip_board_checks": False,
"itar": False
}
headers = {
"X-API-Key": "<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>', 'Content-Type': 'application/json'},
body: JSON.stringify({
upload_id: '<string>',
project_name: '<string>',
source_url: '<string>',
assembly: false,
layers: 123,
thickness_mm: 123,
surface_finish: '<string>',
solder_mask: '<string>',
copper_oz: 123,
material: '<string>',
board: '<string>',
skip_board_checks: false,
itar: false
})
};
fetch('https://api.provenmetal.com/v1/buy-links', 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.provenmetal.com/v1/buy-links",
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([
'upload_id' => '<string>',
'project_name' => '<string>',
'source_url' => '<string>',
'assembly' => false,
'layers' => 123,
'thickness_mm' => 123,
'surface_finish' => '<string>',
'solder_mask' => '<string>',
'copper_oz' => 123,
'material' => '<string>',
'board' => '<string>',
'skip_board_checks' => false,
'itar' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <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.provenmetal.com/v1/buy-links"
payload := strings.NewReader("{\n \"upload_id\": \"<string>\",\n \"project_name\": \"<string>\",\n \"source_url\": \"<string>\",\n \"assembly\": false,\n \"layers\": 123,\n \"thickness_mm\": 123,\n \"surface_finish\": \"<string>\",\n \"solder_mask\": \"<string>\",\n \"copper_oz\": 123,\n \"material\": \"<string>\",\n \"board\": \"<string>\",\n \"skip_board_checks\": false,\n \"itar\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<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.provenmetal.com/v1/buy-links")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"upload_id\": \"<string>\",\n \"project_name\": \"<string>\",\n \"source_url\": \"<string>\",\n \"assembly\": false,\n \"layers\": 123,\n \"thickness_mm\": 123,\n \"surface_finish\": \"<string>\",\n \"solder_mask\": \"<string>\",\n \"copper_oz\": 123,\n \"material\": \"<string>\",\n \"board\": \"<string>\",\n \"skip_board_checks\": false,\n \"itar\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.provenmetal.com/v1/buy-links")
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["Content-Type"] = 'application/json'
request.body = "{\n \"upload_id\": \"<string>\",\n \"project_name\": \"<string>\",\n \"source_url\": \"<string>\",\n \"assembly\": false,\n \"layers\": 123,\n \"thickness_mm\": 123,\n \"surface_finish\": \"<string>\",\n \"solder_mask\": \"<string>\",\n \"copper_oz\": 123,\n \"material\": \"<string>\",\n \"board\": \"<string>\",\n \"skip_board_checks\": false,\n \"itar\": false\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"buy_url": "<string>",
"notes": [
"<string>"
]
}{
"error": "<string>",
"message": "<string>",
"ok": false,
"questions": [
{}
],
"known": {},
"parts": [
{}
],
"off_board_parts": [
{}
],
"retry_after_s": 123,
"checkout_url": "<string>",
"fields": [
{}
]
}{
"error": "<string>",
"message": "<string>",
"ok": false,
"questions": [
{}
],
"known": {},
"parts": [
{}
],
"off_board_parts": [
{}
],
"retry_after_s": 123,
"checkout_url": "<string>",
"fields": [
{}
]
}{
"error": "<string>",
"message": "<string>",
"ok": false,
"questions": [
{}
],
"known": {},
"parts": [
{}
],
"off_board_parts": [
{}
],
"retry_after_s": 123,
"checkout_url": "<string>",
"fields": [
{}
]
}Authorizations
Your ProvenMetal API key (pm_live_...). Authorization: Bearer <key> also works.
Body
application/json
The upload_id from POST /v1/uploads.
Maximum string length:
64The board's name, shown to shoppers.
Maximum string length:
200The board's page.
Maximum string length:
2000true if the board can be ordered assembled.
true if the design is ITAR-controlled: it is refused before anything is read.