{"_id":"571f73e3e2b7000e0091c5ce","parentDoc":null,"category":{"_id":"571f73cfcb4baa0e00d13a80","project":"571f5e8cd8667f0e00a3c498","version":"571f5e8cd8667f0e00a3c49b","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-04-26T13:57:35.810Z","from_sync":false,"order":2,"slug":"form-prepopulation","title":"Form-Prepopulation-API"},"user":"571f5e46d8e3cf1900762b33","__v":15,"project":"571f5e8cd8667f0e00a3c498","version":{"_id":"571f5e8cd8667f0e00a3c49b","hasDoc":true,"__v":12,"hasReference":true,"project":"571f5e8cd8667f0e00a3c498","createdAt":"2016-04-26T12:26:52.312Z","releaseDate":"2016-04-26T12:26:52.312Z","categories":["571f5e8cd8667f0e00a3c49c","571f73cfcb4baa0e00d13a80","571f7451cb4baa0e00d13a88","571f7d2720695f3400f38797","571f7fb0ac2a080e0014c661","571f884be54f2d0e003ebb0a","572200c9ecb38d0e00d80ebd","572c301e7c8eff0e00aaa174","57df91b2c6348d0e0020c452","57e104db9ff1e21900a721ab","57fd04caeaa77f19008b8202","5899c7113514ce0f0014da84"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-04-26T13:57:55.260Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"How to prepopulate form values with GET parameter?\"\n}\n[/block]\nAll fields of the payment form can be prepopulated. The following parameters can be appended to the corresponding url. These variables can be appended to the javascript embed code or directly to the url address.\n[block:callout]\n{\n  \"type\": \"success\",\n  \"title\": \"This API is available in all FundraisingBox plans.\",\n  \"body\": \"\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Fieldnames and values\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Values\",\n    \"h-2\": \"Description\",\n    \"2-0\": \"first_name\",\n    \"2-1\": \"Varchar(100)\",\n    \"2-2\": \"\",\n    \"3-0\": \"last_name\",\n    \"3-1\": \"Varchar(100)\",\n    \"4-1\": \"Varchar(100)\",\n    \"3-2\": \"\",\n    \"4-2\": \"\",\n    \"4-0\": \"company_name\",\n    \"5-0\": \"address\",\n    \"6-0\": \"post_code\",\n    \"7-0\": \"city\",\n    \"9-0\": \"email\",\n    \"10-0\": \"phone\",\n    \"11-0\": \"amount\",\n    \"13-0\": \"wants_receipt\",\n    \"14-0\": \"message\",\n    \"17-0\": \"wants_newsletter\",\n    \"20-0\": \"birthday\",\n    \"21-0\": \"fb_item_id\",\n    \"22-0\": \"fb_item_id_fix\",\n    \"23-0\": \"person_custom_field_ID\",\n    \"24-0\": \"donation_custom_field_ID\",\n    \"25-0\": \"payment_method\",\n    \"5-1\": \"Varchar(300)\",\n    \"6-1\": \"Varchar(10)\",\n    \"7-1\": \"Varchar(100)\",\n    \"9-1\": \"Varchar(100)\",\n    \"10-1\": \"Varchar(100)\",\n    \"11-1\": \"Float\",\n    \"13-1\": \"no_receipt | receipt_now | receipt_end_of_year\",\n    \"14-1\": \"Varchar(500)\",\n    \"17-1\": \"0 | 1\",\n    \"20-1\": \"Dateformat YYYY-MM-DD\",\n    \"21-1\": \"Integer\",\n    \"22-1\": \"Integer\",\n    \"23-1\": \"Mixed (depends on the custom field type)\",\n    \"24-1\": \"Mixed (depends on the custom field type)\",\n    \"25-1\": \"direct_debit | sepa_direct_debit | micropayment_direct_debit | bfs_direct_debit | paypal | sofortueberweisung | micropayment_credit_card | cubits | eps\",\n    \"5-2\": \"\",\n    \"6-2\": \"\",\n    \"7-2\": \"\",\n    \"9-2\": \"\",\n    \"10-2\": \"\",\n    \"11-2\": \"Without currency symbols, e.g. 5.50\",\n    \"13-2\": \"\",\n    \"14-2\": \"\",\n    \"17-2\": \"\",\n    \"20-2\": \"\",\n    \"21-2\": \"Item ids can be found in “settings”>”Donation form”>”Spread”>”Item Dropdown”,\\nItem selection is shown and item is preselected,\\nItem has to be visible in the form.\",\n    \"22-2\": \"Item selection is hidden and item name is shown\\nSpecial case: Item has NOT to be visible in the form.\",\n    \"23-2\": \"Custom field ids can be found in “settings”>”Custom fields”.\\nCustom field has to be added to the form.\\nExample: to prepopulate the custom field with ID “123“ with the text “example“ use: “person_custom_field_123=example“\",\n    \"24-2\": \"Custom field ids can be found in “settings”>”Custom fields”.\\nCustom field has to be added to the form.\\nExample: to prepopulate the custom field with ID “123“ with the text “example“ use: “donation_custom_field_123=example“\",\n    \"25-2\": \"\",\n    \"18-1\": \"0 | 1\",\n    \"19-1\": \"0 | 1\",\n    \"18-0\": \"is_terms_accepted\",\n    \"19-0\": \"is_privacy_accepted\",\n    \"15-0\": \"public_name\",\n    \"16-0\": \"public_message\",\n    \"15-1\": \"Varchar(100)\",\n    \"16-1\": \"Varchar(1000)\",\n    \"8-2\": \"Set default country in dropdown, e.g. \\\"DE\\\" for \\\"Germany\\\"\",\n    \"8-1\": \"2-letter ISO 3166 country code in uppercase\",\n    \"8-0\": \"country\",\n    \"0-0\": \"salutation\",\n    \"0-1\": \"Mr. | Mrs.\",\n    \"1-0\": \"title\",\n    \"1-1\": \"Varchar(50)\",\n    \"12-0\": \"interval\",\n    \"12-1\": \"0 | 1 | 3 | 6 | 12\",\n    \"12-2\": \"once, monthly, quarterly, half-yearly, yearly\"\n  },\n  \"cols\": 3,\n  \"rows\": 26\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Non editable prepopulation\"\n}\n[/block]\nIf you do not want that the prepopulated field is editable add a \"_fix\" to the parameter. \nFor example: \"first_name_fix\", \"amount_fix\", \"donation_custom_field_123_fix\".\n\n**Attention:** fixing values will prevent the donor to change or correct values. Use it with care.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Session-API\",\n  \"body\": \"You can use also the Session API for form value prepopulation. This offers you various advantages.\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\"\n}\n[/block]","excerpt":"Form-Prepopulation-API","slug":"form-prepopulation-api","type":"basic","title":"Introduction"}

Introduction

Form-Prepopulation-API

[block:api-header] { "type": "basic", "title": "How to prepopulate form values with GET parameter?" } [/block] All fields of the payment form can be prepopulated. The following parameters can be appended to the corresponding url. These variables can be appended to the javascript embed code or directly to the url address. [block:callout] { "type": "success", "title": "This API is available in all FundraisingBox plans.", "body": "" } [/block] [block:api-header] { "type": "basic", "title": "Fieldnames and values" } [/block] [block:parameters] { "data": { "h-0": "Name", "h-1": "Values", "h-2": "Description", "2-0": "first_name", "2-1": "Varchar(100)", "2-2": "", "3-0": "last_name", "3-1": "Varchar(100)", "4-1": "Varchar(100)", "3-2": "", "4-2": "", "4-0": "company_name", "5-0": "address", "6-0": "post_code", "7-0": "city", "9-0": "email", "10-0": "phone", "11-0": "amount", "13-0": "wants_receipt", "14-0": "message", "17-0": "wants_newsletter", "20-0": "birthday", "21-0": "fb_item_id", "22-0": "fb_item_id_fix", "23-0": "person_custom_field_ID", "24-0": "donation_custom_field_ID", "25-0": "payment_method", "5-1": "Varchar(300)", "6-1": "Varchar(10)", "7-1": "Varchar(100)", "9-1": "Varchar(100)", "10-1": "Varchar(100)", "11-1": "Float", "13-1": "no_receipt | receipt_now | receipt_end_of_year", "14-1": "Varchar(500)", "17-1": "0 | 1", "20-1": "Dateformat YYYY-MM-DD", "21-1": "Integer", "22-1": "Integer", "23-1": "Mixed (depends on the custom field type)", "24-1": "Mixed (depends on the custom field type)", "25-1": "direct_debit | sepa_direct_debit | micropayment_direct_debit | bfs_direct_debit | paypal | sofortueberweisung | micropayment_credit_card | cubits | eps", "5-2": "", "6-2": "", "7-2": "", "9-2": "", "10-2": "", "11-2": "Without currency symbols, e.g. 5.50", "13-2": "", "14-2": "", "17-2": "", "20-2": "", "21-2": "Item ids can be found in “settings”>”Donation form”>”Spread”>”Item Dropdown”,\nItem selection is shown and item is preselected,\nItem has to be visible in the form.", "22-2": "Item selection is hidden and item name is shown\nSpecial case: Item has NOT to be visible in the form.", "23-2": "Custom field ids can be found in “settings”>”Custom fields”.\nCustom field has to be added to the form.\nExample: to prepopulate the custom field with ID “123“ with the text “example“ use: “person_custom_field_123=example“", "24-2": "Custom field ids can be found in “settings”>”Custom fields”.\nCustom field has to be added to the form.\nExample: to prepopulate the custom field with ID “123“ with the text “example“ use: “donation_custom_field_123=example“", "25-2": "", "18-1": "0 | 1", "19-1": "0 | 1", "18-0": "is_terms_accepted", "19-0": "is_privacy_accepted", "15-0": "public_name", "16-0": "public_message", "15-1": "Varchar(100)", "16-1": "Varchar(1000)", "8-2": "Set default country in dropdown, e.g. \"DE\" for \"Germany\"", "8-1": "2-letter ISO 3166 country code in uppercase", "8-0": "country", "0-0": "salutation", "0-1": "Mr. | Mrs.", "1-0": "title", "1-1": "Varchar(50)", "12-0": "interval", "12-1": "0 | 1 | 3 | 6 | 12", "12-2": "once, monthly, quarterly, half-yearly, yearly" }, "cols": 3, "rows": 26 } [/block] [block:api-header] { "type": "basic", "title": "Non editable prepopulation" } [/block] If you do not want that the prepopulated field is editable add a "_fix" to the parameter. For example: "first_name_fix", "amount_fix", "donation_custom_field_123_fix". **Attention:** fixing values will prevent the donor to change or correct values. Use it with care. [block:callout] { "type": "info", "title": "Session-API", "body": "You can use also the Session API for form value prepopulation. This offers you various advantages." } [/block] [block:api-header] { "type": "basic" } [/block]