支付手段

GET accounts/:account_id/funding_instruments

检索与当前账号关联的部分或所有支付手段的详细信息。

资源 URL

https://ads-api.twitter.com/10/accounts/:account_id/funding_instruments

参数

名称 说明
account_id
必需

所使用账号的标识符。出现在资源路径中,通常是所有广告商 API 请求的必要参数,不包含 GET accounts。指定账号必须与已验证的用户关联。

类型:string

示例:18ce54d4x5t

count
可选

指定每个不同请求尝试检索的记录数量。

类型:int

默认值:200
最小值、最大值:11000
cursor
可选

指定光标以获取下一页结果。参阅分页了解更多信息。

类型:string

示例:8x7v00oow

funding_instrument_ids
可选

通过指定以逗号分隔的标识符列表,将响应范围限定为所需的支付手段。最多可提供 200 个 ID。

类型:string

示例:lygyi

sort_by
可选

根据支持的属性,按升序或降序排序。参阅排序了解更多信息。

类型:string

示例:created_at-asc

with_deleted
可选

在请求中包含已删除的结果。

类型:boolean

默认值:false
可能值:truefalse
with_total_count
可选

包含 total_count 响应属性。

注意:不包含此参数和 cursor

注意:包含 total_count 的请求速率限制较低,目前设置为每 15 分钟 200 次。

类型:boolean

默认值:false
可能值:truefalse

请求示例

GET https://ads-api.twitter.com/10/accounts/18ce54d4x5t/funding_instruments

响应示例

{
  "request": {
    "params": {
      "account_id": "18ce54d4x5t"
    }
  },
  "next_cursor": null,
  "data": [
    {
      "start_time": "2016-07-22T04:24:04Z",
      "description": "Visa ending in 0650",
      "credit_limit_local_micro": 200000000,
      "end_time": null,
      "id": "lygyi",
      "entity_status": "ACTIVE",
      "account_id": "18ce54d4x5t",
      "reasons_not_able_to_fund": [],
      "io_header": null,
      "currency": "USD",
      "funded_amount_local_micro": 645940000,
      "created_at": "2016-07-22T04:24:04Z",
      "type": "CREDIT_CARD",
      "able_to_fund": true,
      "updated_at": "2017-04-05T00:25:13Z",
      "credit_remaining_local_micro": null,
      "deleted": false
    }
  ]
}

GET accounts/:account_id/funding_instruments/:funding_instrument_id

检索与当前账号关联的特定支付手段。

资源 URL

https://ads-api.twitter.com/10/accounts/:account_id/funding_instruments/:id

参数

名称 说明
account_id
必需

所使用账号的标识符。出现在资源路径中,通常是所有广告商 API 请求的必要参数,不包含 GET accounts。指定账号必须与已验证的用户关联。

类型:string

示例:18ce54d4x5t

funding_instrument_id
必需

请求中对正在操作的支付手段的引用。

类型:string

示例:lygyi

with_deleted
可选

在请求中包含已删除的结果。

类型:boolean

默认值:false
可能值:truefalse

请求示例

GET https://ads-api.twitter.com/10/accounts/18ce54d4x5t/funding_instruments/lygyi

响应示例

{
  "request": {
    "params": {
      "funding_instrument_id": "lygyi",
      "account_id": "18ce54d4x5t"
    }
  },
  "data": {
    "start_time": "2016-07-22T04:24:04Z",
    "description": "Visa ending in 0650",
    "credit_limit_local_micro": 200000000,
    "end_time": null,
    "id": "lygyi",
    "entity_status": "ACTIVE",
    "account_id": "18ce54d4x5t",
    "reasons_not_able_to_fund": [],
    "io_header": null,
    "currency": "USD",
    "funded_amount_local_micro": 645940000,
    "created_at": "2016-07-22T04:24:04Z",
    "type": "CREDIT_CARD",
    "able_to_fund": true,
    "updated_at": "2017-04-05T00:25:13Z",
    "credit_remaining_local_micro": null,
    "deleted": false
  }
}

POST accounts/:account_id/funding_instruments

仅限沙盒

在沙盒环境中创建支付手段。

使用沙盒支付手段不存在产生成本的风险。

