Tap Laundry API v1

Tap Laundry API v1 documentation


Getting Started #back to top

Authentication

API Authentication will be via the use of API keys. Currently API keys will be static and will not link actions to a user. This creates a security concern when exposing API keys to the web browser through JavaScript as unauthenticated users would be able to use the API keys. In the future, each user should be generated an API key and web requests should be made using the authenticated user’s API key so information like UserIDs can be restricted to the authenticated user. Currently, any API key can be used to create / modify /delete / manage orders for ANY user, not the authenticated user.

Requests

All requests should post the data to the endpoint. The post body should be of type “x-www-form-urlencoded” – or a standard form post. The name of each parameter should follow the name specified in the endpoint documentation, and the value should also follow the guidelines laid out in the endpoint documentation. In addition to the parameters laid out in the endpoint documentation, every request should have a key “token” and the value should be a valid API access token.

Responses

Each API request will respond with a standardized format, to let the caller know if the request completed successfully, if an error was returned, an error message, and any results returned from the request. An example response is provided below

Successful Request
                                    {
                                        "status": "ok",
                                        "result": 
                                        {
                                            "order_id": 137,
                                            "another_result": "another result"
                                        }
                                    }
                                
Unsuccessful Request
                                    {
                                        "status": "error",
                                        "message": "Missing required parameter: user_id"
                                    }                  
                                

/commercial/invoice/new #back to top

Description

Generate a Stripe Billing invoice for a commercial account.

Parameters

Name Required Description
orders_idstrueA comma separated list of orders to generate invoices for. Items will be grouped by commercial account and billed to the stripe account on file.
days_until_duetrueDays until the invoice is due. If it is zero, stripe will bill automatically 1 hour after it is due.

Result

{
     "amount_due":10203,
     "invoice_number":"7E8E0D8-0001"
}

/commercial/list #back to top

Description

Generate a list of commercial accounts

Parameters

Name Required Description

Result

[
    {
      "id": 1,
      "name": "Residential",
      "subaccounts": 709,
      "orders": 159
    },
    {
      "id": 2,
      "name": "White Spider",
      "subaccounts": 20,
      "orders": 227
    },
    {
      "id": 3,
      "name": "Dorm Mom",
      "subaccounts": 37,
      "orders": 336
    },
    {
      "id": 4,
      "name": "Laundry Care - College Park",
      "subaccounts": 5,
      "orders": 0
    },
    {
      "id": 5,
      "name": "Heaven and Earth Acupuncture",
      "subaccounts": 1,
      "orders": 44
    },
    {
      "id": 7,
      "name": "Timeless Skin Solutions",
      "subaccounts": 1,
      "orders": 132
    },
    {
      "id": 8,
      "name": "Laundry Care Imports",
      "subaccounts": 474,
      "orders": 0
    },
    {
      "id": 9,
      "name": "Charles Hawkins",
      "subaccounts": 5,
      "orders": 1
    },
    {
      "id": 10,
      "name": "Test Commercial",
      "subaccounts": 1,
      "orders": 0
    }
  ]

/commercial/review #back to top

Description

Mark a Commercial Account as being reviewed.

Parameters

Name Required Description
user_idtrueThe Id of the User approving the commercial account.
commercial_idtrueThe Id of the Commercial Account to be reviewed.

Result

Returns status="ok" when completed successfully.

/commercial/show #back to top

Description

Show information and orders pertaining to a specific commercial account.

Parameters

Name Required Description
commercial_idtrueThe ID of the commercial account

Result

