### Create Product Response Example Source: https://docs.fourthwall.com/api-reference/platform/products/create-product This is an example of the JSON response you will receive after successfully creating a product. ```json { "images": [ { "url": "", "width": 123, "height": 123, "style": "", "color": "", "size": "", "region": "" } ], "productId": "", "customizationId": "" } ``` -------------------------------- ### Products Format Examples Source: https://docs.fourthwall.com/shop-apis/cart-checkout-endpoint Examples demonstrating the format for the 'products' query parameter, including single and multiple variants with optional quantities. ```text ?products=11111111-1111-1111-1111-111111111111 ``` ```text ?products=11111111-1111-1111-1111-111111111111:2 ``` ```text ?products=11111111-1111-1111-1111-111111111111:1,22222222-2222-2222-2222-222222222222:3 ``` -------------------------------- ### App Section Configuration Example Source: https://docs.fourthwall.com/apps/app-sections This is an example of how app section settings might be structured. Contact support on Discord for access to the experimental feature. ```javascript { // ... other app section properties settings: { // Example settings theme: 'dark', show_header: false } } ``` -------------------------------- ### Products Format Example Source: https://docs.fourthwall.com/shop-apis/cart-checkout-endpoint This example shows the expected format for the 'products' query parameter, which is a comma-separated list of variant IDs and quantities. ```text variantId[:quantity] ``` -------------------------------- ### Example Integration: Direct Variant Handoff Source: https://docs.fourthwall.com/shop-apis/cart-checkout-endpoint Example of how to implement a direct variant handoff to the checkout. ```APIDOC ## Example Integration: Direct Variant Handoff ### Description Direct variant handoff (primary) implementation. ### Method JavaScript Function ### Function Signature `redirectToDirectCheckout(shopDomain, variantId, quantity, coupon)` ### Example Usage ```javascript function redirectToDirectCheckout(shopDomain, variantId, quantity, coupon) { const params = new URLSearchParams({ // ... parameters for checkout }); window.location.href = `https://${shopDomain}/cart/checkout?${params.toString()}`; } ``` ``` -------------------------------- ### Products Format Example: Single Variant with Quantity Source: https://docs.fourthwall.com/llms-full.txt Example of the 'products' query parameter format specifying a variant ID and its quantity. ```text ?products=11111111-1111-1111-1111-111111111111:2 ``` -------------------------------- ### Products Format Example: Single Variant Source: https://docs.fourthwall.com/llms-full.txt Example of the 'products' query parameter format for a single variant ID. Quantity defaults to 1 if not specified. ```text ?products=11111111-1111-1111-1111-111111111111 ``` -------------------------------- ### Example Product Template ID Source: https://docs.fourthwall.com/api-reference/platform/product-templates/get-product-template An example of a product template ID that can be used in the `productId` path parameter. ```yaml example: pro_k66ZW4fsRm6c2def3itltA ``` -------------------------------- ### OpenAPI Specification for Get Draw Source: https://docs.fourthwall.com/api-reference/platform/gifting/get-draw This OpenAPI 3.1.0 specification defines the GET /open-api/v1.0/gifting/draw/{id} endpoint for retrieving draw details. It includes parameters, response schemas, and error examples. ```yaml GET /open-api/v1.0/gifting/draw/{id} openapi: 3.1.0 info: title: Fourthwall APIs description: Service used for management of orders, carts, and payments. termsOfService: https://fourthwall.com/terms-of-service contact: name: Backend team url: https://fourthwall.com email: backend@fourthwall.com version: unspecified servers: - url: https://api.fourthwall.com description: Production server security: [] externalDocs: description: OpenAPI documentation url: https://docs.fourthwall.com paths: /open-api/v1.0/gifting/draw/{id}: get: tags: - Gifting summary: Get draw description: >- *Rate limit: 100 requests / 10 seconds per shop. See [Rate limiting](/guides/rate-limiting).* Get draw details operationId: get-draw parameters: - name: id in: path required: true schema: type: string responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/com.fourthwall.openapi.model.GiftDraftV1' '404': description: >- Possible errors: `GIVEAWAY_NOT_FOUND_FOR_DRAW_ID`, `OFFER_NOT_FOUND_ERROR`, `OFFER_VARIANT_NOT_FOUND_ERROR`, `SHOP_TEAM_MEMBER_SHOP_NOT_FOUND_ERROR` content: application/json: examples: giveaway-not-found-for-draw-id: value: code: GIVEAWAY_NOT_FOUND_FOR_DRAW_ID shopId: drawId: offer-not-found-error: value: code: OFFER_NOT_FOUND_ERROR offerId: offer-variant-not-found-error: value: code: OFFER_VARIANT_NOT_FOUND_ERROR offerVariantId: shop-team-member-shop-not-found-error: value: code: SHOP_TEAM_MEMBER_SHOP_NOT_FOUND_ERROR shopId: '429': description: 'Rate limited: 100 requests / 10 seconds per shop.' content: application/json: examples: too-many-requests: value: code: OPEN_API_TOO_MANY_REQUESTS title: Too many requests status: 429 security: - oauth: - giveaway_read - basicAuth: [] externalDocs: url: https://docs.fourthwall.com/api-reference/platform/gifting/get-draw components: schemas: com.fourthwall.openapi.model.GiftDraftV1: type: object properties: id: type: string example: gdr_EdJvIXu3SEiXe_QkPavHSA type: type: string enum: - INITIAL - REDO giveawayId: type: string example: giv_EdJvIXu3SEiXe_QkPavHSA giveawayFriendlyId: type: string example: D3XZFWPP shopId: type: string example: sh_c689d374-22ca-43d3-8d29-9ef0805cc4cb offer: $ref: >- #/components/schemas/com.fourthwall.openapi.model.OfferAbstractV1.OfferGiftPurchaseV1 amounts: $ref: >- #/components/schemas/com.fourthwall.openapi.model.GiftDraftV1.Amounts email: type: string example: supporter@fourthwall.com username: type: string example: Johnny123 message: type: string example: Sample message gifts: type: array items: oneOf: - $ref: >- #/components/schemas/com.fourthwall.openapi.model.GiftDraftV1.Gift.Available - $ref: >- #/components/schemas/com.fourthwall.openapi.model.GiftDraftV1.Gift.Cancelled - $ref: >- #/components/schemas/com.fourthwall.openapi.model.GiftDraftV1.Gift.ChangedToGiftCard - $ref: >- #/components/schemas/com.fourthwall.openapi.model.GiftDraftV1.Gift.ChangedToPromotion - $ref: >- #/components/schemas/com.fourthwall.openapi.model.GiftDraftV1.Gift.Redeemed createdAt: type: string format: date-time durationSeconds: type: integer format: int64 ``` -------------------------------- ### JavaScript: Example Configuration Source: https://docs.fourthwall.com/apps/embedded-settings This JavaScript code demonstrates how to configure settings, including API key type, name, and hash, along with allowed operations. ```javascript {\n keyType: 'raw',\n keyData: { \n name:'HMAC',\n hash:'SHA-512'\n },\n false,\n ['sign', 'verify']\n }; ``` -------------------------------- ### Get product template details Source: https://docs.fourthwall.com/channel-api/agency-integration Get detailed information about a specific product template. This endpoint is public and does not require authentication. Returns full product details including variants, customizable areas, size guide, and images. ```APIDOC ## GET /open-api/v1.0/product-templates/{productId} ### Description Get detailed information about a specific product template. This endpoint is public and does not require authentication. Returns full product details including variants, customizable areas, size guide, and images. ### Method GET ### Endpoint /open-api/v1.0/product-templates/{productId} ### Parameters #### Path Parameters - **productId** (string) - Required - The ID of the product template to retrieve. ### Response #### Success Response (200 OK) - **templateId** (string) - The ID of the product template. - **name** (string) - The name of the product template. - **description** (string) - The description of the product template. - **variants** (array) - Available variants for the template. - **customizableAreas** (array) - Areas on the template that can be customized. - **sizeGuide** (object) - Information about the size guide. - **images** (array) - Images associated with the product template. ### Response Example ```json { "templateId": "tmpl_xyz", "name": "Classic T-Shirt Template", "description": "A basic template for t-shirts.", "variants": [ { "variantId": "var_1", "name": "Small", "price": 25.00 } ], "customizableAreas": [ { "areaId": "area_1", "name": "Front Print" } ], "sizeGuide": { "title": "T-Shirt Sizing", "measurements": [ { "size": "S", "width": 18, "length": 28 } ] }, "images": [ { "url": "https://example.com/image.jpg", "altText": "Front view of the t-shirt" } ] } ``` ``` -------------------------------- ### Get product template details Source: https://docs.fourthwall.com/guides/rate-limiting Get detailed information about a specific product template. This endpoint is public and does not require authentication. Returns full product details including variants, customizable areas, size guide, and images. Rate limit: 100 requests / 10 seconds per shop. ```APIDOC ## GET /open-api/v1.0/product-templates/{productId} ### Description Get detailed information about a specific product template. This endpoint is public and does not require authentication. Returns full product details including variants, customizable areas, size guide, and images. ### Method GET ### Endpoint /open-api/v1.0/product-templates/{productId} ### Parameters #### Path Parameters - **productId** (string) - Required - The ID of the product template to retrieve. ### Rate Limiting 100 requests / 10 seconds per shop. See [Rate limiting](/guides/rate-limiting). ``` -------------------------------- ### Get Product Template Details Source: https://docs.fourthwall.com/llms-full.txt Retrieves detailed information about a specific product template, including variants, customizable areas, size guide, and images. This endpoint is public. ```APIDOC ## Get Product Template Details ### Description Get detailed information about a specific product template. This endpoint is public and does not require authentication. Returns full product details including variants, customizable areas, size guide, and images. Product image URLs (`colorVariants[].photos[].url`) are generated on demand by imgproxy and are **not durable** — they may change or expire. Fetch them fresh from this endpoint when you need to display images rather than storing or hardcoding them. ### Method GET ### Endpoint /open-api/v1.0/product-templates/{productId} ### Rate Limit 100 requests / 10 seconds per shop. ``` -------------------------------- ### Get Product Template Source: https://docs.fourthwall.com/open-api-docs/open-api.yaml Retrieves detailed information about a specific product template, including its variants, customizable areas, size guide, and images. This endpoint is public and does not require authentication. ```APIDOC ## GET /open-api/v1.0/product-templates/{productId} ### Description Get detailed information about a specific product template. This endpoint is public and does not require authentication. Returns full product details including variants, customizable areas, size guide, and images. ### Method GET ### Endpoint /open-api/v1.0/product-templates/{productId} ### Parameters #### Path Parameters - **productId** (string) - Required - Product template ID ### Response #### Success Response (200) - (com.fourthwall.openapi.model.ProductTemplateV1) - OK #### Error Response (404) - **code** (string) - Possible errors: `GENERATOR_ID_NOT_FOUND`, `PRODUCT_CATALOG_PRODUCT_ID_NOT_FOUND` #### Error Response (429) - **code** (string) - `OPEN_API_TOO_MANY_REQUESTS` - **title** (string) - Too many requests - **status** (integer) - 429 - **x-rate-limit** (object) - Rate limit details ``` -------------------------------- ### Create a New Shop with Payout Onboarding Source: https://docs.fourthwall.com/channel/integration-guide This cURL command creates a new shop, sends an invitation to the owner, and initiates the payout onboarding process. The response includes details about the created shop and the onboarding URL. ```bash curl -X POST "https://api.fourthwall.com/channel-api/v1.0/shops" \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "Nova\'s Shop", "ownerEmail": "nova@example.com", "payout": { "returnUrl": "https://yourapp.com/onboarding/return", "refreshUrl": "https://yourapp.com/onboarding/refresh", "country": "US", "businessType": "individual" } }' ``` ```json { "shopId": "sh_abc123", "shopName": "Nova's Shop", "publicToken": "ptkn_xyz789", "invitationEmail": "nova@example.com", "invitationStatus": "INVITED", "payoutOnboardingUrl": "https://connect.fourthwall.com/onboard/..." } ``` -------------------------------- ### Get Current Shop Information Source: https://docs.fourthwall.com/llms-full.txt After completing the OAuth flow, exchange the authorization code for an access token and then use this token to retrieve the current shop's information. This is typically done during the app installation process. ```APIDOC ## GET /shops/current ### Description Retrieves the details of the currently authenticated shop. ### Method GET ### Endpoint /shops/current ### Parameters #### Query Parameters None #### Request Body None ### Request Example ```ts // after OAuth callback const shop = await fetch( "https://api.fourthwall.com/open-api/v1.0/shops/current", { headers: { Authorization: `Bearer ${accessToken}` } } ).then(r => r.json()); ``` ### Response #### Success Response (200) - **shop_id** (string) - The unique identifier for the shop. - **name** (string) - The name of the shop. - **currency** (string) - The currency used by the shop. #### Response Example ```json { "shop_id": "shop_12345", "name": "Example Shop", "currency": "USD" } ``` ``` -------------------------------- ### Shop and Product Management Source: https://docs.fourthwall.com/channel-api/platform-integration Provision a new shop if it doesn't exist, and then create a live product against it. ```APIDOC ## GET /channel-api/v1.0/shops ### Description Retrieves a list of shops associated with the channel. ### Method GET ### Endpoint /channel-api/v1.0/shops ## POST /channel-api/v1.0/shops ### Description Provisions a new shop for the channel. This is typically called once when a creator first publishes. ### Method POST ### Endpoint /channel-api/v1.0/shops ### Request Body - **name** (string) - Required - The name of the shop. - **currency** (string) - Required - The currency for the shop (e.g., "USD"). ## POST /open-api/v1.0/products ### Description Creates a new live product in a shop. ### Method POST ### Endpoint /open-api/v1.0/products ### Request Body - **shopId** (string) - Required - The ID of the shop where the product will be created. - **templateId** (string) - Required - The ID of the product template. - **name** (string) - Required - The name of the product. - **price** (object) - Required - Pricing information for the product. - **amount** (integer) - Required - The price amount. - **currency** (string) - Required - The currency of the price. - **mediaIds** (array of strings) - Required - A list of media IDs to be associated with the product. ``` -------------------------------- ### Get Product Template by ID Source: https://docs.fourthwall.com/api-reference/platform/product-templates/get-product-template Retrieves detailed information for a specific product template using its ID. This endpoint is public and does not require authentication. It returns full product details, including variants, customizable areas, size guide, and images. ```APIDOC ## GET /open-api/v1.0/product-templates/{productId} ### Description Get detailed information about a specific product template. This endpoint is public and does not require authentication. Returns full product details including variants, customizable areas, size guide, and images. *Rate limit: 100 requests / 10 seconds per shop. See [Rate limiting](/guides/rate-limiting).* ### Method GET ### Endpoint /open-api/v1.0/product-templates/{productId} ### Parameters #### Path Parameters - **productId** (string) - Required - Product template ID. Example: `pro_k66ZW4fsRm6c2def3itltA` ### Responses #### Success Response (200) - **productId** (string) - Product template ID - **slug** (string) - URL slug for this product - **name** (string) - Product name - **description** (string) - Product description - **category** (string) - Product category path - **brand** (string) - Brand name - **productionMethod** (string) - Production method (e.g. DTG, EMBROIDERY, DTFX, KNITTING, SUBLIMATION) - **minimumOrdersNumber** (integer) - Minimum orders required to produce this product, if any - **priceFrom** (object) - Price information for the product #### Error Response (404) - **code** (string) - Error code (e.g., `GENERATOR_ID_NOT_FOUND`, `PRODUCT_CATALOG_PRODUCT_ID_NOT_FOUND`) - **id** (string) - Identifier related to the error #### Error Response (429) - **code** (string) - Error code (`OPEN_API_TOO_MANY_REQUESTS`) - **title** (string) - Error title (`Too many requests`) - **status** (integer) - HTTP status code (429) ``` -------------------------------- ### Get Webhook Source: https://docs.fourthwall.com/channel-api/agency-integration Get a specific webhook configuration by its ID. ```APIDOC ## GET /open-api/v1.0/webhooks/{webhookConfigurationId} ### Description Get a specific webhook configuration by its ID. *Rate limit: 100 requests / 10 seconds per shop. See [Rate limiting](/guides/rate-limiting).* ### Method GET ### Endpoint /open-api/v1.0/webhooks/{webhookConfigurationId} ### Path Parameters - **webhookConfigurationId** (string) - Required - The ID of the webhook configuration to retrieve. ### Response #### Success Response (200) - **webhookConfigurationId** (string) - The ID of the webhook configuration. - **url** (string) - The URL of the webhook. - **events** (array) - An array of event types subscribed to. ``` -------------------------------- ### F2 — Onboard a creator (channel-api) Source: https://docs.fourthwall.com/channel-api/agency-integration Create a subaccount shop, invite the owner, and optionally start payout onboarding using the channel-api. ```APIDOC ## POST /channel-api/v1.0/shops ### Description Creates a new subaccount shop, invites the owner, and initiates payout onboarding. ### Method POST ### Endpoint /channel-api/v1.0/shops ### Parameters #### Request Body - **owner_email** (string) - Required - The email address of the shop owner. - **shop_name** (string) - Optional - The name of the shop. - **start_payout_onboarding** (boolean) - Optional - Whether to start payout onboarding immediately. ``` -------------------------------- ### Constructing an API Request with Authentication Source: https://docs.fourthwall.com/channel-api/agency-integration This example demonstrates how to construct an API request, including setting up authentication headers with your client ID and secret. It shows how to encode credentials and use them in a fetch request. ```javascript await fetch(TOKEN_URL, { method: "POST", headers: { Authorization: `Basic ${Buffer.from(`${CLIENT_ID}:${CLIENT_SECRET}`).toString("base64")}`, "Content-Type": "application/json" } }) ``` -------------------------------- ### GET /open-api/v1.1/memberships/members/{id} Source: https://docs.fourthwall.com/apps/getting-started Get a specific member by ID. ```APIDOC ## GET /open-api/v1.1/memberships/members/{id} ### Description Retrieves details for a specific member identified by their unique ID. ### Method GET ### Endpoint /open-api/v1.1/memberships/members/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the member. ``` -------------------------------- ### Upload Digital Product with Metadata Source: https://docs.fourthwall.com/guides/create-digital-products This example demonstrates how to upload a digital product, specifying its filename, content type, and size. It includes setting up authorization headers for the API request. ```javascript headers: { "Authorization": `Basic ${credentials}` }, body: JSON.stringify({ fileName: "my-ebook.pdf", contentType: "application/pdf", size: 1048576 }) ``` -------------------------------- ### Gift Draw Started Source: https://docs.fourthwall.com/embedded-sections/signature Fired when a giveaway draw is started. ```APIDOC ## Gift Draw Started ### Description Fired when a giveaway draw is started. ### Method Not specified (likely webhook or event-driven) ### Endpoint /api-reference/giveaway-events/gift-draw-started ``` -------------------------------- ### GET /open-api/v1.1/memberships/tiers/{id} Source: https://docs.fourthwall.com/apps/getting-started Get a specific membership tier by ID. ```APIDOC ## GET /open-api/v1.1/memberships/tiers/{id} ### Description Retrieves details for a specific membership tier identified by its unique ID. ### Method GET ### Endpoint /open-api/v1.1/memberships/tiers/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the membership tier. ``` -------------------------------- ### Publish Product Details and Price Source: https://docs.fourthwall.com/channel-api/platform-integration Provision a shop on the first publish, then create the product. This involves multiple API calls and requires shop context. ```HTTP GET /channel-api/v1.0/shops ``` ```HTTP POST /channel-api/v1.0/shops ``` ```HTTP POST /open-api/v1.0/products ``` -------------------------------- ### GET /open-api/v1.1/memberships/series/posts/{id} Source: https://docs.fourthwall.com/apps/getting-started Get a specific post series by ID. ```APIDOC ## GET /open-api/v1.1/memberships/series/posts/{id} ### Description Retrieves details for a specific post series identified by its unique ID. ### Method GET ### Endpoint /open-api/v1.1/memberships/series/posts/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the post series. ``` -------------------------------- ### POST /open-api/v1.0/products Source: https://docs.fourthwall.com/apps/embedded-settings Create a product. Rate limit: 5 requests / minute per shop. ```APIDOC ## POST /open-api/v1.0/products ### Description Create a product. Rate limit: 5 requests / minute per shop. ### Method POST ### Endpoint /open-api/v1.0/products ### Parameters (No parameters specified) ### Request Body (No specific request body details provided in the source) ### Response #### Success Response (200) (No specific response fields provided in the source) #### Response Example (No response example provided in the source) ``` -------------------------------- ### GET /open-api/v1.1/memberships/tags/posts/{id} Source: https://docs.fourthwall.com/apps/getting-started Get a specific post tag by ID. ```APIDOC ## GET /open-api/v1.1/memberships/tags/posts/{id} ### Description Retrieves details for a specific post tag identified by its unique ID. ### Method GET ### Endpoint /open-api/v1.1/memberships/tags/posts/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the post tag. ``` -------------------------------- ### Liquid Image Filter Examples Source: https://docs.fourthwall.com/html/filters/image Demonstrates how to access and format product images using Liquid templating. Includes examples for thumbnail, large, and full-width hero images. ```liquid {% comment %} Thumbnail {% endcomment %} {{" product".featured_image | img_url: 'thumb' }} {% comment %} Product card {% endcomment %} {{" product".featured_image | img_url: 'large' }} {% comment %} Full-width hero {% endcomment %} {{" product".featured_image | img_url: 'grande' }} ``` -------------------------------- ### Get Webhook Event Source: https://docs.fourthwall.com/apps/getting-started Get a single webhook event by ID. ```APIDOC ## GET /open-api/v1.0/webhook-events/{webhookEventId} ### Description Get a single webhook event by ID. ### Method GET ### Endpoint /open-api/v1.0/webhook-events/{webhookEventId} ### Parameters #### Path Parameters - **webhookEventId** (string) - Required - The ID of the webhook event to retrieve. ### Response #### Success Response (200) - **id** (string) - The ID of the webhook event. - **type** (string) - The type of the webhook event. ``` -------------------------------- ### Products Format Example: Multiple Variants with Quantities Source: https://docs.fourthwall.com/llms-full.txt Example of the 'products' query parameter format for multiple variants, each with a specified quantity. Variants are separated by commas. ```text ?products=11111111-1111-1111-1111-111111111111:1,22222222-2222-2222-2222-222222222222:3 ``` -------------------------------- ### F2 — Onboard a Creator (channel-api) Source: https://docs.fourthwall.com/channel-api/agency-integration Create a new subaccount shop, invite the creator, and optionally initiate payout onboarding. The response includes the new shop's publicToken. ```APIDOC ## F2 — Onboard a Creator (channel-api) ### Description This operation enables the creation of a new subaccount shop for a creator. It also handles inviting the creator to the shop and can optionally start the payout onboarding process. The response from this creation request contains the `publicToken` for the newly created shop. ### Method POST ### Endpoint `/channel-api/v1.0/shops` ``` -------------------------------- ### Gift Draw Started Event Source: https://docs.fourthwall.com/channel-api/agency-integration Fired when a giveaway draw is started. ```APIDOC ## POST /api-reference/giveaway-events/gift-draw-started ### Description This endpoint is triggered when a new giveaway draw begins. ### Method POST ### Endpoint /api-reference/giveaway-events/gift-draw-started ### Request Body (No specific request body details provided in the source) ### Response (No specific response details provided in the source) ``` -------------------------------- ### Start Streaming Source: https://docs.fourthwall.com/llms-full.txt Sets the streaming status to started for specified services. ```APIDOC ## PUT /open-api/v1.0/streaming/start ### Description Sets streaming status to started for specified services. ### Method PUT ### Endpoint /open-api/v1.0/streaming/start ### Rate Limit 100 requests / 10 seconds per shop. ### Authentication OAuth scope: `giveaway_write` or API keys. ``` -------------------------------- ### Create a Digital Product with cURL Source: https://docs.fourthwall.com/guides/create-digital-products Use this cURL command to create a digital product. Ensure you replace 'your_username' and 'your_password' with your actual credentials. The product will be created with the specified name, description, and price. ```bash curl -u "your_username:your_password" \ -X POST https://api.fourthwall.com/open-api/v1.0/products \ -H "Content-Type: application/json" \ -d '{ "type": "digital", "name": "My Digital Product", "description": "A detailed description of my digital product", "price": 25.00 }' ``` -------------------------------- ### Publish Product to Shop Source: https://docs.fourthwall.com/channel-api/platform-integration Publish a product to the shop, which involves creating a shop if it doesn't exist and then creating the live product. Requires an access token, shop ID, product ID, and image ID. ```bash curl -X POST "https://api.fourthwall.com/open-api/v1.0/products" \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "X-ShopId: $SHOP_ID" \ -H "Content-Type: application/json" \ -d '{ "type": "design", "name": "My link", "...": "..." }' ``` -------------------------------- ### Webhook Gift Draw Started Source: https://docs.fourthwall.com/open-api-docs/storefront.yaml This event is fired when a giveaway draw is started. ```APIDOC ## POST /webhook/gift-draw-started ### Description This event is fired when a giveaway draw is started. ### Method POST ### Endpoint /webhook/gift-draw-started ### Request Body - **id** (string) - Required - Unique identifier for this webhook event - **webhookId** (string) - Required - ID of the webhook configuration that triggered this event - **shopId** (string) - Required - ID of the shop that generated this event - **type** (string) - Required - The event type - **apiVersion** (string) - Required - API version of the webhook payload - **createdAt** (string) - Required - When this event was created - **testMode** (boolean) - Optional - Whether this event was sent in test mode - **data** (object) - Required - The event data ### Request Example ```json { "id": "00aa4abd-5778-4199-8161-0b49b2f212e5", "webhookId": "00aa4abd-5778-4199-8161-0b49b2f212e5", "shopId": "sh_c689d374-22ca-43d3-8d29-9ef0805cc4cb", "type": "GIFT_DRAW_STARTED", "apiVersion": "V1", "createdAt": "2020-08-13T09:05:36.939Z", "testMode": false, "data": {} } ``` ### Response #### Success Response (200) - **description** (string) - Event received successfully ``` -------------------------------- ### Gift Draw Started Webhook Source: https://docs.fourthwall.com/api-reference/platform/webhooks/create-webhook Receive notifications when a gift draw is started. ```APIDOC ## HOOK Gift draw started ### Description This webhook is triggered when a gift draw is started. ### Method HOOK ### Endpoint /api-reference/giveaway-events/gift-draw-started ``` -------------------------------- ### Create a Shop with Products Source: https://docs.fourthwall.com/ai/mcp Creates a new shop and associates products with it. ```APIDOC ## POST /channel-api/v1.0/shops ### Description Creates a new shop, optionally with associated products. ### Method POST ### Endpoint /channel-api/v1.0/shops ``` -------------------------------- ### Create a product Source: https://docs.fourthwall.com/api-reference/platform/digital-products/request-digital-file-upload-url Creates a new product within the system. ```APIDOC ## POST /api-reference/platform/products/create-product ### Description Creates a new product within the system. ### Method POST ### Endpoint /api-reference/platform/products/create-product ``` -------------------------------- ### Streaming Started Event Source: https://docs.fourthwall.com/open-api-docs/open-api.yaml Represents an event when a user starts streaming on a connected platform. ```APIDOC ## POST /events/streaming/started ### Description Receives an event when a user starts streaming. ### Method POST ### Endpoint /events/streaming/started ### Request Body - **services** (array) - Required - A list of services that are streaming. Currently only supports Twitch. - **type** (string) - Required - The type of service. Must be 'TWITCH'. - **broadcasterId** (string) - Required - The ID of the broadcaster on the platform. - **broadcasterLogin** (string) - Required - The login name of the broadcaster. - **thumbnailUrl** (string) - The URL of the stream's thumbnail. ### Request Example ```json { "services": [ { "type": "TWITCH", "broadcasterId": "123456789", "broadcasterLogin": "example_streamer", "thumbnailUrl": "https://example.com/thumbnail.jpg" } ] } ``` ### Response #### Success Response (200) - **shopId** (string) - The ID of the shop associated with the streaming event. - **services** (array) - Details about the streaming services. - **type** (string) - The type of service (e.g., 'TWITCH'). - **status** (string) - The status of the stream (e.g., 'ONLINE'). - **broadcasterId** (string) - The ID of the broadcaster. - **broadcasterLogin** (string) - The login name of the broadcaster. - **thumbnailUrl** (string) - The URL of the stream's thumbnail. #### Response Example ```json { "shopId": "shop_abcde", "services": [ { "type": "TWITCH", "status": "ONLINE", "broadcasterId": "123456789", "broadcasterLogin": "example_streamer", "thumbnailUrl": "https://example.com/thumbnail.jpg" } ] } ``` ``` -------------------------------- ### Implement Responsive Design Source: https://docs.fourthwall.com/llms-full.txt Apply mobile-first styles and use media queries to adapt layouts for different screen sizes. This example shows padding adjustments based on screen width. ```liquid ``` -------------------------------- ### Gift Draw Started Event Source: https://docs.fourthwall.com/api-reference/platform/digital-products/request-digital-file-upload-url Webhook event triggered when a gift draw starts. ```APIDOC ## HOOK /api-reference/giveaway-events/gift-draw-started ### Description Webhook event triggered when a gift draw starts. ### Method HOOK ### Endpoint /api-reference/giveaway-events/gift-draw-started ``` -------------------------------- ### Create Product Source: https://docs.fourthwall.com/storefront/products Creates a new product in the store. ```APIDOC ## POST /products ### Description Creates a new product in the store. ### Method POST ### Endpoint /products ### Request Body - **name** (string) - Required - The name of the product. - **description** (string) - Optional - A detailed description of the product. - **price** (object) - Required - The pricing information for the product. - **amount** (number) - Required - The price amount. - **currency** (string) - Required - The currency of the price. ### Request Example { "name": "Cool Mug", "description": "A mug that keeps your drinks cool.", "price": { "amount": 15.50, "currency": "USD" } } ### Response #### Success Response (201) - **id** (string) - The unique identifier for the newly created product. - **name** (string) - The name of the product. - **description** (string) - A detailed description of the product. - **price** (object) - The pricing information for the product. - **amount** (number) - The price amount. - **currency** (string) - The currency of the price. #### Response Example { "id": "prod_456", "name": "Cool Mug", "description": "A mug that keeps your drinks cool.", "price": { "amount": 15.50, "currency": "USD" } } ``` -------------------------------- ### Signature Verification Example Source: https://docs.fourthwall.com/webhooks/signature-verification This example demonstrates how to verify the signature of an incoming webhook request. ```APIDOC ## Signature Verification To ensure the authenticity of incoming webhook requests, you should verify the signature. ### Method HMAC-SHA256 ### Process 1. **Retrieve the Signature:** The signature is provided in the `X-Signature-Hmac-Sha256` header of the incoming request. 2. **Retrieve the Payload:** The raw, unparsed request body is the payload. 3. **Retrieve the Shared Secret:** Your shared secret is available in your Fourthwall developer settings. 4. **Compute the Expected Signature:** Compute the HMAC-SHA256 hash of the payload using your shared secret as the key. 5. **Compare Signatures:** Compare the computed signature with the signature from the header. If they match, the request is authentic. ``` -------------------------------- ### Create Product using cURL Source: https://docs.fourthwall.com/api-reference/platform/products/create-product Use this cURL command to create a new product. Ensure you replace `` with your actual API token and provide valid IDs and strings for the other parameters. ```bash curl --request POST \ --url https://api.fourthwall.com/open-api/v1.0/products \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data \ '{ "productTemplateId": "pro_k66ZW4fsRm6c2def3itltA", "regions": [ { "region": "front", "imageId": "img_k66ZW4fsRm6c2def3itltA", "placementId": "", "placementStrategy": "AUTO" } ], "name": "My Awesome Design Tee", "type": "", "colors": [ "" ], "sizes": [ "" ], "description": "Limited edition design", "profitMargin": 10, "publishOnCreate": true }' ``` -------------------------------- ### Example Secret Key Source: https://docs.fourthwall.com/webhooks/signature-verification This is an example of a secret key obtained from the Fourthwall webhook configuration panel. ```text e3f93c7c-c92b-4b8f-a9b1-5b70e0891abc ``` -------------------------------- ### Custom Code Section Examples Source: https://docs.fourthwall.com/apps/app-sections View complete working examples of Custom Code sections. ```APIDOC ## Custom Code Section Examples ### Description Complete working examples of Custom Code sections. ### Endpoint `/html/examples` ``` -------------------------------- ### Create Shop Source: https://docs.fourthwall.com/channel-api/agency-integration Creates a new subaccount shop, invites the owner, and optionally starts payout onboarding. ```APIDOC ## Create Shop ### Description Creates a subaccount shop, invites the owner, and optionally starts payout onboarding. The creation response carries the new shop's `publicToken`. ### Method `POST` ### Endpoint `/channel-api/v1.0/shops` ### Headers - `Authorization`: `Bearer ` - `Content-Type`: `application/json` ### Request Body - `name` (string) - Required - The name of the new shop. - `ownerEmail` (string) - Optional - The email address of the shop owner. - `startPayoutOnboarding` (boolean) - Optional - Whether to start payout onboarding. ### Response #### Success Response (200) - `id` (string) - The unique identifier for the newly created shop. - `publicToken` (string) - The shop's public token for storefront access. ``` -------------------------------- ### Rate Limited Error Example Source: https://docs.fourthwall.com/api-reference/platform/giveaway-links/create-giveaway-links This example demonstrates the response when the API rate limit has been exceeded. ```json { "code": "OPEN_API_TOO_MANY_REQUESTS", "title": "Too many requests", "status": 429 } ```