Subscriptions
Base URL: https://global.miridia.io. Read Authentication and Conventions before you call these operations.
| Method | Path | Operation |
|---|---|---|
| POST | /api/subscription/add-plan | Add plan |
| POST | /api/subscription/save-billing-details | Add billing details |
| GET | /api/subscription/billing-details/{subscriptionId} | Get billing details |
| GET | /api/subscription/{subscriptionId} | Get subscription |
| GET | /api/subscriptions | Get subscriptions |
| GET | /api/subscription/subscription-offers | Get subscription offers |
| POST | /api/subscription/{subscriptionId}/toggle | Toggle subscription |
| GET | /api/subscription/redirect/{subscriptionId} | Handle redirect |
| GET | /api/subscription/plans | Get plans |
Add plan
POST/api/subscription/add-plan
Access. Send a bearer token or an API key. Any signed-in member can call this operation.
Request body
Send JSON with the shape SubscriptionPlanRequest.
| Field | Type | Required | Description |
|---|---|---|---|
planId | integer (int32) | Yes | |
quantity | integer (int32) | No | |
billingCycle | enum BillingCycle | Yes | One of: Monthly, Annually. |
subscriptionId | string (uuid) | No | |
discountCode | string | No |
Response
200. Returns a SingleResult envelope. The data field is boolean.
curl -X POST "https://global.miridia.io/api/subscription/add-plan" \
-H "Authorization: Bearer $MIRIDIA_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"planId": 0,
"quantity": 0,
"billingCycle": "Monthly",
"subscriptionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"discountCode": "string"
}'{
"data": true,
"statusCode": 0,
"messages": [
"string"
]
}Add billing details
POST/api/subscription/save-billing-details
Access. Send a bearer token or an API key. Any signed-in member can call this operation.
Request body
Send JSON with the shape SubscriptionBillingRequest. Billing address comes from address on this request instead.
| Field | Type | Required | Description |
|---|---|---|---|
user | BillingUserRequest | No | |
business | BillingBusinessRequest | No | |
address | BillingAddressRequest | No | |
paymentMethod | enum PaymentMethod | No | One of: Unknown, Cash, Card, CashOnDelivery, CardOnDelivery, Eft, Crypto, Paypal, WireTransfer, DebitOrder. |
subscriptionId | string (uuid) | No |
Response
200. Returns a SingleResult envelope. The data field is boolean.
curl -X POST "https://global.miridia.io/api/subscription/save-billing-details" \
-H "Authorization: Bearer $MIRIDIA_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"user": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"firstName": "string",
"lastName": "string",
"email": "string",
"phoneNumber": "string"
},
"business": {
"registeredName": "string",
"displayName": "string",
"phoneNumber": "string",
"website": "string",
"email": "string",
"registrationNumber": "string",
"requiresOrderIntegration": true,
"requiresOrderFulfillment": true,
"requiresAccountingIntegration": true,
"requiresDispatchBuilder": true
},
"address": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"placeId": "string",
"name": "string",
"website": "string",
"fullAddress": "string",
"street": "string",
"suburb": "string",
"city": "string",
"country": "string",
"postcode": "string",
"unit": "string",
"number": "string",
"province": "string",
"latitude": 0,
"longitude": 0
},
"paymentMethod": "Cash",
"subscriptionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}'{
"data": true,
"statusCode": 0,
"messages": [
"string"
]
}Get billing details
GET/api/subscription/billing-details/{subscriptionId}
Access. Send a bearer token or an API key. Any signed-in member can call this operation.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
subscriptionId | path | string (uuid) | Yes |
Response
200. Returns a SingleResult envelope. The data field is SubscriptionBillingResponse.
curl -X GET "https://global.miridia.io/api/subscription/billing-details/{subscriptionId}" \
-H "Authorization: Bearer $MIRIDIA_TOKEN"{
"data": {
"user": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"displayName": "string",
"firstName": "string",
"lastName": "string",
"email": "string",
"phoneNumber": "string"
},
"business": {
"registeredName": "string",
"registrationNumber": "string",
"displayName": "string",
"phoneNumber": "string",
"website": "string",
"email": "string",
"requiresOrderIntegration": true,
"requiresOrderFulfillment": true,
"requiresAccountingIntegration": true,
"requiresDispatchBuilder": true
},
"address": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"placeId": "string",
"name": "string",
"website": "string",
"fullAddress": "string",
"street": "string",
"suburb": "string",
"city": "string",
"country": "string",
"postcode": "string",
"unit": "string",
"number": "string",
"province": "string",
"latitude": 0,
"longitude": 0
},
"paymentMethod": "Cash",
"hasCompletedBillingDetails": true
},
"statusCode": 0,
"messages": [
"string"
]
}Get subscription
GET/api/subscription/{subscriptionId}
Access. Send a bearer token or an API key. Any signed-in member can call this operation.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
subscriptionId | path | string (uuid) | Yes |
Response
200. Returns a SingleResult envelope. The data field is SubscriptionResponse.
curl -X GET "https://global.miridia.io/api/subscription/{subscriptionId}" \
-H "Authorization: Bearer $MIRIDIA_TOKEN"{
"data": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"billingCycle": "Monthly",
"active": true,
"discount": 0,
"subTotal": 0,
"total": 0,
"totalSuffix": "string",
"currency": {
"iso4217": "string",
"utf8Symbol": "string",
"currencyCode": "Eur"
},
"items": [
{}
],
"primaryPlan": {
"id": 0,
"pricePerMonth": 0,
"pricePerYear": 0,
"discountPercentage": 0,
"title": "string",
"description": "string",
"items": [
"string"
],
"addOns": [
{}
],
"hasQuantity": true,
"canAdd": true,
"currentPlan": true,
"showPrice": true,
"activeSubscription": true,
"planGroup": "ECommerce",
"countryCodeId": "Global",
"discountValidity": "OneMonth",
"currencyCode": "string",
"currencySymbol": "string"
},
"planLimit": 0,
"vehicleLimit": 0,
"shipmentLimit": 0,
"orderLimit": 0,
"requestLimit": 0,
"suggestions": [
{}
]
},
"statusCode": 0,
"messages": [
"string"
]
}Get subscriptions
GET/api/subscriptions
Access. Send a bearer token or an API key. Any signed-in member can call this operation.
Response
200. Returns a PagedResult envelope. Each item in data is SubscriptionResponse.
curl -X GET "https://global.miridia.io/api/subscriptions" \
-H "Authorization: Bearer $MIRIDIA_TOKEN"{
"data": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"billingCycle": "Monthly",
"active": true,
"discount": 0,
"subTotal": 0,
"total": 0,
"totalSuffix": "string",
"currency": {},
"items": [
{}
],
"primaryPlan": {},
"planLimit": 0,
"vehicleLimit": 0,
"shipmentLimit": 0,
"orderLimit": 0,
"requestLimit": 0,
"suggestions": [
{}
]
}
],
"count": 0,
"page": 0,
"pageSize": 0,
"totalCount": 0,
"statusCode": 0,
"messages": [
"string"
]
}Get subscription offers
GET/api/subscription/subscription-offers
Access. Send a bearer token or an API key. Any signed-in member can call this operation.
Response
200. Returns a JSON array. Each item is ActionMessage.
curl -X GET "https://global.miridia.io/api/subscription/subscription-offers" \
-H "Authorization: Bearer $MIRIDIA_TOKEN"[
{
"title": "string",
"message": "string",
"level": "Standard",
"icon": "None",
"code": "string"
}
]Toggle subscription
POST/api/subscription/{subscriptionId}/toggle
Access. Send a bearer token or an API key. Any signed-in member can call this operation.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
subscriptionId | path | string (uuid) | Yes |
Request body
Send JSON with the shape ToggleSubscriptionRequest.
| Field | Type | Required | Description |
|---|---|---|---|
mode | string | Yes |
Response
200. Returns a SingleResult envelope. The data field is RedirectAction.
curl -X POST "https://global.miridia.io/api/subscription/{subscriptionId}/toggle" \
-H "Authorization: Bearer $MIRIDIA_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"mode": "string"
}'{
"data": {
"redirect": true,
"url": "string",
"paymentMethod": "Cash",
"messages": [
{}
]
},
"statusCode": 0,
"messages": [
"string"
]
}Handle redirect
GET/api/subscription/redirect/{subscriptionId}
Handles redirections to the payment provider. No security checks. This is a plain redirect.
Access. This operation needs no authentication.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
subscriptionId | path | string (uuid) | Yes |
Response
200. The response has no body.
curl -X GET "https://global.miridia.io/api/subscription/redirect/{subscriptionId}"Get plans
GET/api/subscription/plans
Access. Send a bearer token or an API key. Any signed-in member can call this operation.
Response
200. Returns a JSON array. Each item is PricePlanGroupResponse.
curl -X GET "https://global.miridia.io/api/subscription/plans" \
-H "Authorization: Bearer $MIRIDIA_TOKEN"[
{
"title": "string",
"description": "string",
"planGroup": "ECommerce",
"plans": [
{}
]
}
]Models
The operations on this page use these object types. Select a type to see its fields.
ActionMessage
| Field | Type | Description |
|---|---|---|
title | string | |
message | string | |
level | enum NotificationLevel | One of: Standard, Info, Warning, Error, Success, Recommendation. |
icon | enum MdiIcon | One of: None. |
code | string |
AddOnResponse
| Field | Type | Description |
|---|---|---|
title | string | |
description | string | |
quantity | integer (int32) | |
hasQuantity | boolean |
BillingAddressRequest
| Field | Type | Description |
|---|---|---|
id | string (uuid) | |
placeId | string | |
name | string | |
website | string | |
fullAddress | string | |
street | string | |
suburb | string | |
city | string | |
country | string | |
postcode | string | |
unit | string | |
number | string | |
province | string | |
latitude | number (double) | |
longitude | number (double) |
BillingAddressResponse
| Field | Type | Description |
|---|---|---|
id | string (uuid) | |
placeId | string | |
name | string | |
website | string | |
fullAddress | string | |
street | string | |
suburb | string | |
city | string | |
country | string | |
postcode | string | |
unit | string | |
number | string | |
province | string | |
latitude | number (double) | |
longitude | number (double) |
BillingBusinessRequest
| Field | Type | Description |
|---|---|---|
registeredName | string | |
displayName | string | |
phoneNumber | string | |
website | string | |
email | string | |
registrationNumber | string | |
requiresOrderIntegration | boolean | |
requiresOrderFulfillment | boolean | |
requiresAccountingIntegration | boolean | |
requiresDispatchBuilder | boolean |
BillingBusinessResponse
The live org-side Business aggregate is out of reach here).
| Field | Type | Description |
|---|---|---|
registeredName | string | |
registrationNumber | string | |
displayName | string | |
phoneNumber | string | |
website | string | |
email | string | |
requiresOrderIntegration | boolean | |
requiresOrderFulfillment | boolean | |
requiresAccountingIntegration | boolean | |
requiresDispatchBuilder | boolean |
BillingCurrencyResponse
| Field | Type | Description |
|---|---|---|
iso4217 | string | |
utf8Symbol | string | |
currencyCode | enum CurrencyCode | One of: Invalid, Eur, Usd, Gbp, Zar, Zmw. |
BillingPrimitiveUserResponse
| Field | Type | Description |
|---|---|---|
id | string (uuid) | |
displayName | string | |
firstName | string | |
lastName | string | |
email | string | |
phoneNumber | string |
BillingUserRequest
| Field | Type | Description |
|---|---|---|
id | string (uuid) | |
firstName | string | |
lastName | string | |
email | string | |
phoneNumber | string |
PricePlanGroupResponse
| Field | Type | Description |
|---|---|---|
title | string | |
description | string | |
planGroup | enum PlanGroup | One of: ECommerce, Logistics, Retail, AddOn. |
plans | PricePlanResponse[] |
PricePlanResponse
| Field | Type | Description |
|---|---|---|
id | integer (int32) | |
pricePerMonth | number (double) | |
pricePerYear | number (double) | |
discountPercentage | number (double) | |
title | string | |
description | string | |
items | string[] | |
addOns | AddOnResponse[] | |
hasQuantity | boolean | |
canAdd | boolean | |
currentPlan | boolean | |
showPrice | boolean | |
activeSubscription | boolean | |
planGroup | enum PlanGroup | One of: ECommerce, Logistics, Retail, AddOn. |
countryCodeId | enum CountryCode | One of: Invalid, Global, FallbackZa, Be, De, Lu, Nl, Za, Zw, Gb, Us, Zm. |
discountValidity | enum DiscountValidity | One of: OneMonth, ThreeMonths, SixMonths, TwelveMonths. |
currencyCode | string | |
currencySymbol | string |
RedirectAction
| Field | Type | Description |
|---|---|---|
redirect | boolean | |
url | string | |
paymentMethod | enum PaymentMethod | One of: Unknown, Cash, Card, CashOnDelivery, CardOnDelivery, Eft, Crypto, Paypal, WireTransfer, DebitOrder. |
messages | ActionMessage[] |
SubscriptionBillingResponse
| Field | Type | Description |
|---|---|---|
user | BillingPrimitiveUserResponse | |
business | BillingBusinessResponse | |
address | BillingAddressResponse | |
paymentMethod | enum PaymentMethod | One of: Unknown, Cash, Card, CashOnDelivery, CardOnDelivery, Eft, Crypto, Paypal, WireTransfer, DebitOrder. |
hasCompletedBillingDetails | boolean |
SubscriptionItemResponse
| Field | Type | Description |
|---|---|---|
title | string | |
description | string | |
price | number (double) | |
discount | number (double) | |
quantity | integer (int32) | |
id | string (uuid) | |
currencyCode | enum CurrencyCode | One of: Invalid, Eur, Usd, Gbp, Zar, Zmw. |
discountApplied | string (date-time) | |
discountExpiry | string (date-time) | |
planCategory | enum PlanCategory | One of: Primary, ECommerce, Fulfillment, Accounting, Crm, OrderApi, RouteApi, ServiceBridge, Queue, Notification, RoutePlanning, Member, PointOfSale. |
SubscriptionResponse
| Field | Type | Description |
|---|---|---|
id | string (uuid) | |
billingCycle | enum BillingCycle | One of: Monthly, Annually. |
active | boolean | |
discount | number (double) | |
subTotal | number (double) | |
total | number (double) | |
totalSuffix | string | |
currency | BillingCurrencyResponse | |
items | SubscriptionItemResponse[] | |
primaryPlan | PricePlanResponse | |
planLimit | integer (int32) | |
vehicleLimit | integer (int32) | |
shipmentLimit | integer (int32) | |
orderLimit | integer (int32) | |
requestLimit | integer (int32) | |
suggestions | ActionMessage[] |