Chilkat Online Tools

Swift / New FreshBooks / Create Single Proposal w/ Sections, Logos, and E-signature

Back to Collection Items

func chilkatTest() {
    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    let http = CkoHttp()
    var success: Bool

    // Use this online tool to generate code from sample JSON: Generate Code to Create JSON

    // The following JSON is sent in the request body.

    // {
    //   "estimate": {
    //     "rich_proposal": true,
    //     "require_client_signature": true,
    //     "create_date": "2019-07-16",
    //     "currency_code": "CAD",
    //     "discount_value": 0,
    //     "estimate_number": "0000044",
    //     "template": "clean-grouped",
    //     "terms": "Cupcake ipsum dolor sit amet. Pudding candy cupcake wafer. Apple pie pie candy canes soufflé gummies muffin icing sweet roll. Fruitcake gummies croissant chocolate cake sugar plum chocolate bar. Bonbon jelly-o lemon drops candy jujubes chupa chups gingerbread. Powder jelly tart cotton candy chocolate bar fruitcake cotton candy dragée. Tart sugar plum bear claw sesame snaps. Dragée jelly beans candy canes. Powder pie gingerbread jelly croissant sesame snaps icing gummies jelly beans. Cotton candy jelly beans gummi bears sweet sesame snaps jujubes sesame snaps carrot cake. Pastry lemon drops muffin halvah cake dessert gummies tootsie roll soufflé. Cotton candy sesame snaps dessert ice cream. Topping jujubes oat cake bear claw liquorice bear claw chocolate bar ice cream sesame snaps. Cake pudding tiramisu topping sesame snaps croissant candy sesame snaps tootsie roll. Danish lemon drops tart muffin. Chocolate bar toffee icing tiramisu danish ice cream sweet roll pastry.",
    //     "payment_details": null,
    //     "vat_name": null,
    //     "vat_number": null,
    //     "attachments": [
    //     ],
    //     "lines": [
    //       {
    //         "compounded_tax": false,
    //         "taskno": null,
    //         "amount": {
    //           "amount": "100",
    //           "code": "CAD"
    //         },
    //         "description": "",
    //         "expenseid": null,
    //         "taxName1": "HST",
    //         "taxAmount1": 13,
    //         "name": "Item One",
    //         "qty": 1,
    //         "taxName2": null,
    //         "taxAmount2": null,
    //         "type": null,
    //         "unit_cost": {
    //           "amount": "100",
    //           "code": "CAD"
    //         },
    //         "estimateid": null
    //       },
    //       {
    //         "compounded_tax": false,
    //         "amount": {
    //           "amount": "200",
    //           "code": "CAD"
    //         },
    //         "description": "",
    //         "expenseid": null,
    //         "taxName1": "HST",
    //         "taxAmount1": 13,
    //         "name": "Item Two",
    //         "qty": 1,
    //         "taxName2": null,
    //         "taxAmount2": null,
    //         "unit_cost": {
    //           "amount": "200",
    //           "code": "CAD"
    //         },
    //         "estimateid": null
    //       },
    //       {
    //         "compounded_tax": false,
    //         "amount": {
    //           "amount": "300",
    //           "code": "CAD"
    //         },
    //         "description": "",
    //         "expenseid": null,
    //         "taxName1": null,
    //         "taxAmount1": null,
    //         "name": "Item Three",
    //         "qty": 1,
    //         "taxName2": null,
    //         "taxAmount2": null,
    //         "unit_cost": {
    //           "amount": "300",
    //           "code": "CAD"
    //         },
    //         "estimateid": null
    //       }
    //     ],
    //     "presentation": {
    //       "theme_font_name": "classic",
    //       "theme_primary_color": "#1460aa",
    //       "theme_layout": "simple",
    //       "date_format": "mm/dd/yyyy",
    //       "image_banner_position_y": -83,
    //       "image_logo_src": "/service/uploads/images/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjozMTg1OTUwLCJvcmlnaW5hbF9maWxlbmFtZSI6ImdhdmVscGljLmpwZWciLCJidWNrZXQiOiJ1cGxvYWRzIiwiZmlsZW5hbWUiOiJ1cGxvYWQtYTZmNzY3M2VhN2VjMmYwYjEzODNlOTg5MTc1NDFjMGIyOWE0MmUyOCIsImxlbmd0aCI6MzIzNiwia2V5IjoiJ2RvY3MtJy0zMTg1OTUwL3VwbG9hZC1hNmY3NjczZWE3ZWMyZjBiMTM4M2U5ODkxNzU0MWMwYjI5YTQyZTI4In0._GITi9SFuSJdGyba0tlOptyAyDA5BIQsGIa4WeGm36c"
    //     },
    //     "sections": [
    //       {
    //         "body": "Squiffy Jack Ketch coxswain plunder fire in the hole bucko trysail topgallant mizzenmast sheet. Nelsons folly hogshead Jack Tar Davy Jones' Locker grog blossom scourge of the seven seas tackle mizzen to go on account deadlights. Jib bilged on her anchor crack Jennys tea cup cog reef matey spike Jack Ketch scurvy landlubber or just lubber. Pinnace shrouds Yellow Jack hands yardarm rutters Arr hearties piracy lookout. Doubloon ye Corsair warp cutlass brigantine reef sails aft hands haul wind. Snow spyglass measured fer yer chains barkadeer no",
    //         "group_name": "top",
    //         "title": "Overview",
    //         "type": "overview"
    //       },
    //       {
    //         "body": "prey, no pay bowsprit pressgang swing the lead squiffy plunder. Six pounders poop deck doubloon driver topmast broadside American Main mutiny Corsair scurvy. Grog blossom lateen sail spike Sail ho man-of-war case shot maroon Nelsons folly quarterdeck Cat o'nine tails. Hogshead overhaul aye prow barkadeer rope's end stern belay code of conduct topgallant. Pieces of Eight American Main dance the hempen jig port rope's end barkadeer bilged on her anchor league Admiral of the Black Brethren of the Coast.",
    //         "group_name": "top",
    //         "title": "Scope of Work",
    //         "type": "scope_of_work"
    //       },
    //       {
    //         "body": "Squiffy trysail lad log boom rigging walk the plank scourge of the seven seas swab. Arr Blimey smartly gangway prow schooner bounty run a rig hardtack. Chandler rope's end rutters heave down jib fire in the hole Plate Fleet cackle fruit squiffy.<br>",
    //         "group_name": "top",
    //         "title": "Timeline",
    //         "type": "timeline"
    //       },
    //       {
    //         "body": "Mizzen capstan trysail sloop execution dock lookout gangway Cat o'nine tails hang the jib bucko. Gun lad salmagundi aye Jolly Roger Brethren of the Coast chase guns smartly plunder galleon. League rutters tender topmast brig hang the jib yardarm plunder shrouds sloop. Jack bucko Sink me quarterdeck lugsail marooned tack reef keel Blimey. Haul wind yardarm blow the man down flogging scuppers aft run a shot across the bow bilge rat Cat o'nine tails lugger. Sheet chandler run a shot across the bow Sail ho aft carouser spanker cutlass crack Jennys tea cup parrel. Pieces of Eight belaying pin Yellow Jack rigging boatswain cutlass loaded to the gunwalls yardarm bounty grog blossom. Hempen halter bilged on her anchor splice the main brace line parrel bilge water lad cable scuppers shrouds. Killick ho lee take a caulk wench line coxswain coffer heave down keel. Line Jack Ketch booty pirate black spot six pounders gibbet yardarm aft lateen sail.",
    //         "group_name": "top",
    //         "title": "Custom Heading",
    //         "type": "custom"
    //       }
    //     ],
    //     "customerid": 123
    //   }
    // }

    let json = CkoJsonObject()
    json.UpdateBool("estimate.rich_proposal", value: true)
    json.UpdateBool("estimate.require_client_signature", value: true)
    json.UpdateString("estimate.create_date", value: "2019-07-16")
    json.UpdateString("estimate.currency_code", value: "CAD")
    json.UpdateInt("estimate.discount_value", value: 0)
    json.UpdateString("estimate.estimate_number", value: "0000044")
    json.UpdateString("estimate.template", value: "clean-grouped")
    json.UpdateString("estimate.terms", value: "Cupcake ipsum dolor sit amet. Pudding candy cupcake wafer. Apple pie pie candy canes soufflé gummies muffin icing sweet roll. Fruitcake gummies croissant chocolate cake sugar plum chocolate bar. Bonbon jelly-o lemon drops candy jujubes chupa chups gingerbread. Powder jelly tart cotton candy chocolate bar fruitcake cotton candy dragée. Tart sugar plum bear claw sesame snaps. Dragée jelly beans candy canes. Powder pie gingerbread jelly croissant sesame snaps icing gummies jelly beans. Cotton candy jelly beans gummi bears sweet sesame snaps jujubes sesame snaps carrot cake. Pastry lemon drops muffin halvah cake dessert gummies tootsie roll soufflé. Cotton candy sesame snaps dessert ice cream. Topping jujubes oat cake bear claw liquorice bear claw chocolate bar ice cream sesame snaps. Cake pudding tiramisu topping sesame snaps croissant candy sesame snaps tootsie roll. Danish lemon drops tart muffin. Chocolate bar toffee icing tiramisu danish ice cream sweet roll pastry.")
    json.UpdateNull("estimate.payment_details")
    json.UpdateNull("estimate.vat_name")
    json.UpdateNull("estimate.vat_number")
    json.UpdateNewArray("estimate.attachments")
    json.UpdateBool("estimate.lines[0].compounded_tax", value: false)
    json.UpdateNull("estimate.lines[0].taskno")
    json.UpdateString("estimate.lines[0].amount.amount", value: "100")
    json.UpdateString("estimate.lines[0].amount.code", value: "CAD")
    json.UpdateString("estimate.lines[0].description", value: "")
    json.UpdateNull("estimate.lines[0].expenseid")
    json.UpdateString("estimate.lines[0].taxName1", value: "HST")
    json.UpdateInt("estimate.lines[0].taxAmount1", value: 13)
    json.UpdateString("estimate.lines[0].name", value: "Item One")
    json.UpdateInt("estimate.lines[0].qty", value: 1)
    json.UpdateNull("estimate.lines[0].taxName2")
    json.UpdateNull("estimate.lines[0].taxAmount2")
    json.UpdateNull("estimate.lines[0].type")
    json.UpdateString("estimate.lines[0].unit_cost.amount", value: "100")
    json.UpdateString("estimate.lines[0].unit_cost.code", value: "CAD")
    json.UpdateNull("estimate.lines[0].estimateid")
    json.UpdateBool("estimate.lines[1].compounded_tax", value: false)
    json.UpdateString("estimate.lines[1].amount.amount", value: "200")
    json.UpdateString("estimate.lines[1].amount.code", value: "CAD")
    json.UpdateString("estimate.lines[1].description", value: "")
    json.UpdateNull("estimate.lines[1].expenseid")
    json.UpdateString("estimate.lines[1].taxName1", value: "HST")
    json.UpdateInt("estimate.lines[1].taxAmount1", value: 13)
    json.UpdateString("estimate.lines[1].name", value: "Item Two")
    json.UpdateInt("estimate.lines[1].qty", value: 1)
    json.UpdateNull("estimate.lines[1].taxName2")
    json.UpdateNull("estimate.lines[1].taxAmount2")
    json.UpdateString("estimate.lines[1].unit_cost.amount", value: "200")
    json.UpdateString("estimate.lines[1].unit_cost.code", value: "CAD")
    json.UpdateNull("estimate.lines[1].estimateid")
    json.UpdateBool("estimate.lines[2].compounded_tax", value: false)
    json.UpdateString("estimate.lines[2].amount.amount", value: "300")
    json.UpdateString("estimate.lines[2].amount.code", value: "CAD")
    json.UpdateString("estimate.lines[2].description", value: "")
    json.UpdateNull("estimate.lines[2].expenseid")
    json.UpdateNull("estimate.lines[2].taxName1")
    json.UpdateNull("estimate.lines[2].taxAmount1")
    json.UpdateString("estimate.lines[2].name", value: "Item Three")
    json.UpdateInt("estimate.lines[2].qty", value: 1)
    json.UpdateNull("estimate.lines[2].taxName2")
    json.UpdateNull("estimate.lines[2].taxAmount2")
    json.UpdateString("estimate.lines[2].unit_cost.amount", value: "300")
    json.UpdateString("estimate.lines[2].unit_cost.code", value: "CAD")
    json.UpdateNull("estimate.lines[2].estimateid")
    json.UpdateString("estimate.presentation.theme_font_name", value: "classic")
    json.UpdateString("estimate.presentation.theme_primary_color", value: "#1460aa")
    json.UpdateString("estimate.presentation.theme_layout", value: "simple")
    json.UpdateString("estimate.presentation.date_format", value: "mm/dd/yyyy")
    json.UpdateInt("estimate.presentation.image_banner_position_y", value: -83)
    json.UpdateString("estimate.presentation.image_logo_src", value: "/service/uploads/images/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjozMTg1OTUwLCJvcmlnaW5hbF9maWxlbmFtZSI6ImdhdmVscGljLmpwZWciLCJidWNrZXQiOiJ1cGxvYWRzIiwiZmlsZW5hbWUiOiJ1cGxvYWQtYTZmNzY3M2VhN2VjMmYwYjEzODNlOTg5MTc1NDFjMGIyOWE0MmUyOCIsImxlbmd0aCI6MzIzNiwia2V5IjoiJ2RvY3MtJy0zMTg1OTUwL3VwbG9hZC1hNmY3NjczZWE3ZWMyZjBiMTM4M2U5ODkxNzU0MWMwYjI5YTQyZTI4In0._GITi9SFuSJdGyba0tlOptyAyDA5BIQsGIa4WeGm36c")
    json.UpdateString("estimate.sections[0].body", value: "Squiffy Jack Ketch coxswain plunder fire in the hole bucko trysail topgallant mizzenmast sheet. Nelsons folly hogshead Jack Tar Davy Jones' Locker grog blossom scourge of the seven seas tackle mizzen to go on account deadlights. Jib bilged on her anchor crack Jennys tea cup cog reef matey spike Jack Ketch scurvy landlubber or just lubber. Pinnace shrouds Yellow Jack hands yardarm rutters Arr hearties piracy lookout. Doubloon ye Corsair warp cutlass brigantine reef sails aft hands haul wind. Snow spyglass measured fer yer chains barkadeer no")
    json.UpdateString("estimate.sections[0].group_name", value: "top")
    json.UpdateString("estimate.sections[0].title", value: "Overview")
    json.UpdateString("estimate.sections[0].type", value: "overview")
    json.UpdateString("estimate.sections[1].body", value: "prey, no pay bowsprit pressgang swing the lead squiffy plunder. Six pounders poop deck doubloon driver topmast broadside American Main mutiny Corsair scurvy. Grog blossom lateen sail spike Sail ho man-of-war case shot maroon Nelsons folly quarterdeck Cat o'nine tails. Hogshead overhaul aye prow barkadeer rope's end stern belay code of conduct topgallant. Pieces of Eight American Main dance the hempen jig port rope's end barkadeer bilged on her anchor league Admiral of the Black Brethren of the Coast.")
    json.UpdateString("estimate.sections[1].group_name", value: "top")
    json.UpdateString("estimate.sections[1].title", value: "Scope of Work")
    json.UpdateString("estimate.sections[1].type", value: "scope_of_work")
    json.UpdateString("estimate.sections[2].body", value: "Squiffy trysail lad log boom rigging walk the plank scourge of the seven seas swab. Arr Blimey smartly gangway prow schooner bounty run a rig hardtack. Chandler rope's end rutters heave down jib fire in the hole Plate Fleet cackle fruit squiffy.<br>")
    json.UpdateString("estimate.sections[2].group_name", value: "top")
    json.UpdateString("estimate.sections[2].title", value: "Timeline")
    json.UpdateString("estimate.sections[2].type", value: "timeline")
    json.UpdateString("estimate.sections[3].body", value: "Mizzen capstan trysail sloop execution dock lookout gangway Cat o'nine tails hang the jib bucko. Gun lad salmagundi aye Jolly Roger Brethren of the Coast chase guns smartly plunder galleon. League rutters tender topmast brig hang the jib yardarm plunder shrouds sloop. Jack bucko Sink me quarterdeck lugsail marooned tack reef keel Blimey. Haul wind yardarm blow the man down flogging scuppers aft run a shot across the bow bilge rat Cat o'nine tails lugger. Sheet chandler run a shot across the bow Sail ho aft carouser spanker cutlass crack Jennys tea cup parrel. Pieces of Eight belaying pin Yellow Jack rigging boatswain cutlass loaded to the gunwalls yardarm bounty grog blossom. Hempen halter bilged on her anchor splice the main brace line parrel bilge water lad cable scuppers shrouds. Killick ho lee take a caulk wench line coxswain coffer heave down keel. Line Jack Ketch booty pirate black spot six pounders gibbet yardarm aft lateen sail.")
    json.UpdateString("estimate.sections[3].group_name", value: "top")
    json.UpdateString("estimate.sections[3].title", value: "Custom Heading")
    json.UpdateString("estimate.sections[3].type", value: "custom")
    json.UpdateInt("estimate.customerid", value: 123)

    // Adds the "Authorization: Bearer <access_token>" header.
    http.AuthToken = "<access_token>"
    http.SetRequestHeader("Content-Type", value: "application/json")

    var resp: CkoHttpResponse? = http.PostJson3("https://api.freshbooks.com/accounting/account/{{accountid}}/estimates/estimates", contentType: "application/json", json: json)
    if http.LastMethodSuccess == false {
        print("\(http.LastErrorText)")
        return
    }

    print("\(resp!.StatusCode.intValue)")
    print("\(resp!.BodyStr)")
    resp = nil

}

