NAV Navigation
HTTP cURL JavaScript PHP Ruby Python Java Go

Welcome

This documentation was last updated on Thu Jan 18 07:20:24 UTC 2024

Welcome to the Mambu Functions API Reference documentation.

Mambu Functions help you enhance your financial products by extending the functionality of the Mambu composable banking platform. Using Functions reduces the time it takes to create custom financial products and gives you the power to customize for your unique requirements by injecting your own code into existing business processes.

Base URLs

The base URL for requests to the API is:

https://TENANT_NAME.mambu.com/api/mambu-functions

You may also use the sandbox environment for testing. The sandbox environment is generally one version ahead of the production environment. The base URL for your sandbox environment is:

https://TENANT_NAME.sandbox.mambu.com/api/mambu-functions

HTTP verbs

Standard HTTP verbs are used to indicate the API request method.

Verb Function
GET To get a resource or a collection of resources
POST To create a resource
PUT To replace an existing resource
DELETE To delete a resource

Open API Specification

Use this link to get the latest Open API Specification.

This documentation is automatically generated from an OpenAPI Specification (OAS).

This OAS file can also be used to quickly scaffold client software development kits, in various languages, for interacting with our APIs using tools such as Swagger Editor.

Using the API

Authentication

Mambu supports two methods for authenticating API requests:

Basic Authentication

curl --location --request GET 'https://TENANT_NAME.mambu.com/api/users' \
--header 'Authorization: Basic U29tZVVzZXI6T3BlblNlc2FtZQ=='
GET /api/users HTTP/1.1
Host: TENANT_NAME.mambu.com
Authorization: Basic U29tZVVzZXI6T3BlblNlc2FtZQ==
var settings = {
  "url": "https://TENANT_NAME.mambu.com/api/users",
  "method": "GET",
  "timeout": 0,
  "headers": {
    "Authorization": "Basic U29tZVVzZXI6T3BlblNlc2FtZQ=="
  },
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
require "uri"
require "net/http"

url = URI("https://TENANT_NAME.mambu.com/api/users")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = "Basic U29tZVVzZXI6T3BlblNlc2FtZQ=="

response = https.request(request)
puts response.read_body
import requests

url = "https://TENANT_NAME.mambu.com/api/users"

payload={}
headers = {
  'Authorization': 'Basic U29tZVVzZXI6T3BlblNlc2FtZQ=='
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
Request request = new Request.Builder()
  .url("https://TENANT_NAME.mambu.com/api/users")
  .method("GET", null)
  .addHeader("Authorization", "Basic U29tZVVzZXI6T3BlblNlc2FtZQ==")
  .build();
Response response = client.newCall(request).execute();
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://TENANT_NAME.mambu.com/api/users"
  method := "GET"

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, nil)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "Basic U29tZVVzZXI6T3BlblNlc2FtZQ==")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}

For basic authorization, provide your username and password directly via the Authorization header in the format Basic {base64-encoded-string}, where base64-encoded-string is the base-64-encoded value of your username and password separated by a colon ':'.

For example, a user with the username SomeUser and the password OpenSesame would take the value SomeUser:OpenSesame and base-64 encode it, yielding U29tZVVzZXI6T3BlblNlc2FtZQ==. They would then provide an Authorization header for their request with the value Basic U29tZVVzZXI6T3BlblNlc2FtZQ==.

See the code samples for this section for sample GET requests to the /users endpoint using the above example.

Note that the login credentials must be for a user account with API access permissions. For more information, see Creating a User - Access Rights in our User Guide.

API Keys

API keys are tokens that you provide in an apiKey header to authenticate requests. They are generated by API consumers, which are an abstraction similar to an OAuth client.

API consumers are currently an Early Access feature. If you would like to request access to this feature, please get in touch with your Mambu Customer Success Manager to discuss your requirements.

For more information on API consumers and keys, see API Consumers in our User Guide.

Content types

The Mambu Functions API will only accept JSON content. The format should be specified in the Content-Type header with the value application/json. Check the parameters table for each request for the required value for the Content-Type header.

