Phase 1 preview. 预览版本。价格、余额和订单均为示例数据,不会产生真实付款或交付。
Sample announcement: try the marketplace preview with promo code WELCOME10 (sample code, no real discount).See deals

SDKs and code examples

Code examples for common languages.

Preview only. These pages describe the proposed Phase 2 API. Endpoints are not live.

Official SDKs are not published yet. The examples below show the expected request shape.

Example: create an order

curl -X POST https://api.example.com/v1/orders \ -H "Authorization: Bearer nv_test_****" \ -H "Idempotency-Key: 6f1c2a1e-9d3b-4b1e-8f7e-2c4d5a6b7c8d" \ -H "Content-Type: application/json" \ -d '{"items":[{"product_id":"PRD-1A2B3C","value":"25.00","currency":"USD","recipient":{"email":"friend@example.com"}}]}'
// PHP: verify a webhook signature $payload = file_get_contents('php://input'); $expected = hash_hmac('sha256', $_SERVER['HTTP_X_NESVRA_TIMESTAMP'] . '.' . $payload, getenv('NESVRA_WEBHOOK_SECRET')); if (!hash_equals($expected, $_SERVER['HTTP_X_NESVRA_SIGNATURE'] ?? '')) { http_response_code(400); exit; }