Common Functionality APIs
Click an API to expand/collapse it.
- Description
- Enable / disable mobile for the countries provided.
- Request Endpoint
- PUT https://<Example api server address>/common/country/mobile/enable/disable
- Parameters
-
None.
- cURL syntax
-
curl --include \
--request PUT \
--header "Content-Type: application/json" \
--data-binary "{
\"enabledCountries\": [
\"6835a044-1095-49b5-a15c-e09bab7d30f4\",
\"131b800d-8442-44d9-a5fa-2710180b307c\",
\"78d8e178-9aa8-48ee-8e6c-2e839fdf00ba\"
],
\"disabledCountries\": [
\"ee9ce6bc-2a10-4bf7-8cb5-f40b0374ab9a\"
]
}" \
'https://core.dev.Example.net/api/common/country/mobile/enable/disable'
- PUT body attributes (JSON)
-
Attribute |
Type |
Use |
Description |
enabledCountries |
Array |
Required |
An array of country UUID's. |
disabledCountries |
Array |
Required |
An array of country UUID's. |
- PUT body
-
Headers: Content-Type: application/json
{
"enabledCountries": [
"6835a044-1095-49b5-a15c-e09bab7d30f4",
"131b800d-8442-44d9-a5fa-2710180b307c",
"78d8e178-9aa8-48ee-8e6c-2e839fdf00ba"
],
"disabledCountries": [
"ee9ce6bc-2a10-4bf7-8cb5-f40b0374ab9a"
]
}
- Response body
-
Headers: Content-Type: application/json | HTTPS Status Code: 200
{
"data": true,
"detail": null,
"error": false,
"message": "Successfully enabled or disabled for mobile allowed for country"
}
Return to top
- Description
- Enable / disable a payment method for the countries provided.
- Request Endpoint
- PUT https://<Example api server address>/common/country/payment/enable/disable
- Parameters
-
None.
- cURL syntax
-
curl --include \
--request PUT \
--header "Content-Type: application/json" \
--data-binary "{
\"enabledCountries\": [\"6835a044-1095-49b5-a15c-e09bab7d30f4\", \"78d8e178-9aa8-48ee-8e6c-2e839fdf00ba\"],
\"disabledCountries\": [\"6835a044-1095-49b5-a15c-e09bab7d30f4\"]
}" \
'https://core.dev.Example.net/api/common/country/payment/enable/disable'
- PUT body attributes (JSON)
-
Attribute |
Type |
Use |
Description |
enabledCountries |
Array |
Required |
An array of country UUID's. |
disabledCountries |
Array |
Required |
An array of country UUID's. |
- PUT body
-
Headers: Content-Type: application/json
{
"enabledCountries": [
"6835a044-1095-49b5-a15c-e09bab7d30f4",
"78d8e178-9aa8-48ee-8e6c-2e839fdf00ba"
],
"disabledCountries": [
"6835a044-1095-49b5-a15c-e09bab7d30f4"
]
}
- Response body
-
Headers: Content-Type: application/json | HTTPS Status Code: 200
{
"data": true,
"detail": null,
"error": false,
"message": "Successfully enabled / disabled for payment allowed for country"
}
Return to top
- Description
- Fetches all countries.
- Request Endpoint
- GET https://<Example api server address>/common/country
- Parameters
-
None.
- cURL syntax
-
curl --include \
'https://core.dev.Example.net/api/common/country'
- Response body
-
Headers: Content-Type: application/json | HTTPS Status Code: 200
{
"data": {
"content": [
{
"id": "6835a044-1095-49b5-a15c-e09bab7d30f4",
"countryCode": "AE",
"name": "United Arab Emirates",
"paymentAllowed": false
},
{
"id": "78d8e178-9aa8-48ee-8e6c-2e839fdf00ba",
"countryCode": "AF",
"name": "Afghanistan",
"paymentAllowed": true
}
],
"last": false,
"totalPages": 126,
"totalElements": 252,
"size": 2,
"number": 0,
"sort": null,
"first": true,
"numberOfElements": 2
},
"detail": null,
"error": false,
"message": "Fetching all countries successful"
}
Return to top
- Description
- Fetches all currencies that are available.
- Request Endpoint
- GET https://<Example api server address>/common/currency
- Parameters
-
None.
- cURL syntax
-
curl --include \
'https://core.dev.Example.net/api/common/currency'
- Response body
Headers: Content-Type: application/json | HTTPS Status Code: 200
-
{
"data": [
{
"code": "AED",
"numericCode": 784,
"decimalPlaces": 2,
"symbol": "AED",
"defaultFractionDigits": 2,
"currencyCode": "AED",
"numeric3Code": "784",
"countryCodes": [
"AE"
],
"pseudoCurrency": false
}
],
"detail": null,
"error": false,
"message": "Fetching all currencies successful"
}
Return to top
- Description
-
Use only timezones like "County/Timezone".
- Do not use a single string timezone like "ACT", "CET" etc.
- Note: "Bouvet Island" does not have any timezone.
- Request Endpoint
- GET https://<Example api server address>/common/all/timezones
- Parameters
-
None.
- cURL syntax
-
curl --include \
'https://core.dev.Example.net/api/common/all/timezones'
- Response body
-
Headers: Content-Type: application/json | HTTPS Status Code: 200
{
"data": [
{
"countryName": "Andorra",
"countryCode": "AD",
"timeZones": [
"Europe/Andorra"
]
},
{
"countryName": "United Arab Emirates",
"countryCode": "AE",
"timeZones": [
"Asia/Dubai"
]
},
{
"countryName": "Afghanistan",
"countryCode": "AF",
"timeZones": [
"Asia/Kabul"
]
},
{
"countryName": "Antigua and Barbuda",
"countryCode": "AG",
"timeZones": [
"America/Antigua"
]
}
],
"detail": null,
"error": false,
"message": "All timezone ids are fetched successfully."
}
Return to top
- Description
- Fetches all allowed countries for mobile.
- Request Endpoint
- GET https://<Example api server address>/common/country/mobile/allowed
- Parameters
-
None.
- cURL syntax
-
curl --include \
'https://core.dev.Example.net/api/common/country/mobile/allowed'
- Response body
-
Headers: Content-Type: application/json | HTTPS Status Code: 200
{
"data": {
"content": [
{
"id": "78d8e178-9aa8-48ee-8e6c-2e839fdf00ba",
"deleted": false,
"countryCode": "AF",
"name": "Afghanistan",
"paymentAllowed": false,
"mobileAllowed": true
},
{
"id": "131b800d-8442-44d9-a5fa-2710180b307c",
"deleted": false,
"countryCode": "AG",
"name": "Antigua and Barbuda",
"paymentAllowed": false,
"mobileAllowed": true
},
{
"id": "6835a044-1095-49b5-a15c-e09bab7d30f4",
"deleted": false,
"countryCode": "AE",
"name": "United Arab Emirates",
"paymentAllowed": false,
"mobileAllowed": true
}
],
"last": true,
"totalElements": 3,
"totalPages": 1,
"numberOfElements": 3,
"sort": null,
"first": true,
"size": 70,
"number": 0
},
"detail": null,
"error": false,
"message": "Successfully enabled for mobile allowed for country"
}
Return to top
- Description
- Fetches all allowed countries for payment.
- Request Endpoint
- GET https://<Example api server address>/common/country/payment/allowed
- Parameters
-
None.
- cURL syntax
-
curl --include \
'https://core.dev.Example.net/api/common/country/payment/allowed'
- Response body
-
Headers: Content-Type: application/json | HTTPS Status Code: 200
{
"data": {
"content": [
{
"id": "78d8e178-9aa8-48ee-8e6c-2e839fdf00ba",
"countryCode": "AF",
"name": "Afghanistan",
"paymentAllowed": true
},
{
"id": "6835a044-1095-49b5-a15c-e09bab7d30f4",
"countryCode": "AE",
"name": "United Arab Emirates",
"paymentAllowed": true
},
{
"id": "3bc6ddfe-c2e7-4099-9a7c-c8ae2a3118e1",
"countryCode": "GB",
"name": "United Kingdom",
"paymentAllowed": true
},
{
"id": "ecff692b-d780-49ee-b996-c2eb34bcf26c",
"countryCode": "US",
"name": "United States",
"paymentAllowed": true
}
],
"last": true,
"totalPages": 1,
"totalElements": 4,
"size": 70,
"number": 0,
"sort": null,
"first": true,
"numberOfElements": 4
},
"detail": null,
"error": false,
"message": "Successfully enabled for payment allowed for country"
}
Return to top