Actions4
- Link Actions
Overview
This node integrates with the PayTR Link API to manage payment links. It allows users to create, delete, and send payment links via email or SMS. The primary use case is to facilitate online payments by generating customizable payment links for products, services, or invoice collections. For example, an e-commerce business can create a payment link for a product sale with installment options, or a service provider can send an invoice link directly to a customer’s email or phone.
Properties
Name | Meaning |
---|---|
Product or Service Name | Description of the product or service (4-200 characters). Required when creating a link. |
Price | Payment amount in cents (e.g., 3456 means 34.56). Required when creating a link. |
Currency | Currency code for the payment. Options: Turkish Lira (TL), Euro (EUR), US Dollar (USD), British Pound (GBP), Russian Ruble (RUB). Required when creating a link. |
Max Installment | Maximum number of installments allowed (1 means no installments, valid range 2-12). Required when creating a link. |
Language | Language for the payment interface. Options: Turkish (tr), English (en). Required when creating a link. |
Link Type | Type of payment link. Options: Product Sale (product), Invoice/Collection (collection). Required when creating a link. |
Additional Fields | Optional extra settings including: |
- Minimum Count | Minimum quantity limit (required if link type is product). |
Customer email address (required if link type is collection). | |
- Max Count | Stock quantity (for product type only). |
- PFT | Installment cash price setting (valid range 2-12). |
- Expiry Date | Link expiration date/time (format: YYYY-MM-DD HH:mm:ss). |
- Callback Link | URL to receive payment result notifications. |
- Callback ID | Notification ID to return in callbacks. |
- Debug Mode | Enable debug mode for testing (boolean). |
Link ID | Identifier of the payment link (required for delete, send email, send SMS operations). |
Email address to send the payment link to (required for send email operation). | |
Phone Number | Phone number to send SMS (must start with 05 and be 11 digits; required for send SMS operation). |
Output
The node outputs JSON data containing the response from the PayTR API for each operation:
- Create: Returns details about the created payment link, such as link ID and status.
- Delete: Returns confirmation of deletion status.
- Send Email: Returns status of the email sending operation.
- Send SMS: Returns status of the SMS sending operation.
No binary data output is produced by this node.
Dependencies
- Requires an API key credential for authenticating with the PayTR API (merchant ID, key, and salt).
- Uses the PayTR Link API endpoints:
- Create link:
https://www.paytr.com/odeme/api/link/create
- Delete link:
https://www.paytr.com/odeme/api/link/delete
- Send email:
https://www.paytr.com/odeme/api/link/send-email
- Send SMS:
https://www.paytr.com/odeme/api/link/send-sms
- Create link:
- Requires n8n HTTP Request helper for making POST requests with form-urlencoded bodies.
- Uses SHA256 hashing to generate security tokens for API requests.
Troubleshooting
- Invalid phone number format for SMS: The phone number must start with "05" and be exactly 11 digits long. If not, the node throws an error before making the API call.
- Missing required fields: When creating a link, ensure all required fields are provided, especially those conditional on the link type (e.g., minimum count for product links, email for collection links).
- API authentication errors: Incorrect or missing merchant credentials will cause API calls to fail. Verify that the API key credential is correctly configured.
- Debug mode: Enabling debug mode adds additional information in API responses which can help diagnose issues.
- Network or API errors: Standard HTTP errors or timeouts may occur; check network connectivity and PayTR API status.
Links and References
- PayTR Official Website
- PayTR Link API Documentation (Note: actual documentation URL may vary)