{
        "id": 51,
        "name": "Noya Chiropractic",
        "creation_date": "2018-10-09 20:55:32",
        "is_active": true,
        "is_reviewed": false,
        "allow_rush_bonus": true,
        "normal_client_payment": "1",
        "billing_details": "",
        "minimum_policy": "No minimum policy entered",
        "user_pricing_only": true,
        "stripe_id": "cus_DkyBeJrV3pZcWy",
        "days_until_due": 0,
        "requires_purchase_order": true,
        "is_taxable_organization": true,
        "requires_our_w9": true,
        "payment_method": "card",
        "ein": "",
        "first_pickup": "10/16/2018",
        "payment_frequency": "onreceipt",
        "addresses": [
            {
                "id": 65,
                "name": "Noya Chiropractic",
                "line_1": "4708 Wisconsin Ave NW",
                "line_2": "101",
                "state": "DC",
                "city": "Washington",
                "zip_code": "20016",
                "latitude": 0,
                "longitude": 0,
                "special_instructions": "No fragrance laundry soap "
            }
        ],
        "contacts": [
            {
                "id": 59,
                "first_name": "Anthony",
                "last_name": "Noya",
                "email": "DrAnthony@NoyaChiropractic.com",
                "phone": "2022371399",
                "type": null,
                "addresses": []
            },
            {
                "id": 60,
                "first_name": "Noya Chiropractic",
                "last_name": "Billing",
                "email": "DrAnthony@NoyaChiropractic.com",
                "phone": "2022371399",
                "type": "BILLING",
                "addresses": [
                    {
                        "id": 64,
                        "name": "Billing Address",
                        "line_1": "4708 Wisconsin Ave",
                        "line_2": "101",
                        "state": "DC",
                        "city": "Washington",
                        "zip_code": "20016",
                        "latitude": null,
                        "longitude": null,
                        "special_instructions": null
                    }
                ]
            },
            {
                "id": 65,
                "first_name": "test1",
                "last_name": "test2",
                "email": "test3",
                "phone": "test4",
                "type": "BILLING",
                "addresses": []
            }
        ],
        "users": [
            {
                "id": 1719,
                "firstname": "Noya",
                "lastname": "Chiropractic",
                "email": "martin@noyachiropractic.com",
                "phone": "2022371399",
                "commercial_account": "Noya Chiropractic",
                "commercial_account_id": 51,
                "commercial_account_normal_client_payment": true,
                "site_id": 2
            }
        ]
    }

/commercial/unpaid #back to top

Description

View unpaid orders for a CommercialAccount

Parameters

Name Required Description
commercial_idtrueThe ID of the commercial account

Result

Array of Order objects.

/email/send #back to top

Description

Send an email via noreply@taplaundry.com

Parameters

Name Required Description
requesttrueformatted JSON request, like you see in the Result section.
site_idfalseSite ID to use for filling assets into emails. Defaults to 7 (Tap Laundry).

Result

This endpoint does not return a result.

The format for the request parameter is as follows.

{
        "to": ["daniel@fanara.co"],
        "cc": ["daniel@fanara.co"],
        "subject": "testing email",
        "body": "HTML BODY",
        "altbody": "Plain text body content."
}

/orders/additem #back to top

Description

Add a service to the order in the form of an OrderItem.

Parameters

Name Required Description
order_idtrueThe ID of the order to update.
service_uidtrueThe ID of the service to be added to the order.
custom_pricefalse**This field is required when adding a service that is custom priced to the order. (ex. Dry Cleaning)
quantitytrueThe quantity of the service ordered, based on the unit of measurement. If a custom price is specified, the quantity should be 1.

Result

{
    "orderitem_id": "the ID of the order item added to the order."
}

/orders/all #back to top

Description

Lists 30 orders from the database for each request.

Parameters

Name Required Description
pagefalse-1 will return all orders. Returns 30 orders per page.

Result

This endpoint return an array of Order objects, in the same format of the /orders/view endpoint.

/orders/assignprovider #back to top

Description

Assign a provider to an Order. This will fetch the tax rate using TaxJar.

Parameters

Name Required Description
order_idtrueThe ID of the order to be updated.
provider_idtrueThe user id of the provider to assign to the order.

Result

This endpoint has an empty result, but you can verify that is completed successfully by ensuring the status of the result is "ok"

/orders/between #back to top

Description

Lists all orders created between two dates.

Parameters

Name Required Description
starttrueThe unix timestamp to start the search
endtrueThe unix timestamp to end the search

Result

This endpoint return an array of Order objects, in the same format of the /orders/view endpoint.

/orders/bycustomer #back to top

Description

Lists all orders belonging to a customer.

Parameters

Name Required Description
customer_idtrueThe ID of the customer

Result

This endpoint return an array of Order objects, in the same format of the /orders/view endpoint.

/orders/bylocation #back to top

Description

List all orders within a location

Parameters

Name Required Description
location_idtrueThe ID of the location

Result

This endpoint return an array of Order objects, in the same format of the /orders/view endpoint.

/orders/byprovider #back to top

Description

Lists all orders assigned to a provider.

Parameters

Name Required Description
provider_idtrueThe ID of the provider

Result

This endpoint return an array of Order objects, in the same format of the /orders/view endpoint.

/orders/cancel #back to top

Description

Mark an order as cancelled.

Parameters

Name Required Description
order_idtrueThe ID of the order to cancel.

Result

This endpoint has an empty result, but you can verify that is completed successfully by ensuring the status of the result is "ok"

/orders/complete #back to top

Description

