registerSubscription

🚧

Method can be used only with client-side payment process.

Method provides entitlement to your subscription offer for given customer.

📘

You can try that method by clicking here

Parameters

NameTypeDescription
publisherToken* stringYou can find your publisher token at api-keys page
customerEmail* stringEmail provided by customer
offerId* stringID of the subscription offer
expirationDate* integerExpiration date in UNIX timestamp format.
paymentGateway* stringParameter requires additional configuration. Contact us for its value
paymentMethod* stringParameter requires additional configuration. Contact us for its value
paymentMethodSpecificParamsstringAdditional payment parameters (depend on paymentMethod)
paymentExternalIdstringExternal ID of the payment

Result Parameters

NameTypeDescription
successbooleantrue/false information about registration success

API Request/Response

Request

{
  "method": "registerSubscription",
  "params": {
     "publisherToken": "Ilrx-SjTLVMCsaRsOf2q2hvWKOlrF57yHknDRRRMX-13Fz-x",
     "customerEmail": "[email protected]",
     "offerId": "S123123123_US",
     "expirationDate": 1542794400,
     "paymentGateway": "free-isp",
     "paymentMethod": "free-isp",
     "paymentMethodSpecificParams": [],
     "paymentExternalId": null
  },
  "jsonrpc": "2.0",
  "id": 1
}

Response

{
  "result": {
    "success": true
  },
  "id": "1",
  "jsonrpc": "2.0"
}

ErrorCodes

CodeDescription
3Publisher token is invalid
4Offer offerId does not exist
10Customer customerEmail is not associated with your account or doesn't exist