Skip to content
Francesca Sadikin edited this page Sep 25, 2019 · 12 revisions

Routes

Clients

Packages

GET /api/users/:user_uuid/clients

Retrieves partial client data for all clients belonging to a user

Response

{
    "data": [
        {
            "contacts": [
                {
                    "best_time_to_contact": "Morning",
                    "email": "mark@gmail.com",
                    "first_name": "Mark",
                    "label": "Groom",
                    "last_name": "Blue",
                    "phone_number": null,
                    "uuid": "dbdbcd2c-3373-4034-bd8e-85427e54af3c"
                },
                {
                    "best_time_to_contact": "Evening",
                    "email": "sarah@gmail.com",
                    "first_name": "Sarah",
                    "label": "Bride",
                    "last_name": "Green",
                    "phone_number": "123-456-7890",
                    "uuid": "53283fb9-79ee-4267-93a2-9b26d9e1e820"
                }
            ],
            "private_notes": "Met at university and looking to do a destination wedding and reception in Bali",
            "user_uuid": "2c2b4bc2-f31d-48b7-9e12-e0930c94130f",
            "uuid": "1a7bc09a-884d-4688-b07b-eed5e8909de5"
        },
    ]
}

GET /api/clients/:client_uuid/data

Retrieves a single client with all related data

Response

{
    "data": {
        "contacts": [
            {
                "best_time_to_contact": "Morning",
                "email": "mark@gmail.com",
                "first_name": "Mark",
                "label": "Groom",
                "last_name": "Blue",
                "phone_number": null,
                "uuid": "dbdbcd2c-3373-4034-bd8e-85427e54af3c"
            },
            {
                "best_time_to_contact": "Evening",
                "email": "sarah@gmail.com",
                "first_name": "Sarah",
                "label": "Bride",
                "last_name": "Green",
                "phone_number": "123-456-7890",
                "uuid": "53283fb9-79ee-4267-93a2-9b26d9e1e820"
            }
        ],
        "current_stage": {
            "category": "Engagement",
            "client_uuid": "1a7bc09a-884d-4688-b07b-eed5e8909de5",
            "event_uuid": null,
            "is_completed": false,
            "step": "Share Gallery Link",
            "uuid": "43f7ce04-7afd-4bd2-a2d3-7f74a7a98ddd"
        },
        "package": {
            "balance_received": false,
            "balance_remaining": 420000,
            "client_uuid": "1a7bc09a-884d-4688-b07b-eed5e8909de5",
            "discount_offered": 0,
            "engagement_included": true,
            "package_contents": "Up To Ten Hours of Photographic Coverage\n\n
Two Photographers\n\n
Handcrafted 10x10 Thirty Sided Artisan Album \n\nComplimentary Engagement Session\n\n
Private Online Gallery of All Images for Friends and Family \n\nSeven Hundred+ Digital Negatives on a Custom USB Drive ",
            "package_events": [
                {
                    "blog_link": null,
                    "client_uuid": "1a7bc09a-884d-4688-b07b-eed5e8909de5",
                    "coordinator_name": null,
                    "edit_image_deadline": null,
                    "event_name": "Engagement",
                    "gallery_link": null,
                    "notes": "Regarding clients question about location, send following email:\n\nHi Sarah & Mark,\nWe can choose a location that you love or that has some sort of meaning, or it can simply be somewhere that offers great spots for photos. It’s a time and opportunity for me to get to know you as a couple and for you to see how I work. \n\nThere is no pressure at all and it’s a great way to get comfortable in front of the camera, especially if you’re a little camera shy. It’s also a wonderful opportunity to get some natural and relaxed photos that reflect the two of you. If you have children you can bring them along and make it a family experience.",
                    "package_uuid": "dbea4bb1-c6a6-434f-ba79-ea6a4d06ad8c",
                    "reception_location": null,
                    "shoot_date": "2019-11-15T08:00:00Z",
                    "shoot_location": "Los Angeles Poppy Fields",
                    "shoot_time": "8AM - 11PM",
                    "uuid": "02522342-8657-4675-a851-6d5668fa7dbd",
                    "wedding_location": null
                },
            ],
            "package_name": "Wedding Premier",
            "package_price": 520000,
            "proposal_signed": true,
            "retainer_paid": true,
            "retainer_paid_amount": 100000,
            "retainer_price": 100000,
            "upcoming_shoot_date": "2019-11-15T08:00:00Z",
            "uuid": "dbea4bb1-c6a6-434f-ba79-ea6a4d06ad8c",
            "wedding_included": true
        },
        "private_notes": "Met at university and looking to do a destination wedding and reception in Bali",
        "user_uuid": "2c2b4bc2-f31d-48b7-9e12-e0930c94130f",
        "uuid": "1a7bc09a-884d-4688-b07b-eed5e8909de5",
        "workflows": [
            {
                "completed_tasks": 2,
                "incomplete_tasks": 0,
                "order": 0,
                "tasks": [
                    {
                        "category": "New Client Inquiry",
                        "client_uuid": "1a7bc09a-884d-4688-b07b-eed5e8909de5",
                        "event_uuid": null,
                        "is_completed": true,
                        "step": "Request More Information",
                        "uuid": "ebd71905-1a94-40a1-a862-e89d0ada1273"
                    },
                    {
                        "category": "New Client Inquiry",
                        "client_uuid": "1a7bc09a-884d-4688-b07b-eed5e8909de5",
                        "event_uuid": null,
                        "is_completed": true,
                        "step": "Save Client Information",
                        "uuid": "13abbcf7-9055-4070-953e-0586868545c9"
                    }
                ],
                "uuid": "96ba8683-1d0c-4160-ba84-94bc52588c14",
                "workflow_name": "New Client Inquiry"
            },
        ]
    }
}