Curl Command

curl -X POST
	-H "Authorization: Bearer <access_token>"
	-H "Content-Type: application/json"
	-d '{
    "estimate": {
        "rich_proposal": true,
        "require_client_signature": true,
        "create_date": "2019-07-16",
        "currency_code": "CAD",
        "discount_value": 0,
        "estimate_number": "0000044",
        "template": "clean-grouped",
        "terms": "Cupcake ipsum dolor sit amet. Pudding candy cupcake wafer. Apple pie pie candy canes soufflé gummies muffin icing sweet roll. Fruitcake gummies croissant chocolate cake sugar plum chocolate bar. Bonbon jelly-o lemon drops candy jujubes chupa chups gingerbread. Powder jelly tart cotton candy chocolate bar fruitcake cotton candy dragée. Tart sugar plum bear claw sesame snaps. Dragée jelly beans candy canes. Powder pie gingerbread jelly croissant sesame snaps icing gummies jelly beans. Cotton candy jelly beans gummi bears sweet sesame snaps jujubes sesame snaps carrot cake. Pastry lemon drops muffin halvah cake dessert gummies tootsie roll soufflé. Cotton candy sesame snaps dessert ice cream. Topping jujubes oat cake bear claw liquorice bear claw chocolate bar ice cream sesame snaps. Cake pudding tiramisu topping sesame snaps croissant candy sesame snaps tootsie roll. Danish lemon drops tart muffin. Chocolate bar toffee icing tiramisu danish ice cream sweet roll pastry.",
        "payment_details": null,
        "vat_name": null,
        "vat_number": null,
        "attachments": [],
        "lines": [
            {
                "compounded_tax": false,
                "taskno": null,
                "amount": {
                    "amount": "100",
                    "code": "CAD"
                },
                "description": "",
                "expenseid": null,
                "taxName1": "HST",
                "taxAmount1": 13,
                "name": "Item One",
                "qty": 1,
                "taxName2": null,
                "taxAmount2": null,
                "type": null,
                "unit_cost": {
                    "amount": "100",
                    "code": "CAD"
                },
                "estimateid": null
            },
            {
                "compounded_tax": false,
                "amount": {
                    "amount": "200",
                    "code": "CAD"
                },
                "description": "",
                "expenseid": null,
                "taxName1": "HST",
                "taxAmount1": 13,
                "name": "Item Two",
                "qty": 1,
                "taxName2": null,
                "taxAmount2": null,
                "unit_cost": {
                    "amount": "200",
                    "code": "CAD"
                },
                "estimateid": null
            },
            {
                "compounded_tax": false,
                "amount": {
                    "amount": "300",
                    "code": "CAD"
                },
                "description": "",
                "expenseid": null,
                "taxName1": null,
                "taxAmount1": null,
                "name": "Item Three",
                "qty": 1,
                "taxName2": null,
                "taxAmount2": null,
                "unit_cost": {
                    "amount": "300",
                    "code": "CAD"
                },
                "estimateid": null
            }
        ],
        "presentation": {
            "theme_font_name": "classic",
            "theme_primary_color": "#1460aa",
            "theme_layout": "simple",
            "date_format": "mm/dd/yyyy",
            "image_banner_position_y": -83,
            "image_logo_src": "/service/uploads/images/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjozMTg1OTUwLCJvcmlnaW5hbF9maWxlbmFtZSI6ImdhdmVscGljLmpwZWciLCJidWNrZXQiOiJ1cGxvYWRzIiwiZmlsZW5hbWUiOiJ1cGxvYWQtYTZmNzY3M2VhN2VjMmYwYjEzODNlOTg5MTc1NDFjMGIyOWE0MmUyOCIsImxlbmd0aCI6MzIzNiwia2V5IjoiJ2RvY3MtJy0zMTg1OTUwL3VwbG9hZC1hNmY3NjczZWE3ZWMyZjBiMTM4M2U5ODkxNzU0MWMwYjI5YTQyZTI4In0._GITi9SFuSJdGyba0tlOptyAyDA5BIQsGIa4WeGm36c"
        },
        "sections": [
            {
                "body": "Squiffy Jack Ketch coxswain plunder fire in the hole bucko trysail topgallant mizzenmast sheet. Nelsons folly hogshead Jack Tar Davy Jones\' Locker grog blossom scourge of the seven seas tackle mizzen to go on account deadlights. Jib bilged on her anchor crack Jennys tea cup cog reef matey spike Jack Ketch scurvy landlubber or just lubber. Pinnace shrouds Yellow Jack hands yardarm rutters Arr hearties piracy lookout. Doubloon ye Corsair warp cutlass brigantine reef sails aft hands haul wind. Snow spyglass measured fer yer chains barkadeer no",
                "group_name": "top",
                "title": "Overview",
                "type": "overview"
            },
            {
                "body": "prey, no pay bowsprit pressgang swing the lead squiffy plunder. Six pounders poop deck doubloon driver topmast broadside American Main mutiny Corsair scurvy. Grog blossom lateen sail spike Sail ho man-of-war case shot maroon Nelsons folly quarterdeck Cat o\'nine tails. Hogshead overhaul aye prow barkadeer rope\'s end stern belay code of conduct topgallant. Pieces of Eight American Main dance the hempen jig port rope\'s end barkadeer bilged on her anchor league Admiral of the Black Brethren of the Coast.",
                "group_name": "top",
                "title": "Scope of Work",
                "type": "scope_of_work"
            },
            {
                "body": "Squiffy trysail lad log boom rigging walk the plank scourge of the seven seas swab. Arr Blimey smartly gangway prow schooner bounty run a rig hardtack. Chandler rope\'s end rutters heave down jib fire in the hole Plate Fleet cackle fruit squiffy.<br>",
                "group_name": "top",
                "title": "Timeline",
                "type": "timeline"
            },
            {
                "body": "Mizzen capstan trysail sloop execution dock lookout gangway Cat o\'nine tails hang the jib bucko. Gun lad salmagundi aye Jolly Roger Brethren of the Coast chase guns smartly plunder galleon. League rutters tender topmast brig hang the jib yardarm plunder shrouds sloop. Jack bucko Sink me quarterdeck lugsail marooned tack reef keel Blimey. Haul wind yardarm blow the man down flogging scuppers aft run a shot across the bow bilge rat Cat o\'nine tails lugger. Sheet chandler run a shot across the bow Sail ho aft carouser spanker cutlass crack Jennys tea cup parrel. Pieces of Eight belaying pin Yellow Jack rigging boatswain cutlass loaded to the gunwalls yardarm bounty grog blossom. Hempen halter bilged on her anchor splice the main brace line parrel bilge water lad cable scuppers shrouds. Killick ho lee take a caulk wench line coxswain coffer heave down keel. Line Jack Ketch booty pirate black spot six pounders gibbet yardarm aft lateen sail.",
                "group_name": "top",
                "title": "Custom Heading",
                "type": "custom"
            }
        ],
        "customerid": {{customerid}}
    }
}'
https://api.freshbooks.com/accounting/account/{{accountid}}/estimates/estimates

