Credits


Retrieve a credit address

GET /api/v1/partners/:api_token/credits

Partners pre-fund their remittances by sending BTC to a credit address. The BTC is immediately converted to PHP using the real-time rate (looked up at the time the BTC is announced on the blockchain) and stored as credit under their account. Each time the partner creates a new remittance, the PHP amount is drawn from the credit, and is no longer invoiced. In this manner, Partners may optimize their cashflow by sending BTC when rates are optimal and locking in its peso value.

Examples

/api/v1/partners/:api_token/credits?api_secret=:api_secret

Show a list of credit transactions

GET /api/v1/partners/:api_token/credits/history

Grab a list of the most recent 100 credit transactions associated with this vendor account. Transactions that add to your credit will have the boolean ‘consumed’ set to ‘false’, and transactions that use up your credit (i.e., to pay for remittances) will have it set to ‘true’.

Examples

/api/v1/partners/:api_token/credits/history?api_secret=:api_secret

[
  {
    "amount_in_php" : 1000.0,
    "target_currency" : "PHP",
    "target_amount" : 1000.0,
    "balance" : 44000.0,
    "created_at" : "2016-09-07T09:53:02.686+08:00",
    "description" : null,
    "id" : 2,
    "invoice_address" : null,
    "item_id" : null,
    "item_type" : null,
    "partner_id" : "0a711ec2-aa0a-4249-a327-0dea6ecc2467",
    "rate" : 1.0,
    "source_amount" : "1000.0",
    "source_currency" : "PHP",
    "transaction_hash" : null,
    "updated_at" : "2016-09-07T09:53:02.686+08:00"
  },
  {
    "amount_in_php" : 45000.0,
    "target_currency" : "PHP",
    "target_amount" : 45000.0,
    "balance" : 45000.0,
    "created_at" : "2016-09-07T09:53:02.678+08:00",
    "description" : null,
    "id" : 1,
    "invoice_address" : null,
    "item_id" : null,
    "item_type" : null,
    "partner_id" : "0a711ec2-aa0a-4249-a327-0dea6ecc2467",
    "rate" : 45.0,
    "source_amount" : "1000.0",
    "source_currency" : "USD",
    "transaction_hash" : null,
    "updated_at" : "2016-09-07T09:53:02.678+08:00"
  }
]