### PayFort Tokenization Setup Source: https://store-docs.wuilt.com/docs/types/objects/pay-fort-tokenization-setup This section outlines the structure and fields for the PayFort tokenization setup, used to initiate payment processing. ```APIDOC ## PayFortTokenizationSetup ### Description This object represents the configuration required to set up PayFort tokenization for payment processing. It includes essential merchant and service details. ### Method POST (Assumed, as it involves setting up a process) ### Endpoint /payfort/tokenization/setup (Assumed) ### Parameters #### Request Body - **signature** (String!) - Required - A security signature for the request. - **merchant_identifier** (String!) - Required - The unique identifier for the merchant. - **access_code** (String!) - Required - The access code provided by PayFort. - **merchant_reference** (String!) - Required - A reference identifier for the transaction. - **return_url** (String!) - Required - The URL to redirect the user to after the transaction. - **service_command** (String!) - Required - The command for the PayFort service. - **language** (String!) - Required - The language code for the transaction interface. ### Request Example ```json { "signature": "your_signature", "merchant_identifier": "your_merchant_id", "access_code": "your_access_code", "merchant_reference": "your_ref_123", "return_url": "https://your.site/return", "service_command": "TOKENIZATION", "language": "en" } ``` ### Response #### Success Response (200) - **paymentUrl** (String!) - The URL where the user will be redirected to complete the tokenization process. #### Response Example ```json { "paymentUrl": "https://payfort.site/payment/redirect?token=generated_token" } ``` ``` -------------------------------- ### GET /products Source: https://store-docs.wuilt.com/docs/operations/queries/get-all-products Retrieves a list of all products available in the store. Supports filtering by locale, currency, and requires store ID and installation ID. ```APIDOC ## GET /products ### Description Retrieves a list of all products available in the store. Supports filtering by locale, currency, and requires store ID and installation ID. ### Method GET ### Endpoint /products ### Parameters #### Query Parameters - **installationId** (ID!) - Required - The unique identifier for the installation. - **storeId** (ID!) - Required - The unique identifier for the store. - **locale** (String) - Optional - The language and region code for localization (e.g., "en-US"). - **storeCurrency** (CurrencyCode) - Optional - The currency code for the store (e.g., "USD"). ### Request Example ``` GET /products?installationId=123&storeId=456&locale=en-US&storeCurrency=USD ``` ### Response #### Success Response (200) - **DropshippingProductConnection** (object) - The connection object containing a list of products. - **edges** (array) - A list of product edges. - **node** (object) - Represents a single product. - **id** (ID!) - The unique identifier for the product. - **title** (String) - The title of the product. - **description** (String) - The description of the product. - **price** (Float!) - The price of the product. - **currency** (CurrencyCode!) - The currency of the product price. - **pageInfo** (object) - Information about the pagination. - **hasNextPage** (Boolean!) - Indicates if there are more pages. - **endCursor** (String) - The cursor for the last item on the current page. #### Response Example ```json { "data": { "getAllProducts": { "edges": [ { "node": { "id": "gid://shopify/Product/12345", "title": "Example Product", "description": "This is a sample product.", "price": 19.99, "currency": "USD" } } ], "pageInfo": { "hasNextPage": false, "endCursor": "" } } } } ``` ``` -------------------------------- ### GraphQL: Example Query Variables for Product Details Source: https://store-docs.wuilt.com/docs/SampleAPIs/GetProductDetails These are example variables to be used with the `GetProductDetails` GraphQL query. They include the required `storeId` and `handle`, along with an optional `locale`. The `handle` should correspond to the product's handle found in the storefront URL. ```json { "storeId": "Store_cm84j35iy02m001i89iiu2cts", "handle": "example-product", "locale": "en" } ``` -------------------------------- ### Session ID Header Example Source: https://store-docs.wuilt.com/docs/SampleAPIs/ApplyPromoCode An example of the required 'sessionid' header, which should be consistent across cart-related operations like creation, updates, and applying promo codes. ```json { "sessionid": "Session_3f6a0f1d-9c4a-4f3e-8f4b-1a2b3c4d5e6f" } ``` -------------------------------- ### POST /websites/store-docs_wuilt/webhooks/create Source: https://store-docs.wuilt.com/docs/types/objects/store-webhook-actions Creates a new store webhook with the provided input. This action initiates the setup of a webhook for store-related events. ```APIDOC ## POST /websites/store-docs_wuilt/webhooks/create ### Description Creates a new store webhook with the provided input. This action initiates the setup of a webhook for store-related events. ### Method POST ### Endpoint /websites/store-docs_wuilt/webhooks/create ### Parameters #### Query Parameters None #### Request Body - **input** (StoreWebhookCreateInput!) - Required - The input object for creating a store webhook. ### Request Example ```json { "input": { "url": "https://example.com/webhook", "events": ["order.created", "product.updated"] } } ``` ### Response #### Success Response (200) - **webhookId** (ID) - The unique identifier for the newly created webhook. - **status** (string) - The status of the webhook creation (e.g., 'success'). #### Response Example ```json { "webhookId": "whk_123abc", "status": "success" } ``` ``` -------------------------------- ### Example GraphQL API Request using cURL Source: https://store-docs.wuilt.com/docs/generate-api-key Provides an example of how to interact with the Wuilt GraphQL API using the cURL command-line tool. This example shows how to send a POST request with the necessary headers and a JSON payload containing the query and variables. ```bash curl -X POST https://graphql.wuilt.com/ \ -H "Content-Type: application/json" \ -H "X-API-KEY: your_api_key_here" \ -d '{ \ "query": "query GetStoreInfo($storeId: String!) { store(id: $storeId) { id name email } }", \ "variables": { "storeId": "your_store_id" } \ }' ``` -------------------------------- ### Example Query Variables for Listing Store Products Source: https://store-docs.wuilt.com/docs/SampleAPIs/StoreProducts These are example variables to be used with the `ListStoreProducts` GraphQL query. They specify pagination parameters (first, offset, sortBy, sortOrder), filtering criteria (status, storeIds), and the locale for the product data. Ensure the `storeId` is replaced with your actual store identifier. ```json { "connection": { "first": 20, "offset": 0, "sortBy": "createdAt", "sortOrder": "desc" }, "filter": { "status": "ACTIVE", "storeIds": [ "Store_cm84j35iy02m001i89iiu2cts" ] }, "locale": "en" } ``` -------------------------------- ### Get Cart Query Example Variables Source: https://store-docs.wuilt.com/docs/SampleAPIs/GetCart Example input variables for the GetCart GraphQL query. These parameters specify the store and the cart to be retrieved, enabling the API to fetch the correct cart details. The `storeId` is mandatory, while `id` can be omitted to use the session's active cart. ```json { "storeId": "Store_cm84j35iy02m001i89iiu2cts", "id": "Cart_d8f8ce2f-681e-4554-93b7-230e0b34a151" } ``` -------------------------------- ### Product Data JSON Example Source: https://store-docs.wuilt.com/docs/SampleAPIs/CreateProduct This JSON object represents the structure of product data, including details like store ID, title, pricing, variants, options, and SEO information. It serves as an example input for product-related queries. ```json { "input": { "storeId": "Store_your_store_id_here", "title": "Premium Wireless Headphones", "type": "SIMPLE", "status": "ACTIVE", "descriptionHtml": "
High-quality wireless headphones with noise cancellation and premium sound quality. Perfect for music lovers and professionals.
", "shortDescription": "Premium wireless headphones with noise cancellation", "handle": "premium-wireless-headphones", "taxable": true, "productTax": 0.08, "seo": { "title": "Premium Wireless Headphones - High Quality Audio", "description": "Shop premium wireless headphones with noise cancellation. Free shipping on orders over $100." }, "variants": [ { "options": [ "ProductOptionValue_color_black_id", "ProductOptionValue_size_standard_id" ], "sku": "PWH-BLK-STD", "price": { "amount": 299.99, "currencyCode": "USD" }, "compareAtPrice": { "amount": 349.99, "currencyCode": "USD" }, "cost": { "amount": 150, "currencyCode": "USD" }, "quantity": 50, "trackQuantity": true, "cartLimitsEnabled": true, "minPerCart": 1, "maxPerCart": 5, "packageDetails": { "weight": 0.8, "dimensions": { "length": 20, "width": 18, "height": 8 } } }, { "options": [ "ProductOptionValue_color_white_id", "ProductOptionValue_size_standard_id" ], "sku": "PWH-WHT-STD", "price": { "amount": 299.99, "currencyCode": "USD" }, "quantity": 30, "trackQuantity": true, "cartLimitsEnabled": true, "minPerCart": 1, "maxPerCart": 5, "packageDetails": { "weight": 0.8, "dimensions": { "length": 20, "width": 18, "height": 8 } } } ], "options": [ { "id": "ProductOption_color_id", "position": 0 }, { "id": "ProductOption_size_id", "position": 1 } ], "attributes": [], "collectionsToJoin": [] }, "media": [], "locale": "en" } ``` -------------------------------- ### Wuilt GraphQL API - Authentication and Example Request Source: https://store-docs.wuilt.com/docs/generate-api-key This section details how to authenticate your requests to the Wuilt GraphQL API using an API key and provides examples for making POST requests. ```APIDOC ## POST /graphql ### Description This endpoint is used to interact with the Wuilt GraphQL API. Authentication is performed by including your API key in the request headers. ### Method POST ### Endpoint `https://graphql.wuilt.com/` ### Parameters #### Query Parameters None #### Headers - **Content-Type** (string) - Required - Set to `application/json`. - **X-API-KEY** (string) - Required - Your generated Wuilt API key. ### Request Body - **query** (string) - Required - The GraphQL query or mutation to execute. - **variables** (object) - Optional - Variables to be used with the GraphQL query. ### Request Example #### JavaScript/Node.js ```javascript const response = await fetch("https://graphql.wuilt.com/", { method: "POST", headers: { "Content-Type": "application/json", "X-API-KEY": "your_api_key_here", }, body: JSON.stringify({ query: `query GetStoreInfo($storeId: String!) { store(id: $storeId) { id name email } }`, variables: { storeId: "your_store_id", }, }), }); const data = await response.json(); console.log(data); ``` #### cURL ```bash curl -X POST https://graphql.wuilt.com/ \ -H "Content-Type: application/json" \ -H "X-API-KEY: your_api_key_here" \ -d '{ "query": "query GetStoreInfo($storeId: String!) { store(id: $storeId) { id name email } }", "variables": { "storeId": "your_store_id" } }' ``` ### Response #### Success Response (200) - **data** (object) - The result of the GraphQL query. - **errors** (array) - An array of errors, if any occurred during query execution. #### Response Example ```json { "data": { "store": { "id": "your_store_id", "name": "Example Store Name", "email": "store@example.com" } } } ``` ``` -------------------------------- ### Example UpdateProduct Response (JSON) Source: https://store-docs.wuilt.com/docs/SampleAPIs/UpdateProduct This JSON object represents a successful response from the UpdateProduct mutation. It includes details of the updated product, its variants, and associated collections. Dependencies: None. Input: None. Output: JSON object with product details. ```json { "data": { "updateProduct": { "product": { "id": "Product_premium_headphones_001", "title": "Premium Wireless Headphones Pro", "handle": "premium-wireless-headphones-pro", "type": "SIMPLE", "status": "ACTIVE", "isVisible": true, "shortDescription": "Enhanced premium wireless headphones with 40-hour battery", "descriptionHtml": "Enhanced premium wireless headphones...
", "updatedAt": "2024-01-15T14:30:00Z", "variants": { "nodes": [ { "id": "Variant_existing_001", "title": "Black / Standard", "sku": "PWH-PRO-BLK-STD", "price": { "amount": 349.99, "currencyCode": "USD" }, "quantity": 75 }, { "id": "Variant_new_002", "title": "White / Standard", "sku": "PWH-PRO-WHT-STD", "price": { "amount": 349.99, "currencyCode": "USD" }, "quantity": 50 } ] }, "collections": { "totalCount": 2, "nodes": [ { "id": "Collection_electronics_001", "title": "Electronics & Gadgets" }, { "id": "Collection_audio_devices_002", "title": "Audio Devices" } ] } } } } } ``` -------------------------------- ### ORDER_UPDATED Payload Example (JSON) Source: https://store-docs.wuilt.com/docs/webhooks An example of the JSON payload received when the ORDER_UPDATED trigger is fired. It includes details about the events that occurred and the updated order information. ```json { "event": "ORDER_UPDATED", "payload": { "events": ["status_changed", "fulfillment_updated"], "order": { "_id": "cmdlpac7n000201pm3dgifkqu", "storeId": "cm4qwjv0e004s01k77o2f1f5e", "cartId": "d3f61199-b262-4deb-a42d-31a5b93952b0", "status": "SUCCESSFUL", "errors": [], "subtotal": { "amount": 3000, "currencyCode": "EGP" }, "totalPrice": { "amount": 3200, "currencyCode": "EGP" }, "shippingRateCost": { "amount": 75, "currencyCode": "EGP" }, "fulfillmentStatus": "UNFULFILLED", "notes": "", "shippingRateId": "clzvqvezy0004017i4vwe4667", "shippingRateName": "Bosta", "promoCodeSnapshot": null, "isArchived": false, "isCanceled": false, "isViewed": false, "customerId": "cm4qwyzfv000g018y6mv39bnd", "itemsCount": 1, "fulfilledItems": 0, "shippingAddress": { "addressLine1": "11th Districtttt", "addressLine2": "12th apartment", "phone": "+201111111111", "secondPhone": null, "postalCode": "001", "notes": "", "countryCode2": "EG", "countryName": "Egypt", "stateName": "Alexandria", "cityName": "Borg Al Arab City", "area": { "countryId": "clzy5vtku0000kn9kagau94vi", "stateId": "clzy5vtl6004rkn9k8dx8gmml", "cityId": "clzy5vtl7004ukn9k1my75jhi" }, "areaSnapshot": { "countryName": "Egypt", "stateName": "Alexandria", "cityName": "Borg Al Arab City" } }, "billingAddress": { "addressLine1": "11th Districtttt", "addressLine2": "12th apartment", "phone": "+201111111111", "secondPhone": null, "postalCode": "001", "notes": "", "countryCode2": "EG", "countryName": "Egypt", "stateName": "Alexandria", "cityName": "Borg Al Arab City", "area": { "countryId": "clzy5vtku0000kn9kagau94vi", "stateId": "clzy5vtl6004rkn9k8dx8gmml", "cityId": "clzy5vtl7004ukn9k1my75jhi" }, "areaSnapshot": { "countryName": "Egypt", "stateName": "Alexandria", "cityName": "Borg Al Arab City" } }, "promoCode": null, "customer": { "name": "John Doe", "email": "john.doe@gmail.com", "phone": "+201111111111", "isSubscribedToNewsLetter": true }, "storeData": { "name": "John Doe", "logo": null, "email": "john.doe@gmail.com", "phone": "115050" }, "items": [ { "_id": "08672157-9dc9-443d-a74c-cb55312162d4", "productId": "cmdeh9e2h00d801xoco4ngtt5", "productSnapshot": { "id": "cmdeh9e2h00d801xoco4ngtt5", "type": "SIMPLE", "media": ["cmdeh6b4c004201ceeufm8fqu", "cmdeh6b4c004301ceefuk40e4"], "title": "Product Title", "handle": "product-handle", "locale": "en", "source": "MANUAL", "status": "ACTIVE", "options": "", "storeId": "cm4qwjv0e004s01k77o2f1f5e", "taxable": false, "isVisible": true, "productTax": 0, "translations": [], "collectionIds": [], "descriptionHtml": "", "integrationProvider": { "icon": { "src": "", "altText": "" }, "name": "MANUAL", "provider": "MANUAL", "websiteLink": "" } }, "title": "Product Title", "fulfilledItems": 0, "subtotal": { "amount": 3000, "currencyCode": "EGP" }, "quantity": 1, "discount": null, "discounts": [], "type": "SIMPLE", "variantId": "cmdeh9e2h00d901xo8oqu5a2x", "variantSnapshot": { "id": "cmdeh9e2h00d901xo8oqu5a2x", "sku": "product-sku", "type": "variant", "price": { "amount": 3000, "currencyCode": "EGP" }, "storeId": "cm4qwjv0e004s01k77o2f1f5e", "quantity": 10, "productId": "cmdeh9e2h00d801xoco4ngtt5", "externalId": "", "trackQuantity": true, "compareAtPrice": { ``` -------------------------------- ### Product Data Structure JSON Example Source: https://store-docs.wuilt.com/docs/SampleAPIs/UpdateProduct This JSON object demonstrates the structure of a product within the Wuilt store. It includes details such as product ID, store ID, title, description, pricing, variants, options, and associated collections. This structure is used to manage and display product information. ```JSON { "input": { "id": "Product_premium_headphones_001", "storeId": "Store_cm84j35iy02m001i89iiu2cts", "title": "Premium Wireless Headphones Pro", "type": "SIMPLE", "descriptionHtml": "Enhanced premium wireless headphones with advanced noise cancellation, premium sound quality, and extended battery life. Perfect for music lovers, professionals, and travelers.