XM

Create Plan

Path:

POST /data-subscription/plans

This API facilitates easy creation of a new subscription plans based on the subscription details such as planId, itemId, quantity, etc. in the request body.

‚Äč

Headers

Content-Type : application/json

Authorization: JWT Token

x-site-context : { "date": "2020-08-28T02:35:27.787Z", "channel": 12, "account": 5f493c9f30ec2a0007a94fc8", "stage": "sandbox"

Consumes

  • application/json

Produces

  • application/json

Parameters

Type : body

Name : Subscription details

Required: true

Sample Path

https://{baseurl}/data-subscription/plans

Sample Request

{
"title": "Plan for testing",
"description": "Creating this plan for testing ",
"frequency": 2,
"frequencyType": "Weekly",
"discount": 1,
"products": [
{
"itemId": "1000019269"
}
],
"shippingCost": 12,
"status": "ACTIVE"
}

Sample Response

Response Code: 200

Message: OK

{
"success": true,
"responseStatus": "OK",
"message": "Request processed successfully.",
"data": {
"_id": "60584b5fd54c3d6ddd934c8e",
"isDeleted": false,
"deletedAt": null,
"title": "Plan for testing",
"description": "Creating this plan for testing ",
"products": [
{
"_id": "60584b5fd54c3d6ddd934c8f",
"itemId": "1000019269",
"priceListId": "100272"
}
],
"frequency": 2,
"frequencyType": "weekly",
"status": "ACTIVE",
"discount": 1,
"shippingCost": 12,
"merchantAccountId": "8739392294",
"merchantAccount": "5f328bf0b7c15700071233b9",
"createdAt": "2021-03-22T07:46:39.675Z",
"updatedAt": "2021-03-22T07:46:39.675Z",
"__v": 0
}
}

Response Code: 400

Message: Client Error

Response Code: 500

Message: Server Error

Changelog

  • April-2021