Mark an order as complete. The complete order workflow will be executed, so the customer’s transaction_id should already be obtained. On success, the operation will also transfer funds to the provider’s wallet. This endpoint will also create a TaxJar item for the order.

Parameters

Name Required Description
order_idtrueThe ID of the order to mark as complete.
transaction_idtrueThe transaction ID that should be associated with the completion of the order. An empty transaction is possible, in cases where the customer is not charged due to an error etc, but the field should still be present. BILLING_ERROR indicates an error when billing the client, and PENDING_INVOICE indicates that we are invoicing a commercial client. Note: because this parameter can be empty, we should just check if it is set, but not necessarily check if it has a value.

Result

This endpoint has an empty result, but you can verify that is completed successfully by ensuring the status of the result is "ok"

/orders/finalize #back to top

Description

Finalize an order. This sets the order status to finalized. An order in the finalized state means the total costs and taxes have been set, and it is ready to be reviewed for billing. The next stage would be to mark the order as completed once the order has been verified.

Parameters

Name Required Description
order_idtrueThe ID of the order to be finalized.

Result

This endpoint has an empty result, but you can verify that is completed successfully by ensuring the status of the result is "ok"

/orders/modifyitem #back to top

Description

Modify an OrderItem attached to an order. This is useful for modifying the CustomPrice or Quantity of an OrderItem.

Parameters

Name Required Description
orderitem_idtrueThe ID of the orderitem to remove.
order_idtrueThe ID of the order to be updated.
quantityfalseThe quantity to set on the order item.
custom_pricefalse*This field is required if the service is custom priced. This sets the cost of the service orderitem.

Result

{
    "quantity": "true or false depending on whether or not the update was successful",
    "custom_price": "true or false depending on whether or not the update was successful",
}

/orders/new #back to top

Description

This endpoint is used to create a new order for a user. After an order has been created, it will return an order ID allowing services to be added to that order.

Parameters

Name Required Description
user_idtrueThe ID of the user to associate with the order.
location_idtrueThe ID for the location of the order. This is used for calculating region based prices.
addresstrueJSON string of the address. Used for calculating taxes, and for the order's location.
namefalseThe name to associate with the order. If no name is provided, it will default to the name associated with the User.
pickup_timefalseUnix timestamp for the order's scheduled pickup time.
dropoff_timefalseUnix timestamp for the order's scheduled dropoff time.
promo_idfalseThe ID of the promo-code to attach to the order. Currently promos are not verified, just added to the order.
special_instructionsfalseAny instructions to associate with the order.
send_notificationfalseDefaults to true. Whether or not to send a dispatch notification to all of the eligible providers in the location.
sourcefalseString describing where the order was created. ex 'workdesk'

Result

{
    "order_id": "id of the new order"
}

/orders/notes #back to top

Description

Return all of the notes associated with an order.

Parameters

Name Required Description
order_idtrueThe order to fetch notes for.
provider_onlyfalseIf set to true, only notes created by the provider will be returned.

Result

[
        {
            "id": 5557,
            "related": 3002,
            "note": "Provider 1566 assigned to order.",
            "creation_date": "2018-07-15 02:00:30",
            "creation_time": 1531620030,
            "author": 0,
            "author_name": "System",
            "type": 6,
            "system_generated": true
        },
        {
            "id": 5561,
            "related": 3002,
            "note": "Changed status from Waiting for Pickup to Pickup Complete.",
            "creation_date": "2018-07-15 14:30:14",
            "creation_time": 1531665014,
            "author": 0,
            "author_name": "System",
            "type": 6,
            "system_generated": true
        },
        {
            "id": 5587,
            "related": 3002,
            "note": "Changed status from Pickup Complete to In progress.",
            "creation_date": "2018-07-16 01:05:42",
            "creation_time": 1531703142,
            "author": 0,
            "author_name": "System",
            "type": 6,
            "system_generated": true
        },
        {
            "id": 5727,
            "related": 3002,
            "note": "Changed status from In progress to Out for delivery.",
            "creation_date": "2018-07-17 13:43:35",
            "creation_time": 1531835015,
            "author": 0,
            "author_name": "System",
            "type": 6,
            "system_generated": true
        }
    ]

/orders/notes/new #back to top

Description

Create a new note on an Order.

Parameters

Name Required Description
order_idtrueThe Order Id to attach the note to
user_idtrueThe Id of the user creating the note
notetrueThe content of the note

Result

Check for status = "ok" for successful requests

/orders/removeitem #back to top

Description

Remove an OrderItem from an Order

Parameters

Name Required Description
orderitem_idtrueThe ID of the orderitem to remove.
order_idtrueThe ID of the order to be updated.

