Generate codes according to order data


You can generate codes of a product with a script according to order data and customer details in Vendor Control Panel > Manage Products > Delivery Options. Check the box Provide a Code and select "Retrieve Codes from a Remote Web Server" option to setup the delivery method.

You need to input a remote URL which the system posts data to and retrieves codes from. You can define the parameters as you need. Parameter value could be a static text or a variable from order data. Here are the variables supported by the system.

{OrderID}, {Currency}, {CreateTime}, {LastUpdateTime}, {TransactionID}, {RefererURL}, {CustomerIP}, {AffiliateID}, {Status}, {Additional1}, {Additional2}, {CouponID}, {CustomerFullName}, {CustomerFirstName}, {CustomerLastName}, {CustomerOrganization}, {CustomerAddress}, {CustomerSuburb}, {CustomerZipCode}, {CustomerState}, {CustomerCountryCode}, {CustomerPhone}, {CustomerFax}, {CustomerEmail}, {RecipientFullName}, {RecipientFirstName}, {RecipientLastName}, {RecipientOrganization}, {RecipientAddress}, {RecipientSuburb}, {RecipientZipCode}, {RecipientState}, {RecipientCountryCode}, {RecipientPhone}, {RecipientFax}, {RecipientEmail}, {ItemID}, {ProductID}, {ProductName}, {StandardUnitPrice}, {StandardPrice}, {UnitPrice}, {Price}, {Subscription}, {FirstPeriod}, {RegularUnitFee}, {RegularFee}, {RegularPeriod}, {UnitTax}, {Tax}, {TaxID}, {OfferID}, {Quantity}, {UnitCommission}, {Commission}, {Code}, {DownloadLink}

For example, you would like to post order ID as a parameter named "order_id", you can add a parameter as "order_id = {OrderID}". It is recommended you setup a static text as token to verify the post data are from SWPal even though your script URL is unknown to others.

The URL should response a text as the code of product. By default the system considers the recipient's full name from an order as username of the product. It sends the customer both the username and the code in a post-sale email. You can create a customized post-sale email with instructions for using the code.

[ Back to Topic List ]