Customers

On this page, we’ll dive into the different customer endpoints you can use to manage customers programmatically.

The Customer Model

The Customer model contains all the information about your customer, such as their email, address, and phone number. This is a prerequisite in order to create transactions on BlueHill Payments.

Properties

  • Name
    id
    Type
    string
    Description

    Unique identifier for the Customer.

  • Name
    company
    Type
    string
    Description

    This is the company name of the customer.

  • Name
    email
    Type
    string
    Description

    This is the email address of the customer.

  • Name
    phoneNumber
    Type
    string
    Description

    This is the phone number of the customer.

  • Name
    firstName
    Type
    string
    Description

    This is the first name of the customer.

  • Name
    lastName
    Type
    string
    Description

    This is the last name of the customer.

  • Name
    street
    Type
    string
    Description

    This is the address of the customer.

  • Name
    town
    Type
    string
    Description

    This is the city of the customer.

  • Name
    state
    Type
    string
    Description

    This is the state of the customer.

  • Name
    zipCode
    Type
    string
    Description

    This is the zip code of the customer.

  • Name
    createdAt
    Type
    DateTime
    Description

    This is the date and time the customer was created.

  • Name
    updatedAt
    Type
    DateTime
    Description

    This is the date and time the customer was last updated.


POSTcustomers/v2/create

Create Customer

This endpoint allows you to create a new customer. All fields except notes are Required

Optional attributes

  • Name
    None
    Type
    None
    Description

    There are no additional attributes for this operation

Request

POST
customers/v2/create
  curl --location --request POST 'https://api.bluehillpayments.io/customers/v2/create' \
  --header 'Content-Type: application/json' \
  --data-raw '{
      "organizationId": "{{organizationId}}",
      "firstName": "Himanshu",
      "lastName": "Minocha",
      "street": "123 Alphabet St.",
      "town": "Chicago", 
      "zipCode": 60654, 
      "state": "MA", 
      "email": "himanshu@example.com", 
      "phoneNumber": "555-555-5555", 
      "company": "BlueHill Payments"
  }

Response

  {
      "data": {
          "company": "BlueHill Payments",
          "createdAt": "2023-01-11 02:03:44",
          "customerIds": null,
          "email": "himanshu@example.com",
          "fee": null,
          "firstName": "Himanshu1",
          "id": "76F1947E0A93405C984A7E5CE1A5A746",
          "lastName": "Minocha",
          "notes": null,
          "organizationId": "{{organizationId}}",
          "phoneNumber": "555-555-5555",
          "state": "MA",
          "street": "123 Alphabet St.",
          "town": "Chicago",
          "uniqueHash": "DD2F735ED79B4EF9889DDB51E270C16C",
          "updateAt": "2023-01-11 02:03:44",
          "zipCode": "60654"
      },
      "status": "success"
  }

DELETEcustomers/v2/delete/<id>

Delete Customer

This endpoint allows you to delete a customer. The only required field is customerId

Required attributes

  • Name
    customerId
    Type
    string
    Description

    The Id of the customer to delete

Request

DELETE
customers/v2/delete/:customerId
    curl --location --request DELETE 'https://api.bluehillpayments.io/customers/v2/delete/BDB87E3896D743D8A2E8AD312204779E'

Response

  {
      "data": {
          "company": "BlueHill Payments",
          "connectId": null,
          "createdAt": "2023-06-25 21:52:41",
          "customerIds": null,
          "email": "joe@example.com",
          "firstName": "Joe",
          "id": "BDB87E3896D743D8A2E8AD312204779E",
          "lastName": "Minocha",
          "notes": null,
          "organizationId": "9A6D20A4DB674341BDC290E1E88126BD",
          "phoneNumber": "555-555-5555",
          "state": "MA",
          "street": "123 Alphabet St.",
          "town": "Chicago",
          "uniqueHash": "5EAEA856764D4077B2791763279A8F0F",
          "updateAt": "2023-06-25 21:52:41",
          "zipCode": "60654"
      },
      "status": "success"
  }

GET/customers/v2/get-by-organization/:organizationId

Get All Customers

This endpoint allows you to get all the customers in your BlueHill Payments account.

Required attributes

  • Name
    organizationId
    Type
    string
    Description

    The organizationId for your BlueHill Account

Optional attributes

  • Name
    None
    Type
    None
    Description

    There are no additional attributes for this operation

Request

GET
/customers/v2/get-by-organization/:organizationId
  curl --location --request GET 'https://api.bluehillpayments.io/customers/v2/get-by-organization/{{organizationId}}'

