BCL icon

BCL

Consume BCL Payment API

Overview

This node integrates with the BCL Payment API to manage coupons, payment links, and forms. Specifically for the Coupon - Get operation, it retrieves detailed information about a specific coupon by its ID. This is useful in scenarios where you want to verify coupon details such as discount type, amount, status, or usage limits before applying them in your workflows.

Practical examples:

  • Fetching coupon details to validate a discount before processing an order.
  • Retrieving coupon metadata to display in a customer portal or admin dashboard.
  • Automating coupon audits or reporting by extracting coupon data programmatically.

Properties

Name Meaning
Coupon ID The unique numeric identifier of the coupon to retrieve. This is a required input.

Output

The node outputs JSON data representing the coupon's details as returned by the BCL API. The structure typically includes fields such as coupon code, description, discount amount and type, active status, expiry dates, usage limits, and any conditions applied to the coupon.

No binary data output is produced by this operation.

Example output JSON (simplified):

{
  "id": 123,
  "code": "SUMMER21",
  "description": "Summer sale 2021 discount",
  "discount_amount": 10.00,
  "discount_type": "percentage",
  "is_active": true,
  "start_date": "2021-06-01T00:00:00Z",
  "expiry_date": "2021-08-31T23:59:59Z",
  "usage_limit": 100,
  "max_purchase": 500,
  "min_purchase": 50
}

Dependencies

  • Requires an API token credential for authenticating with the BCL Payment API.
  • The node makes HTTP requests to https://bcl.my/api.
  • Proper configuration of the API token credential in n8n is necessary.

Troubleshooting

  • Authentication failed: If the API token is invalid or expired, the node will return an authentication error. Ensure the API token credential is correctly configured and valid.
  • Not found error: If the provided Coupon ID does not exist, a 404 error will be returned. Verify that the Coupon ID is correct.
  • Validation errors: Improperly formatted inputs or missing required parameters may cause validation errors. Make sure the Coupon ID is a valid number and provided.
  • Server errors: Temporary issues on the BCL server side may result in 5xx errors. Retry after some time or check BCL service status.

If the node is set to continue on fail, errors will be returned as JSON objects containing error messages and status codes instead of stopping execution.

Links and References

Discussion