Skip to main content

Payment through taximeter

The customer orders a taxi in the taxi company's app. After the journey, the taximeter automatically initiates a payment request to Vipps or MobilePay with the customer's phone number, which is already known. The customer's Vipps or MobilePay app opens, and the customer pays the amount due.

Details

Step 1. Get the customer's phone number

Get the customer's phone number through the taxi app or ask them for it and enter it manually.

Step 2. Initiate a payment request

Use the customer's phone number to send them a request for the taxi fare.

Detailed example

To create this payment, you first send a create payment request, where customer.phoneNumber is set.

Use userFlow:PUSH_MESSAGE and "customerInteraction": "CUSTOMER_PRESENT" while initiating the payment. You need the customer's phone number to send them a request from the taximeter.

You may also attach the receipt at this time.

Here is an example HTTP POST:

POST:/epayment/v1/payments

{
"amount": {
"value": 100000,
"currency": "NOK"
},
"paymentMethod": {
"type": "WALLET"
},
"customer": {
"phoneNumber": 4712345678
},
"customerInteraction": "CUSTOMER_PRESENT",
"receipt":{
"orderLines": [
{
"name": "trip",
"id": "line_item_1",
"totalAmount": 100000,
"totalAmountExcludingTax": 80000,
"totalTaxAmount": 20000,
"taxPercentage": 25,
},
],
"bottomLine": {
"currency": "NOK",
"posId": "taxi_122",
"tipAmount": 10000,
"receiptNumber": "0527013501"
},
},
"reference": 2486791679658155992,
"userFlow": "PUSH_MESSAGE",
"returnUrl": "http://example.com/redirect?reference=2486791679658155992",
"paymentDescription": "Travel from Oslo central station to Oslo airport"
}

Step 3. The customer approves the payment

The payment request will appear in the customer's Vipps or MobilePay app, where they can select to pay or cancel.

To get confirmation that payment was approved, monitor your webhooks.

What are webhooks?

When changes happen to your payment request, events are triggered (for example: Authorized, Terminated, Aborted, Cancelled, Expired, and many more).

You can register to receive these events, which is useful for programming an appropriate and quick response.

The webhook will send a message to your web server at the URL you specify.

See the Webhooks API guide for more details.

Once the payment is approved, update the status in your system.

Step 4. Capture the amount due

Capture the payment and confirm that it was successful.

Detailed example

POST:/epayment/v1/payments/{reference}/capture

With body:

{
"modificationAmount": {
"value": 100000,
"currency": "NOK"
}
}

Sequence diagram

Next steps

Now, you can go to the API guide and start experimenting.

👉 Go to the ePayment API guide

Help us improve our documentation

Did you find what you were looking for?