# Create a Single Immediate Payment
source: https://developer.mastercard.com/ob-accept-payments/documentation/tutorials-and-guides/create-sip-tutorial/index.md

This guide walks you through creating a Single Immediate Payment request, authorizing the payment and getting the payment status.

Refer to [Single Immediate Payments](https://developer.mastercard.com/ob-accept-payments/documentation/payments/single-immediate-payments/single-immediate-payments/index.md) for the detailed specification for this scenario.

## Prerequisites {#prerequisites}

* You have been onboarded to Mastercard Open Finance Pay and obtained a `destinationId` to receive payments (refer to the [Quick Start](https://developer.mastercard.com/ob-accept-payments/documentation/quickstart/index.md) guide).
* Your `redirectURL`, where the PSU is redirected after the authorization, have been allowlisted as part of onboarding.
* You have successfully authenticated with the API (refer to the [Authentication](https://developer.mastercard.com/ob-accept-payments/documentation/api-basics/index.md) guide).

## Step 1 - Specify the Scheme / Payment Rail {#step-1---specify-the-scheme--payment-rail}

To create a payment through Mastercard Open Finance Pay, you need to specify which scheme / payment rail will be used by the ASPSP / Provider for processing the payment.

Refer to [Supported Payment Rails](https://developer.mastercard.com/ob-accept-payments/documentation/production/supported-payments-rails/index.md) to learn more about the payment rails in different regions.

Identify the payment rail that you will use and record the `paymentRail` and `currency` associated with it for next step.

## Step 2 - Identify Additional Values {#step-2---identify-additional-values}

Assign a unique identifier for each consumer (Payment Services User), `endUser.id`.

For UKFasterPayments payment rail you are strongly encouraged to prepare the following context values:

* `contextCode`
* `purposeCode`
* `deliveryAddress`

These are used by UK banks for risk scoring. For more details about each field and accepted values, refer to [Supported Payment Rails](https://developer.mastercard.com/ob-accept-payments/documentation/production/supported-payments-rails/index.md).

## Step 3 - Create a Payment Request {#step-3---create-a-payment-request}

Once you have identified the scheme / payment rail from the previous step and collected the parameters needed for it, you can create a payment and retrieve a flowUrl for users to authorize the payment.

API Reference: `POST /payments`

### Request {#request}

* Use the `paymentRail` and `currency` identified during previous step. Note that scheme rules will be applied automatically to the fields in the message
* Use the `destinationId` that you obtained from onboarding.
* Specify a `redirectURL` where the user will be redirected after finishing the Payment flow.
* Specify a `reference` for your Payment. This may be useful for reconciliation.
* Depending on your payment rails, populate the fields in the `context` section with values identified at the previous step.
* Please only specify pre-selected `providerId` if you have an outsourcing agreement with Mastercard Open Finance Pay.

### Response {#response}

If the request is successful, the response will look like:

```json
{
  "flowUrl": "https://mtf.connect.openbanking.mastercard.eu/start/storage-payments/472e651e-5a1e-424d-8098-23858bf03ad7",
  "paymentId": "81506a92-d746-43d2-9a8b-03ef4383f8fd"
}
```

* Record the `paymentId` for the next steps.
* Redirect the user to the `flowUrl` to start the mandate authorization flow.

## Step 4 - User Payment Authorization Flow {#step-4---user-payment-authorization-flow}

Redirect the user to the `flowUrl` received in the previous step to authorize the payment.
Note: The flowUrl must not be presented in an iframe, and it cannot be reused.

A flow will be displayed to the user where they will be able to:

* Select their provider / bank
* Go through an SCA with the provider
* Select the account to pay from and complete the payment.

An example flow is displayed here:

#### Mastercard Open Finance Pay Screens {#mastercard-open-finance-pay-screens}

![Mastercard-Open-Banking-Screen 1](https://static.developer.mastercard.com/content/ob-accept-payments/uploads/sip_flow_1a.png)
![Mastercard-Open-Banking-Screen 2](https://static.developer.mastercard.com/content/ob-accept-payments/uploads/sip_flow_2a.png)

#### Example of Provider Screens {#example-of-provider-screens}

![Mastercard-Open-Banking-Screen 3](https://static.developer.mastercard.com/content/ob-accept-payments/uploads/sip_flow_3a.png)
![Mastercard-Open-Banking-Screen 4](https://static.developer.mastercard.com/content/ob-accept-payments/uploads/sip_flow_4a.png)
![Mastercard-Open-Banking-Screen 5](https://static.developer.mastercard.com/content/ob-accept-payments/uploads/sip_flow_5a.png)

#### Mastercard Open Finance Pay Screens {#mastercard-open-finance-pay-screens-1}

![Mastercard-Open-Banking-Screen 6](https://static.developer.mastercard.com/content/ob-accept-payments/uploads/sip_flow_6a.png)

## Step 5 - Payment Status Webhook Notification {#step-5---payment-status-webhook-notification}

When the Payment status changes you will receive webhook notifications from the Mastercard Open Finance Pay API of `type="AcceptPaymentStatusUpdated"`.

An example of how the webhooks content should appear:

```json
{
  "type": "AcceptPaymentStatusUpdated",
  "data": {
    "paymentId": "acb29db6-70df-4c99-888c-d8485cd40c3d",
    "executionTime": "2024-01-01T12:34:56.123456+00:00",
    "status": {
      "code": "AUTHORIZATION_FLOW_INCOMPLETE",
      "lastUpdated": "2025-05-12T15:23:39.969894+00:00"
    }
  },
  "retryCount": 0
}
```

Record the `paymentId` for the next step.

## Step 6 - Payment Initiation Result {#step-6---payment-initiation-result}

After the payment authorization flow is completed, the user is redirected back to your application using the `redirectUrl`. Retrieve the latest state of the payment using the Get Payment endpoint.

API Reference: `GET /payments/{payment_id}`

### Request {#request-1}

Use the `paymentId` retrieved from the second step as the `payment_id` path parameter to get the payment status.

### Response {#response-1}

If the request is successful, the response will look like:

```json
{
  "paymentId": "472e651e-5a1e-424d-8098-23858bf03ad7",
  "mandateId": "c61f1e0e-3f3e-459d-a4f1-5fa6c52b1921",
  "destinationId": "472e651e-5a1e-424d-8098-23858bf03ad7",
  "paymentRail": "UkFasterPayments",
  "amount": 123.5,
  "currency": "GBP",
  "status": {
    "code": "string",
    "lastUpdated": "2023-10-30T10:10:00.7539418+00:00",
    "events": [],
    "details": {}
  },
  "reference": "Example Reference",
  "identifier": "Example ID",
  "endToEndId": "Example ID",
  "providerId": "GB_TestBank",
  "date": {
    "requestedDate": "2024-02-21",
    "actualDate": "2024-02-22"
  },
  "context": {
    "contextCode": "BillingGoodsAndServicesInAdvance",
    "purposeCode": "GDSV",
    "deliveryAddress": {}
  },
  "providerPaymentId": "472e651e-5a1e-424d-8098-23858bf03ad7",
  "endUser": {
    "id": "0001789937234"
  },
  "clientAssignedReference": "Example client assigned reference"
}
```

Handle different payment outcomes based on the returned payment status code and reason code.

You can also receive payment status updates through [Webhooks](https://developer.mastercard.com/ob-accept-payments/documentation/event-notifications/index.md).
