# Quick Start Guide
source: https://developer.mastercard.com/ob-accept-payments/documentation/quickstart/index.md

Note: While in Pilot Mode, all our onboarding is manual. Please [contact us](https://www.mastercard.com/europe/en/business/open-finance/demo-request.html) to obtain the onboarding form and instructions on the next steps to get you started.

###### Time to Complete: **20 minutes** {#time-to-complete-20-minutes}

This guide walks you through accepting a Single Immediate Payment in the Sandbox
environment, using the UK Simulator Bank. By the end you will have:

* Exchanged a signed JSON Web Token (JWT) for an access token
* Created a payment on the UK Faster Payments rail
* Authorized the payment as a consumer in the Simulator Bank
* Retrieved the final payment status

### Prerequisites {#prerequisites}

You need to be onboarded to the Sandbox environment before you start. Onboarding
is a manual process during Pilot Mode. See [Onboarding](https://developer.mastercard.com/ob-accept-payments/documentation/api-basics/index.md#onboarding) for details.

You will need:

* Your **Client ID**
* A **destination ID** for a receiving account on the UK Faster Payments rail
* An allowlisted **redirect URL**
* **Simulator Bank credentials** for a consumer (payment service user) to use during authorization

<br />

This guide assumes you have already created and signed a JWT with your private
key. To learn how to generate and sign the JWT, refer to
[Authentication](https://developer.mastercard.com/ob-accept-payments/documentation/api-basics/index.md#authentication).

### Step 1 - Get an Access Token {#step-1---get-an-access-token}

Exchange your signed JWT for an access token. Call the token endpoint with the
`ob_accept_payments` scope.
Note: Note that the base Sandbox URL for Pay endpoints is `https://mtf.auth.openbanking.mastercard.eu/`
API Reference: `POST /oauth2/token`

Send the signed JWT as the `client_assertion`:
* Sh

```sh
curl --location --request POST 'https://mtf.auth.openbanking.mastercard.eu/oauth2/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer' \
--data-urlencode 'client_assertion=<your-signed-JWT>' \
--data-urlencode 'scope=ob_accept_payments'
```

The response contains the access token:
* JSON

```JSON
{
  "access_token": "<access-token>",
  "token_type": "bearer",
  "expires_in": 3600
}
```

Use this value as a bearer token in the `Authorization` header of every API
request that follows. The token is valid for one hour.
Note: You cannot reuse a JWT after you use it to obtain an access token. Sign a new JWT each time you request a new token.

### Step 2 - Identify Your Payment Destination {#step-2---identify-your-payment-destination}

A payment is paid into a destination account that you set up during onboarding.
You received a `destinationId` for your UK Faster Payments destination as part
of your onboarding data.

Take a note of this `destinationId`. You provide it in the next step to select
the account that receives the funds.

### Step 3 - Create a Single Immediate Payment {#step-3---create-a-single-immediate-payment}

Call the Create Payment endpoint with your access token. The request models are
polymorphic, so each payment rail has its own model. This guide uses the UK
Faster Payments rail.

API Reference: `POST /payments`

The UK Faster Payments rail requires `amount`, `currency` set to GBP, and
`endToEndId`. For payments in the UK, populate `endUser.id` so the bank can
perform its risk assessment.
* Sh

```sh
curl --location --request POST 'https://mtf.api.openbanking.mastercard.eu/accept-payments/payments' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <access-token>' \
--data-raw '{
  "paymentRail": "UkFasterPayments",
  "destinationId": "<your-destination-id>",
  "redirectUrl": "https://your-site.example.com/return",
  "amount": 10.00,
  "currency": "GBP",
  "endToEndId": "QSG-01062026-0001",
  "reference": "Quick Start payment",
  "endUser": {
    "id": "0001789937234"
  }
}'
```

The response returns a `flowUrl` and a `paymentId`:
* JSON

```JSON
{
  "paymentId": "18a403f3-28bb-4240-b62f-b49e134fcdef",
  "flowUrl": "https://mtf.connect.openbanking.mastercard.eu/start/storage-payments/18a403f3-28bb-4240-b62f-b49e134fcdef"
}
```

Take a note of the `paymentId`. You use it to track the payment in Step 5.

### Step 4 - Authorize the Payment in the Simulator Bank {#step-4---authorize-the-payment-in-the-simulator-bank}

In a live integration, you redirect the consumer to the `flowUrl` to authorize
the payment with their bank. In the Sandbox environment, you complete this step
manually to simulate the consumer's Strong Customer Authentication (SCA) with
the UK Simulator Bank.

1. Open the `flowUrl` from Step 3 in a desktop browser.
2. The flow may open on a device-choice screen that shows a QR code. Choose **Want to continue on desktop instead?** to continue in the same browser.
3. When prompted to choose a bank, select the **Simulator Bank**.
4. Log in with the Simulator Bank consumer credentials you received during onboarding.
5. Review the payment details and select the source account to pay from.
6. Confirm the payment to complete the simulated SCA.

After you authorize, the Simulator Bank returns you to the `redirectUrl` you
provided in Step 3. Mastercard Open Finance Pay appends the payment ID as a
query parameter, for example `?paymentId=18a403f3-28bb-4240-b62f-b49e134fcdef`.
Note: The exact screens depend on the consumer role and scenario you select. For the available accounts, credentials and advanced scenarios, refer to [Test Banks](https://developer.mastercard.com/ob-accept-payments/documentation/testing-and-integration/test-banks/index.md).

### Step 5 - Get the Payment Status {#step-5---get-the-payment-status}

Query the Get Payment endpoint with the `paymentId` from Step 3 to retrieve the
latest status.

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

* Sh

```sh
curl --location --request GET 'https://mtf.api.openbanking.mastercard.eu/accept-payments/payments/<payment-id>' \
--header 'Authorization: Bearer <access-token>'
```

After the consumer authorizes a payment in the Simulator Bank, its status
progresses through `PREPARING`, `AUTHORIZING` and `PROVIDER_PROCESSING` to a
final status of `PAYMENT_EXECUTED_CREDITED`. For a description of each status,
refer to the [Payment Status Model](https://developer.mastercard.com/ob-accept-payments/documentation/payments/single-immediate-payments/payment-status-model/index.md).
Note: In a live integration, we recommend you use webhooks to receive status changes instead of polling the Get Payment endpoint. Refer to [Webhooks](https://developer.mastercard.com/ob-accept-payments/documentation/event-notifications/index.md) for details.

### Next Steps {#next-steps}

You have completed a Single Immediate Payment in the Sandbox environment. To
continue your integration:

* Read the full [Single Immediate Payments](https://developer.mastercard.com/ob-accept-payments/documentation/payments/single-immediate-payments/single-immediate-payments/index.md) guide for the complete flow, including webhooks and error handling.
* Accept recurring payments with [Variable Recurring Payments](https://developer.mastercard.com/ob-accept-payments/documentation/payments/vrp/vrp/index.md).
* Explore every endpoint in the [API Reference](https://developer.mastercard.com/ob-accept-payments/documentation/api-reference/index.md).
* Try more scenarios with the [Test Banks](https://developer.mastercard.com/ob-accept-payments/documentation/testing-and-integration/test-banks/index.md).
