Skip to content

Manage Accounts

Unmanagable Accounts

Within MyPup the accounts are "shared" accross all the tenants. This means that the e-mail addresses are globally unique. Only accounts that are linked to a PickUpPoint that you (the tenant) can manage can be managed (looked up and/or changed). All other accounts cannot be looked up. It is however possible to check if an e-mail address is already registered with MyPup by using the GetAccount call.

SetAccountDetails

Location /v1/Account/SetAccountDetails

Can be used to update account information.

Note

If you want to update name or address all fields are required. So if you want to update StreetName then StreetNo, MailBox, City and CountryCode are required.

{
    # Mandatory Fields
    "userUid": null,                # The Unique identifier of the account to be updated

    # Optional Fields
    "emailAddress": "",             # Email address, also used for e-mail messages
    "phoneNumber": "",              # Mobile phone number, used for SMS messages
    "languageCode": null,           # Communication language, e.g. 'nl', 'nl-NL', 'en-GB', 'en'

    # Name                          # All fields of name (first and last name) are only required if one or more are set
    "firstName": "",                # First name, used in communication
    "lastName": "",                 # Last name, used in communication

    # Address                       # All address fields below are only required if one or more are set
    "streetName": null,
    "streetNo": null,
    "mailbox": null,
    "city": null,
    "countryCode": null             # Two letter (ISO 3166-1 alpha-2) country code of the address
}
POST /v1/Account/SetAccountDetails HTTP/1.1
Host: api.staging.mypup.app
Authorization: Bearer ......
Content-Type: application/json

{
    "userUid": "c492877c...3dea5663",

    "emailAddress": "janjanssen@domain.com",
    "phoneNumber": "0612345679",
    "firstName": "Jan",
    "lastName": "Janssen",    

    "streetName": "Kalverstraat",
    "streetNo": 1,
    "city": "Amsterdam",
    "mailbox": "1234AB",
    "languageCode": "NL",
    "countryCode": "NL"
}
{
  "userUid": "",                    # Unique identifier (if found)
  "canManageUser": true/false,      # True when the authenticated user (you) can manage/change/see the 
                                    # user's details. If the account existed and is managed by another
                                    # tenant then this will be false and all the other fields are null.
                                    # tenant then this will be false and all the other fields are null.
  "firstName": "Jan",
  "lastName": "Janssen",
  "emailAddress": "janjanssen@domain.com",
  "phoneNumber": "0612345679",
  "mainPupUid": "ca5...b5e6",       # Linked main pick up point for this account.
  "mainPupName": "Pup Name",
  "languageCode": "en-GB",          # Optional language code of the account.
  "mailCode": "MyPup A...F",        # Mail delivery code of this account

  "success": true/false,            # Command executed successfully
  "error": null,                    # Error code (if any)
  "message": null                   # Error message (if any)
}
error code Description
Generic Error Codes Any of the generic error codes.
InvalidUserUid No or invalid user uid in request
EmailAlreadyRegistered Email address is already registered for another account

SetAccountPickUpPoint

Location /v1/Account/SetAccountPickUpPoint

Can be used to update the account's default PickUpPoint.

{
    # Mandatory Fields
    "userUid": null,                    # The Unique identifier of the account to be updated with the new PickUpPoint
    "pickUpPointUid": null              # The Unique identifier of the new default PickUpPoint
}
POST /v1/Account/SetAccountPickUpPoint HTTP/1.1
Host: api.staging.mypup.app
Authorization: Bearer ......
Content-Type: application/json

{
    "pickUpPointUid": "c8c3650e...47645",
    "userUid": "75815d3b...c964"
}
{
  "userUid": "",                    # Unique identifier of the account (if found)
  "pupUid": "",                     # The current default PickUp Point for the given account
  "pickUpPointChanged": true/false, # If the account pickUpPoint is changed


  "success": true/false,            # Command executed successfully
  "error": null,                    # Error code (if any)
  "message": null                   # Error message (if any)
}
error code Description
Generic Error Codes Any of the generic error codes.
InvalidUserUid No or invalid user uid in request

SetAccountMutationConfig

Location /v1/Account/SetAccountMutationConfig

Can be used to update account's mutation configuration. Only the fields having a non-null value will be changed. See GetAccountMutationConfig for more info.

{
    # Mandatory Fields
    "userUid": null,                # The Unique identifier of the account to be updated

    # Optional Fields
    "canChangeFirstName": true/false/null
    "canChangeLastName": true/false/null
    "canChangeEmailAddress": true/false/null
    "canChangePhoneNumber": true/false/null
    "canChangeLanguageCode": true/false/null
    "canChangeMainPickUpPoint": true/false/null
    "canChangeAddress": true/false/null
    "canRemoveAutomatically": true/false/null
    "canRemoveManually": true/false/null
}
POST /v1/Account/SetAccountMutationConfig HTTP/1.1
Host: api.staging.mypup.app
Authorization: Bearer ......
Content-Type: application/json

{
    "userUid": "c492877c...3dea5663",

    "canChangeFirstName": false
    "canChangeLastName": false
    "canRemoveAutomatically": false
    "canRemoveManually": false
}
{
    "userUid": "638f2f...a2fa",         # Unique identifier (if found)

    "canChangeFirstName": true/false
    "canChangeLastName": true/false
    "canChangeEmailAddress": true/false
    "canChangePhoneNumber": true/false
    "canChangeLanguageCode": true/false
    "canChangeMainPickUpPoint": true/false
    "canChangeAddress": true/false
    "canRemoveAutomatically": true/false
    "canRemoveManually": true/false
    .  
    "success": true/false,              # Command executed successfully
    "error": null,                      # Error code (if any)
    "message": null                     # Error message (if any)
}
error code Description
Generic Error Codes Any of the generic error codes.
InvalidUserUid No or invalid user uid in request

RemoveAccount

Location /v1/Account/RemoveAccount

Can be used to remove account (that can be managed).

{
    # Mandatory Fields
    "userUid": null,                # The Unique identifier of the account which may be deleted
}
POST /v1/Account/RemoveAccount HTTP/1.1
Host: api.staging.mypup.app
Authorization: Bearer ......
Content-Type: application/json

{
  "userUid": "c492877c...3dea5663"
}
{
  "success": true/false,            # Command executed successfully
  "error": null,                    # Error code (if any)
  "message": null                   # Error message (if any)
}
error code Description
Generic Error Codes Any of the generic error codes.
InvalidUserUid No or invalid user uid in request