Skip to content

API Get Country List

API Get Country List is an endpoint to retrieve a list of countries available in the Senmo system.


API Information

FieldValue
Path/api/{version}/general/countries
HTTP MethodGET
Service Code00
Versionv1.0
TypeJSON
AuthenticationOAuth 2.0 with Access Token

Request Structure

Request Header

Details
Parameter / FieldMandatoryTypeDescription
Content-TypeMStringIndicates the media type of the resource. Use: application/json
AuthorizationMStringRepresents the access_token. Starts with "Bearer" followed by the access token. e.g.: Bearer eyJraWQiOi...
X-TIMESTAMPMStringClient's current local time in yyyy-MM-ddTHH:mm:ss.SSSTZD format
X-SIGNATUREMStringSymmetric 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-IDMStringUnique partner ID. Use the Client ID obtained after the onboarding process.
X-EXTERNAL-IDMStringNumeric String. A unique reference number you generate. Must be unique on the same day.
ORIGINOStringOrigin domain registered on the iFortepay system.
CHANNEL-IDMStringDevice 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 / FieldMandatoryTypeDescription
Content-TypeMStringIndicates the media type of the resource (e.g. application/json)
X-TIMESTAMPMStringClient's current local time in yyyy-MM-ddTHH:mm:ss.SSSTZD format

Response Body

Details
Parameter / FieldTypeLengthDescription
responseCodeString7Response code
responseMessageString150Response description
detailDataArray-List of country data
detailData[].countryCodeString-Country code (e.g. ID, US)
detailData[].countryNameString-Country name
additionalInfoObject-Additional information (pagination)
additionalInfo.totalDataNumeric-Total number of data records
additionalInfo.pageSizeNumeric-Page size. Default: 10 records per page
additionalInfo.pageNumberNumeric-Current page number
additionalInfo.totalPageNumeric-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": {}
  }
}

iFortepay API Documentation