### GET Request Example (cURL) Source: https://docs.pandabase.io/developers/learn/api-tokens This cURL command demonstrates how to make a GET request to retrieve products, including deriving the signing key and computing the HMAC signature for an empty request body. ```bash # derive signing key: SHA-256 of your secret SIGNING_KEY=$(echo -n "$TOKEN_SECRET" | openssl dgst -sha256 | awk '{print $2}') # GET — sign empty string SIGNATURE=$(echo -n "" | openssl dgst -sha256 -hmac "$SIGNING_KEY" | awk '{print $2}') curl https://api.pandabase.io/v2/core/stores/shp_xxx/products \ -H "Authorization: Bearer stk_xxx" \ -H "X-Signature: $SIGNATURE" ``` -------------------------------- ### Define rule examples Source: https://docs.pandabase.io/guides/shield Examples of rule configurations including action, priority, and condition. ```text Action: BLOCK Priority: 1 Condition: email IN @disposable_emails ``` ```text Action: REVIEW Priority: 2 Condition: amount > 50000 AND is_new_customer == true ``` ```text Action: BLOCK Priority: 3 Condition: card_funding == "prepaid" AND amount > 20000 ``` ```text Action: ALLOW Priority: 0 Condition: customer_order_count >= 10 ``` ```text Action: REVIEW Priority: 4 Condition: country != ip_country AND amount > 5000 ``` ```text Action: BLOCK Priority: 5 Condition: card_bin IN @blocked_bins ``` ```text Action: REVIEW Priority: 6 Condition: risk_score >= 75 ``` -------------------------------- ### Install Mintlify CLI Source: https://docs.pandabase.io/development Install the Mintlify command-line interface globally using npm. This tool is required to run the development server. ```bash npm i -g mintlify ``` -------------------------------- ### List Products with HMAC Signature (TypeScript) Source: https://docs.pandabase.io/developers/learn/api-tokens Example of listing products using HMAC signature authentication in TypeScript. For GET requests, an empty string is signed. ```typescript // GET request (sign empty string) async function listProducts() { const signature = sign(""); const res = await fetch( `https://api.pandabase.io/v2/core/stores/${STORE_ID}/products`, { headers: { Authorization: `Bearer ${TOKEN_ID}`, "X-Signature": signature, }, }, ); return res.json(); } ``` -------------------------------- ### Basic Express Server Setup Source: https://docs.pandabase.io/developers/learn/dynamic-payments This TypeScript code initializes an Express server and configures it to parse JSON request bodies. It's a starting point for building your webhook receiver. ```typescript import express from "express"; import crypto from "crypto"; import dotenv from "dotenv"; dotenv.config(); const app = express(); const PORT = process.env.PORT || 3000; app.use(express.json()); app.listen(PORT, () => { console.log(`Server is running on port ${PORT}`); }); ``` -------------------------------- ### Install Pandabase Node.js SDK Source: https://docs.pandabase.io/developers/sdks/typescript Install the Pandabase Node.js SDK using npm, pnpm, or bun. This package provides convenient access to the Pandabase API. ```sh npm install @pandabase/node ``` ```sh pnpm add @pandabase/node ``` ```sh bun add @pandabase/node ``` -------------------------------- ### Install Pandabase Go Package Source: https://docs.pandabase.io/developers/sdks/go Use this command to explicitly fetch and add the Pandabase Go package to your project. ```sh go get -u github.com/pandabase/pandabase-go/v1 ``` -------------------------------- ### List Products with Bearer Token (cURL) Source: https://docs.pandabase.io/developers/learn/api-tokens Example of listing products using Bearer token authentication with cURL. This is useful for command-line testing. ```bash curl https://api.pandabase.io/v2/core/stores/shp_xxx/products \ -H "Authorization: Bearer sk_live_abc123..." ``` -------------------------------- ### GET /v2/core/stores/{storeId}/products Source: https://docs.pandabase.io/developers/learn/api-tokens Retrieves a list of products for a specific store. ```APIDOC ## GET /v2/core/stores/{storeId}/products ### Description Retrieves a list of products associated with the specified store ID. ### Method GET ### Endpoint https://api.pandabase.io/v2/core/stores/{storeId}/products ### Parameters #### Path Parameters - **storeId** (string) - Required - The unique identifier of the store. ### Response #### Success Response (200) - **products** (array) - A list of product objects. ``` -------------------------------- ### Create Payment Intent Request Source: https://docs.pandabase.io/developers/onchain/api Example cURL request to create a payment intent with required asset and refund details. ```bash curl -X POST https://api.pandabase.io/v2/{storeId}/onramp/payment-intents \ -H "Authorization: Bearer sk_live_xxx" \ -H "Content-Type: application/json" \ -d '{ "amount": "1000000", "originAsset": "SOL_USDC", "customerRefundAddress": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU", "refundType": "ORIGIN_CHAIN", "slippageTolerance": 100, "metadata": { "orderId": "order_123" } }' ``` -------------------------------- ### POST Request Example (cURL) Source: https://docs.pandabase.io/developers/learn/api-tokens This cURL command shows how to make a POST request to create a product. It includes deriving the signing key and computing the HMAC signature for a JSON request body. ```bash # POST — sign the JSON body BODY='{"name":"New Product","amount":2999,"type":"ONE_TIME"}' SIGNATURE=$(echo -n "$BODY" | openssl dgst -sha256 -hmac "$SIGNING_KEY" | awk '{print $2}') curl -X POST https://api.pandabase.io/v2/core/stores/shp_xxx/products \ -H "Content-Type: application/json" \ -H "Authorization: Bearer stk_xxx" \ -H "X-Signature: $SIGNATURE" \ -d "$BODY" ``` -------------------------------- ### Get Payment Status Request Source: https://docs.pandabase.io/developers/onchain/api Example cURL request to fetch the status of an existing payment intent. ```bash curl https://api.pandabase.io/v2/{storeId}/onramp/payment-intents/onpi_abc123 \ -H "Authorization: Bearer sk_live_xxx" ``` -------------------------------- ### Initialize Go Module Source: https://docs.pandabase.io/developers/sdks/go Run this command in the root of your project to initialize a new Go module. ```sh go mod init ``` -------------------------------- ### Initialize Express Server with TypeScript Source: https://docs.pandabase.io/developers/learn/dynamic-payments Set up a basic Express.js server with TypeScript for handling API requests and webhooks. Ensure you have Node.js and npm installed. ```bash npm init npm add express dotenv npm add -D typescript @types/express @types/node ts-node npx tsc --init ``` -------------------------------- ### Get Payout Details OpenAPI Specification Source: https://docs.pandabase.io/api-reference/payouts/get-payout-details This OpenAPI 3.1.0 specification defines the GET endpoint for retrieving payout details. It includes request parameters, response schemas for success and error cases, and security scheme definitions. ```yaml openapi: 3.1.0 info: title: Pandabase V2 API description: >- Token-authenticated programmatic API for managing stores, products, orders, and more. Authenticated via Bearer token (sk_ prefix) or HMAC (stk_ token ID). version: 2.0.0 contact: name: Pandabase url: https://pandabase.io servers: - url: https://api.pandabase.io/v2/core description: Production - url: https://api.sandbox.pandabase.io/v2/core description: Development security: - BearerAuth: [] tags: - name: Store description: Store information - name: Products description: Product management - name: Categories description: Category management - name: Coupons description: Coupon management - name: Orders description: Order management - name: Payments description: Payment management - name: Webhooks description: Webhook management - name: Analytics description: Store analytics - name: Payouts description: Payout management - name: Customers description: Customer management - name: Licenses description: License management - name: Subscriptions description: Subscription management (Beta) paths: /stores/{storeId}/payouts/{payoutId}: get: tags: - Payouts summary: Get payout details operationId: getPayoutDetails parameters: - $ref: '#/components/parameters/StoreId' - $ref: '#/components/parameters/PayoutId' responses: '200': description: Payout details content: application/json: schema: type: object required: - ok - data properties: ok: type: boolean const: true data: $ref: '#/components/schemas/Payout' '404': $ref: '#/components/responses/ErrorResponse' components: parameters: StoreId: name: storeId in: path required: true schema: type: string minLength: 12 maxLength: 48 description: Store ID (shp_ prefix) PayoutId: name: payoutId in: path required: true schema: type: string minLength: 12 maxLength: 48 description: Payout ID (pto_ prefix) schemas: Payout: type: object properties: id: type: string amount: type: integer description: Amount in cents fee: type: integer description: Payout fee in cents status: type: string referenceId: type: - string - 'null' payoutMethod: type: object properties: id: type: string isPrimary: type: boolean status: type: string createdAt: type: string format: date-time updatedAt: type: string format: date-time responses: ErrorResponse: description: Error response content: application/json: schema: type: object required: - ok - error properties: ok: type: boolean const: false error: type: string securitySchemes: BearerAuth: type: http scheme: bearer description: Store API token. Use the `sk_` prefixed secret key as the Bearer token. ``` -------------------------------- ### Get a webhook Source: https://docs.pandabase.io/api-reference/webhooks/get-a-webhook Retrieves details for a specific webhook associated with a store. ```APIDOC ## GET /stores/{storeId}/webhooks/{webhookId} ### Description Retrieves details for a specific webhook associated with a store. ### Method GET ### Endpoint /stores/{storeId}/webhooks/{webhookId} ### Parameters #### Path Parameters - **storeId** (string) - Required - Store ID (shp_ prefix) - **webhookId** (string) - Required - Webhook ID (whk_ prefix) ### Response #### Success Response (200) - **ok** (boolean) - Indicates success. - **data** (Webhook) - The webhook object. #### Response Example ```json { "ok": true, "data": { "id": "whk_abc123xyz789", "url": "https://example.com/webhook", "note": "My webhook", "isEnabled": true, "eventTypes": [ "PAYMENT_COMPLETED", "PAYMENT_REFUNDED" ], "createdAt": "2023-01-01T12:00:00Z", "updatedAt": "2023-01-01T12:00:00Z" } } ``` ``` -------------------------------- ### Run Pandabase Docs Development Server Source: https://docs.pandabase.io/development Start the local development server for the Pandabase documentation site. The site will be accessible at http://localhost:3000. ```bash mintlify dev ``` -------------------------------- ### Create Checkout Session for Subscription Source: https://docs.pandabase.io/developers/learn/subscriptions This `curl` command initiates a checkout session for a subscription product. Ensure the `product_id` is valid and customer billing details are provided. The checkout UI will adapt to subscription requirements. ```bash curl -X POST https://api.pandabase.io/v2/stores/{storeId}/checkouts \ -H "Content-Type: application/json" \ -d '{ "items": [{ "product_id": "prd_xxx", "quantity": 1 }], "customer": { "name": "Jane Doe", "email": "jane@example.com", "billing": { "line1": "123 Main St", "city": "San Francisco", "state": "CA", "postal_code": "94105", "country": "US" } } }' ``` -------------------------------- ### GET /v2/core/stores/{storeId}/subscriptions/{subscriptionId} Source: https://docs.pandabase.io/developers/learn/subscriptions Retrieve the details of a specific subscription. ```APIDOC ## GET /v2/core/stores/{storeId}/subscriptions/{subscriptionId} ### Description Get detailed information about a specific subscription. ### Method GET ### Endpoint /v2/core/stores/{storeId}/subscriptions/{subscriptionId} ### Parameters #### Path Parameters - **storeId** (string) - Required - The unique identifier of the store. - **subscriptionId** (string) - Required - The unique identifier of the subscription. ``` -------------------------------- ### GET /v2/core/stores/{storeId}/subscriptions Source: https://docs.pandabase.io/developers/learn/subscriptions Retrieve a list of all subscriptions for a specific store. ```APIDOC ## GET /v2/core/stores/{storeId}/subscriptions ### Description List all subscriptions associated with a specific store. ### Method GET ### Endpoint /v2/core/stores/{storeId}/subscriptions ### Parameters #### Path Parameters - **storeId** (string) - Required - The unique identifier of the store. ``` -------------------------------- ### Create Subscription Product with Free Trial Source: https://docs.pandabase.io/developers/learn/subscriptions This JSON object defines a subscription product that includes a free trial period. Set the `trialDays` field to the desired number of days for the trial. The customer's card is saved during the trial without immediate charge. ```json { "title": "Pro Plan", "price": 1999, "type": "SUBSCRIPTION", "billingInterval": "MONTHLY", "trialDays": 7, "status": "ACTIVE" } ``` -------------------------------- ### GET /v2/{storeId}/onramp/payment-intents/{paymentId} Source: https://docs.pandabase.io/developers/onchain/api Retrieve the current status of a payment intent. ```APIDOC ## GET /v2/{storeId}/onramp/payment-intents/{paymentId} ### Description Retrieve the current status of a payment intent. ### Method GET ### Endpoint https://api.pandabase.io/v2/{storeId}/onramp/payment-intents/{paymentId} ### Parameters #### Path Parameters - **paymentId** (string) - Required - The unique ID of the payment intent. ### Response #### Success Response (200) - **id** (string) - Payment intent ID - **amount** (string) - Original amount requested - **originAsset** (string) - Chain and token identifier - **recipientAddress** (string) - Merchant's receiving address - **status** (string) - Current payment status (see below) - **liveStatus** (string) - Underlying chain transaction status - **txHash** (string) - On-chain transaction hash (available after deposit) - **metadata** (object) - Your metadata from the creation request - **expiresAt** (string) - Expiration timestamp - **completedAt** (string) - Completion timestamp (null if not yet completed) - **createdAt** (string) - Creation timestamp #### Response Example ```json { "id": "onpi_abc123", "amount": "1000000", "originAsset": "SOL_USDC", "recipientAddress": "So11...", "status": "COMPLETED", "liveStatus": "SUCCESS", "txHash": "0xabc...", "metadata": { "orderId": "order_123" }, "expiresAt": "2026-04-08T16:30:00.000Z", "completedAt": "2026-04-08T16:20:00.000Z", "createdAt": "2026-04-08T16:15:00.000Z" } ``` ``` -------------------------------- ### Create Subscription Product Source: https://docs.pandabase.io/developers/learn/subscriptions Use this `curl` command to create a new product with the type set to SUBSCRIPTION. Configure the billing interval, price, and status as needed. The `fulfillmentMode` is set to MANUAL for subscriptions. ```bash curl -X POST https://api.pandabase.io/v2/core/stores/{storeId}/products \ -H "Authorization: Bearer {token}" \ -H "Content-Type: application/json" \ -d '{ "title": "Pro Plan", "price": 1999, "type": "SUBSCRIPTION", "billingInterval": "MONTHLY", "status": "ACTIVE", "fulfillmentMode": "MANUAL" }' ``` -------------------------------- ### List Products with Bearer Token (TypeScript) Source: https://docs.pandabase.io/developers/learn/api-tokens Example of listing products using Bearer token authentication in TypeScript. Ensure your API token is stored securely. ```typescript const STORE_ID = process.env.PANDABASE_STORE_ID!; const API_TOKEN = process.env.PANDABASE_API_TOKEN!; // sk_live_... // list products const res = await fetch( `https://api.pandabase.io/v2/core/stores/${STORE_ID}/products`, { headers: { Authorization: `Bearer ${API_TOKEN}`, }, }, ); const { data } = await res.json(); console.log(data.items); ``` -------------------------------- ### GET /stores/{storeId}/subscriptions/{subscriptionId} Source: https://docs.pandabase.io/api-reference/subscriptions/get-subscription-details Retrieves the details of a specific subscription associated with a store. ```APIDOC ## GET /stores/{storeId}/subscriptions/{subscriptionId} ### Description Retrieves the details of a specific subscription associated with a store. ### Method GET ### Endpoint /stores/{storeId}/subscriptions/{subscriptionId} ### Parameters #### Path Parameters - **storeId** (string) - Required - Store ID (shp_ prefix) - **subscriptionId** (string) - Required - Subscription ID (sub_ prefix) ### Response #### Success Response (200) - **ok** (boolean) - Indicates success - **data** (object) - The subscription data object #### Error Response (404) - **ok** (boolean) - Indicates failure - **error** (string) - Error message ``` -------------------------------- ### Create Product with HMAC Signature (TypeScript) Source: https://docs.pandabase.io/developers/learn/api-tokens Example of creating a product using HMAC signature authentication in TypeScript. The JSON request body is signed. ```typescript // POST request (sign the JSON body) async function createProduct() { const body = JSON.stringify({ name: "New Product", amount: 2999, type: "ONE_TIME", }); const signature = sign(body); const res = await fetch( `https://api.pandabase.io/v2/core/stores/${STORE_ID}/products`, { method: "POST", headers: { "Content-Type": "application/json", Authorization: `Bearer ${TOKEN_ID}`, "X-Signature": signature, }, body, }, ); return res.json(); } ``` -------------------------------- ### GET /stores/{storeId}/webhooks Source: https://docs.pandabase.io/api-reference/webhooks/list-webhooks Retrieves a paginated list of webhooks associated with a specific store. ```APIDOC ## GET /stores/{storeId}/webhooks ### Description Retrieves a paginated list of webhooks for the specified store. ### Method GET ### Endpoint /stores/{storeId}/webhooks ### Parameters #### Path Parameters - **storeId** (string) - Required - Store ID (shp_ prefix) #### Query Parameters - **page** (integer) - Optional - Page number (default: 1) - **limit** (integer) - Optional - Number of items per page (default: 20, max: 100) ### Response #### Success Response (200) - **ok** (boolean) - Indicates success - **data** (object) - Contains items and pagination details #### Response Example { "ok": true, "data": { "items": [], "pagination": { "page": 1, "limit": 20, "total": 0, "totalPages": 0 } } } ``` -------------------------------- ### GET /stores/{storeId} Source: https://docs.pandabase.io/api-reference/store/get-store-details Retrieves the details of a specific store identified by its unique store ID. ```APIDOC ## GET /stores/{storeId} ### Description Retrieves the details of a specific store identified by its unique store ID. ### Method GET ### Endpoint /stores/{storeId} ### Parameters #### Path Parameters - **storeId** (string) - Required - Store ID (shp_ prefix) ### Response #### Success Response (200) - **ok** (boolean) - Indicates success - **data** (object) - The store details object #### Response Example { "ok": true, "data": {} } ``` -------------------------------- ### List Products (Python) Source: https://docs.pandabase.io/developers/learn/api-tokens Use this function to retrieve a list of products from your store. Ensure you have set the STORE_ID and TOKEN_ID environment variables. ```python def list_products(): signature = sign("") res = requests.get( f"https://api.pandabase.io/v2/core/stores/{STORE_ID}/products", headers={ "Authorization": f"Bearer {TOKEN_ID}", "X-Signature": signature, }, ) return res.json() ``` -------------------------------- ### GET /stores/{storeId}/coupons/{couponId} Source: https://docs.pandabase.io/api-reference/coupons/get-a-coupon Retrieves the details of a specific coupon associated with a store. ```APIDOC ## GET /stores/{storeId}/coupons/{couponId} ### Description Retrieves the details of a specific coupon identified by its ID within a given store. ### Method GET ### Endpoint /stores/{storeId}/coupons/{couponId} ### Parameters #### Path Parameters - **storeId** (string) - Required - Store ID (shp_ prefix) - **couponId** (string) - Required - Coupon ID (cpn_ prefix) ### Response #### Success Response (200) - **ok** (boolean) - Indicates success - **data** (object) - The coupon object containing details like id, code, type, value, and usage limits. #### Response Example { "ok": true, "data": { "id": "cpn_123456789012", "code": "SAVE10", "type": "PERCENTAGE", "value": 10, "enabled": true, "timesUsed": 5 } } ``` -------------------------------- ### Get Analytics Overview Source: https://docs.pandabase.io/api-reference/analytics/get-analytics-overview Retrieves an overview of store analytics. You can filter the data by a specific period. ```APIDOC ## GET /stores/{storeId}/analytics/overview ### Description Retrieves an overview of store analytics, allowing filtering by a specific period. ### Method GET ### Endpoint /stores/{storeId}/analytics/overview ### Parameters #### Path Parameters - **storeId** (string) - Required - Store ID (shp_ prefix) #### Query Parameters - **period** (string) - Optional - The period for which to retrieve analytics. Allowed values: `7d`, `30d`, `90d`, `all`, `custom`. - **startDate** (string) - Optional - The start date for custom period analytics (format: date-time). - **endDate** (string) - Optional - The end date for custom period analytics (format: date-time). ### Response #### Success Response (200) - **ok** (boolean) - Indicates if the operation was successful. - **data** (object) - Contains the analytics data. #### Error Response - **ok** (boolean) - Indicates if the operation was successful. - **error** (string) - Description of the error. ``` -------------------------------- ### Get Payment Status Response Source: https://docs.pandabase.io/developers/onchain/api The JSON response containing the current status and details of the payment intent. ```json { "id": "onpi_abc123", "amount": "1000000", "originAsset": "SOL_USDC", "recipientAddress": "So11...", "status": "COMPLETED", "liveStatus": "SUCCESS", "txHash": "0xabc...", "metadata": { "orderId": "order_123" }, "expiresAt": "2026-04-08T16:30:00.000Z", "completedAt": "2026-04-08T16:20:00.000Z", "createdAt": "2026-04-08T16:15:00.000Z" } ``` -------------------------------- ### POST /v2/core/stores/{storeId}/products Source: https://docs.pandabase.io/developers/learn/api-tokens Creates a new product within the specified store. ```APIDOC ## POST /v2/core/stores/{storeId}/products ### Description Creates a new product in the store. Requires a valid HMAC signature in the X-Signature header. ### Method POST ### Endpoint https://api.pandabase.io/v2/core/stores/{storeId}/products ### Parameters #### Path Parameters - **storeId** (string) - Required - The unique identifier of the store. #### Request Body - **name** (string) - Required - The name of the product. - **amount** (integer) - Required - The price of the product in cents. - **type** (string) - Required - The billing type (e.g., ONE_TIME). ### Request Example { "name": "New Product", "amount": 2999, "type": "ONE_TIME" } ### Response #### Success Response (200) - **product** (object) - The created product details. ``` -------------------------------- ### Create Product (Python) Source: https://docs.pandabase.io/developers/learn/api-tokens Use this function to create a new product in your store. The function requires the product details to be passed in a JSON format within the request body. Ensure STORE_ID and TOKEN_ID are configured. ```python def create_product(): body = json.dumps({"name": "New Product", "amount": 2999, "type": "ONE_TIME"}) signature = sign(body) res = requests.post( f"https://api.pandabase.io/v2/core/stores/{STORE_ID}/products", headers={ "Content-Type": "application/json", "Authorization": f"Bearer {TOKEN_ID}", "X-Signature": signature, }, data=body, ) return res.json() ``` -------------------------------- ### Get Payment Status Endpoint Source: https://docs.pandabase.io/developers/onchain/api The endpoint used to retrieve the current status of a specific payment intent. ```http GET https://api.pandabase.io/v2/{storeId}/onramp/payment-intents/{paymentId} ``` -------------------------------- ### POST /stores/{storeId}/products Source: https://docs.pandabase.io/api-reference/products/create-a-product Creates a new product within a specified store. Requires authentication. ```APIDOC ## POST /stores/{storeId}/products ### Description Creates a new product within a specified store. Requires authentication. ### Method POST ### Endpoint /stores/{storeId}/products ### Parameters #### Path Parameters - **storeId** (string) - Required - Store ID (shp_ prefix) #### Request Body - **title** (string) - Required - Product title (1-256 characters) - **productType** (ProductType) - Required - Type of the product - **price** (integer) - Required - Product price (non-negative) - **subtitle** (string) - Optional - Product subtitle (max 512 characters) - **description** (string) - Optional - Product description (max 10000 characters) - **compareAtPrice** (integer) - Optional - Price to compare against (non-negative) - **images** (array) - Optional - Array of image URLs (max 10 images) - **message** (string) - Optional - Message associated with the product (max 1000 characters) - **fulfillmentMode** (FulfillmentMode) - Optional - Fulfillment mode for the product - **pricingModel** (PricingModel) - Optional - Pricing model for the product - **status** (ProductStatus) - Optional - Status of the product - **minimumPrice** (integer) - Optional - Minimum price for the product (non-negative) - **maxPerCustomer** (integer) - Optional - Maximum quantity per customer (minimum 1) - **availableFrom** (string) - Optional - Date and time when the product becomes available (ISO 8601 format) - **availableUntil** (string) - Optional - Date and time when the product is no longer available (ISO 8601 format) - **downloadUrl** (string) - Optional - URL for downloadable products (max 2048 characters) - **redirectUrl** (string) - Optional - URL to redirect to for the product (max 2048 characters) - **keyFormat** (KeyFormat) - Optional - Format for license keys - **customPrefix** (string) - Optional - Custom prefix for license keys (max 32 characters) - **maxActivations** (integer) - Optional - Maximum number of activations for license keys (minimum 1) - **licenseDuration** (LicenseDuration) - Optional - Duration of the license - **revokeOnRefund** (boolean) - Optional - Whether to revoke license on refund - **lowStockThreshold** (integer) - Optional - Threshold for low stock notifications (non-negative) - **webhookUrl** (string) - Optional - URL for webhooks (max 2048 characters) - **webhookSecret** (string) - Optional - Secret for webhook authentication (max 256 characters) - **billingInterval** (BillingInterval) - Optional - Interval for billing - **billingAnchor** (BillingAnchor) - Optional - Anchor date for billing - **trialDays** (integer) - Optional - Number of trial days for subscriptions (non-negative) - **licenseKeys** (array) - Optional - Array of license keys (max 1000 keys, max 512 characters each) - **variants** (array) - Optional - Array of product variants (max 4 variants) - **title** (string) - Required - Variant title (1-256 characters) - **slug** (string) - Optional - Variant slug (max 128 characters) - **description** (string) - Optional - Variant description (max 1000 characters) - **sku** (string) - Optional - Variant SKU (max 128 characters) - **options** (object) - Required - Variant options - **price** (integer) - Required - Variant price (non-negative) - **compareAtPrice** (integer) - Optional - Variant compare-at price (non-negative) ### Response #### Success Response (201) - **id** (string) - Description of the created product ID - **title** (string) - Description of the created product title #### Response Example ```json { "id": "prod_xxxxxxxxxxxx", "title": "Example Product" } ``` ``` -------------------------------- ### Initialize and Use Pandabase TypeScript Client Source: https://docs.pandabase.io/developers/sdks/typescript Configure the TypeScript client with your API key and store ID. Use the client to list payments and products, and create payment links. ```ts import { Client } from "@pandabase/node"; const pb = new Client({ storeId: "store_", apiKey: "sk_v3_interactions_" }); const payments = await pb.payments.list({ page: 1, page_size: 10 }) const products = await pb.products.list({ page: 1, page_size: 10 }); const { url } = await pb.payments.createLink({ amount: 100, // in cents currency: 'USD' }) console.log(url); // logs `https://pay.pandabase.io/?token=` ``` -------------------------------- ### GET /stores/{storeId}/orders/payments/{paymentId} Source: https://docs.pandabase.io/api-reference/payments/get-payment-details Retrieves the details of a specific payment for a given order within a store. ```APIDOC ## GET /stores/{storeId}/orders/payments/{paymentId} ### Description Retrieves the details of a specific payment for a given order within a store. ### Method GET ### Endpoint /stores/{storeId}/orders/payments/{paymentId} ### Parameters #### Path Parameters - **storeId** (string) - Required - Store ID (shp_ prefix) - **paymentId** (string) - Required - Payment ID (pmt_ prefix) ### Response #### Success Response (200) - **ok** (boolean) - Indicates success. - **data** (object) - Contains the payment details. - **id** (string) - Payment ID. - **referenceId** (string) - Reference ID for the payment. - **amount** (integer) - The amount of the payment. - **discountAmount** (integer) - The discount amount applied. - **platformFeeAmount** (integer) - The platform fee amount. - **pspFeeAmount** (integer) - The payment service provider fee amount. - **taxAmount** (integer) - The tax amount. - **totalAmount** (integer) - The total amount of the payment. - **settledAmount** (integer) - The amount that has been settled. - **status** (string) - The status of the payment. - **pspProvider** (string) - The payment service provider. - **couponCode** (string | null) - The coupon code used, if any. - **taxId** (string | null) - The tax ID, if applicable. - **ipAddress** (string | null) - The IP address of the customer. - **userAgent** (string | null) - The user agent of the customer. - **geo** (object | null) - Geographic information. - **city** (string | null) - **region** (string | null) - **country** (string | null) - **postal** (string | null) - **asn** (string | null) - **org** (string | null) - **customer** (object | null) - Customer details. - **id** (string) - **email** (string) - **firstName** (string | null) - **lastName** (string | null) - **guest** (boolean) - **order** (object | null) - Order details. - **id** (string) - **orderNumber** (string) - **status** (string) - **amount** (integer) - **currency** (string) - **dispute** (object | null) - Dispute details. - **id** (string) - **disputeId** (string) #### Response Example ```json { "ok": true, "data": { "id": "pmt_xxxxxxxxxxxx", "referenceId": "ord_xxxxxxxxxxxx", "amount": 10000, "discountAmount": 0, "platformFeeAmount": 500, "pspFeeAmount": 200, "taxAmount": 1000, "totalAmount": 11700, "settledAmount": 11700, "status": "paid", "pspProvider": "stripe", "couponCode": null, "taxId": null, "ipAddress": "192.168.1.1", "userAgent": "Mozilla/5.0", "geo": { "city": "San Francisco", "region": "CA", "country": "US", "postal": "94107", "asn": "AS15169", "org": "Google LLC" }, "customer": { "id": "cus_xxxxxxxxxxxx", "email": "customer@example.com", "firstName": "John", "lastName": "Doe", "guest": false }, "order": { "id": "ord_xxxxxxxxxxxx", "orderNumber": "#12345", "status": "completed", "amount": 10000, "currency": "USD" }, "dispute": null } } ``` ``` -------------------------------- ### Create rules via API Source: https://docs.pandabase.io/guides/shield Use the POST endpoint to programmatically create new rules in your store. ```bash curl -X POST https://api.pandabase.io/v2/stores/{storeId}/shield/rules \ -H "Authorization: Bearer sk_live_xxx" \ -H "Content-Type: application/json" \ -d '{ "name": "Block disposable emails", "condition": "email IN @disposable_emails", "action": "BLOCK", "priority": 1, "enabled": true }' ``` -------------------------------- ### Get Order Details Source: https://docs.pandabase.io/api-reference/orders/get-order-details Retrieves the details of a specific order within a store. Requires authentication with a Bearer token. ```APIDOC ## GET /stores/{storeId}/orders/{orderId} ### Description Retrieves the details of a specific order. ### Method GET ### Endpoint /stores/{storeId}/orders/{orderId} ### Parameters #### Path Parameters - **storeId** (string) - Required - Store ID (shp_ prefix) - **orderId** (string) - Required - Order ID (ord_ prefix) ### Response #### Success Response (200) - **ok** (boolean) - Indicates success. - **data** (object) - Contains the order details. - **id** (string) - Order ID. - **orderNumber** (string) - The order number. - **status** (string) - The current status of the order. - **amount** (integer) - The total amount of the order. - **currency** (string) - The currency of the order. - **gateway** (string) - The payment gateway used. - **discounted** (boolean) - Whether a discount was applied. - **discountCode** (string | null) - The discount code used, if any. - **customFields** (object | null) - Custom fields associated with the order. - **returnUrl** (string | null) - The URL for returns. - **items** (array) - An array of items in the order. - **id** (string) - Item ID. - **productId** (string) - Product ID. - **variantId** (string | null) - Product variant ID. - **name** (string | null) - Name of the item. - **quantity** (integer) - Quantity of the item. - **price** (integer) - Unit price in cents. - **customer** (object | null) - Customer information. - **id** (string) - Customer ID. - **email** (string) - Customer email. - **firstName** (string | null) - Customer first name. - **lastName** (string | null) - Customer last name. - **guest** (boolean) - Whether the customer is a guest. - **billingAddress** (object | null) - Billing address details. - **id** (string) - Address ID. - **addressLine1** (string) - Address line 1. - **addressLine2** (string | null) - Address line 2. - **city** (string) - City. - **state** (string) - State. - **postalCode** (string) - Postal code. - **country** (string) - Country. - **payment** (object | null) - Payment details. - **id** (string) - Payment ID. - **referenceId** (string) - Payment reference ID. - **amount** (integer) - Payment amount. - **discountAmount** (integer) - Discount amount. - **platformFeeAmount** (integer) - Platform fee amount. - **pspFeeAmount** (integer) - PSP fee amount. - **taxAmount** (integer) - Tax amount. #### Response Example ```json { "ok": true, "data": { "id": "ord_1234567890ab", "orderNumber": "#1001", "status": "processing", "amount": 5000, "currency": "USD", "gateway": "stripe", "discounted": false, "discountCode": null, "customFields": null, "returnUrl": null, "items": [ { "id": "item_abcdef123456", "productId": "prod_1234567890ab", "variantId": null, "name": "T-Shirt", "quantity": 1, "price": 2500 } ], "customer": { "id": "cust_abcdef123456", "email": "customer@example.com", "firstName": "John", "lastName": "Doe", "guest": false }, "billingAddress": { "id": "addr_abcdef123456", "addressLine1": "123 Main St", "addressLine2": null, "city": "Anytown", "state": "CA", "postalCode": "90210", "country": "USA" }, "payment": { "id": "pay_abcdef123456", "referenceId": "ref_1234567890ab", "amount": 5000, "discountAmount": 0, "platformFeeAmount": 100, "pspFeeAmount": 150, "taxAmount": 400 } } } ``` #### Error Response (404) Refer to components/responses/ErrorResponse. ```