Result

This endpoint has an empty result, but you can verify that is completed successfully by ensuring the status of the result is "ok"

/orders/review #back to top

Description

Leave a review for a provider on an order. This endpoint is not restricted to a specific status, but should be called after an order has been completed.

Parameters

Name Required Description
order_idtrueThe ID of the order to review.
ratingtrueNumerical equivalent to rate the provider. Should be up to 5 stars.
commenttrueOptional comment to leave with review. The comment can be empty but the parameter should still be sent to the server.

Result

This endpoint does not return a result, status = ok if the call was successful.

/orders/rush [POST] #back to top

Description

Force rush status on an order.

Parameters

Name Required Description
user_idtrueUser that initiated the API call.
order_idtrueThe Order to be updated.
rush_statustrue0 enables the default method of rush calculation, 1 forces rush status on an order, 2 force disables rush status on an order.

Result

{
        "id": 4500,
        "location": {
            "id": 61,
            "name": "Testville",
            "state": "TestState",
            "state_abbreviation": "TS",
            "time_difference": 0,
            "is_taxable": false,
            "is_origin_tax": false,
            "is_active": false,
            "url": "",
            "site_id": 1
        },
        "order_items": null,
        "customer_id": 1084,
        "creation_date": 1539492866,
        "customer_name": "Test order. Do not accept.",
        "promo": null,
        "is_finalized": false,
        "payment_id": "",
        "final_cost": null,
        "final_discount_amount": null,
        "final_tax_cost": null,
        "final_provider_payment": null,
        "pickup_time": 1532779200,
        "dropoff_time": 1532865600,
        "status": "Cancelled",
        "provider": null,
        "tax_rate": null,
        "address": "{\"address\":\"2585 Findley Ave\",\"address2\":\"\",\"zipcode\":\"43202\"}",
        "is_rush": true,
        "special_request": "This is a test order. ",
        "is_active": false,
        "final_tip": 0,
        "customer_reviewed": true,
        "force_rush_status": 1
    }

/orders/tip #back to top

Description

Leave a tip on an order for the provider. This endpoint requires the order be in the finalized state.

Parameters

Name Required Description
order_idtrueThe ID of the Order to leave a tip for.
amounttrueThe amount in dollars to tip for an order.

Result

This endpoint does not return a result, status = ok if the call was successful.

/orders/unassigned #back to top

Description

Lists all of the unassigned orders for a location.

Parameters

Name Required Description
location_idtrueLocation to query for unassigned orders

Result

An array of Order objects.

/orders/update #back to top

Description

This endpoint is used to update some fields of an order. You can specify as many or as few parameters as you’d like so you can update multiple properties of an order in a single call. This endpoint supports things like updating the: pickup time, dropoff time, or status, and provider of an order.

Parameters

Name Required Description
order_idtrueThe ID of the order to update.
addressfalseJSON string of the address. Used for calculating taxes, and for the order's location.
pickup_timefalseUnix timestamp for the order's scheduled pickup time.
dropoff_timefalseUnix timestamp for the order's scheduled dropoff time.
statusfalseString to set the status field to. Typically, this is something like “Complete” or “Cancelled”. Generally, this value is automatically set through calls like finalizing the order or cancelling the order and is only useful for setting the order status outside of the typical workflow.
payment_idfalseStripe Payment ID or PENDING_INVOICE or BILLING_FAILED
special_requestfalseThe customers special instructions

Result

{
    "pickup_time": "true or false depending on if the update was successful",
    "dropoff_time": "true or false depending on if the update was successful",
    "status": "true or false depending on if the update was successful",
    "address": "true or false depending on if the update was successful",
}

/orders/view #back to top

Description

View all the information necessary to render an order.

Parameters

Name Required Description
order_idtrueThe ID of the Order to be fetched.

Result