Postman Collection Item JSON

{
  "name": "Create Single Proposal w/ Sections, Logos, and E-signature",
  "request": {
    "method": "POST",
    "header": [
      {
        "key": "Content-Type",
        "name": "Content-Type",
        "value": "application/json",
        "type": "text"
      }
    ],
    "body": {
      "mode": "raw",
      "raw": "{\n    \"estimate\": {\n        \"rich_proposal\": true,\n        \"require_client_signature\": true,\n        \"create_date\": \"2019-07-16\",\n        \"currency_code\": \"CAD\",\n        \"discount_value\": 0,\n        \"estimate_number\": \"0000044\",\n        \"template\": \"clean-grouped\",\n        \"terms\": \"Cupcake ipsum dolor sit amet. Pudding candy cupcake wafer. Apple pie pie candy canes soufflé gummies muffin icing sweet roll. Fruitcake gummies croissant chocolate cake sugar plum chocolate bar. Bonbon jelly-o lemon drops candy jujubes chupa chups gingerbread. Powder jelly tart cotton candy chocolate bar fruitcake cotton candy dragée. Tart sugar plum bear claw sesame snaps. Dragée jelly beans candy canes. Powder pie gingerbread jelly croissant sesame snaps icing gummies jelly beans. Cotton candy jelly beans gummi bears sweet sesame snaps jujubes sesame snaps carrot cake. Pastry lemon drops muffin halvah cake dessert gummies tootsie roll soufflé. Cotton candy sesame snaps dessert ice cream. Topping jujubes oat cake bear claw liquorice bear claw chocolate bar ice cream sesame snaps. Cake pudding tiramisu topping sesame snaps croissant candy sesame snaps tootsie roll. Danish lemon drops tart muffin. Chocolate bar toffee icing tiramisu danish ice cream sweet roll pastry.\",\n        \"payment_details\": null,\n        \"vat_name\": null,\n        \"vat_number\": null,\n        \"attachments\": [],\n        \"lines\": [\n            {\n                \"compounded_tax\": false,\n                \"taskno\": null,\n                \"amount\": {\n                    \"amount\": \"100\",\n                    \"code\": \"CAD\"\n                },\n                \"description\": \"\",\n                \"expenseid\": null,\n                \"taxName1\": \"HST\",\n                \"taxAmount1\": 13,\n                \"name\": \"Item One\",\n                \"qty\": 1,\n                \"taxName2\": null,\n                \"taxAmount2\": null,\n                \"type\": null,\n                \"unit_cost\": {\n                    \"amount\": \"100\",\n                    \"code\": \"CAD\"\n                },\n                \"estimateid\": null\n            },\n            {\n                \"compounded_tax\": false,\n                \"amount\": {\n                    \"amount\": \"200\",\n                    \"code\": \"CAD\"\n                },\n                \"description\": \"\",\n                \"expenseid\": null,\n                \"taxName1\": \"HST\",\n                \"taxAmount1\": 13,\n                \"name\": \"Item Two\",\n                \"qty\": 1,\n                \"taxName2\": null,\n                \"taxAmount2\": null,\n                \"unit_cost\": {\n                    \"amount\": \"200\",\n                    \"code\": \"CAD\"\n                },\n                \"estimateid\": null\n            },\n            {\n                \"compounded_tax\": false,\n                \"amount\": {\n                    \"amount\": \"300\",\n                    \"code\": \"CAD\"\n                },\n                \"description\": \"\",\n                \"expenseid\": null,\n                \"taxName1\": null,\n                \"taxAmount1\": null,\n                \"name\": \"Item Three\",\n                \"qty\": 1,\n                \"taxName2\": null,\n                \"taxAmount2\": null,\n                \"unit_cost\": {\n                    \"amount\": \"300\",\n                    \"code\": \"CAD\"\n                },\n                \"estimateid\": null\n            }\n        ],\n        \"presentation\": {\n            \"theme_font_name\": \"classic\",\n            \"theme_primary_color\": \"#1460aa\",\n            \"theme_layout\": \"simple\",\n            \"date_format\": \"mm/dd/yyyy\",\n            \"image_banner_position_y\": -83,\n            \"image_logo_src\": \"/service/uploads/images/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjozMTg1OTUwLCJvcmlnaW5hbF9maWxlbmFtZSI6ImdhdmVscGljLmpwZWciLCJidWNrZXQiOiJ1cGxvYWRzIiwiZmlsZW5hbWUiOiJ1cGxvYWQtYTZmNzY3M2VhN2VjMmYwYjEzODNlOTg5MTc1NDFjMGIyOWE0MmUyOCIsImxlbmd0aCI6MzIzNiwia2V5IjoiJ2RvY3MtJy0zMTg1OTUwL3VwbG9hZC1hNmY3NjczZWE3ZWMyZjBiMTM4M2U5ODkxNzU0MWMwYjI5YTQyZTI4In0._GITi9SFuSJdGyba0tlOptyAyDA5BIQsGIa4WeGm36c\"\n        },\n        \"sections\": [\n            {\n                \"body\": \"Squiffy Jack Ketch coxswain plunder fire in the hole bucko trysail topgallant mizzenmast sheet. Nelsons folly hogshead Jack Tar Davy Jones' Locker grog blossom scourge of the seven seas tackle mizzen to go on account deadlights. Jib bilged on her anchor crack Jennys tea cup cog reef matey spike Jack Ketch scurvy landlubber or just lubber. Pinnace shrouds Yellow Jack hands yardarm rutters Arr hearties piracy lookout. Doubloon ye Corsair warp cutlass brigantine reef sails aft hands haul wind. Snow spyglass measured fer yer chains barkadeer no\",\n                \"group_name\": \"top\",\n                \"title\": \"Overview\",\n                \"type\": \"overview\"\n            },\n            {\n                \"body\": \"prey, no pay bowsprit pressgang swing the lead squiffy plunder. Six pounders poop deck doubloon driver topmast broadside American Main mutiny Corsair scurvy. Grog blossom lateen sail spike Sail ho man-of-war case shot maroon Nelsons folly quarterdeck Cat o'nine tails. Hogshead overhaul aye prow barkadeer rope's end stern belay code of conduct topgallant. Pieces of Eight American Main dance the hempen jig port rope's end barkadeer bilged on her anchor league Admiral of the Black Brethren of the Coast.\",\n                \"group_name\": \"top\",\n                \"title\": \"Scope of Work\",\n                \"type\": \"scope_of_work\"\n            },\n            {\n                \"body\": \"Squiffy trysail lad log boom rigging walk the plank scourge of the seven seas swab. Arr Blimey smartly gangway prow schooner bounty run a rig hardtack. Chandler rope's end rutters heave down jib fire in the hole Plate Fleet cackle fruit squiffy.<br>\",\n                \"group_name\": \"top\",\n                \"title\": \"Timeline\",\n                \"type\": \"timeline\"\n            },\n            {\n                \"body\": \"Mizzen capstan trysail sloop execution dock lookout gangway Cat o'nine tails hang the jib bucko. Gun lad salmagundi aye Jolly Roger Brethren of the Coast chase guns smartly plunder galleon. League rutters tender topmast brig hang the jib yardarm plunder shrouds sloop. Jack bucko Sink me quarterdeck lugsail marooned tack reef keel Blimey. Haul wind yardarm blow the man down flogging scuppers aft run a shot across the bow bilge rat Cat o'nine tails lugger. Sheet chandler run a shot across the bow Sail ho aft carouser spanker cutlass crack Jennys tea cup parrel. Pieces of Eight belaying pin Yellow Jack rigging boatswain cutlass loaded to the gunwalls yardarm bounty grog blossom. Hempen halter bilged on her anchor splice the main brace line parrel bilge water lad cable scuppers shrouds. Killick ho lee take a caulk wench line coxswain coffer heave down keel. Line Jack Ketch booty pirate black spot six pounders gibbet yardarm aft lateen sail.\",\n                \"group_name\": \"top\",\n                \"title\": \"Custom Heading\",\n                \"type\": \"custom\"\n            }\n        ],\n        \"customerid\": {{customerid}}\n    }\n}"
    },
    "url": {
      "raw": "https://api.freshbooks.com/accounting/account/{{accountid}}/estimates/estimates",
      "protocol": "https",
      "host": [
        "api",
        "freshbooks",
        "com"
      ],
      "path": [
        "accounting",
        "account",
        "{{accountid}}",
        "estimates",
        "estimates"
      ],
      "query": [
        {
          "key": "include%5B%5D",
          "value": "audit_logs",
          "disabled": true
        },
        {
          "key": "include%5B%5D",
          "value": "attachments",
          "disabled": true
        },
        {
          "key": "include%5B%5D",
          "value": "client",
          "disabled": true
        },
        {
          "key": "include%5B%5D",
          "value": "contacts",
          "disabled": true
        },
        {
          "key": "include%5B%5D",
          "value": "lines",
          "disabled": true
        },
        {
          "key": "include%5B%5D",
          "value": "owner",
          "disabled": true
        },
        {
          "key": "include%5B%5D",
          "value": "presentation",
          "disabled": true
        },
        {
          "key": "include%5B%5D",
          "value": "signature",
          "disabled": true
        },
        {
          "key": "include%5B%5D",
          "value": "sections",
          "disabled": true
        },
        {
          "key": "include%5B%5D",
          "value": "signature",
          "disabled": true
        },
        {
          "key": "include%5B%5D",
          "value": "system",
          "disabled": true
        }
      ]
    },
    "description": "Create a single proposal that has sections, logos, and requires an e-signature from the customer"
  },
  "response": [
  ]
}