curl --request POST \
--url https://api.provenmetal.com/v1/previous-orders \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"email": "<string>",
"code": "<string>",
"history_token": "<string>"
}
'import requests
url = "https://api.provenmetal.com/v1/previous-orders"
payload = {
"email": "<string>",
"code": "<string>",
"history_token": "<string>"
}
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({email: '<string>', code: '<string>', history_token: '<string>'})
};
fetch('https://api.provenmetal.com/v1/previous-orders', 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/previous-orders",
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([
'email' => '<string>',
'code' => '<string>',
'history_token' => '<string>'
]),
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/previous-orders"
payload := strings.NewReader("{\n \"email\": \"<string>\",\n \"code\": \"<string>\",\n \"history_token\": \"<string>\"\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/previous-orders")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"<string>\",\n \"code\": \"<string>\",\n \"history_token\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.provenmetal.com/v1/previous-orders")
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 \"email\": \"<string>\",\n \"code\": \"<string>\",\n \"history_token\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"sent_to": "<string>",
"expires_in_minutes": 123,
"history_token": "<string>",
"orders": [
{}
]
}{
"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": [
{}
]
}Find a customer's earlier orders
The MCP’s previous_orders. With the email the customer ordered with, ProvenMetal emails them a 6-digit code if it has orders for that email; with the email and that code, their own paid or requested orders and a history_token for 60 minutes; with history_token alone, the same list again.
curl --request POST \
--url https://api.provenmetal.com/v1/previous-orders \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"email": "<string>",
"code": "<string>",
"history_token": "<string>"
}
'import requests
url = "https://api.provenmetal.com/v1/previous-orders"
payload = {
"email": "<string>",
"code": "<string>",
"history_token": "<string>"
}
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({email: '<string>', code: '<string>', history_token: '<string>'})
};
fetch('https://api.provenmetal.com/v1/previous-orders', 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/previous-orders",
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([
'email' => '<string>',
'code' => '<string>',
'history_token' => '<string>'
]),
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/previous-orders"
payload := strings.NewReader("{\n \"email\": \"<string>\",\n \"code\": \"<string>\",\n \"history_token\": \"<string>\"\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/previous-orders")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"<string>\",\n \"code\": \"<string>\",\n \"history_token\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.provenmetal.com/v1/previous-orders")
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 \"email\": \"<string>\",\n \"code\": \"<string>\",\n \"history_token\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"sent_to": "<string>",
"expires_in_minutes": 123,
"history_token": "<string>",
"orders": [
{}
]
}{
"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
Everything the MCP previous_orders tool takes: the email alone asks for a code, the email and the code list the orders, and history_token alone lists them again.
The email the customer ordered with, as they gave it; never guess one.
254The 6-digit code from ProvenMetal's email.
12From an earlier reply: lists the orders again for 60 minutes.
200Response
Successful Response
After the email alone: where the code went, partly hidden.
For POST /v1/reorders and to list the orders again, 60 minutes.
The customer's own paid or requested orders: each order_id, board options, quantity, BOM choices (customer-supplied and unfitted parts, approved substitutions, ProvenMetal picking parts), delivery and files.