Appearance
API Get Country List
API Get Country List is an endpoint to retrieve a list of countries available in the Senmo system.
API Information
| Field | Value |
|---|---|
| Path | /api/{version}/general/countries |
| HTTP Method | GET |
| Service Code | 00 |
| Version | v1.0 |
| Type | JSON |
| Authentication | OAuth 2.0 with Access Token |
Request Structure
Request Header
Details
| Parameter / Field | Mandatory | Type | Description |
|---|---|---|---|
Content-Type | M | String | Indicates the media type of the resource. Use: application/json |
Authorization | M | String | Represents the access_token. Starts with "Bearer" followed by the access token. e.g.: Bearer eyJraWQiOi... |
X-TIMESTAMP | M | String | Client's current local time in yyyy-MM-ddTHH:mm:ss.SSSTZD format |
X-SIGNATURE | M | String | Symmetric signature using HMAC_SHA512. Formula: stringToSign = HTTPMethod + ":" + EndpointUrl + ":" + AccessToken + ":" + Lowercase(HexEncode(SHA256(minify(RequestBody)))) + ":" + TimeStamp. Notes: (1) Use full URL including all parameters. (2) If no Request Body, use empty string. |
X-PARTNER-ID | M | String | Unique partner ID. Use the Client ID obtained after the onboarding process. |
X-EXTERNAL-ID | M | String | Numeric String. A unique reference number you generate. Must be unique on the same day. |
ORIGIN | O | String | Origin domain registered on the iFortepay system. |
CHANNEL-ID | M | String | Device identification on which the API services are being accessed. Use value: api |
M = Mandatory, O = Optional
Request Body
ℹ️ There is no request body for this API.
Example Request
Details
artifact
id: get-country-list-request
name: Example Request - API Get Country List
type: code.bash
content: |-
curl --location 'https://api-stage.senmo.id/api/v1.0/general/countries' \
--header 'Content-Type: application/json' \
--header 'X-TIMESTAMP: 2023-06-12T12:00:00+07:00' \
--header 'X-SIGNATURE: azQz36hdevpbtaMEIuGt6/GSsJUOTbBdVXP7ZeRn4MKMwt806xCiaZ3aEWHeRtcNg64zMJFa1CyZea7eRVy91w==' \
--header 'X-PARTNER-ID: MCPD2312010070' \
--header 'X-EXTERNAL-ID: 1712127049015' \
--header 'CHANNEL-ID: api' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'Response Structure
Response Header
Details
| Parameter / Field | Mandatory | Type | Description |
|---|---|---|---|
Content-Type | M | String | Indicates the media type of the resource (e.g. application/json) |
X-TIMESTAMP | M | String | Client's current local time in yyyy-MM-ddTHH:mm:ss.SSSTZD format |
Response Body
Details
| Parameter / Field | Type | Length | Description |
|---|---|---|---|
responseCode | String | 7 | Response code |
responseMessage | String | 150 | Response description |
detailData | Array | - | List of country data |
detailData[].countryCode | String | - | Country code (e.g. ID, US) |
detailData[].countryName | String | - | Country name |
additionalInfo | Object | - | Additional information (pagination) |
additionalInfo.totalData | Numeric | - | Total number of data records |
additionalInfo.pageSize | Numeric | - | Page size. Default: 10 records per page |
additionalInfo.pageNumber | Numeric | - | Current page number |
additionalInfo.totalPage | Numeric | - | Total number of pages available |
Example Response
Details
✅ Success Response
json
{
"responseCode": "2000000",
"responseMessage": "Successful",
"detailData": [
{ "countryCode": "AD", "countryName": "Andorra" },
{ "countryCode": "AE", "countryName": "United Arab Emirates" },
{ "countryCode": "AF", "countryName": "Afghanistan" },
{ "countryCode": "AG", "countryName": "Antigua and Barbuda" },
{ "countryCode": "AI", "countryName": "Anguilla" },
{ "countryCode": "AL", "countryName": "Albania" },
{ "countryCode": "AM", "countryName": "Armenia" },
{ "countryCode": "AN", "countryName": "Netherlands Antilles" },
{ "countryCode": "AO", "countryName": "Angola" },
{ "countryCode": "AQ", "countryName": "Antarctica" }
],
"additionalInfo": {
"totalData": 246,
"pageSize": 10,
"pageNumber": 1,
"totalPage": 25,
"filter": {}
}
}