# Parameters to Add a Card source: https://developer.mastercard.com/donations/documentation/parameters/manage-cards-param/add-card-param/index.md ## Method to Add a Card-on-file {#method-to-add-a-card-on-file} | Method | Endpoint | |--------|------------------------------------| | POST | /donations/donors/{donor_id}/cards | ## Path parameters {#path-parameters} | Name | Type | Description | |-------------|--------|-----------------------------------------------------------------| | **donorId** | string | Unique ID generated by Mastercard when a new donor is enrolled. | ## Request parameters {#request-parameters} Note: The Entire Request Body has to be encrypted! For more details, refer to the [How to Encrypt](https://developer.mastercard.com/donations/tutorial/how-to-access-sandbox-environment/mastercard-encryption-decryption-mechanism/index.md) section. | Name | Type | Description | Notes | |--------------------------------|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------| | **cardholderName** | string | The card holder's name as it appears on the card. | Optional | | **primaryAccountNumber** | string | The primary account number (PAN) for the payment card. Maximum length: 19. | **Required** | | **primaryAccountNumberSource** | string | The source of the primary account number (PAN). | **Required** | | **expiryInfo** | object | The expiry info. See [Expiry Info](https://developer.mastercard.com/donations/documentation/parameters/manage-cards-param/add-card-param/index.md#expiryInfo) attributes. | **Required** | | **billingAddress** | object | An object representing the cardholder's billing address. See [Billing Address](https://developer.mastercard.com/donations/documentation/parameters/manage-cards-param/add-card-param/index.md#billingAddress) attributes. | Conditional If we provide the address object it is Mandatory, else it is Optional. | | **cardAlias** | string | The alias provided by the cardholder to identify the card. Maximum 40 characters. | Optional | ### Child Attributes {#child-attributes} #### expiryInfo {#expiryinfo} | Name | Type | Description | Notes | |-----------|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------| | **month** | string | The expiration month of the associated card as an integer between 1 and 12. in [Internet date format](https://tools.ietf.org/html/rfc3339#section-5.6). Minimum value: 01. Maximum value: 12. | **Required** | | **year** | string | The four-digit year of the card's expiration date in [Internet date format](https://tools.ietf.org/html/rfc3339#section-5.6). | **Required** | #### billingAddress {#billingaddress} | Name | Type | Description | Notes | |-----------------|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------| | **line1** | string | The type of address. Allowed values are : *home* , *work* and *others* | Optional | | **line2** | string | The donor's street address. | Optional | | **line3** | string | The donor's land mark or other address. | Optional | | **city** | string | City, district, suburb, town or village | Optional | | **postalCode** | string | The postal code, which is the zip code or equivalent. Typically required for countries with a postal code or an equivalent. See [Postal Code](https://en.wikipedia.org/wiki/Postal_code) | Optional | | **countryCode** | string | Three-character [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) code that identifies the country or region. | Optional | ## Response Parameters {#response-parameters} A successful request returns the `HTTP 200 Created` status code and a JSON response body that includes a unique card identifier \& last 4 digits of card. | Name | Type | Description | |--------------------------------|--------|---------------------------------------------------------| | **cardId** | string | Unique ID for the card on file. Generated by Mastercard | | **primaryAccountNumberSuffix** | string | The last 4 digits of the card number. |