plusCreate Plan

Key details of the API

  1. Resource URL

https://api.sandbox.irembopay.com/subscritpions/plans
  1. Method: POST

  2. Headers

irembopay-secretKey: secreKey
X-API-Version: 2

Create a plan api reference

POST /subscriptions/plans

Headers

Name
Value

Content-Type

application/json

irembopay-secretKey

secretKey

X-API-Version

2

Body

Data representation: JSON

Name
Type
Mandatory
Comment (Description)

name

string

Yes

Display name of the plan (e.g., “quarter”).

currency

string

Yes

Currency code (e.g., “USD”).

billingCycle

string

Yes

Billing cycle for the plan (e.g., “QUARTERLY”).

amount

Big d

Yes

Charge amount for each billing cycle (e.g., 10000).

reminders

array

No

List of reminder rules to send before due/payment times.

The reminders array is composed of objects with fields below:

Name
Type
Mandatory?
Comments

unit

String

Yes

Time unit for the reminder (e.g., “HOUR” or “DAY”).

interval

integer

Yes

Offset in the given unit before the event (e.g., 23, 3, 13).


Response body payload

For this endpoint, the "data" payload in the response will have the fields below:

Field
Type
Mandatory
Comment (Description)

id

string

Yes

Unique identifier of the plan.

name

string

Yes

Plan name.

currency

string

Yes

Currency code.

billingCycle

string

Yes

Billing cycle (e.g., QUARTERLY).

amount

number

Yes

Plan amount.

reminders

array

No

List of configured reminders.

reminders[].unit

string

Yes*

Reminder time unit (HOUR, DAY).

reminders[].interval

number

Yes*

Reminder offset in the given unit.

createdAt

string

Yes

Creation timestamp (ISO 8601).

updatedAt

string

Yes

Last update timestamp (ISO 8601).


Error codes

HTTP Status
Code/Key
Comment (Description)

400

VALIDATION_ERROR

Missing/invalid fields (name, currency, billingCycle, amount, reminders.*).

400

BAD_DATA

Business rule violation (e.g., invalid billingCycle or negative/zero amount).

401

UNAUTHORIZED

Missing or invalid authentication token.

403

FORBIDDEN

Insufficient permissions to create a plan.

404

NOT_FOUND

Related resource not found (rare for create).

409

DUPLICATE_RESOURCE

Plan with same unique attributes already exists.

500

INTERNAL_SERVER_ERROR

Unexpected server error.


Open API Sample

Create a new invoice

post
Authorizations
irembopay-secretKeystringRequired
Body
transactionIdstringRequired
paymentAccountIdentifierstringRequired
descriptionstringRequired
expiryAtstring · date-timeRequired
languagestringRequired
Responses
post
/payments/invoices

Last updated