# Create Delegated Mandate
source: https://developer.mastercard.com/bs-creditor-api/documentation/use-cases/use-cases-1/index.md

This use case describes how a delegated mandate is created.


Diagram use_case1

This example describes the workflow for a debtor choosing a monthly donation plan of DKK 150 with an environmental non-profit organization (creditor).

1. The debtor selects the plan and completes the creditor's e-commerce checkout flow.
2. The debtor completes authentication on the creditor's website and approves the payment plan using Betalingsservice as the payment method. By doing this, the debtor authorizes the creditor to submit and establish a mandate on their behalf (hence it is delegated).
3. To submit the delegated mandate, the creditor must:
   1. Generate a UUID that identifies the request for creation of the delegated mandate.
   2. Prepare the rest of the payload according to the provided Open API specification. For more information, see the [API Reference](https://developer.mastercard.com/bs-creditor-api/documentation/api-reference/index.md#APIs) section.
   3. Send a POST request to the BS Creditor API that includes the necessary OAuth 1.0a properties for [authentication](https://developer.mastercard.com/bs-creditor-api/documentation/api-basics/index.md#Authentication) to ensure that the request is securely validated by the BS Creditor API.
4. The BS Creditor API validates the request and returns the following in the response body:
   * 201 status code
   * UUID
   * RECEIVED status code
5. The BS Creditor API forwards the request to the Betalingsservice system. From this step, the process is asynchronous and the BS Creditor API will not get an immediate response.
6. The Betalingsservice system sends the request to the debtor's bank for approval.
7. The debtor's bank can:
   * **Approve** the request resulting in the creation of the mandate.
   * **Reject** the request due to incorrect debtor account information.
8. Based on whether the request is approved or rejected:
   * For approved requests, the Betalingsservice system notifies the BS Creditor API, and the state of the delegated mandate changes from RECEIVED to VALIDATED.
   * For rejected requests, no mandate is created, the Betalingsservice system notifies the BS Creditor API, and the state of the delegated mandate changes from RECEIVED to FAILED. Also, the BS creditor API is provided with an error code and an error description. For example, if the debtor account information is incorrect, the response will include error code 230940 and error description DEBTOR_ACCOUNT_INFORMATION_IS_NOT_CORRECT. For a comprehensive list of potential error codes and failure scenarios, see the [Error Codes](/documentation/code-and-formats/#Error Codes) section.
