Edit this Page

Starting A Subscription

In order to create a new subscription using API you need 3 information:

  • Offer Id: You can learn Offer Id from the management panel:
  • Customer Information: The email address in the customer information is mandatory. The Subscreasy subscription system parses customers with their e-mail address. In a standard subscription process, customer name, surname and e-mail address is sufficient. If desired, the customer phone number can also be added to the subscription request. The phone number will be required when you want to send SMS to your customers.
  • Credit Card Information: If credit card information is not provided while subscribing to a paid offer, the Subscreasy subscription system advances the transaction, assuming the payment method as OFFLINE (Wire Transfer, EFT).

Method: POST
Path: /api/subscriptions/start
Sandbox Url: https://sandbox.subscreasy.com/api/subscriptions/start

For security reasons, this service requires API authorization. Click for details about API authorization.

 Sample Request

Curl

curl -X POST https://sandbox.subscreasy.com/api/subscriptions/start \
  -H 'Accept: application/json' -H 'Content-Type: application/json' -H 'Cache-Control: no-cache' \
  -H 'Authorization: Apikey brs-1234567890' \
  -d '{
  "offer": {"id":240},
  "subscriber": {
    "email": "john.doe@gmail.com",
    "name": "John",
    "surname": "Doe"
  },
  "paymentCard": {
    "cardHolderName": "John Doe",
    "cardNumber": "5528790000000008",
    "expireYear": "2030",
    "expireMonth": "12",
    "cvc": "123",
    "registerCard": 0
  }
}'

C#

var client = new RestClient("https://sandbox.subscreasy.com/api/subscriptions/start");
var request = new RestRequest(Method.POST);
request.AddHeader("Cache-Control", "no-cache");
request.AddHeader("Authorization", "Apikey brs-1234567890");
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept", "application/json");
request.AddParameter("undefined", "{  \"offer\": {\"id\": 240},  \"subscriber\": {    \"email\": \"john.doe@gmail.com\",    \"name\": \"John\",    \"surname\": \"Doe\"  },  \"paymentCard\": {    \"cardHolderName\": \"John Doe\",    \"cardNumber\": \"5528790000000008\",    \"expireYear\": \"2030\",    \"expireMonth\": \"12\",    \"cvc\": \"123\",    \"registerCard\": 0  }}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);

JSON

{
  "offer": {"id": 240},
  "subscriber": {
    "email": "john.doe@gmail.com",
    "name": "John",
    "surname": "Doe"
  },
  "paymentCard": {
    "cardHolderName": "John Doe",
    "cardNumber": "5528790000000008",
    "expireYear": "2030",
    "expireMonth": "12",
    "cvc": "123",
    "registerCard": 0
  }
}
 Sample Response
{
    "subscription": {
        "id": 4,
        "status": "ACTIVE",
        "paymentMethod": "CC",
        "startDate": "2018-08-30T13:45:18.615+03:00",
        "termStartDate": "2018-08-30T13:45:18.615+03:00",
        "termEndDate": "2018-08-30T13:46:18.615+03:00",
        "endDate": "2018-08-30T13:48:18.615+03:00",
        "subscriber": {
            "id": -1,
            "name": "John",
            "surname": "Doe"
        },
        "card": {
            "id": 2,
            "binNumber": "5571-xxxx-xxxx-5575"
        },
        "services": []
    },
    "payment": {
        "id": 4,
        "price": 0.99,
        "appliedCoupon": null,
        "paymentId": "71741081",
        "authCode": "649237",
        "errorCode": null,
        "errorText": "Authorized.",
        "jobId": null,
        "invoiceId": null,
        "subscriptionId": 4,
        "serviceInstanceId": null,
        "subscriberSecureId": "0c42c6f3-cea0-4997-a2e2-fd66fbaf50f5",
        "companyId": -1,
        "paymentGateway": "PAYU",
        "status": "PAID",
        "reason": "START",
        "currency": "TRY",
        "transactionId": "c8c253c1c15f48a2a3cefa6f0c6ca6ef",
        "createDate": "2018-08-30T13:45:23.702+03:00",
        "parentId": null,
        "savedCardId": null,
        "savedCard": null
    }
}