PUT
/
v1
/
subscription-plan
/
{plan_id}
curl --request PUT \
  --url https://api.sandbox.hit-pay.com/v1/subscription-plan/{plan_id} \
  --header 'Content-Type: application/json' \
  --header 'X-BUSINESS-API-KEY: <x-business-api-key>' \
  --data '{
  "name": "<string>",
  "description": "<string>",
  "amount": 123,
  "cycle": "<string>",
  "cycle_repeat": 123,
  "cycle_frequency": "<string>",
  "reference": "<string>",
  "redirect_url": "<string>"
}'
"{\n    \"id\": \"973ee344-6737-4897-9929-edbc9d7bf433\",\n    \"name\": \"Spotify Premium\",\n    \"description\": \"Spotify Monthly Subscription\",\n    \"cycle\": \"monthly\",\n    \"cycle_repeat\": null,\n    \"cycle_frequency\": null,\n    \"currency\": \"sgd\",\n    \"amount\": 12.9,\n    \"reference\": \"spotify_premium_2022\",\n    \"created_at\": \"2022-09-13T12:34:13\",\n    \"updated_at\": \"2022-09-13T12:34:13\"\n}"

Headers

X-BUSINESS-API-KEY
string
required

Path Parameters

plan_id
string
required

Body

application/json
name
string
required

Plan name. It's optional field

description
string

The description of subscription plan. It's optional field

amount
number

Plan amount. It's optional field

cycle
string
required

Billing frequency (weekly / monthly / yearly / custom / save_card). If cycle = custom then the user has to send the fields cycle_repeat and cycle_frequency

cycle_repeat
integer

It's required field if cycle is custom

cycle_frequency
string

It's required field if cycle is custom. Options: [day, week, month, year]

reference
string

Arbitrary reference number that you can map to your internal reference number. It's optional field

redirect_url
string

Redirect URL

Response

200 - application/json
id
string
name
string
description
string
cycle
string
cycle_repeat
any
cycle_frequency
any
currency
string
amount
number
default: 0
reference
string
created_at
string
updated_at
string