Examples - Referral service Introducer
Create a referral
This example creates a referral. The instruction is then retrieved and the methods to check if a referral exists are called. Note:
propertyValueOrPurchasePricehas not been set - if it was thenpropertyValueTierCodewould be overridden or calculated.yearBuilthas not been set - if it was thenpropertyAgeCodewould be calculated.
@host=https://api.themovingportal.dev
@auth=BASICAUTHHEADER
@introducerRandomNumber={{$randomInt 100000 999999}}
@introducerIntegrationReference=INTRODUCER-INT-REF-{{introducerRandomNumber}}
@introducerCustomerReference=INTRODUER-CUST-REF-{{introducerRandomNumber}}
### Create a new referral
# @name createreferral
POST {{host}}/Referral HTTP/1.1
Authorization: Basic {{auth}}
Content-Type: application/json
{
"cases": [
{
"uniqueCustomerReference": "{{introducerIntegrationReference}}",
"uniqueIntegrationReference": "{{introducerCustomerReference}}",
"productCode": "RICSHTBVALUATION",
"totalFeeInclVAT": 774.99,
"yourFeeInclVAT": 109.99
}
],
"propertyValueOrPurchasePrice": null,
"propertyValueTierCode": "100K150K",
"propertyTypeCode": "TERRACED",
"propertyAgeCode": "LESSTHANTENYEARS",
"propertyAddress": {
"addressFormatCode": "DEFAULT",
"addressLine1": "29 Market Street",
"addressLine2": "",
"addressLine3": "Milton Keynes",
"addressLine4": "",
"postcode": "MK4 1EB",
"countryCode": "GB"
},
"correspondenceAddress": {
"addressFormatCode": "DEFAULT",
"addressLine1": "44 Castle Road",
"addressLine2": "",
"addressLine3": "Twickenham",
"addressLine4": "",
"postcode": "TW6 7SM",
"countryCode": "GB"
},
"accessDetails": {
"accessTypeCode": "VENDOR",
"firmName": "",
"emailAddress": "vendor@vendor.co.uk",
"contactName": "John Smith",
"telephoneNumber": "01234 121212"
},
"customers": [
{
"emailAddress": "jacob.baker@themovingportal.dev",
"title": "",
"firstName": "Jacob",
"lastName": "Baker",
"telephoneNumber": "01245 399999",
"receiveSMS": false
}
]
}
### Retrieve instruction
# @name retrieveinstruction
GET {{host}}/instruction/{{createreferral.response.body.$.reference}}
Authorization: Basic {{auth}}
### Check if it exists using integration reference
HEAD {{host}}/referral/introducer/{{retrieveinstruction.response.body.$.otherInformation.INTRODUCERINTEGRATIONREFERENCE}}
Authorization: Basic {{auth}}
### Check if it exists using customer reference
HEAD {{host}}/referral/introducer/{{retrieveinstruction.response.body.$.otherInformation.INTRODUCERCUSTOMERREFERENCE}}
Authorization: Basic {{auth}}
Create a lead
This example shows a lead being created with the minimum amount of information. Please send as much information as possible.
A lead requires you to perform no calculation of fees.
@host=https://api.themovingportal.dev
@auth=BASICAUTHHEADER
### Create a lead
# @name createlead
POST {{host}}/Referral HTTP/1.1
Authorization: Basic {{auth}}
Content-Type: application/json
{
"cases": [
{
"productCode": "RICSHTBVALUATION",
"isLead": true
}
],
"propertyValueOrPurchasePrice": 320000,
"propertyTypeCode": "UNKNOWN",
"propertyAgeCode": "UNKNOWN",
"yearBuilt": null,
"propertyAddress": {
"addressFormatCode": "DEFAULT",
"addressLine1": "29 Market Street",
"addressLine2": "",
"addressLine3": "Milton Keynes",
"addressLine4": "",
"postcode": "MK4 1EB",
"countryCode": "GB"
},
"correspondenceAddress": null,
"accessDetails": null,
"customers": [
{
"emailAddress": "jacob.baker@themovingportal.dev",
"title": "",
"firstName": "Jacob",
"lastName": "Baker",
"telephoneNumber": "01245 399999",
"receiveSMS": false
}
]
}
### Retrieve instruction
GET {{host}}/instruction/{{createlead.response.body.$.reference}}
Authorization: Basic {{auth}}
