CasperVend 2/API
Starting from the 12th of June 2012, CasperVend2 has a read-only API which is designed to help creators with scripting knowledge to create plugins for our vendors.
Messages
API messages are sent via linked message. They are sent on the following events:
- On Update - Vendor scrolled, rezzed, reset, or region restarted
- Transaction Completed - When a product has been successfully purchased from a vendor.
On Update
This event occurs when a vendor is scrolled, reset, updated, rezzed, or the region is restarted. It provides information on the currently displayed product.
The following linked message is sent on the vendor concerned:
llMessageLinked(LINK_SET, PRODUCT_PRICE, PRODUCT_NAME, PRODUCT_TEXTURE_KEY);
Please note that the characters :, @ and | are removed from the product name.
Transaction Completed
This event occurs when a transaction has been successfully completed, and the item delivered. It provides information on the transaction.
The following linked message is sent on BOTH the vendor used to purchase the product, and the dropbox used to deliver the item
llMessageLinked(LINK_SET, -10, TRANSACTION_ID+":"+PURCHASER_KEY+":"+PURCHASER_NAME+":"+RECIPIENT_NAME+":"+AMOUNT_PAID+":"+GIFT_CARD_USED+":"+MODE+":"+PRODUCT_ID+":"+ITEM_NAME, RECIPIENT_KEY);
Fields:
- TRANSACTION_ID - This is your CasperVend transactionID. This is used to uniquely identify this transaction.
- PURCHASER_KEY - This is the key (UUID) of the person who has purchased the product.
- PURCHASER_NAME - This is the avatar name (not display name or username) of the person purchasing the product.
- RECIPIENT_NAME - This is the avatar name (not display name or username) of the person receiving the product.
- AMOUNT_PAID - This is the amount that was paid for the item, in Linden Dollars.
- GIFT_CARD_USED - This is 1 if a gift card was used for this transaction, 0 if not.
- MODE - "norm" if a regular transaction. "lucky" if a lucky chair win. "midni" if a midnight madness win.
- PRODUCT_ID - The CasperVend product ID of the product. You should use this rather than the item name, since the item name can change, but the product ID won't.
- ITEM_NAME - The inventory item name that was delivered.
- RECIPIENT_KEY - This is the key (UUID) of the avatar who has received the product.