---
updatedAt: 2026-03-31T12:12:41.000Z
agentTools:
  projectIndex: https://api.net2grid.com/llms.txt
---

# /datahub/mandate

Used to request the creation of a mandate towards the Datahub API for a user.<br/>
    In case of the Fluvius datahub, the consumer is required to provide consent in the Fluvius portal. Once completed,
    they can be redirected to the customer's landing page using two predefined return URLs, the success and failure URLs.
    This endpoint allows the client application to specify these success and failure URLs.<br/>
    - If none of these URLs is provided then the Label Partner default configurations are going to be used.<br/>
    - If no URLs are specified in this endpoint and the default URLs are not specified at the Label Partner configuration,
    then no URLs will be sent to the datahub at all.<br/>
    - If only one of the URLs is provided in the request, the request will return an error.<br/><br/>
    Additionally, validation of the URLs is performed to ensure they are valid.<br/>
    - The validation process checks whether the provided string follows the URL format but does not perform domain
    validation.<br/>
    - Fluvius is required to whitelist these URLs for them to be accepted from their end. If a URL is not whitelisted,
    any request to Fluvius will fail.
    

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "NET2GRID Customer Engagement API",
    "description": "This is the B2C NET2GRID API that can be used by mobile and web apps to manage the accounts and the data that are provided by the NET2GRID Meter Data Analytics Platform.",
    "version": "13.6.0"
  },
  "servers": [
    {
      "url": "http://api.net2grid.docker",
      "description": "API server"
    }
  ],
  "paths": {
    "/v2/datahub/mandate": {
      "post": {
        "tags": [
          "Account Status"
        ],
        "summary": "/datahub/mandate",
        "description": "Used to request the creation of a mandate towards the Datahub API for a user.<br/>\n    In case of the Fluvius datahub, the consumer is required to provide consent in the Fluvius portal. Once completed,\n    they can be redirected to the customer's landing page using two predefined return URLs, the success and failure URLs.\n    This endpoint allows the client application to specify these success and failure URLs.<br/>\n    - If none of these URLs is provided then the Label Partner default configurations are going to be used.<br/>\n    - If no URLs are specified in this endpoint and the default URLs are not specified at the Label Partner configuration,\n    then no URLs will be sent to the datahub at all.<br/>\n    - If only one of the URLs is provided in the request, the request will return an error.<br/><br/>\n    Additionally, validation of the URLs is performed to ensure they are valid.<br/>\n    - The validation process checks whether the provided string follows the URL format but does not perform domain\n    validation.<br/>\n    - Fluvius is required to whitelist these URLs for them to be accepted from their end. If a URL is not whitelisted,\n    any request to Fluvius will fail.\n    ",
        "operationId": "v2postDataHubMandate",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PostDatahubMandateDTO"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MandateCreationResponseDTO"
                },
                "examples": {
                  "Mandate Creation": {
                    "$ref": "#/components/examples/PostMandateCreation"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid Request<br/>102: User already active on platform\n    <br/>425: datahub POST mandate call is disabled\n    <br/>434: Create mandate failed by Datahub\n    <br/>435: Either none or both return URLs should be provided\n    <br/>436: Invalid URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDTO"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "MandateCreationDataDTO": {
        "required": [
          "customer_id",
          "url"
        ],
        "properties": {
          "customer_id": {
            "description": "Customer identifier as of the datahub (reference number).",
            "type": "string"
          },
          "url": {
            "description": "URL provided by the datahub.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "MandateCreationResponseDTO": {
        "required": [
          "status",
          "data"
        ],
        "properties": {
          "status": {
            "description": "The status of the call, it displays “ok” if it is successful.",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/MandateCreationDataDTO"
          }
        },
        "type": "object"
      },
      "PostDatahubMandateDTO": {
        "properties": {
          "success_url": {
            "description": "Redirection route in case of a successful mandate creation. It must be a valid URL.",
            "type": "string",
            "example": "https://example.com/success"
          },
          "failure_url": {
            "description": "Redirection route in case of a failed mandate creation. It must be a valid URL.",
            "type": "string",
            "example": "https://example.com/failure"
          }
        },
        "type": "object"
      },
      "ErrorDTO": {
        "properties": {
          "code": {
            "type": "integer"
          },
          "message": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ErrorResponseDTO": {
        "properties": {
          "status": {
            "type": "string"
          },
          "error": {
            "$ref": "#/components/schemas/ErrorDTO"
          }
        },
        "type": "object"
      }
    },
    "examples": {
      "PostMandateCreation": {
        "summary": "Mandate Creation",
        "value": {
          "status": "ok",
          "data": {
            "customer_id": "12345678",
            "url": "https://some_datahub_url?id=<mandate_request_id>"
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "bearerFormat": "JWT",
        "scheme": "bearer"
      }
    }
  },
  "tags": [
    {
      "name": "Account Status"
    }
  ],
  "x-explorer-enabled": false
}
```