Reward API

Reward API allows developer to directly consume loyalty points via API. Customer earns points when an invoice belongs a customer is recorded in Imonggo or through API. This happens automatically if the customer is a member of a defined group that earns points.


Use Customer API to to get customer information and see available points. This example assumes customer id is 1534.

curl -u 5c4fc5805eb643716bbc17dad456a0c6cf2e23fa:X \
-H "Accept: application/xml" \
-H "Content-Type: application/xml" \

<?xml version="1.0" encoding="UTF-8"?>
  <birthday nil="true"></birthday>
  <name>Juan Cruz</name>
  <status nil="true"></status>
  <birthdate nil="true"></birthdate>

To consume $10 from this customer:

curl -u 5c4fc5805eb643716bbc17dad456a0c6cf2e23fa:X \
-H "Accept: application/xml" \
-H "Content-Type: application/xml" \

<?xml version="1.0" encoding="UTF-8"?>
  <points-spent type="decimal">2000.0</points-spent>
  <amount-spent type="decimal">10.0</amount-spent>
  <points-available type="decimal">28511.0</points-available>


  • q - 'spend'
  • customer_id - given customer id
  • amount - amount to spend, number of points consumed will automatically be computed via defined points-to-amount ratio in the membership definition
  • reference - reference number for this transaction, if the transaction is an invoice, use invoice transaction number. The uniqueness of this reference is not enforced.

Return Value

The Reward API will return points-spend, amount-spend and points-available if the transaction is successful; otherwise, it will return corresponding error message (e.g. in case of insufficient points).