How to get the "Remaining Budget" by Ads API like Ads UI?


#1

We tried to find it in the response of funding_instruments API,
but the field credit_remaining_local_micro may referring to it
gets the “null”…

$ twurl -H "ads-api.twitter.com" -XGET "/3/accounts/18ce54nehwo/funding_instruments" | jq .
{
  "request": {
    "params": {
      "account_id": "18ce54nehwo"
    }
  },
  "next_cursor": null,
  "data": [
    {
      "start_time": "2018-02-07T15:00:00Z",
      "description": "hottolink_pr_ad_2018",
      "credit_limit_local_micro": null,
      "end_time": "2018-07-31T14:59:59Z",
      "id": "qrxk8",
      "entity_status": "ACTIVE",
      "account_id": "18ce54nehwo",
      "reasons_not_able_to_fund": [],
      "io_header": "T1076435",
      "currency": "JPY",
      "funded_amount_local_micro": 400000000000,
      "created_at": "2018-02-06T04:34:16Z",
      "type": "INSERTION_ORDER",
      "able_to_fund": true,
      "updated_at": "2018-02-06T04:34:16Z",
      "credit_remaining_local_micro": null,
      "deleted": false
    }
  ]
}

#2

Not exactly sure how ads.twitter.com calculates that, but I imagine you would want to look at funded_amount_local_micro and subtract out the amount that has already been spend on the funding instrument.


#3

@juanshishido

Thanks for the answer.

How to get the amount that has already been spend on the funding instrument easily?

credit_remaining_local_micro get null in the response.