For certain requests, including some POST requests, there is no need to supply a request body. For these requests, the Content-Type header can be omitted.

Endpoints

Get all deployed Functions

Code samples

# You can also use wget
curl -X GET https://TENANT_NAME.mambu.com/api/mambu-functions \
  -H 'Accept: application/vnd.mambu.v2+json'

GET https://TENANT_NAME.mambu.com/api/mambu-functions HTTP/1.1
Host: tenant_name.mambu.com
Accept: application/vnd.mambu.v2+json


const headers = {
  'Accept':'application/vnd.mambu.v2+json'
};

fetch('https://TENANT_NAME.mambu.com/api/mambu-functions',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/vnd.mambu.v2+json'
}

result = RestClient.get 'https://TENANT_NAME.mambu.com/api/mambu-functions',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/vnd.mambu.v2+json'
}

r = requests.get('https://TENANT_NAME.mambu.com/api/mambu-functions', headers = headers)

print(r.json())

 'application/vnd.mambu.v2+json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://TENANT_NAME.mambu.com/api/mambu-functions', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://TENANT_NAME.mambu.com/api/mambu-functions");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/vnd.mambu.v2+json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://TENANT_NAME.mambu.com/api/mambu-functions", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /mambu-functions

Gets a list of Mambu Functions, with optional filtering by extensionPointId. This operation also supports pagination to help manage large lists.

Parameters

Name Type Description In
extensionPointId string The ID of the Extension Point (for example, DEPOSIT_FEE_AMOUNT). query
offset integer(int32) For pagination this defines the start index to search from when getting elements and is used in combination with limit to paginate results. query
limit integer(int32) For pagination this defines the number of elements to get and is used in combination with offset to paginate results. query
paginationDetails string Flag specifying whether the pagination details should be provided in response headers. Please note that this is disabled (OFF) by default. query

Enumerated Values

Parameter Value
paginationDetails ON
paginationDetails OFF

Example Responses

200 Response

[
  {
    "name": "my-func-1",
    "state": "ACTIVE",
    "version": "v1",
    "lastModifiedDate": "2023-05-08T06:53:52Z",
    "extensionPointId": "DEPOSIT_FEE_AMOUNT"
  }
]

Responses

Status Meaning Description Schema
200 OK Returned Mambu Functions Inline
400 Bad Request Bad Request - Validation: This code is returned when there is malformed syntax in the request or incorrect data in the payload. ErrorResponse
401 Unauthorized Unauthorized ErrorResponse
403 Forbidden Forbidden ErrorResponse

Response Schema

Status Code 200

Name Type Description Restrictions
anonymous [MambuFunction] [Represents a Mambu Function.] none
» name string The name of the Mambu Function. none
» state string The current state of the Mambu Function. none
» version string The version of the Mambu Function. none
» lastModifiedDate string(date-time) The last date the Mambu Function was updated (in UTC). none
» extensionPointId string The ID of the extension point none

Enumerated Values

Property Value
state CREATE_PENDING
state UPDATE_PENDING
state ACTIVE
state FAILED
state REMOVING

Response Headers

Status Header Type Format Description
200 Items-Offset integer int32 The index of the first returned item.
200 Items-Limit integer int32 The size of the requested list.
200 Items-Total integer int32 The total number of available items.

Create Mambu Function

Code samples

# You can also use wget
curl -X POST https://TENANT_NAME.mambu.com/api/mambu-functions \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/vnd.mambu.v2+json' \
  -H 'Content-Type: string'

POST https://TENANT_NAME.mambu.com/api/mambu-functions HTTP/1.1
Host: tenant_name.mambu.com
Content-Type: application/json
Accept: application/vnd.mambu.v2+json
Content-Type: string