{
        "order_id": 4230,
        "name": "Elizabeth Giesecke",
        "total": 32.25,
        "pretax_total": 30,
        "prediscount_total": 30,
        "payment_id": "ch_1DJ29kG3BgNXlmeZIahFezCw",
        "provider_total": 20,
        "dropoff_time": 1538568000,
        "pickup_time": 1538395200,
        "provider": {
            "id": 1027,
            "name": "Laura C.",
            "firstname": "Laura",
            "lastname": "Chapman",
            "phone": "6142028628",
            "role": "Guru",
            "location": {
                "Id": 1,
                "Name": "Columbus",
                "State": "Ohio",
                "Site_Id": 1,
                "StateAbbreviation": "OH",
                "BagRate": 35,
                "TimeDifference": "0",
                "isTaxable": 1,
                "isOriginTax": 1,
                "isActive": 1,
                "Url": "/locations/columbus/",
                "CreationDate": "2017-11-18 16:53:00",
                "Longitude": "-82.99879420000002",
                "Latitude": "39.9611755",
                "ComingSoon": 0,
                "GoogleListing": 0,
                "YelpListing": 0,
                "Type": 0,
                "Tier": 1,
                "ClientPortal": 1
            }
        },
        "address": "{\"address\":\"1287 Glenn Ave.Columbus, Ohio 43212\",\"address2\":\"\",\"zipcode\":\"43212\",\"city\":\"Columbus\",\"state\":\"OH\"}",
        "status": "Complete",
        "customer": {
            "id": 2097,
            "firstname": "Elizabeth",
            "lastname": "Giesecke",
            "email": "egiesecke1@aol.com",
            "phone": "6148008866",
            "commercial_account": "Residential",
            "commercial_account_id": 1,
            "commercial_account_normal_client_payment": true,
            "site_id": 2
        },
        "promo": null,
        "tax_total": 2.25,
        "tax_rate": 0.075,
        "rush": false,
        "active": false,
        "location": {
            "id": 1,
            "name": "Columbus",
            "state": "Ohio",
            "state_abbreviation": "OH",
            "time_difference": 0,
            "is_taxable": true,
            "is_origin_tax": true,
            "is_active": true,
            "url": "/locations/columbus/",
            "site_id": 1
        },
        "special_request": "none",
        "reviewed": true,
        "force_rush_status": 0,
        "details": {
            "stripe": {
                "total_charge": 3225,
                "total_transfer": 3101
            }
        },
        "flags": [],
        "receipt_email": "https://mail.taplaundry.com/archive/0b8eabb7-ca61-4d51-8f1f-1b20ffaa85db.html",
        "orderitems": [
            {
                "id": 4847,
                "service_id": 45,
                "service_name": "Wash and Fold",
                "service_description": "13 gallons capacity. Clothing, towels, sheets, and/or light blankets. Wash, dry, and fold.",
                "service_partial_unit": false,
                "price": 30,
                "unitprice": 30,
                "provider_total": 20,
                "unit": "bag",
                "quantity": 1,
                "taxable": true
            }
        ]
    }

/qeury [DEPRECATED] #back to top

Description

Runs a saved query, supports cached queries as defined in the database. [DEPRECATED] You should opt to use /query/execute unless you would like to utilize the caching ability of this endpoint.

Parameters

Name Required Description
query_idtrueId of the query to execute.

Result

The result returned will vary depending on the query being executed. Successful queries return status="ok"

/query/execute #back to top

Description

Execute a saved query or execute a raw query. Saved queries should be used whenever possible, raw queries are used for dynamically generated queries such as the query building tool.

Parameters

Name Required Description
query_idfalseId of the saved query to execute.
queryfalseRaw JSON query structure to execute.

Result

The result returned will vary depending on the query being executed. Successful queries return status="ok"

/query/list #back to top

Description

List saved queries.

Parameters

Name Required Description

Result

[
        {
            "id": 1,
            "name": "List Orders",
            "description": "List all orders with provider/customer names and ids including pickup and dropoff times."
        },
        {
            "id": 2,
            "name": "Incorrect Payouts",
            "description": "Transactions generated for an order assigned to a provider that is different than the provider on the order. "
        },
        {
            "id": 3,
            "name": "Billing Page",
            "description": "List all relevant details for orders in the finalized state to be rendered on the billing section."
        },
        {
            "id": 4,
            "name": "Billing Audit Page",
            "description": "List all relevant details for orders that have not been audited yet."
        },
        {
            "id": 5,
            "name": "Commercial Users Stripe Audit",
            "description": "List commercial account users that have an incorrect stripe id associated with them."
        },
        {
            "id": 6,
            "name": "List Clients",
            "description": "List all clients and necessary information for the clients module."
        }
    ]

/services [GET] #back to top

Description

List all services and their attributes from the database.

Parameters

Name Required Description
site_idfalseOptional filter for site_id

Result

[
        {
            "id": 45,
            "name": "Wash and Fold",
            "description": "13 gallons capacity. Clothing, towels, sheets, and/or light blankets. Wash, dry, and fold.",
            "is_custom_pricing": 0,
            "site_id": 2,
            "is_taxable": 1,
            "has_partial_unit": 0
        },
        {
            "id": 48,
            "name": "Nylon Bag",
            "description": "Reusable nylon Laundry Care bag.",
            "is_custom_pricing": 0,
            "site_id": 2,
            "is_taxable": 1,
            "has_partial_unit": 0
        }
]

