Update subscription
PUT /subscriptions/:subscriptionId
Facades MERCHANT
HTTP Request
To update the status of subscription
subscription = await client.CreateSubscription(subscriptionObj);
retrievedSubscription = await client.GetSubscription(subscription.id);
retrievedSubscription.nextDelivery = '2021-02-20';
updatedSubscription = await client.UpdateSubscription(retrievedSubscription, retrievedSubscription.id);
Success will return the updated subscription details
HTTP Response
{
"facade": "merchant/subscription",
"data": {
"id": "SeL33Hjyr3VmFHA5Skc4zy",
"status": "active",
"billData": {
"emailBill": true,
"cc": [
"[email protected]"
],
"number": "subscription1234-ABCD",
"currency": "USD",
"name": "John Doe",
"address1": "2630 Hegal Place",
"address2": "Apt 42",
"city": "Alexandria",
"state": "VA",
"zip": "23242",
"country": "US",
"email": "[email protected]",
"phone": "555-123-456",
"dueDate": "2021-05-31T00:00:00.000Z",
"passProcessingFee": true,
"items": [
{
"description": "Test Item 1",
"price": 6,
"quantity": 1
},
{
"description": "Test Item 2",
"price": 4,
"quantity": 1
}
],
"merchant": "5461e13dfd8b0047590d644a"
},
"schedule": "0 0 0 * * 1",
"nextDelivery": "2021-05-24T00:00:00.000Z",
"createdDate": "2021-05-21T12:29:54.428Z",
"token": "85yxWk7aEgPdJME6zTkXkAGA3K13MtXf3WHqvtBvyhw3ycfEebJ5WMBRZHXsssSBvn"
}
}