Update a specific pledge

PATCH /pledge/{id}

Change the properties of a pledge

Path parameters

  • id integer Required

    Which item to be processed

    Minimum value is 0.

application/json

Body Required

Specify one or more fields and their new values to change it

  • user_id integer

    CORE user id

  • status string

    Current state of the pledge

    Values are active or closed.

  • It this is related to a form entry, then this is the form entry ID

  • Links to the Payment Method

  • If a token is available then the word hidden is returned

  • The date the card expires

  • amount number

    The amount of each pledge that will be processed. i.e. not the total amount of the pledge

  • The type of frequency for this pledge. one is One off. Combine with frequency_count

    Values are one, week, month, or year.

  • The number of times the frequency_type occurs before the next date is identified in the series of pledges e.g. 4 weeks means the pledge is paid every 4 weeks | 1 is available for type one,week,month,year 2 is available for type week 3 is available for type month 4 is available for type week 6 is available for type month

    Values are 1, 2, 4, 3, or 6.

  • The first date of the pledge in local time

  • Optional. The date pledges after which, they should not be processed. If blank, it will auto extend giving 3 years of dates

  • If supplied, must link with a FinanceTagCategory id and have a finance_tags_item_1

  • If supplied, must link with a FinanceTagItem id and have a finance_tags_category_1

  • If supplied, must link with a FinanceTagCategory id and have a finance_tags_item_2

  • If supplied, must link with a FinanceTagItem id and have a finance_tags_category_2

  • Required. Must link to an Accountcode that the user is able to see.

  • If supplied, must link to a Campaign the user can see

  • note string

    If supplied, is the note for this pledge

  • If supplied must link to a valid PledgeDrive

  • If the payment gateway has a fee structure, this is the amount of fees that are part of this pledge

Responses

  • 200 application/json

    Item has been saved successfully

    Hide response attribute Show response attribute object
  • 401 application/json

    Authentication unauthorised

    Hide response attribute Show response attribute object
  • 403 application/json

    Invalid permission

    Hide response attribute Show response attribute object
  • 404 application/json

    Not Found

    Hide response attribute Show response attribute object
PATCH /pledge/{id}
curl \
 -X PATCH https://YOURSITE.infoodle.com/apiv2/pledge/99 \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"user_id":569,"status":"active","form_entry_id":76,"payment_method_id":5,"payment_token":"\\*\\* hidden \\*\\*","card_expiry_date":"2028-01-31","amount":30,"frequency_type":"month","frequency_count":6,"start_date_local":"2017-07-18","last_payment_date_local":"2019-07-18","finance_tags_category_1":5,"finance_tags_item_1":91,"finance_tags_category_2":10,"finance_tags_item_2":14,"accountcode_id":43,"campaign_id":43,"note":"The donor requested a change of timing for this pledge","pledge_drive_id":3,"gateway_fees":0.43}'
Request examples
{
  "user_id": 569,
  "status": "active",
  "form_entry_id": 76,
  "payment_method_id": 5,
  "payment_token": "\\*\\* hidden \\*\\*",
  "card_expiry_date": "2028-01-31",
  "amount": 30,
  "frequency_type": "month",
  "frequency_count": 6,
  "start_date_local": "2017-07-18",
  "last_payment_date_local": "2019-07-18",
  "finance_tags_category_1": 5,
  "finance_tags_item_1": 91,
  "finance_tags_category_2": 10,
  "finance_tags_item_2": 14,
  "accountcode_id": 43,
  "campaign_id": 43,
  "note": "The donor requested a change of timing for this pledge",
  "pledge_drive_id": 3,
  "gateway_fees": 0.43
}
Response examples (200)
{
  "id": 4325342
}
Response examples (401)
{
  "error": "Unauthorised"
}
Response examples (403)
{
  "error": "Invalid Permission"
}
Response examples (404)
{
  "error": "Not Found"
}