7.9. Topping up credits

A 3rd-party system may top up credits for its connected companies. This is an alternative to companies buying the credits themselves.

Especially useful for 3rd-party system which already have regular monthly billing in place and would like to seamlessly support Bill of lading document transfer for their clients.

CargoX will issue a monthly invoice for the topped up credits to the 3rd-party system.

To top up 120 credits for a company with an ID 42:

curl -X POST \
   -H 'Authorization: Bearer 3gjCob2ryo6WvYQtmAuwwEBfuvQkrr' \
   -H 'Content-Type: application/json' \
   --data "{ \"credits\": 120, \"request_id\": \"$(date +%s)\" }"
  "credits": 0,
  "pending_credits": 120


Credit topup is a blockchain operation. As such, it takes time to complete successfully. The company will recieve the credits at the time the next blockchain record is created.

As such, Pending credits represents the credits that have been added to the account but not yet recorded on the blockchain.