This call is used to return a specific client’s details stored in MYGW-CM. URLs: Test https://api.test.oneroadpayments.com/merchants/{merchantID}/clients/{clientID} Production https://api.oneroadpayments.com/merchants/{merchantID}/clients/{clientID} Request Method: GET 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- Get Client Request NA- No client body data required. The get client request should be sent to the MYGW server using the GET method. Client Body - Get 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 get client request is as follows. { "response": { "statusCode": 20o, "message": "OK" }, "client": { "merchantID": "9678h65fr-fb52-4a8a-8de6-438ecf8d1104", "merchantName": "The Merchant", "mobileNumber": "2244668800", "clientID": "ACit123456", "created": "2024-07-13T08: 46: 39.347", "updated": "2024-07-13T08: 46: 39.347", "name": "Andrew Citizen", "id": "a0f58b93-0336-458f-8111-d19aaf1b57e8", "emailAddress": "acitizen@client.org", "black": false, "billingAddress": { "streetNumber": "88", "streetName": " New ", "streetSuffix": " Street ", "city": "Newtown", "state": "NSW", "country": "Australia", "valid": true }, "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 get client request is as follows. { "response": { "statusCode": 404, "message": " "Not Found", "detail": " No Client found with MerchantID: 9678h65fr-fb52-4a8a-8de6-438ecf8d1104 and ClientID: A Citizen" } } 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 returned 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 |
Get Client - Sample Source Code An example of executable JavaScript sample source code to get a client’s data can be found by clicking on the icon below. Note that this is an example of how a get client request can be initiated, it is a not a recommendation for how to implement the client APIs in your own applications. |