The CNPC 95504 system provides APIs for fleet management and business data integration, enabling functions like account balance checks and card management. These interfaces are primarily accessible to fleet administrators through an authorized account structure.
Authentication and Login Interfaces
1. Standard Authentication
This endpoint performs user authentication without payload encryption.
- HTTP Method: POST
- Endpoint:
/atlapi/data/cnpc/authentication/basic/{authToken} - Content-Type:
application/json - Path Parameter:
authToken: A user-specific authorization token.
Request Body Example:
{
"userId": "user_phone_number",
"credential": "user_password"
}
Response Example:
{
"status": 200,
"message": "Authentication successful."
}
2. Encrypted Authentication
For enhanced security, this endpoint requires encrypted credentials.
- HTTP Method: POST
- Endpoint:
/atlapi/data/cnpc/authentication/secure/{authToken} - Content-Type:
application/json - Path Parameter:
authToken: An encrypted authorization token.
Request Body Example:
{
"userId": "E9f7k...V4s2w==",
"credential": "X3qLp...N8gRt=="
}
The encryption methodology for the payload is available upon request.
Account Information Retrieval
3. Query Account Details
This endpoint retrieves the authenticated user's account summary.
- HTTP Method: GET
- Endpoint:
/atlapi/data/cnpc/account/details/{authToken} - Path Parameter:
authToken: A valid authorization token.
Prerequisite: A successful call to either authentication interface (1 or 2) is required before invoking this endpoint. The authentication token remains valid until the user's password is changed.
Response Example:
{
"status": 200,
"message": "Request processed.",
"payload": {
"customerCategory": "2",
"operationResult": "1",
"failureDescription": "",
"accountData": ",228587.02,1003700024,Example Corp Ltd,Standard Corporate Client,,,Post-consumption consolidated VAT invoice,",
"internalIdentifier": ""
}
}
Note: This endpoint is limited to five daily calls for evaluation purposes.
Obtaining the Authorization Token
The authToken required for all API calls is generated via a designated mini-program. Users must access the program and complete a daily check-in activity to recieve a valid token.
Integration Code Sample
Below is a Python example demonstrating a call to the standard authentication endpoint.
import urllib.request
import urllib.error
import json
def authenticate_user(token, user_id, password):
api_endpoint = f'https://api.service.com/atlapi/data/cnpc/authentication/basic/{token}'
request_data = json.dumps({
'userId': user_id,
'credential': password
}).encode('utf-8')
req = urllib.request.Request(api_endpoint, data=request_data, method='POST')
req.add_header('Content-Type', 'application/json')
try:
with urllib.request.urlopen(req) as response:
result = json.loads(response.read().decode())
print(f'Authentication Result: {result}')
except urllib.error.HTTPError as e:
print(f'HTTP Error {e.code}: {e.reason}')
# Example usage
my_token = 'your_auth_token_here'
authenticate_user(my_token, '13800138000', 'your_password')
Practical Use Cases
- Fleet Management Integration: Automate fuel allocation, manage physical or virtual card balances, query funds, and synchronize transaction records within fleet management software.
- Real-Time Financial Monitoring: Enable businesses to programmatically access current account balances and holder information for operational decision-making.
- Automated Financial Reconciliation: Streamline accounting workflows by combining transaction data with account details to facilitate automated VAT invoice processing.