POST /api/clients

Creates new client

Request Body

{
   "contacts":[
      {
         "first_name":"Tammy",
         "last_name":"",
         "email":"",
         "phone_number":"",
         "private_notes":"",
         "label":"Client",
         "best_time_to_contact":""
      }
   ],
   "private_notes":""
}

Response:

{
   "data":{
      "contacts":[
         {
            "best_time_to_contact":null,
            "email":null,
            "first_name":"Tammy",
            "label":"Client",
            "last_name":null,
            "phone_number":null,
            "uuid":"90e49431-ea90-4432-88e2-d0e286b21fbe"
         }
      ],
      "private_notes":null,
      "user_uuid":"2c2b4bc2-f31d-48b7-9e12-e0930c94130f",
      "uuid":"9356119b-89f8-4843-b844-b7b8e6e75c7b"
   }
}

PUT /api/clients/:client_uuid

Updates a client

Request Body

{
   "contacts":[
      {
         "first_name":"Tammy",
         "last_name":"Lee",
         "label":"Client",
         "uuid":"90e49431-ea90-4432-88e2-d0e286b21fbe"
      },
      {
         "first_name":"Steven",
         "last_name":"Wong",
         "label":"Partner"
      }
   ],
   "uuid":"9356119b-89f8-4843-b844-b7b8e6e75c7b"
}

Response: All related client data

