Cancel an order (alias)
curl --request DELETE \
--url https://app.papelship.com/api/v1/invoices/{invoiceId} \
--header 'x-api-key: <api-key>' \
--header 'x-store-hash: <api-key>'const options = {
method: 'DELETE',
headers: {'x-api-key': '<api-key>', 'x-store-hash': '<api-key>'}
};
fetch('https://app.papelship.com/api/v1/invoices/{invoiceId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.papelship.com/api/v1/invoices/{invoiceId}"
headers = {
"x-api-key": "<api-key>",
"x-store-hash": "<api-key>"
}
response = requests.delete(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.papelship.com/api/v1/invoices/{invoiceId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://app.papelship.com/api/v1/invoices/{invoiceId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-store-hash", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"success": true,
"invoice": {
"id": "c35ffd-19a1b2c3d4e-8c7a20",
"object": "invoice",
"status": "pending",
"currency": "USD",
"total_cents": 3499,
"shipping_cents": 500,
"refunded_cents": 0,
"refund_status": "not_refunded",
"customer_email": "buyer@example.com",
"delivery_email": "buyer@example.com",
"coupon_code": "<string>",
"payment_method": "STRIPE",
"country": "United Kingdom",
"fraud_score": 0,
"source": "api",
"metadata": {
"order_ref": "WEB-1042"
},
"requires_shipping": false,
"fulfillment_status": "unfulfilled",
"shipping_method": {
"name": "<string>",
"carrier_code": "<string>",
"min_days": 123,
"max_days": 123
},
"checkout_url": "https://app.papelship.com/invoice/c35ffd-19a1b2c3d4e-8c7a20",
"created_at": "2026-10-04T12:00:00.000Z",
"updated_at": "2026-10-04T12:00:00.000Z",
"expires_at": "2026-10-04T12:00:00.000Z",
"paid_at": "2026-10-04T12:00:00.000Z",
"items": [
{
"id": 8812,
"product_id": "a1B2c3D4e5F6",
"product_name": "Pro License",
"variant_id": 123,
"quantity": 1,
"unit_price_cents": 2999,
"discount_percent": 0,
"total_cents": 2999
}
],
"shipping_address": {
"full_name": "Alex Morgan",
"company": "<string>",
"phone": "+44 20 7946 0958",
"email": "<string>",
"country_code": "GB",
"region": "Greater London",
"city": "London",
"district": "<string>",
"line1": "221B Baker Street",
"line2": "<string>",
"postal_code": "NW1 6XE"
},
"custom_fields": {}
}
}{
"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": "RATE_LIMITED",
"error": "Too many requests. The limit is 300 requests per minute per key.",
"request_id": "req_7YbK2mQ9xP1cRt4v"
}Orders
Cancel an order (alias)
Same as POST /invoices/{invoiceId}/cancel. Kept for older integrations.
Permission: orders:write
DELETE
/
invoices
/
{invoiceId}
Cancel an order (alias)
curl --request DELETE \
--url https://app.papelship.com/api/v1/invoices/{invoiceId} \
--header 'x-api-key: <api-key>' \
--header 'x-store-hash: <api-key>'const options = {
method: 'DELETE',
headers: {'x-api-key': '<api-key>', 'x-store-hash': '<api-key>'}
};
fetch('https://app.papelship.com/api/v1/invoices/{invoiceId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.papelship.com/api/v1/invoices/{invoiceId}"
headers = {
"x-api-key": "<api-key>",
"x-store-hash": "<api-key>"
}
response = requests.delete(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.papelship.com/api/v1/invoices/{invoiceId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://app.papelship.com/api/v1/invoices/{invoiceId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-store-hash", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"success": true,
"invoice": {
"id": "c35ffd-19a1b2c3d4e-8c7a20",
"object": "invoice",
"status": "pending",
"currency": "USD",
"total_cents": 3499,
"shipping_cents": 500,
"refunded_cents": 0,
"refund_status": "not_refunded",
"customer_email": "buyer@example.com",
"delivery_email": "buyer@example.com",
"coupon_code": "<string>",
"payment_method": "STRIPE",
"country": "United Kingdom",
"fraud_score": 0,
"source": "api",
"metadata": {
"order_ref": "WEB-1042"
},
"requires_shipping": false,
"fulfillment_status": "unfulfilled",
"shipping_method": {
"name": "<string>",
"carrier_code": "<string>",
"min_days": 123,
"max_days": 123
},
"checkout_url": "https://app.papelship.com/invoice/c35ffd-19a1b2c3d4e-8c7a20",
"created_at": "2026-10-04T12:00:00.000Z",
"updated_at": "2026-10-04T12:00:00.000Z",
"expires_at": "2026-10-04T12:00:00.000Z",
"paid_at": "2026-10-04T12:00:00.000Z",
"items": [
{
"id": 8812,
"product_id": "a1B2c3D4e5F6",
"product_name": "Pro License",
"variant_id": 123,
"quantity": 1,
"unit_price_cents": 2999,
"discount_percent": 0,
"total_cents": 2999
}
],
"shipping_address": {
"full_name": "Alex Morgan",
"company": "<string>",
"phone": "+44 20 7946 0958",
"email": "<string>",
"country_code": "GB",
"region": "Greater London",
"city": "London",
"district": "<string>",
"line1": "221B Baker Street",
"line2": "<string>",
"postal_code": "NW1 6XE"
},
"custom_fields": {}
}
}{
"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": "RATE_LIMITED",
"error": "Too many requests. The limit is 300 requests per minute per key.",
"request_id": "req_7YbK2mQ9xP1cRt4v"
}Yetkilendirmeler
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.
Yol Parametreleri
Public order ID.
Örnek:
"c35ffd-19a1b2c3d4e-8c7a20"