### Example API Request Body Source: https://api.thewayl.com/reference This is an example of the JSON request body used for API interactions. It includes details like environment, reference ID, total amount, currency, line items, and webhook/redirection URLs. ```json { "env": "live", "referenceId": "dummy-reference-id", "total": 10000, "currency": "IQD", "customParameter": "", "lineItem": [ { "label": "Basket Value", "amount": 10000, "type": "increase" } ], "webhookUrl": "https://webhook.site/your-webhook-url", "webhookSecret": "1234567890", "redirectionUrl": "https://www.google.com"} ``` -------------------------------- ### Get All Products Source: https://api.thewayl.com/reference Retrieves a list of all products, including digital, physical, and service types. ```APIDOC ## GET /api/v1/products ### Description Retrieves a list of all products managed in the system. This includes digital, physical, and service products. ### Method GET ### Endpoint /api/v1/products ### Response #### Success Response (200) Returns a list of products. Specific fields are not detailed in the source. ``` -------------------------------- ### Get Product by ID Source: https://api.thewayl.com/reference Retrieves details for a specific product using its ID. ```APIDOC ## GET /api/v1/products/{productId} ### Description Retrieves the details of a specific product identified by its unique product ID. ### Method GET ### Endpoint /api/v1/products/{productId} ### Parameters #### Path Parameters - **productId** (string) - Required - The unique identifier for the product. ### Response #### Success Response (200) Returns the details of the specified product. Specific fields are not detailed in the source. ``` -------------------------------- ### Get All Links Source: https://api.thewayl.com/reference Retrieves a list of all payment links. ```APIDOC ## GET /api/v1/links ### Description Retrieves a list of all payment links created within the system. ### Method GET ### Endpoint /api/v1/links ### Response #### Success Response (200) Returns a list of payment links. Specific fields are not detailed in the source. ``` -------------------------------- ### Get All Refunds Source: https://api.thewayl.com/reference Retrieves a list of all refund requests. ```APIDOC ## GET /api/v1/refunds ### Description Retrieves a list of all refund requests submitted. ### Method GET ### Endpoint /api/v1/refunds ### Response #### Success Response (200) Returns a list of refund requests. Specific fields are not detailed in the source. ``` -------------------------------- ### Get Refund by ID Source: https://api.thewayl.com/reference Retrieves details for a specific refund request using its ID. ```APIDOC ## GET /api/v1/refunds/{refundId} ### Description Retrieves the details of a specific refund request identified by its unique refund ID. ### Method GET ### Endpoint /api/v1/refunds/{refundId} ### Parameters #### Path Parameters - **refundId** (string) - Required - The unique identifier for the refund request. ### Response #### Success Response (200) Returns the details of the specified refund request. Specific fields are not detailed in the source. ``` -------------------------------- ### Get Link by Reference ID Source: https://api.thewayl.com/reference Retrieves a specific payment link using its unique reference ID. ```APIDOC ## GET /api/v1/links/{referenceId} ### Description Retrieves a specific payment link identified by its unique reference ID. ### Method GET ### Endpoint /api/v1/links/{referenceId} ### Parameters #### Path Parameters - **referenceId** (string) - Required - The unique identifier for the payment link. ### Response #### Success Response (200) Returns the details of the specified payment link. Specific fields are not detailed in the source. ``` -------------------------------- ### Batch Create Links Source: https://api.thewayl.com/reference Creates multiple payment links in a single batch request. ```APIDOC ## POST /api/v1/links/batch ### Description Allows for the creation of multiple payment links simultaneously through a batch request. ### Method POST ### Endpoint /api/v1/links/batch ### Request Body This endpoint accepts a request body containing details for multiple links. Specific fields are not detailed in the source. ### Response #### Success Response (200) Returns information about the batch link creation process. Specific response details are not provided in the source. ``` -------------------------------- ### Verify Authentication Key Source: https://api.thewayl.com/reference Use this cURL command to verify your API authentication key. Ensure your key is valid before making other API calls. Replace 'YOUR_SECRET_TOKEN' with your actual secret token. ```Shell curl https://api.thewayl.com/api/v1/verify-auth-key \ --header 'X-WAYL-AUTHENTICATION: YOUR_SECRET_TOKEN' ``` -------------------------------- ### Shell Curl Command for API Request Source: https://api.thewayl.com/reference This shell command demonstrates how to make an API request using curl. It includes the necessary headers for authentication and content type, along with the request body. ```shell curl --request POST \ --url https://api.wayl.com/v1/payments \ --header 'accept: */*' --header 'content-type: application/json' --header 'X-WAYL-AUTHENTICATION: YOUR_API_KEY' \ --data '{ "env": "live", "referenceId": "dummy-reference-id", "total": 10000, "currency": "IQD", "customParameter": "", "lineItem": [ { "label": "Basket Value", "amount": 10000, "type": "increase" } ], "webhookUrl": "https://webhook.site/your-webhook-url", "webhookSecret": "1234567890", "redirectionUrl": "https://www.google.com"}' ``` -------------------------------- ### Verify Authentication Key Source: https://api.thewayl.com/reference Verifies that your API authentication key is valid and working. This endpoint is useful for testing your API credentials before making other API calls. ```APIDOC ## GET /api/v1/verify-auth-key ### Description Verifies that your API authentication key is valid and working. Use this endpoint to test your API credentials before making actual API calls. ### Method GET ### Endpoint /api/v1/verify-auth-key ### Parameters #### Headers - **X-WAYL-AUTHENTICATION** (string) - Required - API key for merchant authentication. ### Request Example ``` curl https://api.thewayl.com/api/v1/verify-auth-key \ --header 'X-WAYL-AUTHENTICATION: YOUR_SECRET_TOKEN' ``` ### Response #### Success Response (200) - **data** (object) - An empty object if the key is valid. - **message** (string) - A confirmation message indicating the key is valid. #### Response Example ```json { "data": {}, "message": "Authentication key is valid" } ``` ``` -------------------------------- ### Create Refund Source: https://api.thewayl.com/reference Initiates a refund request for a completed payment. Requires a detailed reason and can only be issued for paid orders linked to customers. ```APIDOC ## POST /api/v1/refunds ### Description Initiates a refund request for a completed payment. This operation requires a detailed reason and is applicable only to paid orders associated with customers. ### Method POST ### Endpoint /api/v1/refunds ### Request Body This endpoint accepts a request body to process a refund, including a detailed reason. Specific fields are not detailed in the source. ### Response #### Success Response (200) Indicates the refund request has been initiated. Specific response details are not provided in the source. ``` -------------------------------- ### Create a Link Source: https://api.thewayl.com/reference Creates a shareable payment link that customers can use to complete payments. This link is tied to a specific order and can include line item breakdowns, webhooks, and custom redirection URLs. ```APIDOC ## POST /api/v1/links ### Description Creates a shareable payment link for customers to complete payments. The link can be associated with an order and configured with line items, webhooks, and redirection URLs. ### Method POST ### Endpoint /api/v1/links ### Request Body This endpoint accepts a request body to define the link's properties. Specific fields are not detailed in the source. ### Response #### Success Response (200) Details of the created link are returned. Specific fields are not detailed in the source. ``` -------------------------------- ### AuthenticationRequired Source: https://api.thewayl.com/reference API key for merchant authentication. Include your authentication key in the X-WAYL-AUTHENTICATION header for all API requests. You can find your API key in your Wayl merchant dashboard. ```APIDOC ## POST /payment ### Description Initiates a payment transaction with Wayl. ### Method POST ### Endpoint /payment ### Headers - **X-WAYL-AUTHENTICATION** (string) - Required - Your Wayl API key for authentication. - **accept** (string) - Optional - Specifies the desired response format, defaults to */*. - **content-type** (string) - Optional - Specifies the request body format, defaults to application/json. ### Request Body - **env** (string) - Required - The environment for the transaction (e.g., "live"). - **referenceId** (string) - Required - A unique identifier for the transaction. - **total** (integer) - Required - The total amount for the transaction. - **currency** (string) - Required - The currency code for the transaction (e.g., "IQD"). - **customParameter** (string) - Optional - A custom parameter for additional information. - **lineItem** (array) - Optional - An array of line items for the transaction. - **label** (string) - Required - The label for the line item. - **amount** (integer) - Required - The amount for the line item. - **type** (string) - Required - The type of the line item (e.g., "increase"). - **webhookUrl** (string) - Optional - The URL to send webhook notifications to. - **webhookSecret** (string) - Optional - A secret key for webhook verification. - **redirectionUrl** (string) - Optional - The URL to redirect the user after the transaction. ### Request Example ```json { "env": "live", "referenceId": "dummy-reference-id", "total": 10000, "currency": "IQD", "customParameter": "", "lineItem": [ { "label": "Basket Value", "amount": 10000, "type": "increase" } ], "webhookUrl": "https://webhook.site/your-webhook-url", "webhookSecret": "1234567890", "redirectionUrl": "https://www.google.com" } ``` ### Response #### Success Response (200) - **status** (string) - The status of the transaction. - **message** (string) - A message describing the transaction status. - **transactionId** (string) - The unique identifier for the transaction. #### Response Example ```json { "status": "success", "message": "Transaction initiated successfully.", "transactionId": "txn_12345abcde" } ``` ``` -------------------------------- ### Verify Authentication Key Response Schema Source: https://api.thewayl.com/reference This is the JSON schema for a successful response when verifying an authentication key. It indicates that the authentication key is valid. ```JSON { "data": {}, "message": "string" } ``` -------------------------------- ### Invalidate Link if Pending Source: https://api.thewayl.com/reference Conditionally invalidates a payment link if it is currently in a pending state. ```APIDOC ## POST /api/v1/links/{referenceId}/invalidate-if-pending ### Description Invalidates a payment link only if its current status is 'Pending'. This prevents accidental invalidation of active or completed links. ### Method POST ### Endpoint /api/v1/links/{referenceId}/invalidate-if-pending ### Parameters #### Path Parameters - **referenceId** (string) - Required - The unique identifier for the payment link. ### Response #### Success Response (200) Indicates the status of the invalidation attempt. Specific response details are not provided in the source. ``` -------------------------------- ### Cancel Refund Source: https://api.thewayl.com/reference Cancels a refund request using its ID. This operation can only be performed on refunds that have not yet been fully processed. ```APIDOC ## DELETE /api/v1/refunds/{refundId}/cancel ### Description Cancels a refund request. This operation is typically used for refunds that are in a pending state and have not yet been fully processed. ### Method DELETE ### Endpoint /api/v1/refunds/{refundId}/cancel ### Parameters #### Path Parameters - **refundId** (string) - Required - The unique identifier for the refund request to cancel. ### Response #### Success Response (200) Indicates that the refund request has been successfully cancelled. Specific response details are not provided in the source. ``` -------------------------------- ### Invalidate Link Source: https://api.thewayl.com/reference Invalidates a payment link using its reference ID, preventing further use. ```APIDOC ## POST /api/v1/links/{referenceId}/invalidate ### Description Invalidates a payment link, making it unusable for future payments. This operation uses the link's reference ID. ### Method POST ### Endpoint /api/v1/links/{referenceId}/invalidate ### Parameters #### Path Parameters - **referenceId** (string) - Required - The unique identifier for the payment link to invalidate. ### Response #### Success Response (200) Indicates that the link has been successfully invalidated. Specific response details are not provided in the source. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.