【问题标题】:Square Connect API V2 ListCustomers not returning all customersSquare Connect API V2 ListCustomers 未返回所有客户
【发布时间】:2018-01-23 03:54:17
【问题描述】:

我正在使用 Square Connect API V2 尝试做一些非常简单的事情:列出我的所有客户。从我的 Square 仪表板中,我可以看到我有大约 8k 客户,但是在使用 ListCustomers 端点时,我只收到 151 个。查看我的电话,看起来我从我的第一个请求中只得到一个分页 cursor,但没有此后。供参考,以下是相关代码:

def get_customers(api, cursor=None):
    customers = {}
    count = 0
    while cursor or count == 0:
        response = api.list_customers(cursor=cursor)
        cursor = response.cursor
        customers[count] = response.customers
        count += 1
    return customers

151 与 8k 是一个巨大的差异,使这个调用毫无用处。这是 ListCustomers 不返回所有客户的已知行为吗?

编辑:进一步挖掘,我发现 Square 将客户分为“由 Square 创建”和“由您创建”的客户。 ListCustomers 端点似乎只返回“由您创建”的客户,而我的绝大多数客户都是由 Square 创建的。因此,为了细化这个问题,我如何才能从 Connect API v2 返回所有客户,包括由 Square 创建的客户?

【问题讨论】:

    标签: python square square-connect


    【解决方案1】:

    要回答您的编辑,您不能。 ListCustomers 端点只会返回您通过 CreateCustomer 或在 Square 应用中添加到 Square 帐户的客户。

    【讨论】:

    • 这背后有可靠的理由吗?我正在使用的系统一直将这一切委托给 Square。与此同时,我已经使用卡指纹构建了一个解决方法,这很有帮助,但能够访问 Square 一直在创建的所有客户仍然会很好。无论如何感谢您的及时答复!
    • 有一些关于客户隐私的一般推理(您是否希望商家在您刷卡时拥有您的电子邮件/电话号码),但这是一个积极考虑改变的领域。跨度>
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多