Add Card API
POST {{baseUrl}}/donors/:donor_id/cards
Donor can add his/her card onto platform by calling this API, so that next time he/she wants to donate, he/she don't have to provide card details.A card will be added once. Second time, the initial card Id will be returned.Entire request body should be encrypted.
Request Body
{"cardholderName"=>"John Doe", "primaryAccountNumber"=>"5450985888403538", "primaryAccountNumberSource"=>"CARD_ON_FILE", "billingAddress"=>{"city"=>"Brooklyn", "countryCode"=>"USA", "line1"=>"83 Mayfair Street", "line2"=>"Main Road", "line3"=>"Snake Hill Ave", "postalCode"=>"dolor Exc", "state"=>"NY"}, "cardAlias"=>"CardA", "CardExpiryDetails"=>{"month"=>"si", "year"=>"mini"}}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
x-openapi-clientid | string | (Required) ClientId is a unique and a mandatory ID shared while creating a project on Mastercard Developers Portal. | |
x-correlation-id | string | CorrelationId is a unique donation request ID. It is recommended to pass the x-correlation-id by the customer and to use the format "bankname_UUID" (bank name can be indicated using the first 4 digits). Maximum length of this field should be 100 alphanumeric characters. If not passed, Mastercard will generate it. | |
x-program-id | string | ProgramId is an optional field, but if a client has more than one program associated to it, then this field becomes mandatory. | |
Content-Type | string | ||
Accept | string |
RESPONSES
status: OK
{"cardId":"ebee3d81-18d4-409a-8330-73db083f2cfc","primaryAccountNumberSuffix":"3538"}