POST
/
api
/
v1
/
subscription
/
subscription
/
fetch
curl --request POST \
  --url https://api.paytring.com/api/v1/subscription/subscription/fetch \
  --header 'Content-Type: application/json' \
  --data '{
  "key": "<string>",
  "id": "<string>",
  "hash": "<string>"
}'
"{\n    \"status\": true,\n    \"subscription\": {\n        \"subscription_id\": \"677361288237548476\",\n        \"mer_reference_id\": \"TXN934579\",\n        \"amount\": 500,\n        \"initial_amount\": null,\n        \"currency\": \"USD\",\n        \"subscription_status\": \"active\",\n        \"pg\": \"Transactbridge\",\n        \"customer\": {\n            \"name\": \"Preetam Sharma\",\n            \"email\": \"preetam@paytring.com\",\n            \"phone\": \"7027445661\"\n        },\n        \"notes\": {\n            \"udf1\": \"\",\n            \"udf2\": \"\",\n            \"udf3\": \"\",\n            \"udf4\": \"\",\n            \"udf5\": \"\",\n            \"udf6\": \"\",\n            \"udf8\": \"\",\n            \"udf9\": \"\",\n            \"udf10\": \"\"\n        },\n        \"billing_address\": {\n            \"firstname\": \"FirstName\",\n            \"lastname\": \"LastName\",\n            \"phone\": \"9999999999\",\n            \"line1\": \"\",\n            \"line2\": \"\",\n            \"city\": \"\",\n            \"state\": \"\",\n            \"country\": \"\",\n            \"zipcode\": \"\"\n        },\n        \"shipping_address\": {\n            \"firstname\": \"FirstName\",\n            \"lastname\": \"LastName\",\n            \"phone\": \"9999999999\",\n            \"line1\": \"\",\n            \"line2\": \"\",\n            \"city\": \"\",\n            \"state\": \"\",\n            \"country\": \"\",\n            \"zipcode\": \"\"\n        }\n    },\n    \"request_id\": \"66ebdb6678097\"\n}"

This API is used to fetch details of an existing subscription.

Request Body

{
  "subscription_id": "string", // ID of the subscription to fetch
  "hash": "string" // Calculated hash for request validation
}

Responses

200 OK

{
  "status": true,
  "subscription": {
    "id": "string",
    "status": "string",
    "plan": {
      "id": "string",
      "name": "string",
      "amount": "integer",
      "currency": "string",
      "interval": "string"
    }
  },
  "message": "Subscription fetched 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

id
string
required

Subscription id provided by paytring.

hash
string
required

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

Response

200
application/json
200
status
boolean
default:true
Example:

true

subscription
object
request_id
string
Example:

"66ebdb6678097"