Add license keys
curl --request POST \
--url https://app.papelship.com/api/v1/products/{id}/serials \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-store-hash: <api-key>' \
--data '
{
"serials": [
"<string>"
],
"input": "<string>",
"delimiter": "\\n",
"dedupe": false,
"variant_id": 123
}
'const options = {
method: 'POST',
headers: {
'x-api-key': '<api-key>',
'x-store-hash': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
serials: ['<string>'],
input: '<string>',
delimiter: '\n',
dedupe: false,
variant_id: 123
})
};
fetch('https://app.papelship.com/api/v1/products/{id}/serials', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.papelship.com/api/v1/products/{id}/serials"
payload = {
"serials": ["<string>"],
"input": "<string>",
"delimiter": "\n",
"dedupe": False,
"variant_id": 123
}
headers = {
"x-api-key": "<api-key>",
"x-store-hash": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.papelship.com/api/v1/products/{id}/serials",
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([
'serials' => [
'<string>'
],
'input' => '<string>',
'delimiter' => '\\n',
'dedupe' => false,
'variant_id' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-store-hash: <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://app.papelship.com/api/v1/products/{id}/serials"
payload := strings.NewReader("{\n \"serials\": [\n \"<string>\"\n ],\n \"input\": \"<string>\",\n \"delimiter\": \"\\\\n\",\n \"dedupe\": false,\n \"variant_id\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-store-hash", "<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))
}{
"success": true,
"inserted": 100,
"unassigned": 140,
"variant_id": 123
}{
"success": false,
"code": "INVALID_API_KEY",
"error": "Invalid API Key",
"request_id": "req_7YbK2mQ9xP1cRt4v"
}{
"success": false,
"code": "INSUFFICIENT_SCOPE",
"error": "This API key needs the orders:write permission",
"request_id": "req_7YbK2mQ9xP1cRt4v"
}{
"success": false,
"code": "NOT_FOUND",
"error": "Invoice not found",
"request_id": "req_7YbK2mQ9xP1cRt4v"
}{
"success": false,
"code": "INVOICE_PAID",
"error": "A paid order cannot be cancelled. Refund it instead.",
"request_id": "req_7YbK2mQ9xP1cRt4v"
}{
"success": false,
"code": "VALIDATION_FAILED",
"error": "customer_email must be a valid email address",
"request_id": "req_7YbK2mQ9xP1cRt4v"
}{
"success": false,
"code": "RATE_LIMITED",
"error": "Too many requests. The limit is 300 requests per minute per key.",
"request_id": "req_7YbK2mQ9xP1cRt4v"
}Variants & stock
Add license keys
Up to 1000 keys per call. Waiting orders are filled automatically.
Permission: products:write
POST
/
products
/
{id}
/
serials
Add license keys
curl --request POST \
--url https://app.papelship.com/api/v1/products/{id}/serials \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-store-hash: <api-key>' \
--data '
{
"serials": [
"<string>"
],
"input": "<string>",
"delimiter": "\\n",
"dedupe": false,
"variant_id": 123
}
'const options = {
method: 'POST',
headers: {
'x-api-key': '<api-key>',
'x-store-hash': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
serials: ['<string>'],
input: '<string>',
delimiter: '\n',
dedupe: false,
variant_id: 123
})
};
fetch('https://app.papelship.com/api/v1/products/{id}/serials', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.papelship.com/api/v1/products/{id}/serials"
payload = {
"serials": ["<string>"],
"input": "<string>",
"delimiter": "\n",
"dedupe": False,
"variant_id": 123
}
headers = {
"x-api-key": "<api-key>",
"x-store-hash": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.papelship.com/api/v1/products/{id}/serials",
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([
'serials' => [
'<string>'
],
'input' => '<string>',
'delimiter' => '\\n',
'dedupe' => false,
'variant_id' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-store-hash: <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://app.papelship.com/api/v1/products/{id}/serials"
payload := strings.NewReader("{\n \"serials\": [\n \"<string>\"\n ],\n \"input\": \"<string>\",\n \"delimiter\": \"\\\\n\",\n \"dedupe\": false,\n \"variant_id\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-store-hash", "<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))
}{
"success": true,
"inserted": 100,
"unassigned": 140,
"variant_id": 123
}{
"success": false,
"code": "INVALID_API_KEY",
"error": "Invalid API Key",
"request_id": "req_7YbK2mQ9xP1cRt4v"
}{
"success": false,
"code": "INSUFFICIENT_SCOPE",
"error": "This API key needs the orders:write permission",
"request_id": "req_7YbK2mQ9xP1cRt4v"
}{
"success": false,
"code": "NOT_FOUND",
"error": "Invoice not found",
"request_id": "req_7YbK2mQ9xP1cRt4v"
}{
"success": false,
"code": "INVOICE_PAID",
"error": "A paid order cannot be cancelled. Refund it instead.",
"request_id": "req_7YbK2mQ9xP1cRt4v"
}{
"success": false,
"code": "VALIDATION_FAILED",
"error": "customer_email must be a valid email address",
"request_id": "req_7YbK2mQ9xP1cRt4v"
}{
"success": false,
"code": "RATE_LIMITED",
"error": "Too many requests. The limit is 300 requests per minute per key.",
"request_id": "req_7YbK2mQ9xP1cRt4v"
}Authorizations
Your Store API key (pk_live_...). Create it in Developers › API keys.
The ID of the store the request is for. Shown in Developers › API keys.
Headers
Unique key (for example a UUID) that makes retries safe. The first response is stored for 24 hours and replayed for retries with the same key and body.
Maximum string length:
255Path Parameters
Product hash ID (numeric ID also accepted).
Example:
"AbC123xyz789"
Body
application/json