STC Kuwait

STC Kuwait manage the subscription process the interaction with Alacrity API calls is different. Some users will be more familiar with the name Viva Kuwait.

Typical Flow

  1. User visits a landing page and selects to subscribe to a service
  2. Merchant uses the Checkout Flow such as
http://checkout.sla-alacrity.com/purchase?merchant=partner:4e3f654ed86dbb113bb472be07630b3cb6ad0859&
service=campaign:940d351138df895e8dedf51e5d7b90788cdc23d0&
correlator=123XYZ
&redirect_url=http://test.test.com/redirect/kwt/stc?transaction_id=XXXXXXXX
  1. The response from checkout will be pending and include the msisdn such as:
http://test.test.com/redirect/kwt/stc?transaction_id=XXXXX&status=pending&msisdn=965XXXXXX&correlator=jXXXX&auth_method=header_enrichment

You may need to display a warning to the user that there may be a delay until they can access the service until they receive confirmation from STC (or Viva).

  1. Do not make a subscription create call as the checkout call makes a request to STC Kuwait to create the subscription
  2. A HTTP Notifications is sent to report the result of the subscription creation.

You are not required to send a welcome SMS.

πŸ“˜

Info

STC host the msisdn entry, pin entry and subscription confirmation pages.

Example notifications

{
   "success":{
      "type":"subscription",
      "uuid":"05e01521-feb0-432e-846b-xxxxx",
      "bill_id":"559c26dxxxx",
      "operator":"stc-kw",
      "merchant":"partner:xxxxx",
      "campaign":"campaign:xxxx",
      "environment":"production",
      "msisdn":"965xxxxxxx",
      "currency":"KWD",
      "amount":"0.7",
      "mode":"API",
      "frequency":"weekly",
      "transaction":{
         "status":"SUCCESS"
      }
   }
}
{
   "success":{
      "type":"subscription",
      "uuid":"05e01521-feb0-432e-846b-xxxx",
      "bill_id":"559c26d24a46",
      "operator":"stc-kw",
      "merchant":"partner:xxxxx",
      "campaign":"campaign:xxxxx",
      "environment":"production",
      "msisdn":"965xxxxxxxx",
      "currency":"KWD",
      "amount":"0.7",
      "mode":"API",
      "frequency":"weekly",
      "next_payment_timestamp":"2020-12-10T09:20:34Z",
      "transaction":{
         "status":"CHARGED",
         "bill_id":"559cxxxxx",
         "timestamp":"2020-12-03T09:20:34Z",
         "transaction_id":"9066xxxx"
      }
   }
}
{
   "success":{
      "type":"subscription",
      "uuid":"05e01521-feb0-432e-846b-xxxxx",
      "operator":"stc-kw",
      "merchant":"partner:xxxxx",
      "campaign":"campaign:xxxxx",
      "environment":"production",
      "msisdn":"965xxxxx",
      "currency":"KWD",
      "amount":"0.7",
      "mode":"OPCO_API",
      "frequency":"weekly",
      "transaction":{
         "status":"DELETED"
      }
   }
}

Existing subscribers will also be directed back to the landing page by STC Kuwait on a welcome SMS so merchants should provide direction for such users on their landing page.

Sandbox testing

For Sandbox testing the user interface to input a PIN or MSISDN is not shown. A response is provided with the MSISDN and the pending state which you can use in testing. However, no notification is sent.

Send SMS - SMS API

πŸ“˜

Info

Usage of the SMS API for STC Kuwait is by approval basis only.

The SMS API for STC Kuwait is the same with one exception of an optional parameter. STC Kuwait usually only allow a dynamic parameter be inserted into their pre-set SMS. Using this optional parameter will then insert your text into their SMS (usually this will be some type of URL for your service).

For example if their set SMS was "Please visit {param}. To unsubscribe send 1 to #####" Your text parameter would be inserted into this space based on what you sent in the text field in our API.

All HTTP request parameters should be passed in URL Query String - query_params.

HTTP Request

POST /v2.2/sms?msisdn={msisdn}&campaign={campaign}&merchant={merchant}&correlator={correlator}&text={text}&dynamic_sms={true/false}

Request Parameters

NameDescriptionTypeUsage
msisdnThe subscriber MSISDN that you want to send the SMS to.stringmandatory
campaignThe Alacrity service URI that identifies the service that this transaction belongs to.stringmandatory
merchantThe Alacrity merchant URI that identifies which merchant this transaction belongs to.stringmandatory
correlatorA unique string for this transaction. The correlator guards against accidental duplicate transactions.stringmandatory
textThe string to display in the SMS. If dynamic_SMS is passed as true the URL should be passedstringmandatory
dynamic_smsA flag to indicate whether the SMS a dynamic SMS to be inserted into the pre-set SMS by the operator.booleanoptional
POST /v2.2/sms?
msisdn=965987654321&
campaign=campaign:56yhws-87e376-yuio43-45yhh7&
merchant=partner:00ow34-al6g67-12o6hh-00ff66&
correlator=we78fehjke8erwhjkre78&
text=welcome&dynamic_sms=true 
HTTP/1.1
Host: api.sla-alacrity.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json

{
  "success": true
}
HTTP/1.1 200 OK
Content-Type: application/json

{
  "error":
  {
    "category": "SMS API",
    "cdoe": "8001",
    "message": "SMS sending failed"
  }
}

❗️

Warning

Please note that if the result of sending the SMS message fails for any reason the SMS message will NOT be sent.
Please also note that the SMS API must NOT be used for marketing purposes.