{ "info": { "name": "MTN Customer Profile API", "schema": "https:\/\/schema.getpostman.com\/json\/collection\/v2.1.0\/collection.json" }, "item": [ { "name": "View customer profile", "description": "Retrieves the customer profile of a MTN customer. The customer profile includes 4 main objects: Location (Country and Operator), Billing Plan and related details, Subscriptions for VAS and Digital Services, and Loans details", "request": { "auth": { "type": "apikey", "apikey": [ { "key": "key", "value": "X-API-Key", "type": "string" } ] }, "method": "Get", "header": [ { "key": "Content-Type", "name": "Content-Type", "value": "application\/json", "type": "application\/json", "description": "" } ], "url": { "raw": "staging.api.mtn.com\/customers\/{customerId}", "protocol": "https", "host": [ "staging", "api", "mtn", "com" ], "path": [ "v1", "customers", "{customerId}" ], "query": [ { "key": "scope", "value": "", "required": 0, "type": "string", "description": "the set of data to be retrieved. There are 2 options - `basic` will retrieve only the structure of the customer profile including the links to each resource, will `full` will retrieve all the data for each resource, which will be en expensive call. If not specified, the default will be `basic`\"" } ] } }, "response": [ { "code": 200, "status": "OK", "name": "Customer Profile object. For a successfull request, it will contain all the customers details. If the customer does not have any requested data, then it will be null. E.g. if the customer does not any location set, then Country and Operator will be null.", "schema": { "customerId": { "type": "string" }, "locations": { "data": { "country": { "type": "string", "description": "The country that the customer MSISDN was provisioned in.", "example": "South Africa" }, "operator": { "type": "string", "description": "The network operator that the customer MSISDN was provisioned for.", "example": "MTN" } }, "_link": { "self": { "href": { "type": "string", "description": "" } } } }, "plans": { "data": { "type": { "type": "string", "description": "The billing type of the plan.", "enum": [ "Prepaid", "Postpaid", "Hybrid" ] }, "status": { "type": "string", "description": "The current status of the plan.", "enum": [ "Active", "Suspended", "Inactive", "RICA Barred", "Blacklisted" ] }, "startDate": { "type": "string", "description": "The date the customer was created\/provisioned", "format": "date-time" }, "endDate": { "type": "string", "description": "The date the plan will be deactivated.", "format": "date-time" }, "balance": { "data": { "balanceType": { "type": "string", "description": "Identifies the type of balance. A customer plan may have multiple types of balances for different usage, for example, voice, SMS, and game services.", "example": "VOICE" }, "amount": { "type": "string", "description": "Amount of balance.", "example": "26861" }, "currency": { "type": "string", "description": "ISO 4217 three-letter ISO code for the currency.", "example": "ZAR" }, "expiryDate": { "type": "string", "format": "date-time", "description": "Expiry Date of the account.", "example": "2019-12-31T12:00:00" } } } }, "_link": { "self": { "href": { "type": "string", "description": "" } } } }, "loans": { "data": { "_link": { "self": { "href": { "type": "string", "description": "" } } }, "status": { "type": "string", "enum": [ "FAILED", "COMPLETED", "INITED" ] }, "transactionId": { "type": "string" } }, "_link": { "self": { "href": { "type": "string", "description": "" } } } }, "_links": { "self": { "href": { "type": "string", "description": "" } } } }, "body": "{\"customerId\":\"string\",\"locations\":{\"data\":{\"country\":\"string\",\"operator\":\"string\"},\"_link\":{\"self\":{\"href\":\"string\"}}},\"plans\":{\"data\":{\"type\":\"string\",\"status\":\"string\",\"startDate\":\"string\",\"endDate\":\"string\",\"balance\":{\"data\":{\"balanceType\":\"string\",\"amount\":\"string\",\"currency\":\"string\",\"expiryDate\":\"string\"}}},\"_link\":{\"self\":{\"href\":\"string\"}}},\"loans\":{\"data\":{\"_link\":{\"self\":{\"href\":\"string\"}},\"status\":\"string\",\"transactionId\":\"string\"},\"_link\":{\"self\":{\"href\":\"string\"}}},\"_links\":{\"self\":{\"href\":\"string\"}}}", "header": [ { "key": "Content-Type", "value": "application\/json", "description": "Sending as JSON", "type": "string" } ] }, { "code": 207, "status": "Multi-Status", "name": "If there was an error retrieving some part of the request, then the successfull request will be shown, and the remaining failed objects will be be excluded. E.g. if there was an error retrieving Balance information, then the balance object will be empty", "schema": [], "body": "[]", "header": [ { "key": "Content-Type", "value": "application\/json", "description": "Sending as JSON", "type": "string" } ] }, { "code": 400, "status": "Bad Request", "name": "Bad Request", "schema": { "error": { "type": "string" }, "error_description": { "type": "string" } }, "body": "{\"error\":\"string\",\"error_description\":\"string\"}", "header": [ { "key": "Content-Type", "value": "application\/json", "description": "Sending as JSON", "type": "string" } ] }, { "code": 401, "status": "Unauthorized", "name": "Unauthorized", "schema": { "error": { "type": "string" }, "error_description": { "type": "string" } }, "body": "{\"error\":\"string\",\"error_description\":\"string\"}", "header": [ { "key": "Content-Type", "value": "application\/json", "description": "Sending as JSON", "type": "string" } ] }, { "code": 403, "status": "Forbidden", "name": "Forbidden", "schema": { "error": { "type": "string" }, "error_description": { "type": "string" } }, "body": "{\"error\":\"string\",\"error_description\":\"string\"}", "header": [ { "key": "Content-Type", "value": "application\/json", "description": "Sending as JSON", "type": "string" } ] }, { "code": 404, "status": "Not Found", "name": "Customer not found", "schema": [], "body": "[]", "header": [ { "key": "Content-Type", "value": "application\/json", "description": "Sending as JSON", "type": "string" } ] }, { "code": 405, "status": "Method Not Allowed", "name": "Method Not allowed", "schema": { "timestamp": { "type": "string", "format": "date-time", "description": "Error response code" }, "status": { "type": "string", "description": "Text explaining the reason for the error" }, "error": { "type": "string" }, "message": { "type": "string", "description": "More error details and corrective measures" }, "path": { "type": "string", "description": "" } }, "body": "{\"timestamp\":\"string\",\"status\":\"string\",\"error\":\"string\",\"message\":\"string\",\"path\":\"string\"}", "header": [ { "key": "Content-Type", "value": "application\/json", "description": "Sending as JSON", "type": "string" } ] }, { "code": 500, "status": "Internal Server Error", "name": "Internal Server Error", "schema": { "timestamp": { "type": "string", "format": "date-time", "description": "Error response code" }, "status": { "type": "string", "description": "Text explaining the reason for the error" }, "error": { "type": "string" }, "message": { "type": "string", "description": "More error details and corrective measures" }, "path": { "type": "string", "description": "" } }, "body": "{\"timestamp\":\"string\",\"status\":\"string\",\"error\":\"string\",\"message\":\"string\",\"path\":\"string\"}", "header": [ { "key": "Content-Type", "value": "application\/json", "description": "Sending as JSON", "type": "string" } ] } ] } ] }