PROD

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
AuthenticationRequired
Scopenetwork-suscription
HTTP MethodPOST
ResponseJSON
Version1

Resource URL

https://mapaprop.app/api/action/network-v1/update-suscription

Parameters

KeyTypeRequiredDescription
agencyIdstringyesThe 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
planDescriptionstringyesA description of the suscription of the user. Like "Plan Plus 5 Publications". This text is displayed to the customer.
planMaxPublicationsintyesThe maximum number of publications allowed by the plan. Set 0 (zero) to block the user.
planCoststringyesThe 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.
planBillingCyclestringyesIndicate the billing cycle for the plan like "Weekly", "Monthly". This text is displayed to the user.
planUpgradeURLstringyesThe URL where the user can click and upgrade, cancel or modify his suscription.
listingURLstringyesThe URL of in your network with all the properties of the user. For example http://yoursite.com/nelson-properties
accountStatusstringyesA 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.

Sample code

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

Response

The JSON response will tell you if the subscription was updated. If not, an error code indicates what happened.

ObjectFieldTypeRequiredDescription
ResponsesuccessbooleanyesA boolean showing if the update was or not successful
errorstringnoA text indicating the type of error if success == false

Error codes

ErrorCause
CHECK_YOUR_INPUTA required parameter is missing (e.g. agencyId, planDescription or planMaxPublications)
INVALID_AGENCY_IDThe agencyId is not valid
CUSTOMER_DOES_NOT_HAVE_NETWORKThe customer is not a member of your network

Sample code

{
    "success": false,
    "error": "CUSTOMER_DOES_NOT_HAVE_NETWORK"
}