/services/list #back to top

Description

Lists all of the available services. Supplying a user and a location will give a list of available services to a user for a given location, passing just a location will give a list of services available to the entire region.

Parameters

Name Required Description
location_idfalseIf a location ID is given, only services will be shown that are available in that region.
customer_idfalseIf this parameter is present, then location_id must also be sent. Supplying both of these parameters will return services that are available to this user in a given location. In addition to services available in the region, this method will also return services that are not available for the entire region but are available to the specified region.
include_pricefalseDefaults to false. If true, the price of a service will be returned along with the service. If a user is specified, the price will reflect any user-specific pricing associated with the service. If a user-specific pricing does not apply, the standard price for a region will be returned. It will also return the unit of measurement associated with the cost.
site_idfalseThe site making the request. This is to make sure that we are loading services for the correct laundry site.

Result

An array of service objects similar to the one below.

Note on Scope: Set based on if the pricing is location, user or globally specific.

{
    "id": 5,
    "name": "Laundry By The Pound",
    "description": "blah",
    "custom_pricing": false,
    "price": "1.5",
    "unit": "Pound",
    "taxable": true,
    "scope": "location"
}

/services/new [POST] #back to top

Description

Create a new service.

Parameters

Name Required Description
nametrueName of the new service.
descriptiontrueShort description of the service.
is_custom_pricingtrueBoolean. True if the provider must input a cost for a service instead of a quantity.
site_idtrueThe Id of the site the service belongs to.
is_taxabletrueBoolean. True if tax should be applied to the service.
has_partial_unittrueBoolean. True if the provider can enter a decimal, false to limit the input to whole number only (Ex. Bag pricing)

Result

{
        "id": 121,
        "name": "Test Service",
        "description": "DESCRIPTION!",
        "is_custom_pricing": false,
        "site_id": 1,
        "is_taxable": false,
        "has_partial_unit": false
    }

/services/prices/new [POST] #back to top

Description

Create a new ServicePrice for a user.

Parameters

Name Required Description
service_idtrue
unittrueUnit of measurement for Service Price.
customer_idtrue
client_pricetrue
client_rush_pricetrue
provider_pricetrue
provider_rush_pricetrue

Result

Returns no result, status = "ok" if the operation succeeded.

/sites/logo #back to top

Description

Retrieve the URL to a site's brand asset.

Parameters

Name Required Description
site_idtrueThe ID of the site.

Result

{
    "brand_logo": "https://www.taplaundry.com/api/images/company-badges/1.png"
}

/states/list [POST] #back to top

Description

Lists all of the available states as per given Site ID.

Parameters

Name Required Description
site_idtrueReturns all the states having same site_id as provided in 'site_id' parameter.

Result

An array is rendered similar to the one below.

{
    "status": "ok",
    "result": [
        {
            "id": 1,
            "name": "Alabama",
            "abbreviation": "Description of the state",
            "isOriginTax": true,
            "isTaxable": true,
        },
        {
            "id": 2,
            "name": "Alaska",
            "abbreviation": "Description of the state",
            "isOriginTax": true,
            "isTaxable": false,
        },
        {
            "id": 7,
            "name": "Texas",
            "abbreviation": "Description of the state",
            "isOriginTax": false,
            "isTaxable": false,
        }
    ]
}

/states/update [POST] #back to top

Description

This endpoint is used to update some fields of an state. You can specify as many or as few parameters as you’d like so you can update multiple properties of a state in a single call.

Parameters

Name Required Description
state_idtrueThe ID of the state to update.
is_taxablefalseBoolean (true/false)
is_origin_taxfalseBoolean (true/false)
license_requiredfalseBoolean (true/false)
license_obtainedfalseBoolean (true/false)
sos_websitefalseName of the Sos Website
license_filed_timefalseTime of filing license
license_numberfalseLicense Number
renewal_frequencyfalseRenewal Frequency of the license
registered_agentfalseName of the agent

Result

This endpoint has an empty result, but you can verify that is completed successfully by ensuring the status of the result is "ok"

/states/view [POST] #back to top

Description

Returns a state object according to state id.

Parameters

Name Required Description
state_idtrueThe ID of the State to be fetched.

Result

{
    "id": 1,
    "name": "Alabama",
    "abbreviation": "Description of the state",
    "is_taxable": true,
    "is_origin_tax": true,
    "license_required": true,
    "license_obtained": true,
    "license_filed_time": "",
    "license_number": "",
    "renewal_frequency": "",
    "registered_agent": ""
 }

