issueCard
POST /v2/pds/memberships/issueCard
With this API call, a merchant can issue membership cards to users.
Note: For the appId, customerBelongTo, requestId, and customerId parameters, we recommend you pass the same parameter values as those in the notifyCardRegistration API. Otherwise, an error can occur when calling this API.
Structure
A message consists of a header and body. The following sections are focused on the body structure. For the header structure, see:
Request parameters
Response parameters
Field | Data type | Required | Description |
result | Yes | Indicates the request result, such as status and error codes. | |
cardNo | String | Yes | Indicates the unique card number returned by Mini Program Platform to identify a membership card.
|
extendInfo | String | No | Indicates the extended information about the response.
|
Result process logic
In the response, the result.resultStatus
field indicates the result of processing a request. The following table describes each result status:
resultStatus | Description |
S | The request to issue the membership card is successful. The corresponding |
U | The status of the request to issue the membership card is unknown. The corresponding |
F | The request to issue the membership card failed. The corresponding |
Error codes
Error codes are usually classified into the following categories:
- Common error codes are common for all mini program OpenAPIs in V2. Â
- API-specific error codes: This API does not have its dedicated error codes.
Samples
The data flow of sending a request to issue a membership card is illustrated as follows:
The above diagram consists of the following steps:
- The merchant calls this API to send a request to Mini Program Platform to issue a membership card.
- Mini Program Platform processes the request and issues the membership card.
- Mini Program Platform returns the result to the merchant.
Request
{
"requestId": "2019112987210000077771990****",
"appId": "2102010113769***",
"customerBelongsTo": "TNG",
"customerId": "21091129***",
"registerDate": "2022-02-17T00:00:00.00+08:00",
"expireDate": "2023-01-26T00:00:00.00+08:00",
"externalCardNo": "merchant_0121_000***",
"externalCustomerId": "merchant_01***",
"cardFields": [
{
"fieldCode": "POINT",
"fieldValue": "123"
},
{
"fieldCode": "BALANCE",
"fieldValue": {
"value": 100,
"currency": "SGD"
}
},
{
"fieldCode": "LEVEL",
"fieldValue": "GOLD"
}
]
}
Response
{
"cardNo": "011164508621375700010170***",
"result": {
"resultCode": "SUCCESS",
"resultMessage": "Success",
"resultStatus": "S"
}
}
result.resultStatus
is S
, which means the request to issue the membership card is successful.