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

Name

Type

Description

publisherToken*

string

You can find your publisher token at api-keys page

customerEmail*

string

Email provided by customer

offerId*

string

ID of the subscription offer

expirationDate*

integer

Expiration date in UNIX timestamp format.

paymentGateway*

string

Parameter requires additional configuration. Contact us for its value

paymentMethod*

string

Parameter requires additional configuration. Contact us for its value

paymentMethodSpecificParams

string

Additional payment parameters (depend on paymentMethod)

paymentExternalId

string

External ID of the payment

Result Parameters

Name

Type

Description

success

boolean

true/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

Code

Description

3

Publisher token is invalid

4

Offer offerId does not exist

10

Customer customerEmail is not associated with your account or doesn't exist