/training/all [GET] #back to top

Description

List all trainings.

Parameters

Name Required Description

Result

{
  "trainings": [
    {
      "id": 1,
      "title": "Pricing",
      "description": "Learn how our pricing works.",
      "link": "http://www.laundrycareconnection.biz/pricing",
      "is_active": true,
      "creation_date": "2018-09-18 21:26:06",
      "assigned_users": 1
    },
    {
      "id": 2,
      "title": "Nylon Bags",
      "description": "Learn when to give our resuable nylon bags and how much to charge for them.",
      "link": "http://www.laundrycareconnection.biz/nylon-bags",
      "is_active": true,
      "creation_date": "2018-09-18 21:27:02",
      "assigned_users": 1
    },
    {
      "id": 3,
      "title": "Dispatching",
      "description": "Learn about how we notify you of new clients and how we transfer client information.",
      "link": "http://www.laundrycareconnection.biz/dispatching",
      "is_active": true,
      "creation_date": "2018-09-18 21:29:10",
      "assigned_users": 1
    }
  ]
}

/training/complete [POST] #back to top

Description

Mark a training as complete for a provider.

Parameters

Name Required Description
assignment_idtrueThe assignment to mark as complete.

Result

Returns status="ok" when the endpoint completes successfully.

/training/list [POST] #back to top

Description

List trainings for a provider.

Parameters

Name Required Description
provider_idtrue

Result

[{
  "assignment_id": 1,
  "title": "Pricing",
  "description": "Learn how our pricing works.",
  "link": "http://www.laundrycareconnection.biz/pricing",
  "is_active": true,
  "is_complete": true,
  "is_required": true,
  "completed_on": 2147483647
}]

/uploads/new #back to top

Description

Upload files to a new endpoint. Files uploaded via HTTP will be saved, and a URL will be returned for each item. This endpoint supports multiple files in one post.

Parameters

Name Required Description

Result

{"status":"ok","result":{"file":"https:\/\/uploads.taplaundry.com\/889027b4-06ce-4e72-b924-5ca91380beb1"}}

/users/address/delete #back to top

Description

Deletes a user's address.

Parameters

Name Required Description
address_idtrueThe Address.Id to delete.

Result

The endpoint only returns the status. Check if status=='ok' to see if it completed successfully.

/users/address/list #back to top

Description

List all addresses attached to a user's account.

Parameters

Name Required Description
user_idtrueThe user's ID for listing addresses

Result

{
    "status": "ok",
    "result": [
        {
            "id": null,
            "name": "",
            "address": "933 E 224th St",
            "address2": "Apt 3",
            "state": "NY",
            "state_id": "",
            "city": "Bronx",
            "zipcode": "10466-4603",
            "latitude": 40.88496,
            "longitude": -73.85372,
            "special_instructions": "",
            "is_default": true
        }
    ]
}

/users/address/new #back to top

Description

Creates a new address to attach to a user.

Parameters

Name Required Description
user_idtrueThe Id of the user the address is attached to. This can be removed in a later release, but due to the nature of how addresses are currently stored it is a requirement to include this parameter.
nametrueGeneralized name for the address. Ex: 'home' or 'work'
addresstrueThe first line of the address.
address2trueThe second line of the address.
citytrueThe city of the address.
statetrueThe state of the address. Note: this MUST be a 2 letter, capitalized abbreviation.
zipcodetrueThe zip code of the address.

Result

{"address_id": 1}

/users/address/update #back to top

Description

Update an address that is attached to a user.

Parameters

Name Required Description
address_idSee DescriptionThe address.id to update. Important note. If an address from /users/address/list returns an id with the address, you MUST specify it here. If the id is null, then do not include this parameter.
user_idtrueThe Id of the user the address is attached to. This can be removed in a later release, but due to the nature of how addresses are currently stored it is a requirement to include this parameter.
addresstrueThe first line of the address.
address2trueThe second line of the address.
citytrueThe city of the address.
statetrueThe state of the address. Note: this MUST be a 2 letter, capitalized abbreviation.
zipcodetrueThe ZipCode of the address.
isDefaultfalse(Boolean). Can be set to true to override the existing default address for a user.

Result

The endpoint only returns the status. Check if status=='ok' to see if it completed successfully.

/users/login #back to top

Description

Authenticate by using an email and password. Returns full user object.

Parameters

Name Required Description
emailtrueEmail address of requested user.
passwordtruePlain text password string.
sourcetrueMust be one of the acceptable values: WORK_DESK, JOIN_SITE, CLIENT_SITE, API, DRIVER_APP, CLIENT_APP.
site_idtrueThe site id for the user's company.

