/customers endpoint¶
 The /customers endpoint provides methods for listing, creating, and updating the properties of DropStream customers.
List¶
To get a list of customers and their properties, make a GET request to the /customers endpoint.
| Endpoint | /customers | 
|---|---|
| Method | GET | 
| Auth | JWT | 
| Success status | HTTP 200 | 
| Response | JSON array of customers | 
Example
curl -H "Authorization: Bearer $JWT_TOKEN" \
    https://api.getdropstream.com/customers
Response:
[
    {
        "id": 2376,
        "company_name": "Merchant Name",
        "street1": "123 Commerce St",
        "street2": "Suite 789",
        "street3": null,
        "city": "New York",
        "state": "NY",
        "zipcode": "10012",
        "country": "USA",
        "provider": "provider_id",
        "created_at": "2018-08-02T20:36:23.000Z"
    },
    ...
    {
        "id": 3775,
        ...
    }
]
HTTP/1.1 200 OK
Create¶
To create a new customer, make a POST request to /customers and provide the customer properties.
| Endpoint | /customers | 
|---|---|
| Method | POST | 
| Auth | JWT | 
| Required properties | company_name — Company name (string), e.g. "The Company" | 
| Success status | HTTP 201 | 
| Response | id of the new customer | 
Example
curl -X POST \
    -H "Authorization: Bearer $JWT_TOKEN" \
    -H "Content-Type: application/json" \
    https://api.getdropstream.com/customers \
    -d @- <<EOF
{"company_name":"The company",
"street1":"123 Commerce St",
"street2":"Suite 789",
"street3":null,
"city":"New York",
"state":"NY",
"zipcode":"10012",
"country":"USA",
"provider":"dropstream"}
EOF
curl -X POST \
    -H "Authorization: Bearer $JWT_TOKEN" \
    https://api.getdropstream.com/customers \
    -d @- <<EOF
company_name=The company&$
street1=123 Commerce St&
street2=Suite 789&
city=New York&
state=NY&
zipcode=10012&
country=USA&
provider=dropstream
EOF
Response:
{"id":4567}
HTTP/1.1 201 Created
Update¶
To update the properties of an existing customer, make a PATCH request to /customers/{id} with the new customer properties.
| Endpoint | /customers/{customer_id} | 
|---|---|
| Method | PATCH | Auth | JWT | 
| Payload | the updated properties | 
| Success status | HTTP 204 | 
Example
curl -X PATCH \
    -H "Authorization: Bearer $JWT_TOKEN" \
    -H "Content-Type: application/json" \
    https://api.getdropstream.com/customers/1234 \
    -d @- <<EOF
{"company_name":"Company ABC"}
EOF
curl -i -X PATCH \
    -H "Authorization: Bearer $JWT_TOKEN" \
    https://api.getdropstream.com/customers/1234 \
    -d @- <<EOF
company_name=Company ABC
EOF
Response:
HTTP/1.1 204 No Content