B2B users

Customer-portal logins. Credentials are never returned.

The object#

FieldTypeDescription
idread-onlyintegerNolaPro id.
firstnamestring(100)The portal user’s first name.
lastnamestring(100)The portal user’s last name.
loginnamestring(100)Login name for the B2B portal. Customers and vendors sign in to the portal with this, not with a NolaPro user account.
usertypeintegerWhat kind of portal user this is: 1 = customer contact, 2 = vendor contact, 0 = self-registered appointments login (no linked record). Legacy values 3 and 4 are treated as vendor.
referenceidintegerThe customer id (usertype 1) or vendor id (usertype 2) this login belongs to. Polymorphic, so there is no code sibling - send the id.
cancelbooleanCancelled. Always a boolean on the wire, whatever integer width the column uses (D23).
entrydateread-onlystringWhen the record was created.
lastchangedateread-onlystringLast modification. Drives modifiedsince.
emailstring(255)Email address. Password resets and portal notifications go here.
viewedprivacypolicymessageread-onlyintegerSet to 1 when the portal user dismisses the privacy-policy notice. It records the user’s own acknowledgment, so it cannot be written through the API.
wpemailconfirmedread-onlystring(255)Email address the appointments (external WordPress) login flow has verified. Set only when the user completes the emailed verification link, so it cannot be written through the API.
wpemailunconfirmedread-onlystring(255)Address awaiting verification in the appointments login flow. Moves to wpemailconfirmed when the user clicks the emailed link.
externalidstring(100)Your own key. Scoped to your company.

Endpoints#

POST/b2busers/batch 207

Create many.

Requires scope customers:write.

Parameters
NameInTypeNotes
Body array
FieldTypeDescription
idread-onlyintegerNolaPro id.
firstnamestring(100)The portal user’s first name.
lastnamestring(100)The portal user’s last name.
loginnamestring(100)Login name for the B2B portal. Customers and vendors sign in to the portal with this, not with a NolaPro user account.
usertypeintegerWhat kind of portal user this is: 1 = customer contact, 2 = vendor contact, 0 = self-registered appointments login (no linked record). Legacy values 3 and 4 are treated as vendor.
referenceidintegerThe customer id (usertype 1) or vendor id (usertype 2) this login belongs to. Polymorphic, so there is no code sibling - send the id.
cancelbooleanCancelled. Always a boolean on the wire, whatever integer width the column uses (D23).
entrydateread-onlystringWhen the record was created.
lastchangedateread-onlystringLast modification. Drives modifiedsince.
emailstring(255)Email address. Password resets and portal notifications go here.
viewedprivacypolicymessageread-onlyintegerSet to 1 when the portal user dismisses the privacy-policy notice. It records the user’s own acknowledgment, so it cannot be written through the API.
wpemailconfirmedread-onlystring(255)Email address the appointments (external WordPress) login flow has verified. Set only when the user completes the emailed verification link, so it cannot be written through the API.
wpemailunconfirmedread-onlystring(255)Address awaiting verification in the appointments login flow. Moves to wpemailconfirmed when the user clicks the emailed link.
externalidstring(100)Your own key. Scoped to your company.
curl -X POST \
  'https://acme.nolapro.com/!/api/v2/b2busers/batch' \
  -H 'Authorization: Bearer $NP_TOKEN' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: your-unique-key' \
  -d '[
    {
        "firstname": "Example firstname",
        "lastname": "Example lastname",
        "loginname": "Example loginname",
        "usertype": 1,
        "referenceid": 104,
        "email": "Example email"
    }
]'
GET/b2busers 200403

List b2b users.

Requires scope customers:read.

Parameters
NameInTypeNotes
cancelquerystringDefaults to false. Pass true or any.
modifiedsincequerystringRFC 3339 UTC timestamp. Returns only records changed since then, including cancelled ones - so cancel defaults to any rather than false when this is used. The response carries _meta.synced_through; store it and send it back next time.
externalidquerystringExact match on your own key.
includequerystringComma-separated extras to embed. Only custom_fields is available: the extra fields this install has defined on the record. Off by default, and an unrecognised value is refused rather than ignored. See Conventions.
When it fails
StatusCodeMeaning
403insufficient_scopeToken lacks read scope.
curl \
  'https://acme.nolapro.com/!/api/v2/b2busers' \
  -H 'Authorization: Bearer $NP_TOKEN'
POST/b2busers 201400

Create.

Requires scope customers:write.

