Skip to content

Delete Beneficiary

Request URL

DELETE /beneficiary/:AFiBeneficiaryId

Description

This endpoint deletes a beneficiary record. The beneficiary is identified by a path parameter. The user is no longer able to transfer funds to this beneficiary.

Snippet Examples

javascript

const axios = require('axios');
const config = {
  method: 'DELETE',
  url: '${AMPLIFI_BASE_URL}/beneficiary/:AFiBeneficiaryId',
  headers: {
    'Content-Type': "application/json",
    'token': "A long random string token received from /token request"
  },
};

let result;
try {
  result = await axios.request(config);
  if (result.status === 200) {
    console.log(JSON.stringify(result.data));
  }
} catch (err) {
  console.log({
    errCode: err.code,
    responseStatus: err.response && err.response.status,
    data: err.response && JSON.stringify(err.response.data)
  });
}

cURL

curl --location "AMPLIFI_BASE_URL/beneficiary/:AFiBeneficiaryId"  --header "Content-Type: application/json" --header "token: A long random string token received from /token request" 

Successful Response Examples

200 BENEFICIARY/:AFIBENEFICIARYID SUCCESSFUL RESPONSE FOR BENEFICIARY DELETION

HEADERS

Header Value
Content-Type application/json
token A long random string token received from /token request

PARAMETERS

Parameter Description Value
AFiBeneficiaryId [required] qwepgbenlq1lxj7twp

REQUEST BODY

none

RESPONSE BODY

{
    "success": true,
    "text": "queued the beneficiary deletion",
    "undo": {
        "id": "xzats",
        "isActionable": false,
        "dtsQueued": "2023-12-12T11:38:31.808Z",
        "dtsExpiry": "2023-12-12T11:40:31.809Z"
    }
}