# How to process Micro and Roundup donations with non-Mastercard branded cards source: https://developer.mastercard.com/donations/tutorial/donation-api-details/nonmacardbrandapi/index.md ## Using non-Mastercard branded cards {#using-non-mastercard-branded-cards} * The `/donations/external-cards` endpoint retrieves a list of non-Mastercard branded cards for the Client ID and Program ID. * The `/donations/external-transactions` endpoint uploads non-Mastercard branded cards transactions details to Donate application. ## GET /external-cards {#get-external-cards} ## Prerequisites {#prerequisites} Before executing the test cases, acquaint yourself with the endpoint use case and parameters: * [Retrieve all Non-Mastercard Brand Cards](https://developer.mastercard.com/donations/documentation/use-cases/manage-nonma-micro-rndup-dntns/add-non-mcbrand-cards/index.md) * [Parameters to Retrieve All non-Mastercard Brand Cards](https://developer.mastercard.com/donations/documentation/parameters/manage-non-ma-trns-param/non_ma_card/index.md#retrieve-non-mastercard-brand-cards) ## Test Case {#test-case} 1. To retrieve all the non-Mastercard cards registered by donors, send a GET request. 2. The GET request must have the mandatory `clientId` parameter. 3. If a client is associated with more than one program, it is mandatory to pass a `programID` in the header of the request. ```py GET https://sandbox.api.mastercard.com/donations/external-cards ``` 4. A successful request returns the `HTTP 200 Success` status code and a JSON response body with the card IDs and PANs of the non-Mastercard registered cards. ```JSON { "totalItems": 2, "items": [ { "cardId": "85f33e27-4803-4f56-997d-11d32702028c", "pan": "424242******4242" } { "card_id": "85f33e27-4803-4f56-997d-11d32702028d", "pan": "424242******4243" } ] } ``` ## POST /external-transactions {#post-external-transactions} ## Prerequisites {#prerequisites} Before executing the test cases, acquaint yourself with the endpoint use case and parameters: * [Upload Non-Mastercard Card Transactions](https://developer.mastercard.com/donations/documentation/use-cases/manage-nonma-micro-rndup-dntns/add-non-mcbrand-cards/index.md) * [Parameters to Upload Non-Mastercard Card Transactions](https://developer.mastercard.com/donations/documentation/parameters/manage-non-ma-trns-param/non_ma_card/index.md#retrieve-non-mastercard-brand-cards.md) ## Test Case {#test-case} 1. To upload all non-Mastercard branded cards transactions, send a POST request. 2. To create a POST request, fill out the details as shown in the request. ```py POST https://sandbox.api.mastercard.com/donations/external-transactions ``` ```JSON { "currencyCode": "USD", "transactionsSummary": [ { "cardBrand": "VISA", "cardId": "79bfa3d3-235a-4985-8137-447849fe797d", "transactions": [ { "transactionId": "c599bd70-ecc6-4f30-9161-3cb790d89735", "transactionDate": "2023-04-11", "amount": "100" } ] }, { "cardBrand": "AMEX", "cardId": "99bfa3d3-235a-4985-8137-447849fe797d", "transactions": [ { "transactionId": "d599bd70-ecc6-4f30-9161-3cb790d89735", "transactionDate": "2023-04-13", "amount": "10" } ] } ] } ``` 3. A successful request returns the `HTTP 200 Created` status code and a JSON response body confirming the data load. ```JSON { "Data load for Non MA Card Transactions is success." } ``` This section discusses some of the failed scenarios and the error messages expected. If any of the transaction details in the request is incomplete or erroneous, the request fails with `400 Bad Request` error. ```JSON { "Errors": { "Error": [ { "Source": "DONATE_SERVICE", "ReasonCode": "INVALID_REQUEST_PARAMETER", "Description": "One of the request parameters is invalid, try again with the correct request.", "Recoverable": false, "Details": [ "transactionsSummary, Transactions Summary cannot be null" ] } ] } } ``` If the request does not have a currency code for a transaction, the request fails with `400 Bad Request` error. ```json { "Errors": { "Error": [ { "Source": "DONATE_SERVICE", "ReasonCode": "INVALID_REQUEST_PARAMETER", "Description": "One of the request parameters is invalid, try again with the correct request.", "Recoverable": false, "Details": [ "currencyCode, Currency code cannot be empty" ] } ] } } ```