Skip to main content

Init subscription

Summary

Initializes a subscription flow for an MSISDN. On successful initiation, will either send an OTP to the user via SMS or returns SMS-channel instructions (short code + keyword), depending on the MNO.

Path

POST https://merchants.noju.io/subscriptions/init

Headers

HeaderRequiredValue
API-KEYyesYour merchant API key.
Content-Typeyesapplication/json

Request body

FieldTypeRequiredDescription
msisdnstringyesSubscriber phone number, international format.
service_codestringyesService identifier provisioned for your merchant account.
country_codestringyesISO-3166-1 alpha-2 country code, lower case (e.g. bg, my).
languagestringnoBCP-47 / ISO-639-1 language for SMS communications (e.g. en, fr). Defaults to the service's default language.

Success payload

On status: "SUCCESS", payload contains:

FieldTypeDescription
verif_request_idstring | nullVerification request ID to pass to /subscriptions/verify for OTP flows.
short_codestring | nullSMS short code the user texts (Optional - returned only with PSMS integrations).
keywordstring | nullSMS keyword the user texts to short_code (Optional - returned only with PSMS integrations).
carrier_codestring | nullDetected carrier code for the MSISDN.
redirect_urlstring | nullURL to which the user has to be redirected to verify payment (Optional - market-dependant).

Errors

HTTPmessageWhen
400BAD_REQUESTBody fails JSON schema validation (missing msisdn/service_code/country_code).
401UNAUTHORIZEDAPI key missing, invalid, or merchant inactive.
403UNAUTHORIZEDSource IP not allowlisted.
403MERCHANT_SERVICE_NOT_CONFIGUREDNo integration for the provided service_code + country_code.
200INVALID_MSISDNThe MSISDN failed lookup validation.
200CARRIER_NOT_SUPPORTEDThe detected carrier is not provisioned for the requested service and country
200any CarrierErrorThe carrier rejected initiation.
500ERRORUnexpected server error.

Examples

Request

{
"msisdn": "60123456789",
"service_code": "NORDVPN",
"country_code": "my",
"language": "en"
}

Success response

{
"status": "SUCCESS",
"message": "",
"status_code": 200,
"payload": {
"verif_request_id": "550e8400-e29b-41d4-a716-446655440000",
"short_code": "7777",
"keyword": "NORDVPN",
"carrier_code": "50010",
"redirect_url": null
}
}

Failure response (carrier not supported)

{
"status": "FAIL",
"message": "CARRIER_NOT_SUPPORTED",
"status_code": 200,
"payload": null
}

Code samples

curl -X POST 'https://merchants.noju.io/subscriptions/init' \
-H 'Content-Type: application/json' \
-H "API-KEY: $NOJU_API_KEY" \
-d '{"msisdn":"60123456789","service_code":"NORDVPN","country_code":"my","language":"en"}'