Navigation: 4. CLIENT ACCOUNT MANAGEMENT >

The Delete Client API Call

 

 

 

 

 

This call is used to remove a client’s details from the MYGW-CM database.

 

URLs:          

 

Test

 https://api.test.oneroadpayments.com/merchants/{merchantID}/clients/{clientID} 

Production

 https://api.oneroadpayments.com/merchants/{merchantID}/clients/{clientID} 

 

Request Method:          

 

DELETE

 

Headers:

 

The header ‘x-api-key’ should be set to the value of the Merchant API Key allocated to the merchant or PSP at sign up.

 

URL Parameters:

 

Name

Description

R/M/O

merchantID

The unique merchant ID provided by the PSP or allocated by the MYGW system

M

clientID

Uniquely identifies a client within a merchant’s registered client collection. This can be either the clientID or id parameters detailed in the client object above

M

 

Client Body - Delete Client Request

 

NA – No client body data required.

 

The delete request should be sent to the MYGW server using the DELETE method.

 

Client Body - Delete Client Response

 

The MYGW server will respond including a status code, signifying whether the call succeeded, as described above - MYGW API Responses.

 

An example of the JSON object sent in a response to a successful update client request is as follows.

 

{

"response":

{

"statusCode": 200,

"message": "OK"

},

"client":

{

"merchantID": "9678h65fr-fb52-4a8a-8de6-438ecf8d1104",

"merchantName": "The Merchant",

"mobileNumber": "2244668800",

"clientID": "TheClient",

"created": "2024-07-13T08: 46: 39.347",

"updated": "2024-07-13T08: 46: 39.347",

"name": "The Client",

"id": "a0f58b93-0336-458f-8111-d19aaf1b57e8",

"emailAddress": "theclient@client.org",

"black": false,

"valid": true,

"correlatedBlack": false

}

}

 

The response will not necessarily include a complete client object (as described above – The JSON Client Object), only fields that were included when the client was created or updated on the system. If some of those fields (such as cards or billingAddress) are not set, they will not be returned from the host.

 

An example of the JSON object sent in a response to an unsuccessful create client request is as follows.

 

{

"response":

{

"statusCode": 400,

"message": "Bad Request",

"detail": "Invalid Merchant ID"

}

}


The status code and status message returned could be one of the following values.

 

Status Code

Description

Status Message

200

The client details were successfully deleted from the server

Message - OK

400

The request was not correctly formatted

Message - Malformed request

Detail – (e.g) missing path parameters

403

The merchant API key could not be validated, and the request failed

Message - Forbidden

404

No client with the ID specified was found for the merchant at the server

Message – Not Found

Detail – No Client found with MerchantID and ClientID

500

A server error occurred, and the request failed

Message – Internal processing exception

 

Delete Client - Sample Source Code

 

An example of executable JavaScript sample source code to delete a client can be found by clicking on the icon below. Note that this is an example of how a delete client request can be initiated, it is a not a recommendation for how to implement the client APIs in your own applications.

 

 

 

 

 

Copyright © 2024 My Gateway