Plans
GET/v2/plans
Get plans
Get a list of all the plans from your organization.
Optional Query Parameters
status
string
type
string
order
string
search
string
page
string
take
json
Loading...
Response
{
"data": [
{
"id": "xxxx-ee46-xxxxx-xx-5bf5f5f648ab",
"name": "Backend Development course",
"description": "Monthly subscription advanced plan",
"metadata": {},
"createdAt": "2024-03-13T14:47:23.491Z",
"itemFamilyId": null,
"archive": false,
"assets": null,
"type": "plan"
},
{
"id": "xxxxx-xxxx-4ec3-xx-cf9ed2615827",
"name": "Frontend Development Course",
"description": "Monthly subscription with final project.",
"metadata": {},
"createdAt": "2024-02-28T22:31:11.661Z",
"itemFamilyId": null,
"archive": false,
"assets": null,
"type": "plan"
}
],
"meta": {
"page": 1,
"take": 2,
"itemCount": 8,
"pageCount": 3,
"hasPreviousPage": false,
"hasNextPage": true
}
}
GET/v2/plans/{planId}
Get plan by id
Retrieve detailed information about a specific plan using its unique ID. This endpoint provides comprehensive data on the plan, including pricing details for each currency in which you operate.
Required Path Parameters
planId
string
required
Loading...
Response
{
"id": "xxxxxxx-ee46-4c88-a939-5bf5f5f648ab",
"name": "Basic Subscription",
"description": "Monthly subscription basic plan",
"metadata": {},
"prices": [
{
"id": "xxxxxx-3cdf-4ed7-a3f6-c5cffbce465f",
"createdAt": "2024-03-13T14:47:23.513Z",
"gateway": {
"id": "xxxxxxxx-630a-4438-b7d9-9bc87eb20f94",
"type": "rebill_gateway",
"country": "I",
"description": "Rebill Gateway | Crossborder | Chile | ALL",
"status": "ACCEPTED",
"publicKey": "8lynHfD3elgz7AD1MSBL0G_I56ONV7HQ",
"recurring": false,
"crossborder": true
},
"frequency": {
"type": "months",
"quantity": 1
},
"repetitions": null,
"description": null,
"currency": "COP",
"archive": false,
"priceSetting": {
"id": "xxxx-0e5b-4593-8c1a-d98214f702b6",
"documentRequired": true,
"phoneRequired": true,
"billingAddressRequired": true,
"showImage": true,
"redirectUrl": null,
"paymentMethods": [
"REBILL_EFECTY",
"REBILL_NEQUI_QR",
"REBILL_NEQUI_PUSH",
"CARD"
],
"expirationDate": null,
"allowDiscountCodes": true
},
"parent": null,
"itemId": "b6181196-ee46-4c88-a939-5bf5f5f648ab",
"amount": "10",
"type": "fixed",
"debitDay": null,
"debitType": null,
"isExpired": null
}
],
"createdAt": "2024-03-13T14:47:23.491Z",
"itemFamilyId": null,
"archive": false
}
POST/v2/plans
Create a plan
Create a new subscription plan.
Required Parameters
name
string
required
frequency
object
required
type
string
required
repetitions
number
required
currencies
array of objects
required
Optional Parameters
description
string
metadataObject
object
debitDay
number
debitType
string
Loading...
Response
{
"plan": {
"id": "xxxxxxx-e531-46b2-929f-c7c944f9e5f6",
"name": "New Plan",
"description": "Description for a plan",
"frequency": {
"type": "months",
"quantity": 1
},
"repetitions": null,
"debitDay": null,
"debitType": null,
"metadata": {
"SKU": "123"
},
"createdAt": "2024-04-13T13:26:25.367Z"
},
"paymentLinkUrl": "https://pay.rebill.dev/coursesonline/xxx-0a9f-4487-xx-bb7e47fd3869",
"currencies": [
{
"createdAt": "2024-04-13T13:26:25.611Z",
"gateway": {
"id": "xxxxxxxx-630a-4438-b7d9-9bc87eb20f94",
"type": "rebill_gateway",
"description": "Rebill Gateway | Crossborder | Chile | ALL"
},
"description": null,
"currency": "MXN",
"productId": "xxxxxxxx-e531-46b2-929f-c7c944f9e5f6",
"amount": "1500"
}
]
}
PUT/v2/plans/{planId}
Update a plan
Use this endpoint to make changes to attributes like expiration, success URL, and payment methods allowed.
Required Path Parameters
id
string
required
Required Body Parameters
name
string
required
frequency
object
required
repetitions
number
required
currencies
array of objects
required
Optional Parameters
description
string
debitDay
number
debitType
string
type
string
metadataObject
object
archive
boolean
Loading...
Response
{
// empty response with 200 status
}
DELETE/v2/plans/{id}
Archive a plan
Executes a soft delete to a plan along with its prices.
Required Path Parameters
id
string
required
Loading...
Response
{
}