Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to get the pledge status using field option in api_client.fetch_page_of_pledges() #40

Open
morgolock opened this issue May 10, 2023 · 0 comments

Comments

@morgolock
Copy link

Hi, I'm having trouble to get the optional fields from the pledges. I need to get status see https://docs.patreon.com/#pledge

  "type": "pledge"
  "id": <string>
  "attributes": {
    "amount_cents": <int> // Amount cents in the currency used by the patron
    "created_at": <date>
    "currency": <string> // Currency code of the pledge event (USD, GBP, EUR etc.)
    "declined_since": <date>
    "patron_pays_fees": <bool>
    "pledge_cap_cents": <int>
    // optional properties
    "total_historical_amount_cents": <int>
    "is_paused": <bool>
    "status": <string> // The status of this pledge (valid, declined, pending, disabled)
    "has_shipping_address": <bool>
  }
  "relationships": {
    "patron": ...<user>...
    "reward": ...<reward>... // Tier associated with this pledge
    "creator": ...<user>...
    "address": ...<address>...
  }
}

Is this supported in the python api? what I am supposed to pass into the function fetch_page_of_pledges to retrieve the status ? It seems to expect a dictionary? I tried many things but I cannot seem to get the pledge status

Would you please help and clarify what I should pass to the function below to get the pledge status?

       pledges_response = api_client.fetch_page_of_pledges(campaign.id(), 25, cursor=cursor,fields='status'})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant