NowToPrint Hilfe
NowToPrint Hilfe
Hilfe-Center
Getting Started
Platform Overview
Marketplace
Print Shop
Prepress
Design Studio
Orders & Delivery
Notifications
Free Tools
Templates
VDP (Variable Data Printing)
Developer & API
API Reference
OpenAPI Explorer & Spec Reference
Getting StartedAuthenticationEndpointsWebhooksExamplesPartner API Access ModelQuickstart
Webhook Access & DeliveryXJDF API RehberiXJDF Master Data Model
FAQ
Technical Reference
Admin Panel
Developer & APIPartner api
  1. Developer
  2. Partner API
  3. Examples

Examples

Reference snippets for estimates, RFQs, and webhook verification with the Partner API.

Entwicklerdocs2 Min. LesezeitGeprüft 16. Apr. 2026

Examples

Use these snippets as starting points, but always validate payloads and response handling against the published contract at /docs/api/openapi.yaml.


cURL: request an estimate

curl -X POST https://api.nowtoprint.com/api/v1/estimate \
  -H "Authorization: Bearer ntp_test_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "category": "brochure",
    "quantity": 500,
    "specifications": {
      "pageCount": 16
    }
  }'

Node.js: create an RFQ

const response = await fetch('https://api.nowtoprint.com/api/v1/rfq', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.NOWTOPRINT_API_KEY}`,
    'Content-Type': 'application/json',
    'Idempotency-Key': crypto.randomUUID(),
  },
  body: JSON.stringify({
    title: 'Spring brochure batch',
    category: 'brochure',
    quantity: 2500,
    deliveryCity: 'Istanbul',
  }),
});

if (!response.ok) {
  throw new Error(`RFQ creation failed: ${response.status}`);
}

const rfq = await response.json();
console.log(rfq.id);

Python: poll RFQ status

import os
import requests

headers = {
    "Authorization": f"Bearer {os.environ['NOWTOPRINT_API_KEY']}",
    "Accept": "application/json",
}

response = requests.get(
  "https://api.nowtoprint.com/api/v1/rfq/rfq_123456",
    headers=headers,
    timeout=30,
)

response.raise_for_status()
print(response.json())

Node.js: verify webhook signatures

import crypto from 'node:crypto';

export function verifyWebhookSignature(payload: string, signature: string, secret: string) {
  const digest = crypto.createHmac('sha256', secret).update(payload).digest('hex');
  return signature === `sha256=${digest}`;
}

Use the raw request body for verification before parsing JSON.


Production notes

  • keep keys and webhook secrets in managed server-side secrets
  • do not trust client-side integrations with direct live credentials
  • log request IDs, not credentials
  • treat webhook consumers as idempotent workers

War dieser Artikel hilfreich?

Verwandte Artikel

  • IAM Guide
  • Organisation Management
  • Registration, Onboarding, and Activation Operations
  • Roles & Permissions Reference
Edit on GitHub

Zuletzt aktualisiert

Webhooks

Signed webhook delivery for Partner API quote, order, and workflow events.

Partner API Access Model

How Partner API access is enabled through package entitlements, rollout state and contract onboarding.

Auf dieser Seite

ExamplescURL: request an estimateNode.js: create an RFQPython: poll RFQ statusNode.js: verify webhook signaturesProduction notes
Ask AI Assistant