Parameters
NameInTypeNotes
Body
FieldTypeDescription
idread-onlyintegerNolaPro id.
firstnamestring(100)The portal user’s first name.
lastnamestring(100)The portal user’s last name.
loginnamestring(100)Login name for the B2B portal. Customers and vendors sign in to the portal with this, not with a NolaPro user account.
usertypeintegerWhat kind of portal user this is: 1 = customer contact, 2 = vendor contact, 0 = self-registered appointments login (no linked record). Legacy values 3 and 4 are treated as vendor.
referenceidintegerThe customer id (usertype 1) or vendor id (usertype 2) this login belongs to. Polymorphic, so there is no code sibling - send the id.
cancelbooleanCancelled. Always a boolean on the wire, whatever integer width the column uses (D23).
entrydateread-onlystringWhen the record was created.
lastchangedateread-onlystringLast modification. Drives modifiedsince.
emailstring(255)Email address. Password resets and portal notifications go here.
viewedprivacypolicymessageread-onlyintegerSet to 1 when the portal user dismisses the privacy-policy notice. It records the user’s own acknowledgment, so it cannot be written through the API.
wpemailconfirmedread-onlystring(255)Email address the appointments (external WordPress) login flow has verified. Set only when the user completes the emailed verification link, so it cannot be written through the API.
wpemailunconfirmedread-onlystring(255)Address awaiting verification in the appointments login flow. Moves to wpemailconfirmed when the user clicks the emailed link.
externalidstring(100)Your own key. Scoped to your company.
When it fails
StatusCodeMeaning
400invalid_requestA required field was missing.
curl -X POST \
  'https://acme.nolapro.com/!/api/v2/b2busers' \
  -H 'Authorization: Bearer $NP_TOKEN' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: your-unique-key' \
  -d '{
    "firstname": "Example firstname",
    "lastname": "Example lastname",
    "loginname": "Example loginname",
    "usertype": 1,
    "referenceid": 104,
    "email": "Example email"
}'
Response 201
{
    "firstname": "Example firstname",
    "lastname": "Example lastname",
    "loginname": "Example loginname",
    "usertype": 1,
    "referenceid": 104,
    "email": "Example email"
}
GET/b2busers/{id} 200404

Retrieve one record.

Requires scope customers:read.

Parameters
NameInTypeNotes
idrequiredpathintegerThe record id.
includequerystringComma-separated extras to embed. Only custom_fields is available: the extra fields this install has defined on the record. Off by default, and an unrecognised value is refused rather than ignored. See Conventions.
When it fails
StatusCodeMeaning
404not_foundNo record with that id.
curl \
  'https://acme.nolapro.com/!/api/v2/b2busers/104' \
  -H 'Authorization: Bearer $NP_TOKEN'
Response 200
{
    "firstname": "Example firstname",
    "lastname": "Example lastname",
    "loginname": "Example loginname",
    "usertype": 1,
    "referenceid": 104,
    "email": "Example email"
}
PATCH/b2busers/{id} 200404

Update.

Requires scope customers:write.

Parameters
NameInTypeNotes
idrequiredpathintegerThe record id.
Body
FieldTypeDescription
idread-onlyintegerNolaPro id.
firstnamestring(100)The portal user’s first name.
lastnamestring(100)The portal user’s last name.
loginnamestring(100)Login name for the B2B portal. Customers and vendors sign in to the portal with this, not with a NolaPro user account.
usertypeintegerWhat kind of portal user this is: 1 = customer contact, 2 = vendor contact, 0 = self-registered appointments login (no linked record). Legacy values 3 and 4 are treated as vendor.
referenceidintegerThe customer id (usertype 1) or vendor id (usertype 2) this login belongs to. Polymorphic, so there is no code sibling - send the id.
cancelbooleanCancelled. Always a boolean on the wire, whatever integer width the column uses (D23).
entrydateread-onlystringWhen the record was created.
lastchangedateread-onlystringLast modification. Drives modifiedsince.
emailstring(255)Email address. Password resets and portal notifications go here.
viewedprivacypolicymessageread-onlyintegerSet to 1 when the portal user dismisses the privacy-policy notice. It records the user’s own acknowledgment, so it cannot be written through the API.
wpemailconfirmedread-onlystring(255)Email address the appointments (external WordPress) login flow has verified. Set only when the user completes the emailed verification link, so it cannot be written through the API.
wpemailunconfirmedread-onlystring(255)Address awaiting verification in the appointments login flow. Moves to wpemailconfirmed when the user clicks the emailed link.
externalidstring(100)Your own key. Scoped to your company.
When it fails
StatusCodeMeaning
404not_foundNo record with that id.
curl -X PATCH \
  'https://acme.nolapro.com/!/api/v2/b2busers/104' \
  -H 'Authorization: Bearer $NP_TOKEN' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: your-unique-key' \
  -d '{
    "firstname": "Example firstname",
    "lastname": "Example lastname",
    "loginname": "Example loginname",
    "usertype": 1,
    "referenceid": 104,
    "email": "Example email"
}'
Response 200
{
    "firstname": "Example firstname",
    "lastname": "Example lastname",
    "loginname": "Example loginname",
    "usertype": 1,
    "referenceid": 104,
    "email": "Example email"
}
DELETE/b2busers/{id} 200404

Cancel.

Requires scope customers:cancel.

Parameters
NameInTypeNotes
idrequiredpathintegerThe record id.
When it fails
StatusCodeMeaning
404not_foundNo record with that id.
curl -X DELETE \
  'https://acme.nolapro.com/!/api/v2/b2busers/104' \
  -H 'Authorization: Bearer $NP_TOKEN'
Response 200
{
    "firstname": "Example firstname",
    "lastname": "Example lastname",
    "loginname": "Example loginname",
    "usertype": 1,
    "referenceid": 104,
    "email": "Example email"
}