### Pelcro JavaScript SDK - Plan Creation Source: https://docs.pelcro.com/docs/overview Covers the JavaScript SDK functions for creating a plan. ```JavaScript pelcro.plan.create(data); ``` -------------------------------- ### Pelcro Open API - Examples Source: https://docs.pelcro.com/docs/event-subscription-trial-will-end This section showcases examples of using the Pelcro Open API, which offers a broader set of functionalities for integrating with external systems and accessing detailed platform data. ```HTTP GET /v2/analytics/revenue?start_date=2023-01-01&end_date=2023-12-31 POST /v2/integrations/sync { "integration_name": "google_analytics", "data": { ... } } ``` -------------------------------- ### Pelcro JavaScript SDK - Product Creation Source: https://docs.pelcro.com/docs/overview Documentation for the JavaScript SDK's product creation functionality. ```JavaScript pelcro.product.create(data); ``` -------------------------------- ### Pelcro JavaScript SDK - Subscription Creation Source: https://docs.pelcro.com/docs/overview Details the JavaScript SDK methods for creating a subscription. ```JavaScript pelcro.subscription.create(data); ``` -------------------------------- ### Pelcro JavaScript SDK - Plan Creation Source: https://docs.pelcro.com/docs/overview Details the JavaScript SDK methods for creating a plan. ```JavaScript pelcro.plan.create(data); ``` -------------------------------- ### Pelcro Core API - Examples Source: https://docs.pelcro.com/docs/event-subscription-trial-will-end This section provides examples of how to interact with the Pelcro Core API for various operations, including managing customers, products, and subscriptions. It demonstrates the request structure and expected responses. ```HTTP GET /v1/customers POST /v1/products { "name": "New Product", "description": "A description for the new product." } GET /v1/subscriptions?user_id=user_xyz ``` -------------------------------- ### Pelcro JavaScript SDK - Member Creation Source: https://docs.pelcro.com/docs/overview Details the JavaScript SDK methods for creating a member. ```JavaScript pelcro.member. ``` -------------------------------- ### Pelcro JavaScript SDK - Order Creation Source: https://docs.pelcro.com/docs/overview Documentation for the JavaScript SDK's order creation functionality. ```JavaScript pelcro.order.create(data); ``` -------------------------------- ### Pelcro JavaScript SDK - Product Update Source: https://docs.pelcro.com/docs/overview Documentation for the JavaScript SDK's product update functionality. ```JavaScript pelcro.product.update(id, data); ``` -------------------------------- ### Pelcro JavaScript SDK - Integrations Update Source: https://docs.pelcro.com/docs/overview Covers the JavaScript SDK functions for updating integrations. ```JavaScript pelcro.integrations.update(id, data); ``` -------------------------------- ### Pelcro JavaScript SDK - Product SKU Creation Source: https://docs.pelcro.com/docs/overview Covers the JavaScript SDK functions for creating product SKUs. ```JavaScript pelcro.productSku.create(data); ``` -------------------------------- ### Pelcro JavaScript SDK - Invoice Creation Source: https://docs.pelcro.com/docs/overview Covers the JavaScript SDK functions for creating an invoice. ```JavaScript pelcro.invoice.create(data); ``` -------------------------------- ### Pelcro JavaScript SDK - Site Update Source: https://docs.pelcro.com/docs/overview Covers the JavaScript SDK functions for updating site configurations. ```JavaScript pelcro.site.update(id, data); ``` -------------------------------- ### Pelcro JavaScript SDK - Product SKU Update Source: https://docs.pelcro.com/docs/overview Details the JavaScript SDK methods for updating product SKUs. ```JavaScript pelcro.productSku.update(id, data); ``` -------------------------------- ### Pelcro JavaScript SDK - Plan Management Source: https://docs.pelcro.com/docs/overview Documentation for managing plans using the JavaScript SDK, including creation, retrieval, and updates. ```JavaScript pelcro.plan.create(data); pelcro.plan.get(); pelcro.plan.update(data); ``` -------------------------------- ### Pelcro JavaScript SDK - Campaign Management Source: https://docs.pelcro.com/docs/overview Documentation for managing campaigns using the JavaScript SDK, covering creation, triggering, and completion status. ```JavaScript pelcro.campaign.create(data); pelcro.campaign.trigger(); pelcro.campaign.runCompleted(); ``` -------------------------------- ### Pelcro JavaScript SDK - Plan Update Source: https://docs.pelcro.com/docs/overview Covers the JavaScript SDK functions for updating a plan. ```JavaScript pelcro.plan.update(id, data); ``` -------------------------------- ### Pelcro JavaScript SDK - Product Management Source: https://docs.pelcro.com/docs/overview Documentation for managing products using the JavaScript SDK, including creating, retrieving, updating, and deleting product information. ```JavaScript pelcro.product.create(data); pelcro.product.get(); pelcro.product.update(data); pelcro.product.delete(); ``` -------------------------------- ### Pelcro JavaScript SDK - Subscription Update Source: https://docs.pelcro.com/docs/overview Documentation for the JavaScript SDK's subscription update functionality. ```JavaScript pelcro.subscription.update(id, data); ``` -------------------------------- ### Pelcro JavaScript SDK - Integrations Management Source: https://docs.pelcro.com/docs/overview Details the JavaScript SDK methods for managing integrations, including creation and retrieval. ```JavaScript pelcro.integrations.create(data); pelcro.integrations.get(); ``` -------------------------------- ### Pelcro JavaScript SDK - User Update Source: https://docs.pelcro.com/docs/overview Documentation for the JavaScript SDK's user update functionality. ```JavaScript pelcro.user.update(id, data); ``` -------------------------------- ### Pelcro JavaScript SDK - Order Update Source: https://docs.pelcro.com/docs/overview Covers the JavaScript SDK functions for updating an order. ```JavaScript pelcro.order.update(id, data); ``` -------------------------------- ### Pelcro JavaScript SDK - Payment Source Creation Source: https://docs.pelcro.com/docs/overview Details the JavaScript SDK methods for creating a payment source. ```JavaScript pelcro.paymentSource.create(data); ``` -------------------------------- ### Pelcro JavaScript SDK - Insight Update Source: https://docs.pelcro.com/docs/overview Documentation for the JavaScript SDK's insight update functionality. ```JavaScript pelcro.insight.update(id, data); ``` -------------------------------- ### Pelcro JavaScript SDK - Coupon Update Source: https://docs.pelcro.com/docs/overview Details the JavaScript SDK methods for updating a coupon. ```JavaScript pelcro.coupon.update(id, data); ``` -------------------------------- ### Pelcro JavaScript SDK - Product Deletion Source: https://docs.pelcro.com/docs/overview Covers the JavaScript SDK functions for deleting a product. ```JavaScript pelcro.product.delete(id); ``` -------------------------------- ### Pelcro JavaScript SDK - Member Activation Source: https://docs.pelcro.com/docs/overview Covers the JavaScript SDK functions for activating a member. ```JavaScript pelcro.member.activate(id); ``` -------------------------------- ### Pelcro JavaScript SDK - Ecommerce SKU Management Source: https://docs.pelcro.com/docs/overview Documentation for managing e-commerce SKUs using the JavaScript SDK, including creation, retrieval, and updates. ```JavaScript pelcro.ecommerceSku.create(data); pelcro.ecommerceSku.get(); pelcro.ecommerceSku.update(data); ``` -------------------------------- ### Pelcro JavaScript SDK - Site Deletion Source: https://docs.pelcro.com/docs/overview Documentation for the JavaScript SDK's site deletion functionality. ```JavaScript pelcro.site.delete(id); ``` -------------------------------- ### Pelcro JavaScript SDK - Export Request Source: https://docs.pelcro.com/docs/overview Details the JavaScript SDK methods for requesting data exports. ```JavaScript pelcro.export.requested(type, format); ``` -------------------------------- ### Pelcro JavaScript SDK - Invoice Update Source: https://docs.pelcro.com/docs/overview Documentation for the JavaScript SDK's invoice update functionality. ```JavaScript pelcro.invoice.update(id, data); ``` -------------------------------- ### Pelcro JavaScript SDK - Address Update Source: https://docs.pelcro.com/docs/overview Details the JavaScript SDK methods for updating an address. ```JavaScript pelcro.address.update(id, data); ``` -------------------------------- ### Pelcro JavaScript SDK - Authorization Management Source: https://docs.pelcro.com/docs/overview Details the JavaScript SDK methods for managing authorization related to products and offerings. ```JavaScript pelcro.authorization.create(data); pelcro.authorization.get(); ``` -------------------------------- ### Pelcro JavaScript SDK - Paywall Management Source: https://docs.pelcro.com/docs/overview Covers the JavaScript SDK functions for managing paywalls, including creation and retrieval of paywall configurations. ```JavaScript pelcro.paywall.create(data); pelcro.paywall.get(); ``` -------------------------------- ### Pelcro JavaScript SDK - User Management Source: https://docs.pelcro.com/docs/overview Documentation for the JavaScript SDK's user management functionalities, including creating, retrieving, updating, and deleting user accounts. ```JavaScript pelcro.user.create(data); pelcro.user.get(); pelcro.user.update(data); pelcro.user.delete(); ``` -------------------------------- ### Pelcro JavaScript SDK - Customer Passwordless Login Source: https://docs.pelcro.com/docs/overview Covers the JavaScript SDK functions for initiating a passwordless login for a customer. ```JavaScript pelcro.customer.passwordlessLoginRequest(email); ``` -------------------------------- ### Pelcro JavaScript SDK - Coupon Management Source: https://docs.pelcro.com/docs/overview Documentation for managing coupons using the JavaScript SDK, including creation and retrieval. ```JavaScript pelcro.coupon.create(data); pelcro.coupon.get(); ``` -------------------------------- ### Pelcro JavaScript SDK - Site Management Source: https://docs.pelcro.com/docs/overview This section details the JavaScript SDK methods for managing site-related functionalities within Pelcro. It covers initialization and core operations for website integration. ```JavaScript pelcro.site.init(options); pelcro.site.get(); pelcro.site.update(data); pelcro.site.delete(); ``` -------------------------------- ### Pelcro JavaScript SDK - Ecommerce Product Management Source: https://docs.pelcro.com/docs/overview Details the JavaScript SDK functions for managing e-commerce products, including creation, retrieval, and updates. ```JavaScript pelcro.ecommerceProduct.create(data); pelcro.ecommerceProduct.get(); pelcro.ecommerceProduct.update(data); ``` -------------------------------- ### Pelcro JavaScript SDK - Charge Failure Handling Source: https://docs.pelcro.com/docs/overview Documentation for the JavaScript SDK's handling of failed charges. ```JavaScript pelcro.charge.failed(id); ``` -------------------------------- ### Pelcro JavaScript SDK - Order Management Source: https://docs.pelcro.com/docs/overview Provides information on using the JavaScript SDK to manage customer orders, including creating, retrieving, and updating order details. ```JavaScript pelcro.order.create(data); pelcro.order.get(); pelcro.order.update(data); ``` -------------------------------- ### Pelcro JavaScript SDK - Charge Refund Handling Source: https://docs.pelcro.com/docs/overview Covers the JavaScript SDK functions related to refunding charges. ```JavaScript pelcro.charge.refunded(id); ``` -------------------------------- ### Pelcro JavaScript SDK - Subscription Renewal Source: https://docs.pelcro.com/docs/overview Documentation for the JavaScript SDK's subscription renewal functionality. ```JavaScript pelcro.subscription.renew(id); ``` -------------------------------- ### Pelcro JavaScript SDK - Customer Email Verification Source: https://docs.pelcro.com/docs/overview Documentation for the JavaScript SDK's customer email verification process. ```JavaScript pelcro.customer.emailVerificationRequest(email); pelcro.customer.emailVerificationSucceeded(token); ``` -------------------------------- ### Pelcro JavaScript SDK - Insight Management Source: https://docs.pelcro.com/docs/overview Covers the JavaScript SDK functions for managing insights, including creation and retrieval. ```JavaScript pelcro.insight.create(data); pelcro.insight.get(); ``` -------------------------------- ### Pelcro JavaScript SDK - Language Localization Source: https://docs.pelcro.com/docs/overview Documentation for managing language localization settings using the JavaScript SDK. ```JavaScript pelcro.localization.setLanguage(lang); pelcro.localization.getLanguage(); ``` -------------------------------- ### Pelcro JavaScript SDK - Membership Management Source: https://docs.pelcro.com/docs/overview Covers the JavaScript SDK methods for managing memberships, including activation, creation, updates, and deletion. ```JavaScript pelcro.member.activate(data); pelcro.member.create(data); pelcro.member.update(data); pelcro.member.delete(); ``` -------------------------------- ### Pelcro JavaScript SDK - Subscription Management Source: https://docs.pelcro.com/docs/overview Covers the JavaScript SDK methods for managing customer subscriptions, including creation, retrieval, updates, cancellations, and renewals. ```JavaScript pelcro.subscription.create(data); pelcro.subscription.get(); pelcro.subscription.update(data); pelcro.subscription.cancel(); pelcro.subscription.renew(); ``` -------------------------------- ### Pelcro JavaScript SDK - Newsletter Update Source: https://docs.pelcro.com/docs/overview Documentation for the JavaScript SDK's newsletter update functionality. ```JavaScript pelcro.newsletter.update(id, data); ``` -------------------------------- ### Pelcro JavaScript SDK - Product SKU Deletion Source: https://docs.pelcro.com/docs/overview Documentation for the JavaScript SDK's product SKU deletion functionality. ```JavaScript pelcro.productSku.delete(id); ``` -------------------------------- ### Pelcro JavaScript SDK - Plan Deletion Source: https://docs.pelcro.com/docs/overview Details the JavaScript SDK methods for deleting a plan. ```JavaScript pelcro.plan.delete(id); ``` -------------------------------- ### Pelcro JavaScript SDK - Newsletter Creation Source: https://docs.pelcro.com/docs/overview Details the JavaScript SDK methods for creating a newsletter. ```JavaScript pelcro.newsletter.create(data); ``` -------------------------------- ### Pelcro JavaScript SDK - Subscription Cancellation Source: https://docs.pelcro.com/docs/overview Documentation for the JavaScript SDK's subscription cancellation functionality. ```JavaScript pelcro.subscription.cancel(id); ``` -------------------------------- ### Pelcro JavaScript SDK - Payment Source Update Source: https://docs.pelcro.com/docs/overview Covers the JavaScript SDK functions for updating payment sources. ```JavaScript pelcro.paymentSource.update(id, data); ``` -------------------------------- ### Pelcro JavaScript SDK - Metadata Management Source: https://docs.pelcro.com/docs/overview Covers the JavaScript SDK functions for managing metadata associated with various Pelcro entities. ```JavaScript pelcro.metadata.create(entity, data); pelcro.metadata.get(entity); pelcro.metadata.update(entity, data); pelcro.metadata.delete(entity); ``` -------------------------------- ### Pelcro Core API - Webhook Events (Final) Source: https://docs.pelcro.com/docs/overview This final section lists the remaining webhook events from the Pelcro Core API, covering product SKUs, plans, and various subscription-related events. ```JSON { "event": "product_sku.created", "data": { ... } } { "event": "plan.created", "data": { ... } } { "event": "subscription.canceled", "data": { ... } } { "event": "subscription.changed", "data": { ... } } { "event": "subscription.renewed", "data": { ... } } { "event": "subscription.trial_will_end", "data": { ... } } ``` -------------------------------- ### iOS SDK - Pelcro Source: https://docs.pelcro.com/docs/setting-up Documentation for the Pelcro iOS SDK, enabling developers to integrate Pelcro's subscription and e-commerce features into their native iOS applications. Covers user management, payments, and product handling. ```Swift // Example: Initialize Pelcro SDK // Pelcro.shared.configure(apiKey: "YOUR_API_KEY") // Example: Fetch user subscriptions // Pelcro.shared.fetchSubscriptions { result in // switch result { // case .success(let subscriptions): // print(subscriptions) // case .failure(let error): // print(error.localizedDescription) // } // } ``` -------------------------------- ### Pelcro JavaScript SDK - Address Management Source: https://docs.pelcro.com/docs/overview Documentation for managing addresses using the JavaScript SDK, including creating, retrieving, and updating address details. ```JavaScript pelcro.address.create(data); pelcro.address.get(); pelcro.address.update(data); ``` -------------------------------- ### JavaScript SDK - Pelcro Source: https://docs.pelcro.com/docs/setting-up Documentation for the Pelcro JavaScript SDK, covering various modules like Site, User, Subscription, and more. This SDK allows developers to integrate Pelcro's features into their websites. ```JavaScript /* * Pelcro JavaScript SDK - Site Module * Provides methods for interacting with site-specific configurations and data. */ // Example: Get site configuration // Pelcro.Site.getConfig().then(config => console.log(config)); /* * Pelcro JavaScript SDK - User Module * Handles user authentication, profile management, and related operations. */ // Example: Get current user // Pelcro.User.getCurrentUser().then(user => console.log(user)); /* * Pelcro JavaScript SDK - Subscription Module * Manages user subscriptions, including creation, cancellation, and updates. */ // Example: Create a new subscription // Pelcro.Subscription.create({ planId: 'plan_123', userId: 'user_abc' }).then(sub => console.log(sub)); /* * Pelcro JavaScript SDK - Payment Source Module * Handles payment methods and sources for users. */ // Example: Add a new payment source // Pelcro.PaymentSource.add({ userId: 'user_abc', token: 'tok_123' }).then(source => console.log(source)); /* * Pelcro JavaScript SDK - Product Module * Manages product information and purchasing. */ // Example: Get product details // Pelcro.Product.get('prod_xyz').then(product => console.log(product)); /* * Pelcro JavaScript SDK - Plan Module * Manages subscription plans. */ // Example: List available plans // Pelcro.Plan.list().then(plans => console.log(plans)); /* * Pelcro JavaScript SDK - Order Module * Handles e-commerce orders. */ // Example: Create an order // Pelcro.Order.create({ cart: [...], userId: 'user_abc' }).then(order => console.log(order)); /* * Pelcro JavaScript SDK - Invoice Module * Manages invoices for transactions. */ // Example: Get invoice details // Pelcro.Invoice.get('inv_789').then(invoice => console.log(invoice)); /* * Pelcro JavaScript SDK - Membership Module * Manages user memberships. */ // Example: Get user memberships // Pelcro.Membership.list({ userId: 'user_abc' }).then(memberships => console.log(memberships)); /* * Pelcro JavaScript SDK - Campaign Module * Manages marketing campaigns. */ // Example: Trigger a campaign // Pelcro.Campaign.trigger({ campaignId: 'camp_def', userId: 'user_abc' }).then(result => console.log(result)); /* * Pelcro JavaScript SDK - Paywall Module * Handles paywall logic and access control. */ // Example: Check paywall access // Pelcro.Paywall.checkAccess({ resourceId: 'res_ghi' }).then(access => console.log(access)); /* * Pelcro JavaScript SDK - Newsletter Module * Manages newsletter subscriptions. */ // Example: Subscribe to a newsletter // Pelcro.Newsletter.subscribe({ userId: 'user_abc', newsletterId: 'news_jkl' }).then(result => console.log(result)); /* * Pelcro JavaScript SDK - Coupon Module * Manages coupon codes for discounts. */ // Example: Apply a coupon // Pelcro.Coupon.apply({ code: 'SUMMER20', orderId: 'order_mno' }).then(result => console.log(result)); /* * Pelcro JavaScript SDK - Insight Module * Provides access to analytics and insights. */ // Example: Track an event // Pelcro.Insight.trackEvent('page_view', { page: '/home' }).then(result => console.log(result)); /* * Pelcro JavaScript SDK - Integrations Module * Manages integrations with third-party services. */ // Example: Initialize an integration // Pelcro.Integrations.init('stripe', { apiKey: 'pk_test_...' }).then(result => console.log(result)); ``` -------------------------------- ### Pelcro JavaScript SDK - Gift Management Source: https://docs.pelcro.com/docs/overview Covers the JavaScript SDK methods for managing gifts, including creation and retrieval. ```JavaScript pelcro.gift.create(data); pelcro.gift.get(); ``` -------------------------------- ### Pelcro JavaScript SDK - Payment Method Update Source: https://docs.pelcro.com/docs/overview Covers the JavaScript SDK functions for updating existing payment methods. ```JavaScript pelcro.paymentMethod.update(id, data); ``` -------------------------------- ### Pelcro JavaScript SDK - Order Payment Failure Source: https://docs.pelcro.com/docs/overview Documentation for the JavaScript SDK's handling of order payment failures. ```JavaScript pelcro.order.paymentFailed(id); ``` -------------------------------- ### Pelcro JavaScript SDK - Address Deletion Source: https://docs.pelcro.com/docs/overview Covers the JavaScript SDK functions for deleting an address. ```JavaScript pelcro.address.delete(id); ``` -------------------------------- ### Open API - Pelcro Source: https://docs.pelcro.com/docs/setting-up Documentation for Pelcro's Open API, which provides a comprehensive interface for interacting with Pelcro's services. This includes endpoints for managing all core functionalities. ```yaml openapi: 3.0.0 info: title: Pelcro API version: 1.0.0 paths: /customers/{id}: get: summary: Get a customer by ID parameters: - name: id in: path required: true schema: type: string responses: '200': description: Customer details content: application/json: schema: $ref: '#/components/schemas/Customer' ``` -------------------------------- ### Pelcro JavaScript SDK - Payment Source Management Source: https://docs.pelcro.com/docs/overview Details the JavaScript SDK functions for managing customer payment sources, including creation, retrieval, updates, and cancellation. ```JavaScript pelcro.paymentSource.create(data); pelcro.paymentSource.get(); pelcro.paymentSource.update(data); pelcro.paymentSource.cancel(); ``` -------------------------------- ### Pelcro JavaScript SDK - Invoice Management Source: https://docs.pelcro.com/docs/overview Details the JavaScript SDK methods for managing invoices, including creation, retrieval, updates, and handling payment actions. ```JavaScript pelcro.invoice.create(data); pelcro.invoice.get(); pelcro.invoice.update(data); pelcro.invoice.paymentActionRequired(); ``` -------------------------------- ### Pelcro JavaScript SDK - User Deletion Source: https://docs.pelcro.com/docs/overview Details the JavaScript SDK methods for deleting a user. ```JavaScript pelcro.user.delete(id); ``` -------------------------------- ### Core API - Pelcro Source: https://docs.pelcro.com/docs/setting-up Documentation for Pelcro's Core API, detailing endpoints for managing various aspects of the platform such as customers, products, subscriptions, and transactions. This API is essential for backend integrations. ```bash # Example: Get customer details using Core API curl -X GET \ 'https://api.pelcro.com/v1/customers/{customer_id}' \ -H 'Authorization: Bearer YOUR_API_KEY' ``` -------------------------------- ### Pelcro JavaScript SDK - Newsletter Management Source: https://docs.pelcro.com/docs/overview Details the JavaScript SDK methods for managing newsletters, including creation and updates. ```JavaScript pelcro.newsletter.create(data); pelcro.newsletter.update(data); ``` -------------------------------- ### Pelcro Core API - Webhook Events Source: https://docs.pelcro.com/docs/overview This section outlines various webhook events that can be triggered by the Pelcro Core API, covering different modules like addresses, campaigns, charges, customers, invoices, and subscriptions. ```JSON { "event": "address.created", "data": { ... } } { "event": "campaign.triggered", "data": { ... } } { "event": "charge.failed", "data": { ... } } { "event": "customer.created", "data": { ... } } { "event": "invoice.created", "data": { ... } } { "event": "subscription.created", "data": { ... } } ``` -------------------------------- ### Pelcro JavaScript SDK - Member Deletion Source: https://docs.pelcro.com/docs/overview Details the JavaScript SDK methods for deleting a member. ```JavaScript pelcro.member.delete(id); ``` -------------------------------- ### Android SDK - Pelcro Source: https://docs.pelcro.com/docs/setting-up Documentation for the Pelcro Android SDK, facilitating the integration of Pelcro's functionalities into Android applications. Supports subscription management, payment processing, and customer data handling. ```Java // Example: Initialize Pelcro SDK // Pelcro.configure(this, "YOUR_API_KEY"); // Example: Create a subscription // Pelcro.createSubscription(userId, planId, new Pelcro.Callback() { // @Override // public void onSuccess(Subscription subscription) { // // Handle success // } // @Override // public void onError(PelcroException e) { // // Handle error // } // }); ``` -------------------------------- ### Pelcro JavaScript SDK - Fraud Prevention Trigger Source: https://docs.pelcro.com/docs/overview Documentation for the JavaScript SDK's fraud prevention triggering mechanism. ```JavaScript pelcro.fraudPrevention.triggered(rule, data); ``` -------------------------------- ### Pelcro JavaScript SDK - Member Update Source: https://docs.pelcro.com/docs/overview Covers the JavaScript SDK functions for updating a member. ```JavaScript pelcro.member.update(id, data); ``` -------------------------------- ### Pelcro Core API - Webhook Events (Continued) Source: https://docs.pelcro.com/docs/overview This section continues the list of webhook events from the Pelcro Core API, focusing on exports, fraud prevention, members, newsletters, orders, products, and payment sources. ```JSON { "event": "export.requested", "data": { ... } } { "event": "fraud_prevention.triggered", "data": { ... } } { "event": "member.activated", "data": { ... } } { "event": "newsletter.created", "data": { ... } } { "event": "order.created", "data": { ... } } { "event": "product.created", "data": { ... } } { "event": "source.created", "data": { ... } } ``` -------------------------------- ### Webhooks - Pelcro Source: https://docs.pelcro.com/docs/setting-up Documentation for Pelcro's Webhooks, detailing the events that can be subscribed to and the data payloads received. Webhooks enable real-time notifications for events like subscription changes, payment successes, and more. ```JSON { "event": "subscription.created", "data": { "id": "sub_abc123", "user_id": "user_xyz789", "plan_id": "plan_def456", "status": "active", "created_at": "2023-10-27T10:00:00Z" } } ``` -------------------------------- ### Pelcro JavaScript SDK - Payment Method Management Source: https://docs.pelcro.com/docs/overview Details the JavaScript SDK functions for managing customer payment methods, including adding, retrieving, updating, and deleting payment sources. ```JavaScript pelcro.paymentMethod.create(data); pelcro.paymentMethod.get(); pelcro.paymentMethod.update(data); pelcro.paymentMethod.delete(); ``` -------------------------------- ### Pelcro JavaScript SDK for Product and Plan Management Source: https://docs.pelcro.com/docs/faq This snippet shows how to interact with products and plans using the Pelcro JavaScript SDK, including fetching product details and subscribing to a plan. The SDK must be initialized prior to use. ```JavaScript // Example: Fetch product details Pelcro.api.get('/products/PRODUCT_ID').then(function(response) { console.log('Product details:', response.data); }).catch(function(error) { console.error('Error fetching product:', error); }); // Example: Subscribe to a plan Pelcro.api.post('/subscriptions', { plan_id: 'PLAN_ID', user_id: Pelcro.storage.get('user_id') // Assuming user_id is stored }).then(function(response) { console.log('Subscribed to plan:', response.data); }).catch(function(error) { console.error('Error subscribing to plan:', error); }); ``` -------------------------------- ### Pelcro JavaScript SDK - Subscription Expiration Source: https://docs.pelcro.com/docs/overview Covers the JavaScript SDK functions related to subscription expiration. ```JavaScript pelcro.subscription.expired(id); ``` -------------------------------- ### Pelcro JavaScript SDK - Subscription Change Source: https://docs.pelcro.com/docs/overview Details the JavaScript SDK methods for changing an existing subscription. ```JavaScript pelcro.subscription.change(id, data); ``` -------------------------------- ### Pelcro JavaScript SDK - Payment Source Cancellation Source: https://docs.pelcro.com/docs/overview Details the JavaScript SDK methods for canceling a payment source. ```JavaScript pelcro.paymentSource.cancel(id); ``` -------------------------------- ### Core API: Create Product Source: https://docs.pelcro.com/reference/api-open-plan Creates a new product entry in the Pelcro system. Requires product details like name, description, and price. ```shell POST /products { "name": "Premium Widget", "price": 19.99 } ``` -------------------------------- ### Pelcro JavaScript SDK - Product Management Source: https://docs.pelcro.com/docs/paywalls Documentation for interacting with products and their details using the Pelcro JavaScript SDK. ```JavaScript /** * Pelcro JavaScript SDK - Product Module * Provides methods for retrieving product information. */ // Example: Get a list of all available products // pelcro.product.get().then(response => { // console.log('Available Products:', response.data); // }).catch(error => { // console.error('Error fetching products:', error); // }); // Example: Get details for a specific product // pelcro.product.get('prod_abc').then(response => { // console.log('Product Details:', response.data); // }).catch(error => { // console.error('Error fetching product details:', error); // }); ``` -------------------------------- ### Pelcro Custom UIs Showcase Source: https://docs.pelcro.com/docs/metadata Examples and guidance on creating custom user interfaces with Pelcro, demonstrating how to leverage the SDKs and APIs to build tailored experiences for your customers. ```HTML
``` -------------------------------- ### Pelcro iOS SDK - Overview Source: https://docs.pelcro.com/docs/default-ui-showcase Documentation for the Pelcro iOS SDK, providing an introduction to its capabilities for integrating Pelcro services into iOS applications. This includes setup and basic usage guidelines. ```Objective-C // Import the Pelcro SDK // #import // Initialize Pelcro with your public key // [Pelcro configureWithPublicKey:@"your_public_key"]; // Example: Fetching plans /* [[Pelcro Plans] allWithCompletion:^(NSArray * _Nullable plans, NSError * _Nullable error) { if (error) { NSLog(@"Error fetching plans: %@", error); } else { NSLog(@"Plans: %@", plans); } }]; */ ``` -------------------------------- ### Get Site Configuration Source: https://docs.pelcro.com/reference/api-open-upload-profile-picture Retrieves the current site configuration settings. This endpoint provides information about the Pelcro site setup. ```http GET /site/configuration ``` -------------------------------- ### Pelcro JavaScript SDK - Subscription Gift Notification Source: https://docs.pelcro.com/docs/overview Details the JavaScript SDK methods for sending gift notifications for subscriptions. ```JavaScript pelcro.subscription.giftNotification(id, recipient); ``` -------------------------------- ### Pelcro Open API - Example Usage Source: https://docs.pelcro.com/docs/credit-notes This section demonstrates how to interact with the Pelcro Open API to manage resources like customers, subscriptions, and products. It assumes authentication is handled separately. ```JavaScript async function getCustomer(customerId) { const response = await fetch(`https://api.pelcro.com/v1/customers/${customerId}`, { method: 'GET', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' } }); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } return await response.json(); } async function createSubscription(customerId, planId, paymentMethodToken) { const response = await fetch('https://api.pelcro.com/v1/subscriptions', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify({ customer_id: customerId, plan_id: planId, payment_method_token: paymentMethodToken }) }); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } return await response.json(); } // Example usage: // getCustomer('cust_12345').then(customer => console.log(customer)); // createSubscription('cust_12345', 'plan_abc123', 'tok_visa').then(sub => console.log(sub)); ``` -------------------------------- ### Optimizing Pelcro Initialization with Preconnect Hints Source: https://docs.pelcro.com/docs/js-sdk This HTML snippet includes resource hints for preconnecting to Pelcro's servers and Stripe's services. Preconnecting helps speed up the SDK and UI bundle download by establishing early network connections, reducing latency for first-time visitors. ```HTML ``` -------------------------------- ### Pelcro Core API - Reference Source: https://docs.pelcro.com/docs/mapp Provides an overview of the Pelcro Core API, which allows for programmatic interaction with the Pelcro platform. This includes endpoints for managing customers, products, orders, and more. ```HTTP GET /v1/customers GET /v1/products POST /v1/orders ``` -------------------------------- ### Pelcro JavaScript SDK - Customer Password Reset Source: https://docs.pelcro.com/docs/overview Details the JavaScript SDK methods for resetting a customer's password. ```JavaScript pelcro.customer.passwordReset(email); ``` -------------------------------- ### Pelcro JavaScript SDK - Get Products Source: https://docs.pelcro.com/docs/event-subscription-created Documentation for fetching a list of all available products from the Pelcro platform using the JavaScript SDK. ```JavaScript const products = pelcro.products.get(); console.log(products); ``` -------------------------------- ### Pelcro.js SDK Installation Snippet Source: https://docs.pelcro.com/docs/js-sdk This snippet includes the necessary JavaScript code to initialize the Pelcro SDK on your website. It requires your site ID and configuration for the domain, UI bundle, and Stripe publishable key. The defer attribute ensures the script does not block rendering. ```HTML ``` -------------------------------- ### Get Site Configuration - Pelcro API Source: https://docs.pelcro.com/reference/api-core-delete-address Retrieves the site configuration settings. This endpoint provides details about the Pelcro site setup. ```HTTP GET https://www.pelcro.com/api/v1/site/configuration ``` -------------------------------- ### Pelcro API: Get Site Configuration Source: https://docs.pelcro.com/reference/products Retrieves the current site configuration settings from the Pelcro platform. Useful for understanding platform setup. ```HTTP GET /site ``` -------------------------------- ### Pelcro API: Get Site Configuration Source: https://docs.pelcro.com/reference/delete-ecommerce-product Retrieves the current site configuration settings from the Pelcro platform. Useful for understanding platform setup. ```HTTP GET /site ``` -------------------------------- ### Pelcro JavaScript SDK - Plan Management Source: https://docs.pelcro.com/docs/paywalls Documentation for retrieving information about subscription plans using the Pelcro JavaScript SDK. ```JavaScript /** * Pelcro JavaScript SDK - Plan Module * Provides methods for retrieving subscription plan information. */ // Example: Get a list of all available plans // pelcro.plan.get().then(response => { // console.log('Available Plans:', response.data); // }).catch(error => { // console.error('Error fetching plans:', error); // }); // Example: Get details for a specific plan // pelcro.plan.get('plan_abc').then(response => { // console.log('Plan Details:', response.data); // }).catch(error => { // console.error('Error fetching plan details:', error); // }); ``` -------------------------------- ### Pelcro Open API: Get Site Configuration Source: https://docs.pelcro.com/reference/api-open-intro Retrieves the site configuration settings. This endpoint provides information about the Pelcro site setup. ```HTTP GET /site/configuration ``` -------------------------------- ### Pelcro API: Get Site Configuration Source: https://docs.pelcro.com/reference/api-core-delete-product Retrieves the current site configuration settings from the Pelcro platform. Useful for understanding platform setup. ```HTTP GET /site ``` -------------------------------- ### Pelcro Core API - Overview Source: https://docs.pelcro.com/docs/paywalls General information about the Pelcro Core API, which serves as the backend for many of the SDK functionalities. ```REST # Pelcro Core API The Pelcro Core API allows direct interaction with Pelcro's backend services. It is typically used for server-to-server communication or when the JavaScript SDK is not suitable. ## Authentication API requests must be authenticated, usually via an API key passed in the headers. ```http Authorization: Bearer YOUR_API_KEY ``` ## Endpoints Common endpoints include: - `/users`: Manage user accounts. - `/subscriptions`: Manage subscriptions. - `/plans`: Retrieve plan information. - `/invoices`: Retrieve invoice data. Refer to the full API documentation for detailed endpoint specifications, request/response formats, and error codes. ``` -------------------------------- ### Pelcro JavaScript SDK - Subscription Trial End Notification Source: https://docs.pelcro.com/docs/overview Covers the JavaScript SDK functions related to notifications when a subscription trial is about to end. ```JavaScript pelcro.subscription.trialWillEnd(id); ``` -------------------------------- ### Core API: Create Product Source: https://docs.pelcro.com/reference/api-open-customer Creates a new product using the Core API. This endpoint accepts product details for creation. Authentication is required. ```HTTP POST /products ``` -------------------------------- ### Pelcro JavaScript SDK - Password Management Source: https://docs.pelcro.com/docs/overview Details the JavaScript SDK functions for managing user passwords, including reset and update operations. ```JavaScript pelcro.password.reset(data); pelcro.password.update(data); ``` -------------------------------- ### Setup Disqus Div Source: https://docs.pelcro.com/docs/disqus This HTML snippet sets up the necessary container for Disqus comments on your webpage. The 'disqus_thread' ID is a standard requirement for Disqus integration. ```HTML
``` -------------------------------- ### Pelcro JavaScript SDK - Invoice Payment Action Required Source: https://docs.pelcro.com/docs/overview Details the JavaScript SDK methods for handling situations where an invoice requires a payment action. ```JavaScript pelcro.invoice.paymentActionRequired(id); ``` -------------------------------- ### Pelcro JavaScript SDK - Address Cleansing Source: https://docs.pelcro.com/docs/overview Documentation for the JavaScript SDK's address cleansing functionality, including methods for cleansing and validating addresses. ```JavaScript pelcro.address.cleanse(data); pelcro.address.validate(data); ``` -------------------------------- ### Pelcro Core API: Create Product Source: https://docs.pelcro.com/reference/api-core-get-subscription Creates a new product in the Pelcro system. Requires product details like name, description, and pricing. ```HTTP POST /ecommerce/products ``` -------------------------------- ### Pelcro JavaScript SDK - Product and Plan Management Source: https://docs.pelcro.com/docs/event-subscription-updated This documentation covers the JavaScript SDK methods for managing products and plans, including creating, updating, and retrieving product and plan details. It's essential for configuring offerings. ```JavaScript import Pelcro from "pelcro"; // Example: Get a product Pelcro.product.get({ id: "prod_abc123" }).then(response => { console.log("Product details:", response); }).catch(error => { console.error("Error getting product:", error); }); // Example: Get a plan Pelcro.plan.get({ id: "plan_abc123" }).then(response => { console.log("Plan details:", response); }).catch(error => { console.error("Error getting plan:", error); }); // Example: Create a product (requires appropriate permissions) Pelcro.product.create({ name: "New Product", type: "physical" }).then(response => { console.log("Product created:", response); }).catch(error => { console.error("Error creating product:", error); }); ``` -------------------------------- ### Pelcro Default UI Showcase Source: https://docs.pelcro.com/docs/metadata Showcase of Pelcro's default UI components, providing ready-to-use elements for common functionalities like login, signup, and subscription management. ```HTML ``` -------------------------------- ### Pelcro JavaScript SDK - Site Management Source: https://docs.pelcro.com/docs/going-live Provides methods for managing site-related functionalities within the Pelcro JavaScript SDK. This includes operations like initializing the SDK and handling site configurations. ```JavaScript import pelcro from '@pelcro/pelcro'; // Initialize Pelcro with your site ID pelcro.site.init({ siteId: 'YOUR_SITE_ID' }); // Example: Get site information pelcro.site.get().then(site => { console.log('Site Name:', site.name); }); ``` -------------------------------- ### Get Site Configuration (Open API) Source: https://docs.pelcro.com/reference/api-open-update-address Retrieves the site configuration settings using the Open API. This endpoint provides information about the website's setup. ```HTTP GET /site/configuration ``` -------------------------------- ### Pelcro Android SDK - Overview Source: https://docs.pelcro.com/docs/default-ui-showcase Documentation for the Pelcro Android SDK, offering guidance on integrating Pelcro services into Android applications. This section covers initialization and fundamental usage patterns. ```Java // Import the Pelcro SDK // import pelcro.sdk.Pelcro; // Initialize Pelcro in your Application class or Activity // Pelcro.configure(this, "your_public_key"); // Example: Fetching products /* Pelcro.getProducts(new PelcroCallback>() { @Override public void onSuccess(List products) { Log.d("Pelcro", "Products: " + products); } @Override public void onError(PelcroException e) { Log.e("Pelcro", "Error fetching products", e); } }); */ ``` -------------------------------- ### Pelcro iOS SDK - Initialize SDK Source: https://docs.pelcro.com/docs/vimeo This snippet shows the basic initialization of the Pelcro iOS SDK. It requires your Pelcro API key. ```Swift import Pelcro Pelcro.shared.initialize(apiKey: "YOUR_PELCRO_API_KEY") ``` -------------------------------- ### Core API: Create Product Source: https://docs.pelcro.com/reference/api-open-get-site-configuration Creates a new product. This endpoint is part of the Core API and requires product details in the POST request. ```HTTP POST /ecommerce/products ``` -------------------------------- ### Pelcro Open API - Example Request Source: https://docs.pelcro.com/docs/tecnavia An example request to the Pelcro Open API for retrieving customer data. ```JavaScript fetch('https://api.pelcro.com/v1/customers/cus_123', { method: 'GET', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' } }) .then(response => response.json()) .then(data => console.log(data)); ``` -------------------------------- ### Pelcro JavaScript SDK - Product Management Source: https://docs.pelcro.com/docs/go-live-preparation Provides information on using the JavaScript SDK to manage products, including retrieving product details and associated plans. Important for e-commerce and offering management. ```JavaScript pelcro.product.get(productId); pelcro.product.getPlans(productId); ``` -------------------------------- ### Get site configuration (Open API) Source: https://docs.pelcro.com/reference/list-payment-methods Retrieves the site configuration settings using the Pelcro Open API. This endpoint provides information about the current site setup. ```http GET /site ``` -------------------------------- ### Pelcro Open API: Get Site Configuration Source: https://docs.pelcro.com/reference/members-ip-authorization Retrieves the site's configuration settings. This endpoint is part of the Open API and provides information about the website's setup. ```HTTP GET /site/configuration ``` -------------------------------- ### Pelcro Core API: Products Source: https://docs.pelcro.com/reference/api-open-redeem-subscription Manage products, including listing, creating, retrieving, updating, and deleting them, via the Pelcro Core API. ```REST GET /products POST /products GET /products/{id} PUT /products/{id} DELETE /products/{id} ``` -------------------------------- ### Pelcro Open API: Get Site Configuration Source: https://docs.pelcro.com/reference/api-core-member-ip-authorization Retrieves the site's configuration settings. This endpoint is part of the Open API and provides information about the website's setup. ```HTTP GET /site/configuration ``` -------------------------------- ### Pelcro JavaScript SDK - Product Management Source: https://docs.pelcro.com/docs/event-campaign-triggered Documentation for the Pelcro JavaScript SDK, covering product catalog management. This includes fetching product details, pricing, and related information. ```JavaScript /* * Pelcro JavaScript SDK - Product Module */ // Example: Get a list of products Pelcro.product.list().then(products => { console.log('Available Products:', products); }); // Example: Get details for a specific product Pelcro.product.get({ id: 'product_id' }).then(product => { console.log('Product Details:', product); }); ``` -------------------------------- ### Core API: Create Product Source: https://docs.pelcro.com/reference/api-open-get-plan Creates a new product. This endpoint is part of the Core API and requires product details in the request body. ```HTTP POST /ecommerce/products ``` -------------------------------- ### Pelcro Open API: Get Site Configuration Source: https://docs.pelcro.com/reference/api-core-charges Retrieves the site configuration settings using the Pelcro Open API. This endpoint provides information about the current Pelcro site setup. ```HTTP GET /site/configuration ``` -------------------------------- ### JavaScript SDK - Pelcro Product Management Source: https://docs.pelcro.com/docs/subscription-plans This section covers the JavaScript SDK methods for retrieving product information, including details about plans, pricing, and SKUs. Essential for displaying product offerings to users. ```JavaScript /** * Pelcro JavaScript SDK - Product Module * Provides methods for retrieving product and plan information. */ // Example: Get a specific product // pelcro.product.get('prod_abc').then(product => console.log('Product details:', product)).catch(error => console.error('Error fetching product:', error)); // Example: Get all products // pelcro.product.get().then(products => console.log('All products:', products)).catch(error => console.error('Error fetching products:', error)); // Example: Get plans associated with a product // pelcro.product.getPlans('prod_abc').then(plans => console.log('Product plans:', plans)).catch(error => console.error('Error fetching product plans:', error)); ``` -------------------------------- ### Pelcro JavaScript SDK - Webhook Event Handling (subscription.created) Source: https://docs.pelcro.com/docs/orderpaymentsucceeded This example demonstrates handling the 'subscription.created' webhook event with JavaScript. It covers processing the data payload when a new subscription is successfully created. ```JavaScript app.post('/webhooks/pelcro', (req, res) => { const event = req.body; if (event.type === 'subscription.created') { const subscriptionData = event.data.object; console.log('New subscription created:', subscriptionData); // Grant access to content, update user status } res.sendStatus(200); }); ``` -------------------------------- ### List Invoices using Pelcro Core API Source: https://docs.pelcro.com/docs/invoices Provides an example of how to list invoices via the Pelcro Core API. This is useful for server-side integrations or when direct API interaction is preferred over the SDK. ```API GET /v1/invoices ``` -------------------------------- ### Pelcro JavaScript SDK - Product Management Source: https://docs.pelcro.com/docs/disqus This snippet shows how to use the Pelcro JavaScript SDK for managing products, including retrieving product details and associated plans. ```JavaScript pelcro.product.get('prod_abc').then(response => { // Handle response }); pelcro.product.getPlans('prod_abc').then(response => { // Handle response }); ``` -------------------------------- ### Pelcro Core API: Create Product Source: https://docs.pelcro.com/reference/api-open-authentication Creates a new product in the Pelcro e-commerce system. Requires product details such as name, description, and pricing. ```HTTP POST /ecommerce/products ```