const inputBody = '{
  "name": "my-func-1",
  "extensionPointId": "DEPOSIT_FEE_AMOUNT",
  "version": "v1",
  "functionCode": {
    "languageId": "es2020",
    "code": "ZXhwb3J0cy5kZWZhdWx0ID0gYXN5bmMgZnVuY3Rpb24oaW5wdXQpIHsgCiAgcmV0dXJuIGlucHV0LnRvdGFsQmFsYW5jZSAqIDAuMDE7IAp9"
  }
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/vnd.mambu.v2+json',
  'Content-Type':'string'
};

fetch('https://TENANT_NAME.mambu.com/api/mambu-functions',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/vnd.mambu.v2+json',
  'Content-Type' => 'string'
}

result = RestClient.post 'https://TENANT_NAME.mambu.com/api/mambu-functions',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/vnd.mambu.v2+json',
  'Content-Type': 'string'
}

r = requests.post('https://TENANT_NAME.mambu.com/api/mambu-functions', headers = headers)

print(r.json())

 'application/json',
    'Accept' => 'application/vnd.mambu.v2+json',
    'Content-Type' => 'string',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://TENANT_NAME.mambu.com/api/mambu-functions', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://TENANT_NAME.mambu.com/api/mambu-functions");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/vnd.mambu.v2+json"},
        "Content-Type": []string{"string"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://TENANT_NAME.mambu.com/api/mambu-functions", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /mambu-functions

This operation creates a new Mambu Function and returns the status of the created Function, including its deployment state.

Depending on the outcome of this operation, the returned Function might be in one of these states:

State Description
ACTIVE Mambu Function has been successfully deployed and is ready to be used.
CREATE_PENDING Mambu Function has been queued for deployment.
FAILED Mambu Function deployment failed.

Example Request

{
  "name": "my-func-1",
  "extensionPointId": "DEPOSIT_FEE_AMOUNT",
  "version": "v1",
  "functionCode": {
    "languageId": "es2020",
    "code": "ZXhwb3J0cy5kZWZhdWx0ID0gYXN5bmMgZnVuY3Rpb24oaW5wdXQpIHsgCiAgcmV0dXJuIGlucHV0LnRvdGFsQmFsYW5jZSAqIDAuMDE7IAp9"
  }
}

Parameters

Name Type Description In
Content-Type (required) string application/json header
body CreateMambuFunction Represents an action to create a Mambu Function. body

Example Responses

201 Response

{
  "name": "my-func-1",
  "state": "ACTIVE",
  "version": "v1",
  "lastModifiedDate": "2023-05-08T06:53:52Z",
  "extensionPointId": "DEPOSIT_FEE_AMOUNT"
}

409 Response

{
  "errors": [
    {
      "errorCode": 30000,
      "errorSource": "A human-readable message",
      "errorReason": "MFUNCTION_ALREADY_EXISTS"
    }
  ]
}

Responses

Status Meaning Description Schema
201 Created Mambu Function created MambuFunction
400 Bad Request Bad Request - Validation: This code is returned when there is malformed syntax in the request or incorrect data in the payload. ErrorResponse
401 Unauthorized Unauthorized ErrorResponse
403 Forbidden Forbidden ErrorResponse
409 Conflict Conflict - Validation: This code is returned when there is another concurrent operation on the same function or the function with the same name already exists. ErrorResponse

Get Mambu Function

Code samples

# You can also use wget
curl -X GET https://TENANT_NAME.mambu.com/api/mambu-functions/{functionName} \
  -H 'Accept: application/vnd.mambu.v2+json'

GET https://TENANT_NAME.mambu.com/api/mambu-functions/{functionName} HTTP/1.1
Host: tenant_name.mambu.com
Accept: application/vnd.mambu.v2+json


const headers = {
  'Accept':'application/vnd.mambu.v2+json'
};

fetch('https://TENANT_NAME.mambu.com/api/mambu-functions/{functionName}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/vnd.mambu.v2+json'
}

result = RestClient.get 'https://TENANT_NAME.mambu.com/api/mambu-functions/{functionName}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/vnd.mambu.v2+json'
}

r = requests.get('https://TENANT_NAME.mambu.com/api/mambu-functions/{functionName}', headers = headers)

