Card

create and query order information .

Every request must contain common parameters

Demo code can be found at Github

Apply Card

issue a card under a specific user.

POST https://api.musepay.io/v1/card/apply

Only one card can be issued under a single card product.

When issuing a card, the productId must be specified and determines the card product to issue. The card product determines the card type, card face, card features, benefits, interest rates, capabilities, etc.

Request Body

NameTypeDescription

user_id*

String

The user id is an account that holds the funds, balances, and transactions that are used to make purchases with the card.

request_id*

String

External identifier for the issuing request.

card_product_id*

String

Product ID of the card to be issued

card_level*

String

the card level of the card product to apply

phone_number*

String

Mobile phone number of card holder. This phone number should be pre-verified by the partner.

phone_area_code*

String

Country calling codes

{
    // Response
   "code":200,
   "message":"success",
   "data": {
        "apply_status": "APPLYING",
        "apply_id": "2469990273197955",
        "request_id": "afdsfasf234324"
    }
}

Query Apply Result

query Card Apply Result

POST https://api.musepay.io/v1/card/apply-result

Request Body

NameTypeDescription

request_id*

String

External identifier for the issuing request.

apply_id

String

The apply ID of the card issuing

user_id*

String

The unique id in musewallet

{    
     "code":"200",
     "data":{
         "request_id":"2022093002029700786237858945",
         "user_id":"2000061",
         "apply_id":"abc123",
         "card_id":"xxxxx",
         "apply_status":"WAIT_AUDIT"
         },
   "message":"success"
}

Get Card

get Card

POST https://api.musepay.io/v1/card/query

Request Body

NameTypeDescription

card_id*

String

The card ID of the card issued

user_id*

String

The unique id in musewallet

{    
     "code":"200",
     "data":{
         "user_id":"2000061",
         "card_id":"xxxxx",
         "phone_number":"1331236",
         "phone_area_code":"86",
         "product_id":"86",
         "card_level":1,
         "card_network":"masterCard",
         "card_type":"physical",
         "currency":"USD",
         "card_no_last4":"0086",
         "card_status":"PENDING_ACTIVE",
         "embossed_name":"coll boston",
         "expiry_month": "04",
         "expiry_year": "2030",
         "issue_time": "13788886666",
         "card_available_balance": 12321,
         "daily_purchase_limit": 500000,
         "enable_present_transaction": false,
         "enable_noPresent_transaction": true
     }
   "message":"success"
}

Activate Card

activate card

POST https://api.musepay.io/v1/card/activate

Request Body

NameTypeDescription

card_id*

String

The card ID of the card issued

user_id*

String

The unique id in musewallet

{    
     "code":"200",
     "data":{
         "user_id":"2000061",
         "card_id":"xxxxx",
         "card_status":"PENDING_ACTIVE"
     }
   "message":"success"
}

Update Phone

update phone

POST https://api.musepay.io/v1/card/update-phone

Request Body

NameTypeDescription

card_id*

String

The card ID of the card issued

user_id*

String

The unique id in musewallet

phone_number*

String

New phone number for the card

phone_area_code*

String

countryCode

{    
     "code":"200",
     "data":{
         "user_id":"2000061",
         "card_id":"xxxxx",
         "status":""
     }
   "message":"success"
}

Lock Card

lock card

POST https://api.musepay.io/v1/card/lock

Request Body

NameTypeDescription

card_id*

String

The card ID of the card issued

user_id*

String

The unique id in musewallet

{    
     "code":"200",
     "data":{
         "user_id":"2000061",
         "card_id":"xxxxx",
         "card_status":"LOCK"
     }
   "message":"success"
}

UnLock Card

unlock card

POST https://api.musepay.io/v1/card/unlock

Request Body

NameTypeDescription

card_id*

String

The card ID of the card issued

user_id*

String

The unique id in musewallet

{    
     "code":"200",
     "data":{
         "user_id":"2000061",
         "card_id":"xxxxx",
         "card_status":"ACTIVE"
     }
   "message":"success"
}

Get Card Sensitive Info

get Card sensitive info

POST https://api.musepay.io/v1/card/card-sensitive-info

Generate a short-lived one-time URL for retrieving sensitive information for a card. The returned URL must be consumed directly by the client facing application, through the client's IP address provided in the retrieval request.

The API Response of the callback URL will contain the following payload:

{

"card_id": "akflf51b3",

"card_number": "4242424212341234",

"expiry_month": "11",

"expiry_year": "2028",

"security_code": "001"

}

Request Body

NameTypeDescription

card_id*

String

The card ID of the card issued

ip_address*

String

Client IP address

user_id*

String

The unique id in musewallet

{    
     "code":"200",
     "data":{
         "expiry":"2022-09-30", //YYYY-MM-DD
         "url":"https://abc.com/afd" //URL to retrieve card sensitive information
     }
   "message":"success"
}

Activate Physical Card

activate physical card

POST https://api.musepay.io/v1/card/activate-physical

Request Body

NameTypeDescription

card_id*

String

The card ID of the card issued

user_id*

String

The unique id in musewallet

{    
     "code":"200",
     "data":{
         "user_id":"2000061",
         "card_id":"xxxxx",
         "card_status":"PENDING_ACTIVE"
     }
   "message":"success"
}

Change Card PIN

change Card PIN

POST https://api.musepay.io/v1/card/change-pin

Request Body

NameTypeDescription

card_id*

String

The card ID of the card issued

card_pin*

String

New PIN, numeric pin, 4-6 digits, must encrypted by platform public key

user_id*

String

The unique id in musewallet

{    
     "code":"200",
     "message":"success"
}

Code Example for Pin Encryption
// JAVA
// encrypt(pin, platformPublicKey)
    public static String encrypt(String text, String publicStr) throws Exception {
        PublicKey publicKey = getRSAPublicKey(publicStr);
        Cipher cipher = Cipher.getInstance("RSA");
        cipher.init(Cipher.ENCRYPT_MODE, publicKey);
        byte[] bytes = cipher.doFinal(text.getBytes());
        return Base64Utils.encodeToString(bytes);
    }
    
    @SneakyThrows
    private static RSAPublicKey getRSAPublicKey(String publicKey) {
        publicKey = trim(publicKey);

        KeyFactory kFactory = KeyFactory.getInstance("RSA");
        // decode base64 of your key
        byte[] yourKey =  Base64Utils.decodeFromString(publicKey);
        // generate the public key
        X509EncodedKeySpec spec =  new X509EncodedKeySpec(yourKey);
        return (RSAPublicKey) kFactory.generatePublic(spec);
    }

    private static String trim(String key) {
        return Arrays.stream(key.split("\n"))
                .filter(StringUtils::isNotBlank)
                .map(s -> s.replaceAll("\\s+", ""))
                .filter(i -> !i.startsWith("-----"))
                .collect(Collectors.joining());
    }

Last updated