# REST API Configuration
source: https://developer.mastercard.com/mastercard-merchant-presented-qr/documentation/server-apis/reference-app/rest-api-configuration/index.md

**API Reference integration**

Now that your project is running locally, let us dive into how the server interacts with each MPQR API endpoint.

**MPQR APIs facilitate two core functions:**

1. Creating a push payment transaction between a consumer and merchant. This payment can be created with or without funding, which will be described shortly.
2. Performing a detailed lookup of transaction information. We can lookup a transaction by either its Transaction Reference or Transaction ID. Examples of both are provided below.

In most cases, push payments are created with funding. This means that we must first secure funds from the consumer's bank, prior to sending it to the merchant. The only case in which we'd use a push payment transaction without funding is if the application is owned by a bank and can directly fund the transaction.

Let's start by initiating a new push payment transaction:

**Exposing MPQR API services as a REST API**

We will now abstract our newly created service into a separate controller. This way, a mobile device can communicate with the service and any private information (private key, alias, etc., as defined in our YML file) hidden from the device.

First, create a new Spring REST controller and inject our service into it. Sample code is located in the "src/main/java/com/mastercard/mpqr/web/MasterCardController.java" class.
* Java

```java
    @Controller
    public class MasterCardController {
        @Autowired
        MPQRAPIService service;
    }     
```

**Merchant Transfer - Payment**

Now we can create REST endpoints that will then call the service that communicates with the MPQR client.

Below are some code samples located in the "src/main/java/com/mastercard/mpqr/web/MasterCardController.java" class. The samples show how to create the REST endpoints that our mobile application will communicate with.
* Java

```java
    @PostMapping(value = "/merchantPaymentTransfer", produces = MediaType.APPLICATION_JSON_VALUE)
    public ResponseEntity<> merchantPaymentTransfer(@RequestBody MerchantTransferPaymentRequest request) {
        return ResponseEntity.ok(service.makePaymentTransferApiCall(request));
    } 
```

