POST
/
api
/
v1
/
subscription
/
create
curl --request POST \
  --url https://api.paytring.com/api/v1/subscription/create \
  --header 'Content-Type: application/json' \
  --data '{
  "key": "<string>",
  "pg": "<string>",
  "pg_pool_id": "<string>",
  "callback_url": "<string>",
  "cname": "<string>",
  "email": "<string>",
  "phone": "<string>",
  "initial_amount": "<string>",
  "plan_id": "<string>",
  "mer_reference_id": "<string>",
  "hash": "<string>",
  "notes": {
    "udf1": "<string>",
    "udf2": "<string>",
    "udf3": "<string>",
    "udf4": "<string>",
    "udf5": "<string>"
  },
  "billing_address": {
    "line1": "<string>",
    "line2": "<string>",
    "city": "<string>",
    "state": "<string>",
    "zipcode": 123,
    "country": "<string>",
    "phone": "<string>",
    "firstname": "<string>",
    "lastname": "<string>"
  },
  "shipping_address": {
    "line1": "<string>",
    "line2": "<string>",
    "city": "<string>",
    "state": "<string>",
    "zipcode": 123,
    "country": "<string>",
    "phone": "<string>",
    "firstname": "<string>",
    "lastname": "<string>"
  }
}'
"{}"

This API is used to create a new subscription for a customer.

Request Body

{
  "customer_id": "string", // ID of the customer
  "plan_id": "string", // ID of the subscription plan
  "start_date": "string", // Start date of the subscription
  "hash": "string" // Calculated hash for request validation
}

Responses

200 OK

{
  "status": true,
  "subscription_id": "string",
  "message": "Subscription created successfully"
}

400 Bad Request

{
  "status": false,
  "error": {
    "message": "Invalid request",
    "code": 400
  }
}

Body

application/json
key
string
required

Merchant key, available in dashboard profile section

callback_url
string
required
cname
string
required
email
string
required
phone
string
required
plan_id
string
required
mer_reference_id
string
required
hash
string
required

to be calculated by key sort of all non-object key values of this request

pg
string

code for payment gateway, which you want to use

pg_pool_id
string

pool is from which you want to choose pg

initial_amount
string
notes
object
billing_address
object
shipping_address
object

Response

200
application/json
200

The response is of type object.