GET /api/v1/vendors/:vendor_api_token/credits/:id
VENDORS: Retrieve a credit address, its rate, and effectivity

Vendors who have enabled the credit program on their accounts will be able to pre-pay their remittances by sending BTC to dynamically-generated credit addresses with a rate that is locked in for 10 minutes. The BTC is immediately converted to PHP and stored as credit under their account. Each time the vendor creates a new remittance, the PHP amount is drawn from the credit, and is no longer invoiced. In this manner, Vendors may optimize their cashflow by sending BTC when rates are optimal and locking in its peso value.

Supported Formats

json

Examples

{
  "id": 1,
  "vendor_id": 1,
  "invoice_address": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "refreshed_at": "2016-05-03T10:11:18.554+08:00",
  "effective_rate": 20355.0018,
  "credits": [
    0
  ]
}

Params

Param name Description
id
optional

Validations:

  • Must be a Integer


POST /api/v1/vendors/:vendor_api_token/credits
VENDORS: Create a new address and get a new rate

Create a new credit address with a new locked-in rate that you can send BTC to. Note that this doesn't invalidate any older credit addresses so it's the vendor's responsibility to keep track of which address has the rate you wish to follow.

Supported Formats

json

Examples

{
  "id": 1,
  "vendor_id": 1,
  "invoice_address": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "refreshed_at": "2016-05-03T10:11:18.554+08:00",
  "effective_rate": 20355.0018,
  "credits": [
    0
  ]
}

GET /api/v1/vendors/:vendor_api_token/credits
VENDORS: Show a list of credit transactions

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'.

Supported Formats

json

Examples

[
  {
    "vendor_id": 1,
    "amount_in_btc": 0.00029487,
    "amount_in_php": 6.001400295156,
    "effective_rate": 20352.6988,
    "balance": 60.999800197324,
    "notes": null,
    "invoice_address": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "consumed": false,
    "created_at": "2016-05-03T10:36:34.367+08:00"
  },
  {
    "vendor_id": 1,
    "amount_in_btc": 0.00029487,
    "amount_in_php": 6.001400295156,
    "effective_rate": 20352.6988,
    "balance": 60.999800197324,
    "notes": null,
    "invoice_address": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "consumed": false,
    "created_at": "2016-05-03T10:36:34.367+08:00"
  }
]