{
   "data":{
      "contacts":[
         {
            "best_time_to_contact":null,
            "email":null,
            "first_name":"Tammy",
            "label":"Client",
            "last_name":"Lee",
            "phone_number":null,
            "uuid":"90e49431-ea90-4432-88e2-d0e286b21fbe"
         },
         {
            "best_time_to_contact":null,
            "email":null,
            "first_name":"Steven",
            "label":"Partner",
            "last_name":"Wong",
            "phone_number":null,
            "uuid":"74ce2dc2-cd08-4c56-8120-25da0091458e"
         }
      ],
      "current_stage":{
         "category":"New Client Inquiry",
         "client_uuid":"9356119b-89f8-4843-b844-b7b8e6e75c7b",
         "event_uuid":null,
         "is_completed":false,
         "step":"Request More Information",
         "uuid":"58a37e6d-b573-4578-a5f3-45707f2e6ea5"
      },
      "package":null,
      "private_notes":null,
      "user_uuid":"2c2b4bc2-f31d-48b7-9e12-e0930c94130f",
      "uuid":"9356119b-89f8-4843-b844-b7b8e6e75c7b",
      "workflows":[
         {
            "completed_tasks":0,
            "incomplete_tasks":2,
            "order":0,
            "tasks":[
               {
                  "category":"New Client Inquiry",
                  "client_uuid":"9356119b-89f8-4843-b844-b7b8e6e75c7b",
                  "event_uuid":null,
                  "is_completed":false,
                  "step":"Request More Information",
                  "uuid":"58a37e6d-b573-4578-a5f3-45707f2e6ea5"
               },
               {
                  "category":"New Client Inquiry",
                  "client_uuid":"9356119b-89f8-4843-b844-b7b8e6e75c7b",
                  "event_uuid":null,
                  "is_completed":false,
                  "step":"Save Client Information",
                  "uuid":"6a0f29bb-5c03-43ac-95cd-45d5cdd044a4"
               }
            ],
            "uuid":"e04fdcc3-9508-4a17-a916-53f6292e22c8",
            "workflow_name":"New Client Inquiry"
         },
         {
            "completed_tasks":0,
            "incomplete_tasks":4,
            "order":1,
            "tasks":[
               {
                  "category":"Proposal & Retainer",
                  "client_uuid":"9356119b-89f8-4843-b844-b7b8e6e75c7b",
                  "event_uuid":null,
                  "is_completed":false,
                  "step":"Send Proposal",
                  "uuid":"8976d6fb-f984-4001-9603-38420cd69cbd"
               },
               {
                  "category":"Proposal & Retainer",
                  "client_uuid":"9356119b-89f8-4843-b844-b7b8e6e75c7b",
                  "event_uuid":null,
                  "is_completed":false,
                  "step":"Commit To Proposal",
                  "uuid":"4a6916b6-dbd1-480f-a233-934c8e70e250"
               },
               {
                  "category":"Proposal & Retainer",
                  "client_uuid":"9356119b-89f8-4843-b844-b7b8e6e75c7b",
                  "event_uuid":null,
                  "is_completed":false,
                  "step":"Receive Signed Proposal & Retainer",
                  "uuid":"fb935588-dffd-44be-b7e0-39ad553bf23a"
               },
               {
                  "category":"Proposal & Retainer",
                  "client_uuid":"9356119b-89f8-4843-b844-b7b8e6e75c7b",
                  "event_uuid":null,
                  "is_completed":false,
                  "step":"Receive Retainer Fee",
                  "uuid":"0e90068c-4c76-48c7-ae15-3e9eb6ce0c9a"
               }
            ],
            "uuid":"3d34ff23-39b3-478c-89ec-887800602284",
            "workflow_name":"Proposal & Retainer"
         }
      ]
   }
}

DELETE /api/clients/:client_uuid

Deletes a client

Response

{"data":"Ok"}

GET /api/packages/:package_uuid

Retrieves a package

Response: See POST package Response

POST /api/clients/:client_uuid/packages

Request Body

{
   "package_name":"Wedding Classic",
   "proposal_signed":false,
   "package_price":150000,
   "retainer_price":0,
   "retainer_paid_amount":0,
   "retainer_paid":false,
   "discount_offered":0,
   "balance_remaining":0,
   "balance_received":false,
   "wedding_included":false,
   "engagement_included":false
}

Response

{
   "data":{
      "balance_received":false,
      "balance_remaining":0,
      "client_uuid":"9356119b-89f8-4843-b844-b7b8e6e75c7b",
      "discount_offered":0,
      "engagement_included":false,
      "package_contents":null,
      "package_name":"Wedding Classic",
      "package_price":150000,
      "proposal_signed":false,
      "retainer_paid":false,
      "retainer_paid_amount":0,
      "retainer_price":0,
      "uuid":"71ee1212-ac55-43e6-885e-ad46fe5844fe",
      "wedding_included":false
   }
}

PUT /api/packages/:package_uuid

Updates a package

Request Body

{
   "package_name":"Wedding Classic",
   "proposal_signed":false,
   "package_contents":"10 Hour photography session",
   "package_price":150000,
   "retainer_price":0,
   "retainer_paid_amount":0,
   "retainer_paid":false,
   "discount_offered":0,
   "balance_remaining":0,
   "balance_received":false,
   "uuid":"71ee1212-ac55-43e6-885e-ad46fe5844fe",
   "wedding_included":false,
   "engagement_included":false
}

Response

{
   "data":{
      "balance_received":false,
      "balance_remaining":0,
      "client_uuid":"9356119b-89f8-4843-b844-b7b8e6e75c7b",
      "discount_offered":0,
      "engagement_included":false,
      "package_contents":"10 Hour photography session",
      "package_name":"Wedding Classic",
      "package_price":150000,
      "proposal_signed":false,
      "retainer_paid":false,
      "retainer_paid_amount":0,
      "retainer_price":0,
      "uuid":"71ee1212-ac55-43e6-885e-ad46fe5844fe",
      "wedding_included":false
   }
}

DELETE /api/packages/:package_uuid

Deletes a package

Response

{"data":"Ok"}

Clone this wiki locally