Result

{
    "status": "ok",
    "result": {
        "user": {
            "id": 1,
            "first_name": "Test",
            "last_name": "User",
            "email": "test@user.com",
            "site_id": 1,
            "role": "User",
            "default_preferences": "test",
            "assigned_provider": null,
            "phone": "1112223333",
            "location": {
                "id": "1",
                "time_zone": "America/Chicago"
            },
            "address": {
                "address": "123 test ln",
                "address2": "",
                "city": "Columbus",
                "state": "OH",
                "zipcode": "43235"
            },
            "service_radius": 1,
            "app_views": {
                "all_orders_ui": 2,
                "new_orders_ui": 3,
                "my_orders_ui": 3,
                "availability_ui": 0,
                "wallet_ui": 0,
                "profile_ui": 3,
                "supplies_ui": 0,
                "support_ui": 3,
                "provider_payment_ui": 0,
                "recent_clients_ui": 3
            },
            "is_admin": false,
            "stripe": {
                "id": 1,
                "publishable_key": "pk_...",
                "customer_id": "cus_..."
            },
            "modules": [
                {
                    "label": "Dashboard",
                    "icon": "fa fa-dashboard",
                    "url": "/"
                },
                ...
            ],
            "language": [
                {
                    "name": "DRIVER",
                    "category": "BASIC_TERMS",
                    "type": "TEXT",
                    "label": "Driver"
                },
                ...
            ],
            "average_rating": 0
        },
        "tokens": [
            {
                "id": 1,
                "token": "42b65aa1fabf68b0...",
                "last_used": 0,
                "created": 1594868866,
                "site_id": 1,
                "user_id": 1,
                "source": "WORK_DESK"
            },
            ...
        ]
    }
}

/users/new #back to top

Description

Create a new client user. Returns the newly created user id. Login immediately after to get user object.

Parameters

Name Required Description
first_nametrueFirst name of the user.
last_nametrueLast name of the user.
emailtrueEmail address of the user.
site_idtrueSite id of the company.
phonetruePhone number of the user.
addresstrueAddress object. Example: {"address":"10310 Saint Clair Avenue","address2":"","zipcode":"44108","city":"Cleveland","state":"OH"}
roletrueMust be set to User or Guru
location_idtrueId of the parent location.
longitudetrueLongitude of the user's location.
latitudetrueLatitude of the user's location.
passwordfalsePlain text password string. If not sent, password will be set to random string.
referrerfalseUrl of referring site. Use "direct" if not known. If not set, referrer will be null.
sourcefalseMust be one of the acceptable values: "Client Site", "Workdesk", "Client App".
commercial_idfalseThe commercial account id of user's parent account.
googleIdfalseUnique google user auth id.
facebookIdfalseUnique facebook user auth id.

Result

{
    "status": "ok",
    "result": 12345
}

/users/payments/sources #back to top

Description

List a customer's payment sources.

Parameters

Name Required Description
user_idtrueThe user's ID for listing sources

Result

Add later

/users/payments/sources/new #back to top

Description

Creates a new source and attaches it to a user. Only used for giftcards currently.

Parameters

Name Required Description
user_idtrueThe user's ID for listing sources
typetrueOptions: 'GIFTUP'
giftcard_codetrueGift card code

Result

Add later

/wallet/cashout #back to top

Description

Request a cashout from a provider's wallet.

Parameters

Name Required Description
provider_idtrueThe provider Id to request the cashout for

Result

{
     "amount": 13.43
     
"id": 110"
}

/wallet/cashout/complete #back to top

Description

Mark a cashout request as complete.

Parameters

Name Required Description
transaction_idtrueThe Transaction ID to mark as complete.

Result

Returns an empty result.

/wallet/cashout/pending #back to top

Description

Return pending cashouts

Parameters

Name Required Description

Result

An array of transaction objects

/wallet/transactions #back to top

Description

List all transactions for a provider.

Parameters

Name Required Description
provider_idtrueThe provider Id to fetch transactions for.

Result

Array of transactions like /wallet/transactions/all

/wallet/transactions/all #back to top

Description

List all wallet transactions.

Parameters

Name Required Description

Result

An array of transaction objects

{
                "id": 213,
                "amount": 15.4,
                "description": "Payment for Order #3187",
                "order_id": 3187,
                "unixtime": 1534026618,
                "is_active": true,
                "status": 2,
                "pending_till": 1534199418,
                "provider_id": "1027"
            }