مساعدة NowToPrint
مساعدة NowToPrint
مركز المساعدة
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, RFQ launch-disabled handling, and webhook verification with the Partner API.

المطورdocs2 دقيقة قراءةتمت المراجعة ١٣ يونيو ٢٠٢٦

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: handle RFQ launch-disabled response

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) {
  if (response.status === 501) {
    const problem = await response.json();
    console.log('RFQ public launch is disabled for this environment', problem);
    return;
  }

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

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

RFQ, quote, and order readiness

Do not generate public clients for RFQ detail, supplier quotes, quote acceptance, or orders until those operations are present in /docs/api/openapi.yaml. The current published RFQ create/list operations are launch-disabled and return 501.


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

هل كانت هذه المقالة مفيدة؟

مقالات ذات صلة

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

آخر تحديث

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.

في هذه الصفحة

ExamplescURL: request an estimateNode.js: handle RFQ launch-disabled responseRFQ, quote, and order readinessNode.js: verify webhook signaturesProduction notes
Ask AI Assistant