Donations

Create a donation

Changed on

Creates a donation from given data

post/api/v2/donations

Request

  • Base URL
    https://yournation.nationbuilder.com
  • Auth
    HTTP bearer

Request body

Example request

{
  "data": {
    "type": "donations",
    "attributes": {
      "actblue_order_number": "123abc",
      "amount_in_cents": 500,
      "canceled_at": "2019-10-26T10:00:00-04:00",
      "check_number": "1001",
      "custom_values": {
        "custom_text": "Text Value",
        "custom_number": "22",
        "custom_checkbox": true,
        "custom_multi": "Some multiple choice option"
      },
      "donation_tracking_code_id": "1",
      "email": "donor@gmail.com",
      "employer": "Wild Horse Co.",
      "external_id": "ext-123",
      "failed_at": "2019-10-26T10:00:00-04:00",
      "first_name": "Lucy",
      "last_name": "Butler",
      "mailing_id": "1",
      "membership_id": "1",
      "middle_name": "Octavia",
      "note": "Dedicated to Lucy",
      "occupation": "Postal Carrier",
      "page_id": "1",
      "payment_type_id": "1",
      "payment_type_name": "Cash",
      "pending_at": "2019-10-26T10:00:00-04:00",
      "pledge_id": "1",
      "recurring_donation_id": "1",
      "signup_id": "1",
      "succeeded_at": "2019-10-26T10:00:00-04:00",
      "billing_address_attributes": {
        "address1": "20 W 34th St.",
        "address2": "Suite 100",
        "address3": null,
        "city": "New York",
        "state": "NY",
        "zip": "10001",
        "county": "New York County",
        "country_code": "US",
        "lat": "40.7484",
        "lng": "73.9857",
        "fips": "04",
        "submitted_address": "20 W 34th St. Suite 100, New York, NY 10001",
        "distance": 0,
        "import_id": "2",
        "work_phone": "5555555555",
        "phone_number": "5555555555",
        "phone_country_code": "1",
        "work_phone_number": "5555555555",
        "delete": true
      },
      "work_address_attributes": {
        "address1": "20 W 34th St.",
        "address2": "Suite 100",
        "address3": null,
        "city": "New York",
        "state": "NY",
        "zip": "10001",
        "county": "New York County",
        "country_code": "US",
        "lat": "40.7484",
        "lng": "73.9857",
        "fips": "04",
        "submitted_address": "20 W 34th St. Suite 100, New York, NY 10001",
        "distance": 0,
        "import_id": "2",
        "work_phone": "5555555555",
        "phone_number": "5555555555",
        "phone_country_code": "1",
        "work_phone_number": "5555555555",
        "delete": true
      }
    }
  }
}

Response

The newly created donation.

metaobject

Non-standard information about the document. Empty unless the endpoint has metadata to convey.

Example response

{
  "data": {
    "id": "1",
    "type": "donations",
    "attributes": {
      "actblue_order_number": "123abc",
      "amount_in_cents": 500,
      "canceled_at": "2019-10-26T10:00:00-04:00",
      "check_number": "1001",
      "custom_values": {
        "custom_text": "Text Value",
        "custom_number": "22",
        "custom_checkbox": true,
        "custom_multi": "Some multiple choice option"
      },
      "donation_tracking_code_id": "1",
      "email": "donor@gmail.com",
      "employer": "Wild Horse Co.",
      "external_id": "ext-123",
      "failed_at": "2019-10-26T10:00:00-04:00",
      "first_name": "Lucy",
      "last_name": "Butler",
      "mailing_id": "1",
      "membership_id": "1",
      "middle_name": "Octavia",
      "note": "Dedicated to Lucy",
      "occupation": "Postal Carrier",
      "page_id": "1",
      "payment_type_id": "1",
      "payment_type_name": "Cash",
      "pending_at": "2019-10-26T10:00:00-04:00",
      "pledge_id": "1",
      "recurring_donation_id": "1",
      "signup_id": "1",
      "succeeded_at": "2019-10-26T10:00:00-04:00",
      "amount": "5.00",
      "created_at": "2019-10-26T10:00:00-04:00",
      "import_id": "1",
      "payout_id": "po_abc123",
      "status": "succeeded",
      "updated_at": "2019-10-26T10:00:00-04:00"
    }
  },
  "included": [
    {
      "id": "1"
    }
  ]
}

Changes

    • breaking

      added subschema #2 to the request body allOf list

    • breaking

      the request's body type changed from object to no type

    • breaking

      the response's body type changed from object to no type for status

    • breaking

      removed the required property from the response with the status

    • warning

      removed the request property

    • info

      added the new optional query request parameter extra_fields[donations] to all path's operations

    • info

      added the media type application/vnd.api+json to the request body

    • info

      added subschema #2 to the response body allOf list for the response status

    • info

      media type application/json was changed to a more specific media type application/vnd.api+json for the response status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • warning

      removed the optional property ////// from the response with the status

    • info

      added the new optional request property //////

    • info

      added the new optional request property //////

    • info

      added the optional property ////// to the response with the status

    • info

      added the optional property ////// to the response with the status

    • info

      added the optional property ////// to the response with the status