PayOrc
Subscription Plan

Create Subscription Plan

Create a new subscription plan with billing frequency, installment amounts, terms, and payment details.

Create Subscription Plan

Version: 3.0.0

Generate an API Key for the Subscription channel before making requests.

Add a subscription plan and share the payment links with your customers. This endpoint creates a subscription plan with billing frequency, installment amounts, terms, and optional email notifications.

All Subscription Open API requests use base URL https://api.payorc.com/subscriptions/v1/ with merchant-key and merchant-secret headers (Subscription channel API key).

Subscription Flow

Endpoint

MethodURL
POSThttps://api.payorc.com/subscriptions/v1/add

Please use the test credentials for sandbox testing.

Authentication

Include the following headers in every request:

HeaderTypeDescription
merchant-keyStringYour merchant key (e.g. live-D111PIS13YK)
merchant-secretStringYour merchant secret (e.g. sec-JI11G0P13Z0)

All API requests must be made over HTTPS. Requests made over plain HTTP will be rejected.

Request Body

Send a JSON object with the fields below. Amount fields must be numbers (not quoted strings). Dates use YYYY-MM-DD HH:mm.

FieldTypeRequiredDescription
plan_nameStringYesPlan name. Max 50 characters. Must be unique for the same billing frequency, currency, and installment amount.
plan_descriptionStringNoPlan description. Max 250 characters. Letters, numbers, spaces, ., -, , only.
billing_frequencyObjectYesHow often the customer is billed.
billing_frequency.frequencyStringYesOne of: daily, weekly, monthly, yearly.
billing_frequency.intervalNumberYesBilling interval (e.g. 1 = every cycle, 2 = every other cycle). Min 1.
installment_amountObjectYesStandard installment amount (excluding fees).
installment_amount.currencyStringYes3-letter ISO currency enabled on your merchant account (e.g. AED).
installment_amount.valueNumberYesInstallment amount. Min 1. Must be ≥ initial, final, and discount amounts.
termsObjectYesPlan duration and optional discount.
terms.unlimitedStringYesyes = unlimited recurring terms; no = fixed number of terms.
terms.valueNumberConditionalRequired when terms.unlimited is no. Number of billing terms (1–1999). Omit when unlimited is yes.
terms.discount_termNumberNoTerm number (1-based) that uses the discounted amount. Must be ≤ terms.value when unlimited is no.
terms.discount_amountNumberNoDiscounted installment amount for the specified term. Required if discount_term > 0.
initial_payment_amountNumberYesFirst payment amount. Min 1. Cannot exceed installment_amount.value.
final_payment_amountNumberYesLast payment amount (when terms are fixed). Min 1. Cannot exceed installment_amount.value.
shipping_feeNumberYesShipping fee added to each payment. Min 0.
convenience_feeNumberYesConvenience fee added to each payment. Min 0.
start_dateStringYesPlan start date/time. Format: YYYY-MM-DD HH:mm. Must be today or a future date.
expiry_dateStringNoPlan expiry date/time. Format: YYYY-MM-DD HH:mm. Must be after start_date if provided.
noteStringNoInternal note. Max 250 characters.
customer_emailsStringYes*Comma-separated recipient emails (max 40). *Key must be present; send empty string "" to skip email.
customer_email_ccStringYes*Comma-separated CC emails (max 5). *Key must be present; send empty string "" if not used.
subjectStringYes*Email subject. Max 200 characters. *Key must be present; send empty string "" if not sending email.
product_detailsStringYes*Product info shown to the customer. Max 200 characters. *Key must be present; send empty string "" if not used.

Email fields (optional): To create a plan without sending email, set customer_emails, customer_email_cc, subject, and product_details to empty strings. If you set customer_email_cc or subject without customer_emails, the request is rejected. If you set customer_emails, subject is also required.

IDs in responses: data_id is the encrypted plan identifier — store this for update, activate, deactivate, details, and send-mail. plan_id is the plain display plan number shown to customers.

Response (200 OK)

FieldTypeDescription
data_idStringEncrypted plan identifier — use for update, activate, deactivate, details, and send-mail.
plan_idStringPlain display plan number.
qr_codeStringBase64-encoded image data of the QR code.
linkStringPayment link associated with the created subscription plan.
messageStringMessage indicating the success of the subscription plan creation.
statusStringsuccess or error.
codeStringStatus code, e.g., 00 for success.

Code Examples

curl --location 'https://api.payorc.com/subscriptions/v1/add' \
--header 'merchant-key: YOUR_MERCHANT_KEY' \
--header 'merchant-secret: YOUR_MERCHANT_SECRET' \
--header 'Content-Type: application/json' \
--data '{
    "plan_name": "Shree ram yatra",
    "plan_description": "pratishtha",
    "billing_frequency": {
        "frequency": "daily",
        "interval": 2
    },
    "installment_amount": {
        "currency": "AED",
        "value": 300
    },
    "terms": {
        "unlimited": "no",
        "value": 20,
        "discount_term": 5,
        "discount_amount": 90
    },
    "initial_payment_amount": 109,
    "final_payment_amount": 80,
    "shipping_fee": 20,
    "convenience_fee": 10,
    "start_date": "2027-01-15 10:00",
    "expiry_date": "2027-06-15 23:59",
    "note": "",
    "customer_emails": "[email protected]",
    "customer_email_cc": "[email protected]",
    "subject": "Subscription plan details",
    "product_details": ""
}'

Example Response

{
    "data_id": "WGcrVHhrNllyY2tLMlBmcTBBZ3FaZz09",
    "plan_id": "0000000007",
    "qr_code": "{qr_code}",
    "link": "{payment_url}",
    "message": "Subscription plan created successfully.",
    "status": "success",
    "code": "00"
}

Store the data_id safely — you will need it to update or deactivate the plan later.

On this page