资源 URL

https://ads-api-sandbox.twitter.com/10/accounts/:account_id/funding_instruments

参数

名称 说明
account_id
必需

所使用账号的标识符。出现在资源路径中,通常是所有广告商 API 请求的必要参数,不包含 GET accounts。指定账号必须与已验证的用户关联。

类型:string

示例:gq1844

currency
必需

货币,以 ISO-4217 表示。

类型:string

示例:USD

start_time
必需

支付手段生效并可用的日期,以 ISO 8601 表示。

类型:string

示例:2017-05-19T07:00:00Z

type
必需

要创建的支付手段类型。

类型:enum

可能值:AGENCY_CREDIT_LINECREDIT_CARDCREDIT_LINEINSERTION_ORDERPARTNER_MANAGED

end_time
有时为必需

支付手段停用日期,以 ISO 8601 表示。

类型:string

示例:2017-05-26T07:00:00Z

credit_limit_local_micro
可选

针对此支付手段可用的总信用额。

注意:仅适用于部分支付手段类型。

类型:long

示例:37500000

funded_amount_local_micro
可选

分配给此支付手段的总预算金额。

注意:仅适用于部分支付手段类型。

类型:long

示例:37500000

请求示例

POST https://ads-api-sandbox.twitter.com/10/accounts/gq1844/funding_instruments?currency=USD&start_time=2017-07-10T00:00:00Z&type=INSERTION_ORDER&end_time=2018-01-10T00:00:00Z&funded_amount_local_micro=140000000000

响应示例

{
  "data": {
    "start_time": "2017-07-10T00:00:00Z",
    "description": "(no payment method has been set up yet)",
    "credit_limit_local_micro": null,
    "end_time": "2018-01-10T00:00:00Z",
    "id": "hxtet",
    "entity_status": "ACTIVE",
    "account_id": "gq1844",
    "reasons_not_able_to_fund": [],
    "io_header": null,
    "currency": "USD",
    "funded_amount_local_micro": 140000000000,
    "created_at": "2017-09-09T05:23:28Z",
    "type": "INSERTION_ORDER",
    "able_to_fund": true,
    "updated_at": "2017-09-09T05:23:28Z",
    "credit_remaining_local_micro": null,
    "deleted": false
  },
  "request": {
    "params": {
      "start_time": "2017-07-10T00:00:00Z",
      "end_time": "2018-01-10T00:00:00Z",
      "account_id": "gq1844",
      "currency": "USD",
      "funded_amount_local_micro": 140000000000,
      "type": "INSERTION_ORDER"
    }
  }
}

DELETE accounts/:account_id/funding_instruments/:funding_instrument_id

仅限沙盒

在沙盒环境中删除支付手段。

资源 URL

https://ads-api-sandbox.twitter.com/10/accounts/:account_id/funding_instruments/:funding_instrument_id

参数

名称 说明
account_id
必需

所使用账号的标识符。出现在资源路径中,通常是所有广告商 API 请求的必要参数,不包含 GET accounts。指定账号必须与已验证的用户关联。

类型:string

示例:gq1844

funding_instrument_id
必需

请求中对正在操作的支付手段的引用。

类型:string

示例:hxt82

请求示例

DELETE https://ads-api-sandbox.twitter.com/10/accounts/gq1844/funding_instruments/hxt82

响应示例

{
  "data": {
    "start_time": "2017-08-30T19:23:47Z",
    "description": "(no payment method has been set up yet)",
    "credit_limit_local_micro": 500000000,
    "end_time": null,
    "id": "hxt82",
    "entity_status": "ACTIVE",
    "account_id": "gq1844",
    "reasons_not_able_to_fund": [
      "DELETED"
    ],
    "io_header": null,
    "currency": "USD",
    "funded_amount_local_micro": null,
    "created_at": "2017-08-30T19:23:47Z",
    "type": "CREDIT_CARD",
    "able_to_fund": false,
    "updated_at": "2017-09-09T02:08:30Z",
    "credit_remaining_local_micro": null,
    "deleted": true
  },
  "request": {
    "params": {
      "funding_instrument_id": "hxt82",
      "account_id": "gq1844"
    }
  }
}