POST
/
wallets
/
close
curl --request POST \
  --url https://waas-staging.cafeone.ng/api/v1/wallets/close \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "accountNumber": "<string>",
  "accountClosureReasonId": 123,
  "tellerId": 123,
  "closeOrDelete": true,
  "customerOrAccount": true
}'

Request Body

accountNumber
string
required

The account number to be closed or deleted. Example: “3023563113”

accountClosureReasonId
number
required

The ID representing the reason for account closure. Example: 0

tellerId
number

The ID of the teller processing the closure. Example: 0

closeOrDelete
boolean
required

Specifies whether to close or delete the account.

  • true: Delete the account
  • false: Close the account
customerOrAccount
boolean
required

Specifies whether the operation is for a customer or an account.

  • true: Customer
  • false: Account

Response

✅ Success Response
Status Code: 200 OK

{
  "code": "200",
  "success": true,
  "message": "Wallet closed successfully.",
  "data": {
    // Additional data fields if applicable
  }
}

❌ Error Responses


Status Code: 400 Bad Request

{
  "code": "400",
  "success": false,
  "message": "Invalid request data",
  "data": null
}

Status Code: 401 Unauthorized

{
  "code": "401",
  "success": false,
  "message": "You do not have rights to access this account",
  "data": null
}

Status Code: 403 Forbidden

{
  "code": "403",
  "success": false,
  "message": "Access denied for this operation",
  "data": null
}

Status Code: 500 Internal Server Error

{
  "code": "500",
  "success": false,
  "message": "An unexpected error occurred",
  "data": null
}