Response

  {
      "data": [
          {
              "company": "Kanoodle",
              "createdAt": "2022-03-14 23:07:19",
              "customerIds": {
                  "braintree": "014E1518BD1A4B72A6EE5CE63B94D3E8"
              },
              "email": "vtomei0@dyndns.org",
              "fee": 0.0,
              "firstName": "Valene",
              "id": "76F1947E0A93405C984A7E5CE1A5A746",
              "lastName": "Tomei",
              "notes": "",
              "organizationId": "{{organizationId}}",
              "phoneNumber": "123-112-1235",
              "state": "Texas",
              "street": "1785 Sutherland Court",
              "town": "Houston",
              "uniqueHash": "7FA1764F33804161A5A4A890EE6061DD",
              "updateAt": "2023-01-03 00:58:07",
              "zipCode": "77075"
          },
          {
              "company": "Kamba",
              "createdAt": "2022-03-15 15:15:07",
              "customerIds": null,
              "email": "akernan1@sourceforge.net",
              "fee": 0.0,
              "firstName": "Averill",
              "id": "850760F383A94D35984C17A92DB14AE6",
              "lastName": "Kernan",
              "notes": "",
              "organizationId": "{{organizationId}}",
              "phoneNumber": "513-197-3019",
              "state": "Ohio\t",
              "street": "87 Eagan Road",
              "town": "Cincinnati",
              "uniqueHash": "221CB6B4C20143A9929D96ADD3B45822",
              "updateAt": "2022-09-21 22:15:08",
              "zipCode": "45213"
          },
          ...
      ],
      "status": "success"
  }

GET/customers/v2/get/:id

Get Customer By ID

This endpoint allows you to retrieve a customer by providing their BlueHill Payments id. Refer to the list at the top of this page to see which properties are included with customer objects.

Request

GET
/customers/v2/get/:id
curl --location --request GET 'https://api.bluehillpayments.io/customers/v2/get/EC8CD046740E43298BB1636DB0923A91'

Response

{
  "data": {
    "customer": {
        "company": "Mercy Support Services",
        "createdAt": "2022-10-04 20:11:56",
        "customerIds": {
            "braintree": "B38B2B5C413A49BC89A7FE6D5089BDC0"
        },
        "email": "mercy@bhp.io",
        "fee": 0.0,
        "firstName": "Mercy",
        "id": "B38B2B5C413A49BC89A7FE6D5089BDC0",
        "lastName": "Johnson",
        "notes": "",
        "organizationId": "{{organizationId}}",
        "phoneNumber": "555-555-5555",
        "state": "Florida",
        "street": "515 College Drive",
        "town": "middleburg",
        "uniqueHash": "2F8432C9EEAE4BE8A1631616C9104222",
        "updateAt": "2022-11-27 19:58:38",
        "zipCode": "32068"
      }
  },
  "status": "success"
}

POST/customers/v2/update

Update a Customer

This endpoint allows you to perform an update on a contact. Currently, the only attribute that can be updated on contacts is the display_name attribute which controls how a contact appears in your contact list in BlueHill Payments.

Optional attributes

  • Name
    firstName
    Type
    string
    Description

    Update the first name of the customer.

  • Name
    lastName
    Type
    string
    Description

    Update the last name of the customer.

  • Name
    email
    Type
    string
    Description

    Update the email of the customer.

  • Name
    phoneNumber
    Type
    string
    Description

    Update the phone number of the customer.

  • Name
    street
    Type
    string
    Description

    Update the street of the customer.

  • Name
    town
    Type
    string
    Description

    Update the town of the customer.

  • Name
    state
    Type
    string
    Description

    Update the state of the customer.

  • Name
    zipCode
    Type
    string
    Description

    Update the zip code of the customer.

  • Name
    company
    Type
    string
    Description

    Update the company of the customer.

  • Name
    notes
    Type
    string
    Description

    Update the notes of the customer.

Request

POST
/contacts/v2/update
curl --location --request POST 'https://api.bluehillpayments.io/customers/v2/create' \
--header 'Content-Type: application/json' \
--data-raw '{
    "id": "ID_OF_CUSTOMER_TO_UPDATE",
    "organizationId" : "{{organizationId}}",
    "firstName": "Himanshu",
    "lastName": "Minocha",
    "street": "123 Alphabet St.",
    "town": "Chicago", 
    "zipCode": 60654, 
    "state": "MA", 
    "email": "himanshu@example.com", 
    "phoneNumber": "555-555-5555", 
    "notes": ""
}'

Response

{
    "data": {
        "company": "Hello",
        "createdAt": "2023-01-11 04:36:32",
        "customerIds": null,
        "email": "himanshu@example.com",
        "fee": null,
        "firstName": "Himanshu",
        "id": "AD44259B11C6416A955AD813345D0BAD",
        "lastName": "Minocha",
        "notes": "",
        "organizationId": "{{organizationId}}",
        "phoneNumber": "555-555-5555",
        "state": "MA",
        "street": "123 Alphabet St.",
        "town": "Chicago",
        "uniqueHash": "BC73DC8CA1454B079B6071CC631C0960",
        "updateAt": "2023-01-11 04:36:32",
        "zipCode": "60654"
    },
    "status": "success"
}