Update M-PIN ID

Updates a device registration.

Endpoint Supported methods Full URL
/api/v1/projects/<PROJECT_ID>/mpinids/{mpinId} PUT api.mpin.io/api/v1/projects/<PROJECT_ID>/mpinids/{mpinId}

# Endpoint Authentication

  • Basic - The Client ID and Client Secret are used as a username:password pair for the HTTP Basic authentication of the request.

    Authorization: "Basic <base64(<YOUR_CLIENT_ID:YOUR_CLIENT_SECRET>)>"
    
  • Bearer - A service account issued by MIRACL Trust that enables back-end services to access MIRACL Trust’s back-end APIs.

    Each service account is assigned a token by MIRACL Trust. This token must be included in the Authorization header of API requests, using the standard Bearer token format:

    Authorization: "Bearer <YOUR_SERVICE_ACCOUNT_TOKEN>"
    

    For more information, see Create a Service Account.

# Parameters

Name Type Required Description
deviceName Body True A human-readable name for the device registration. It is used in the MIRACL Trust PIN Pad and can be used in a Client-Hosted PIN Pad implementation.
labels Body False List of labels attached to the device. It can be used in a Client-Hosted PIN Pad implementation.

# Request Example

curl \
  --request PUT \
  --user "${YOUR_CLIENT_ID}:${YOUR_CLIENT_SECRET}" \
  --data '{
    "deviceName":"'"${NEW_DEVICE_NAME}"'",
    "labels": ["'"${LABEL_A}"'", "'"${LABEL_B}"'"]}'
  }' \
  "https://api.mpin.io/api/v1/projects/${YOUR_PROJECT_ID}/mpinids/${MPIN_ID}"

# Response Example

{
  "mpinId": "c324f5e55e377de0343f37019ad5b77b8b01bdfee40014a54d76fd934e36a792",
  "userId": "test@example.com",
  "deviceName": "<NEW_DEVICE_NAME>",
  "labels": ["<LABEL_A>", "<LABEL_B>"],
  "ip": "87.227.194.151",
  "country": "UK",
  "dvs": false,
  "createdAt": "2023-05-17T13:07:24.59692Z",
  "updatedAt": "2023-05-17T13:07:24.597557Z",
  "revoked": false
}

# Errors

# UNAUTHORIZED

The request needs to be authenticated with valid Client ID and Client Secret. For more information, see the Endpoint Authentication section above.

{
  "error": "UNAUTHORIZED",
  "info": "Access not allowed due to invalid credentials."
}

# FORBIDDEN

The request has been authorised with credentials that lack permissions for the requested project.

{
  "error": "FORBIDDEN",
  "info": "The request is forbidden."
}

# INVALID_REQUEST_PARAMETERS

Missing or invalid parameters from the request. You can see the affected parameter(s) in the context of the error. For information about the possible parameters, see the Parameters section above.

{
  "error": "INVALID_REQUEST_PARAMETERS",
  "info": "Missing or invalid parameters from the request.",
  "context": {
    "params": "deviceName"
  }
}

# INVALID_REQUEST_PAYLOAD

Request payload doesn’t match the schema. For information about the possible parameters, see the Parameters section above.

{
  "error": "INVALID_REQUEST_PAYLOAD",
  "info": "Request payload doesn't match schema."
}

# INVALID_REQUEST_BODY

The request payload needs to be a valid JSON.

{
  "error": "INVALID_REQUEST_BODY",
  "info": "The request payload is invalid JSON."
}

# METHOD_NOT_ALLOWED

The request was made using an incorrect HTTP method.

{
  "error": "METHOD_NOT_ALLOWED",
  "info": "The request method is not allowed."
}