This webservice is used to update the network user suscription. The users information has to be retreived thru the network/query-customers service.
| Resource information | |
|---|
| Authentication | Required |
| Scope | network-suscription |
| HTTP Method | POST |
| Response | JSON |
| Version | 1 |
https://mapaprop.app/api/action/network-v1/update-suscription
| Key | Type | Required | Description |
|---|
| agencyId | string | yes | The agency ID provided by GET /api/action/feed-v1/get-properties or GET /api/action/feed-v1/get-delta webservices in the Feeds API. some Like ECID001**11267**01EN |
| planDescription | string | yes | A description of the suscription of the user. Like "Plan Plus 5 Publications". This text is displayed to the customer. |
| planMaxPublications | int | yes | The maximum number of publications allowed by the plan. Set 0 (zero) to block the user. |
| planCost | string | yes | The cost of the suscription. This is an arbitrary string so you should send the $ sign included of the currency. This text is displayed to the user. |
| planBillingCycle | string | yes | Indicate the billing cycle for the plan like "Weekly", "Monthly". This text is displayed to the user. |
| planUpgradeURL | string | yes | The URL where the user can click and upgrade, cancel or modify his suscription. |
| listingURL | string | yes | The URL of in your network with all the properties of the user. For example http://yoursite.com/nelson-properties |
| accountStatus | string | yes | A text indicating the current status of the account. This is useful to show if the user is due for payment , with suspended account or to show the balance. |
POST /api/action/network-v1/update-suscription HTTP/1.1
Host: mapaprop.app
Content-Type: application/x-www-form-urlencoded
Content-Length: 0
Authorization: Bearer {access_token}
agencyId=ECID001126701EN&planDescription=PLUS%2010&planMaxPublications=10&planCost=%24%2033&planBillingCycle=SEMANAL
&planUpgradeURL=https%3A%2F%2Fmysite.com%2Fupgrade%3FagencyId%3DAIGIGI
&listingURL=https%3A%2F%2Fmysite.com%2Fjulian-inmobiliaria
&accountStatus=AL%20DIA
The JSON response will tell you if the subscription was updated. If not, an error code indicates what happened.
| Object | Field | Type | Required | Description |
|---|
| Response | success | boolean | yes | A boolean showing if the update was or not successful |
| error | string | no | A text indicating the type of error if success == false |
| Error | Cause |
|---|
CHECK_YOUR_INPUT | A required parameter is missing (e.g. agencyId, planDescription or planMaxPublications) |
INVALID_AGENCY_ID | The agencyId is not valid |
CUSTOMER_DOES_NOT_HAVE_NETWORK | The customer is not a member of your network |
{
"success": false,
"error": "CUSTOMER_DOES_NOT_HAVE_NETWORK"
}