Onerway
POST

Delete a beneficiary

Delete a beneficiary belonging to the operating merchant and return its identifier with status deleted.

Request

ApiKey
Account service API key assigned by Onerway, supplied in the request header. Use the key for the same environment as the request domain.
Example:
Content-Type
Request media type.
Example:
beneficiaryId
Onerway beneficiary ID (64-bit integer).
Constraints
Rule
beneficiaryId is required and must exist, belong to the operating merchant and not already be deleted. Repeated deletion is not guaranteed to succeed idempotently.
Rule
Cannot delete a beneficiary with payments in A (created) or P (processing). Complete those payments first.
onBehalfOf
Merchant number that the request applies to. Supply it only when making a request on behalf of another merchant.

Request example

curl -X POST 'https://sandbox-transfer-api.onerway.com/api/v3/beneficiary/remove' \
  -H 'ApiKey: replace_with_account_service_apikey' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "beneficiaryId": 10001
}'

Response

respCode
Response code; 20000 indicates successful request processing. All other values are error codes.
respMsg
Human-readable description of the response code.
Business data on success; do not consume as valid business data on failure
Constraints
Rule
A successful result returns status=deleted. A deleted beneficiary cannot subsequently be retrieved or edited as an active record. Deleting it does not cancel historical transfers.
Structured failure information; not present for every failure path

Response example

{
  "respCode": "20000",
  "respMsg": "Success",
  "data": {
    "beneficiaryId": "10001",
    "status": "deleted"
  }
}
20050112

The identifier is nonexistent, foreign-owned or already deleted.

Trigger: The identifier is nonexistent, foreign-owned or already deleted.

Example

{
  "respCode": "50112",
  "respMsg": "beneficiaryId invalid",
  "error": {
    "type": "business_error",
    "code": "cl1048",
    "message": "beneficiaryId invalid",
    "requestId": "req_00000000000000000000000000000001",
    "errorDetails": [
      {
        "errorCode": "cl1048",
        "message": "beneficiaryId invalid"
      }
    ]
  }
}