print(r.json())

 'application/vnd.mambu.v2+json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://TENANT_NAME.mambu.com/api/mambu-functions/{functionName}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://TENANT_NAME.mambu.com/api/mambu-functions/{functionName}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/vnd.mambu.v2+json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://TENANT_NAME.mambu.com/api/mambu-functions/{functionName}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /mambu-functions/{functionName}

Get the details of a specified Mambu Function, including its deployment state. You can use this operation to check a Function's deployment state.

Parameters

Name Type Description In
functionName (required) string The name of the Function to fetch. path

Example Responses

200 Response

{
  "name": "my-func-1",
  "state": "ACTIVE",
  "version": "v1",
  "lastModifiedDate": "2023-05-08T06:53:52Z",
  "extensionPointId": "DEPOSIT_FEE_AMOUNT"
}

Responses

Status Meaning Description Schema
200 OK Mambu Function returned MambuFunction
400 Bad Request Bad Request - Validation: This code is returned when there is malformed syntax in the request or incorrect data in the payload. ErrorResponse
401 Unauthorized Unauthorized ErrorResponse
403 Forbidden Forbidden ErrorResponse
404 Not Found Mambu Function not found ErrorResponse

Update Mambu Function

Code samples

# You can also use wget
curl -X PUT https://TENANT_NAME.mambu.com/api/mambu-functions/{functionName} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/vnd.mambu.v2+json' \
  -H 'Content-Type: string'

PUT https://TENANT_NAME.mambu.com/api/mambu-functions/{functionName} HTTP/1.1
Host: tenant_name.mambu.com
Content-Type: application/json
Accept: application/vnd.mambu.v2+json
Content-Type: string

const inputBody = '{
  "version": "v1",
  "functionCode": {
    "languageId": "es2020",
    "code": "ZXhwb3J0cy5kZWZhdWx0ID0gYXN5bmMgZnVuY3Rpb24oaW5wdXQpIHsgCiAgcmV0dXJuIGlucHV0LnRvdGFsQmFsYW5jZSAqIDAuMDE7IAp9"
  }
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/vnd.mambu.v2+json',
  'Content-Type':'string'
};

fetch('https://TENANT_NAME.mambu.com/api/mambu-functions/{functionName}',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/vnd.mambu.v2+json',
  'Content-Type' => 'string'
}

result = RestClient.put 'https://TENANT_NAME.mambu.com/api/mambu-functions/{functionName}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/vnd.mambu.v2+json',
  'Content-Type': 'string'
}

r = requests.put('https://TENANT_NAME.mambu.com/api/mambu-functions/{functionName}', headers = headers)

print(r.json())

 'application/json',
    'Accept' => 'application/vnd.mambu.v2+json',
    'Content-Type' => 'string',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PUT','https://TENANT_NAME.mambu.com/api/mambu-functions/{functionName}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://TENANT_NAME.mambu.com/api/mambu-functions/{functionName}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/vnd.mambu.v2+json"},
        "Content-Type": []string{"string"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PUT", "https://TENANT_NAME.mambu.com/api/mambu-functions/{functionName}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PUT /mambu-functions/{functionName}

Updates an existing Mambu Function with the provided changes and returns the updated Function, including its deployment state.

Depending on the outcome of this operation, the returned Function might be in one of these states:

State Description
ACTIVE Mambu Function has been successfully deployed and is ready to be used.
UPDATE_PENDING Mambu Function has been queued for deployment.
FAILED Mambu Function deployment failed.

Example Request

{
  "version": "v1",
  "functionCode": {
    "languageId": "es2020",
    "code": "ZXhwb3J0cy5kZWZhdWx0ID0gYXN5bmMgZnVuY3Rpb24oaW5wdXQpIHsgCiAgcmV0dXJuIGlucHV0LnRvdGFsQmFsYW5jZSAqIDAuMDE7IAp9"
  }
}

Parameters

Name Type Description In
Content-Type (required) string application/json header
functionName (required) string The name of the Function to be updated. path
body UpdateMambuFunction Represents an action to update a Mambu Function. body

Example Responses

200 Response

{
  "name": "my-func-1",
  "state": "ACTIVE",
  "version": "v1",
  "lastModifiedDate": "2023-05-08T06:53:52Z",
  "extensionPointId": "DEPOSIT_FEE_AMOUNT"
}

409 Response

{
  "errors": [
    {
      "errorCode": 30003,
      "errorSource": "A human-readable message",
      "errorReason": "MFUNCTION_OPERATION_IN_PROGRESS"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Mambu Function updated MambuFunction
400 Bad Request Bad Request - Validation: This code is returned when there is malformed syntax in the request or incorrect data in the payload. ErrorResponse
401 Unauthorized Unauthorized ErrorResponse
403 Forbidden Forbidden ErrorResponse
404 Not Found Mambu Function not found ErrorResponse
409 Conflict Conflict - Validation: This code is returned when there is another concurrent operation on the same function. ErrorResponse

Delete Mambu Function

Code samples

# You can also use wget
curl -X DELETE https://TENANT_NAME.mambu.com/api/mambu-functions/{functionName} \
  -H 'Accept: application/vnd.mambu.v2+json'

DELETE https://TENANT_NAME.mambu.com/api/mambu-functions/{functionName} HTTP/1.1
Host: tenant_name.mambu.com
Accept: application/vnd.mambu.v2+json


const headers = {
  'Accept':'application/vnd.mambu.v2+json'
};

fetch('https://TENANT_NAME.mambu.com/api/mambu-functions/{functionName}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/vnd.mambu.v2+json'
}

result = RestClient.delete 'https://TENANT_NAME.mambu.com/api/mambu-functions/{functionName}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/vnd.mambu.v2+json'
}

r = requests.delete('https://TENANT_NAME.mambu.com/api/mambu-functions/{functionName}', headers = headers)

print(r.json())

 'application/vnd.mambu.v2+json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('DELETE','https://TENANT_NAME.mambu.com/api/mambu-functions/{functionName}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://TENANT_NAME.mambu.com/api/mambu-functions/{functionName}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/vnd.mambu.v2+json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "https://TENANT_NAME.mambu.com/api/mambu-functions/{functionName}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /mambu-functions/{functionName}

Schedules the specified Mambu Function for removal, provided that it is not already bound to a product. The actual removal will happen after 24 hours.

If the removal is scheduled successfully, the Function will be in the REMOVING state. If the removal fails after the grace period the state will change to FAILED.

Parameters

Name Type Description In
functionName (required) string The name of the function to be deleted. path

Example Responses

400 Response

{
  "errors": [
    {
      "errorCode": 30002,
      "errorSource": "A human-readable message",
      "errorReason": "MFUNCTION_INTERNAL_ERROR"
    }
  ]
}

Responses

Status Meaning Description Schema
204 No Content Mambu Function deleted. None
400 Bad Request Bad Request - Validation: This code is returned when there is malformed syntax in the request or incorrect data in the payload. ErrorResponse
401 Unauthorized Unauthorized ErrorResponse
403 Forbidden Forbidden ErrorResponse
404 Not Found Mambu Function not found ErrorResponse

Schemas

MambuFunction

{
  "name": "my-func-1",
  "state": "ACTIVE",
  "version": "v1",
  "lastModifiedDate": "2023-05-08T06:53:52Z",
  "extensionPointId": "DEPOSIT_FEE_AMOUNT"
}

Represents a Mambu Function.

Properties

Name Type Description Restrictions
name string The name of the Mambu Function. none
state string The current state of the Mambu Function. none
version string The version of the Mambu Function. none
lastModifiedDate string(date-time) The last date the Mambu Function was updated (in UTC). none
extensionPointId string The ID of the extension point none

Enumerated Values

Property Value
state CREATE_PENDING
state UPDATE_PENDING
state ACTIVE
state FAILED
state REMOVING

ErrorResponse

{
  "errors": [
    {
      "errorCode": 30002,
      "errorSource": "A human-readable message",
      "errorReason": "MFUNCTION_INTERNAL_ERROR"
    }
  ]
}

Properties

Name Type Description Restrictions
errors [array] none none

RestError

{
  "errorCode": 0,
  "errorReason": "INVALID_BASIC_AUTHORIZATION",
  "errorSource": "string"
}

Properties

Name Type Description Restrictions
errorCode number A unique error code. For more information, see API Responses and Error Codes. none
errorReason string A human-readable message capturing unsatisfied constraints. none
errorSource string A human-readable message stating the general category of the failure. none

Enumerated Values

Property Value
errorReason INVALID_BASIC_AUTHORIZATION
errorReason INVALID_API_OPERATION
errorReason INVALID_PARAMETERS
errorReason INTERNAL_ERROR
errorReason INVALID_TENANT_ID
errorReason INVALID_PAGINATION_OFFSET_VALUE
errorReason OUT_OF_BOUNDS_PAGINATION_OFFSET_VALUE
errorReason INVALID_PAGINATION_LIMIT_VALUE
errorReason OUT_OF_BOUNDS_PAGINATION_LIMIT_VALUE
errorReason INVALID_PERMISSIONS
errorReason INVALID_JSON_SYNTAX
errorReason OBJECT_NOT_FOUND
errorReason MFUNCTION_ALREADY_EXISTS
errorReason MFUNCTION_SERVICE_NOT_READY
errorReason MFUNCTION_INTERNAL_ERROR
errorReason MFUNCTION_OPERATION_IN_PROGRESS
errorReason MFUNCTION_MAX_FUNCTION_COUNT_LIMIT_REACHED
errorReason MFUNCTION_INTERNAL_LIMIT_REACHED
errorReason MFUNCTION_UNSUPPORTED_EXTENSION_POINT
errorReason MFUNCTION_MAPPED_FUNCTION_CANNOT_BE_DELETED

CreateMambuFunction

{
  "name": "my-func-1",
  "extensionPointId": "DEPOSIT_FEE_AMOUNT",
  "version": "v1",
  "functionCode": {
    "languageId": "es2020",
    "code": "ZXhwb3J0cy5kZWZhdWx0ID0gYXN5bmMgZnVuY3Rpb24oaW5wdXQpIHsgCiAgcmV0dXJuIGlucHV0LnRvdGFsQmFsYW5jZSAqIDAuMDE7IAp9"
  }
}

Represents an action to create a Mambu Function.

Properties

Name Type Description Restrictions
name string The name of the Mambu Function. none
extensionPointId string The ID of the extension point none
version string The version of the Mambu Function. none
functionCode MambuFunctionCode Represents a Mambu Function's code. none

MambuFunctionCode

{
  "languageId": "es2020",
  "code": "ZXhwb3J0cy5kZWZhdWx0ID0gYXN5bmMgZnVuY3Rpb24oaW5wdXQpIHsgCiAgcmV0dXJuIGlucHV0LnRvdGFsQmFsYW5jZSAqIDAuMzsgCn0="
}

Represents a Mambu Function's code.

Properties

Name Type Description Restrictions
languageId string The programming language used in the Mambu Function. none
code string(byte) The base-64 encoded code of the Mambu Function. none

Enumerated Values

Property Value
languageId es2020

UpdateMambuFunction

{
  "version": "v1",
  "functionCode": {
    "languageId": "es2020",
    "code": "ZXhwb3J0cy5kZWZhdWx0ID0gYXN5bmMgZnVuY3Rpb24oaW5wdXQpIHsgCiAgcmV0dXJuIGlucHV0LnRvdGFsQmFsYW5jZSAqIDAuMDE7IAp9"
  }
}

Represents an action to update a Mambu Function.

Properties

Name Type Description Restrictions
version string The version of the Mambu Function. none
functionCode MambuFunctionCode Represents a Mambu Function's code. none