The Mobipaid API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.
You can use the Mobipaid API in test/development mode, which does not affect your live data or interact with the banking networks. The URL and API key you use to authenticate the request determines whether the request is live mode or test mode.
The Mobipaid API uses API keys to authenticate requests. You can view and manage your API keys in the Mobipaid Developer Dashboard.
Every application have two access keys in place, development mode and production mode
Development mode specifications:
- The URL is https://test.mobipaid.io/.
- Access key have the prefix mp_test_.
Production mode specifications:
- The URL is https://live.mobipaid.io/.
- Access key have the prefix mp_live_.
- Connect your application with a merchant.
- Change your status application to Published.
- Merchant have to enable your application on their dashboard.
Your Access keys carry many privileges, so be sure to keep them secure! Do not share your access API keys in publicly accessible areas such as GitHub, client-side code, and so forth.
Authentication to the API is performed via HTTP Bearer Auth. Provide your Access key as the bearer auth value.
This is the example with CURL.
curl -X GET https://test.mobipaid.io/v2/payments -H "Authorization: Bearer mp_test_w3Lwv3CZIZzye4cYxxr0"
All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.
Status code | Description |
---|---|
200 - OK | Everything worked as expected. |
400 - Bad Request | The request was unacceptable, often due to missing a required parameter. |
401 - Unauthorized | No valid API key provided. |
402 - Request Failed | The parameters were valid but the request failed. |
403 - Forbidden | The API key doesn't have permissions to perform the request. |
404 - Not Found | The requested resource doesn't exist. |
409 - Conflict | The request conflicts with another request (perhaps due to using the same idempotent key). |
429 - Too Many Requests | Too many requests hit the API too quickly. We recommend an exponential backoff of your requests. |
500, 502, 503, 504 - Server Errors | Something went wrong on Mobipaid's end. (These are rare.) |
Request a payment to your customer email or mobile number with this feature. We will send invoice to the customer automatically.
We support Credit Card, Direct Debit, Paypal, Apple Pay, Google Pay, Nedbank, American Express, etc. With mobipaid wallet in place, customer can pay quickly with payment options that has been saved.
This payment request is intended for one time payment.
Create a new single payment request.
Body Params
Field | Description |
---|---|
request_methods
required |
array
"EMAIL" if you want to send invoice through email. "SMS" if you want to send invoice through SMS. "WEB" if you don't want us to send invoice at all but you still need email or mobile_number. Example: ['EMAIL', 'SMS', 'WEB'] |
reference_number
|
string
This will help you indentify a request. Example: "OO-1234-2020" |
email
required with condition |
string
Customer email, required if request_methods is containing "EMAIL". Example: "john@doe.com" |
merchant_phone_number
|
string
Merchant mobile number that used to send SMS. You can buy the number in merchant dashboard. Example: "+1234567890" |
mobile_number
required with condition |
string
Customer mobile number, required if request_methods is containing "SMS". Example: "+1234567890" |
amount
required |
number
The amount of payment for this request Example: 3 |
currency
required |
string
The currency of this payment request in 3 digit ISO format Example: "USD" |
fixed_amount
required |
boolean
Boolean value between true and false. If set to false, customer can specify the amount they would like to pay. Commonly used for donation payments. |
tax_id
|
number
Tax profile ID to calculate the tax amount for this payment. If it does not exist, the amount value will be tax free. |
template_id
|
number
The Email or SMS template you would like to use with this payment. When empty, the payment request will be send using merchant's default template. If merchant does not set the default template, it will automatically send Mobipaid's default template. |
payment_type
|
string
Add optional payment_type by default it's filled with DB. Set it to "PA" to use Pre Authorization. You need to manually capture to accept the payment. |
payment_methods
|
array
Add optional payment methods that can be used to pay this request. You can add "APPLE_PAY", "GOOGLE_PAY", "NEDBANK_EFT" or "AMEX" in a single array |
moto_enabled
|
boolean
Enable MOTO card mode which have no additional authentication on payment widget |
shipping_enabled
|
boolean
Add optional shipping information that can be filled for this request. |
send_mms_invoice
|
boolean
Use "true" if you want Mobipaid to help you send an invoice through MMS. (Only available for USA and Canada mobile carriers.) Other non-supported countries will send an extended SMS with an URL to download the respective invoice. You will be charged based on your MMS and SMS fee where applicable. |
attach_invoice
|
boolean
Use "true" if you want Mobipaid to attach an invoice as a file and send it through email. |
invoice_url
|
string
The url of the invoice file. If it's not exist, the message template will be used as the invoice content. |
send_mms_receipt
|
boolean
Use "true" if you want Mobipaid to help you send a payment receipt through MMS or SMS. You will be charged on your MMS and SMS fee where applicable. |
attach_receipt
|
boolean
Use "true" if you want the payment receipt to be attached as a file and sent through email. |
receipt_file_type
|
string
File type for payment receipt. Available value: "pdf/jpeg/png", default value pdf. |
expiry_date
|
string
The expiry date for this payment request. Format = YYYY-MM-DD HH:MM |
customer_id
|
string
Customer ID used to update customer data if exist. Example: "h3xDi8" |
customer_salutation
|
string
Mr, Mrs, or Miss. Example: "Mr" |
customer_first_name
|
string
Customer first name. Example: "John" |
customer_last_name
|
string
Customer last name. Example: "Doe" |
send_confirmation
|
string
Use "true" if you want Mobipaid to help you send the confirmation sms/email after payment is succeed. Use "false" if you want to send the confirmation by yourself |
response_url
|
string
Response_url is the url where customer will get the payment result. After the transaction is paid, the payment response will be posted to the response_url. Example: "http://mymobipaidmerchant.com/response/" |
cancel_url
|
string
The url where customer will redirected when customer click cancel button on payment page. Example: "https://mywebsite.com" |
redirect_url
|
string
After payment we will redirect to this URL. If empty, we will show the receipt page instead. Example: "http://mymobipaidmerchant.com/receipt/" |
payment_frequency
|
string
The frequency for the payment request. Available frequency are "ONE-TIME", "WEEKLY", "MONTHLY", "QUARTERLY", "YEARLY". The default value is ONE-TIME. |
payment_start_date
required with condition |
string
Payment start date , requested if payment_frequency is not "ONE-TIME". The value must follow the ISO8601 standard (ex:"2023-08-09T16:59:59.000Z"). Default value is empty |
Required Header:
- Authorization
Request URL
https://test.mobipaid.io/v2/payment-requests/Request Body
{ "request_methods": [ "SMS"], "reference_number": "123", "email": "example@example.com", "merchant_phone_number": null, "mobile_number": "+12345678901", "customer_id": "", "customer_salutation": "Mr", "customer_first_name": "John", "customer_last_name" : "Preston", "redirect_url" : "https://mobipaid.com", "response_url" : "https://mobipaid.com", "cancel_url" : "https://mobipaid.com", "fixed_amount": true, "currency": "ZAR", "amount": 1500.12, "tax_id": "", "template_id": "", "moto_enabled": false, "shipping_enabled": false, "send_mms_invoice": true, "attach_invoice": true, "invoice_url": "https://mp-fixed-assets.s3.amazonaws.com/logo.png", "attach_receipt": true, "receipt_file_type": "pdf", "payment_type": "DB", "payment_methods": ["APPLE_PAY", "GOOGLE_PAY", "NEDBANK_EFT", "AMEX"], "expiry_date": "", "payment_frequency": "ONE-TIME", "payment_start_date": "" }
Examples
curl -X POST https://test.mobipaid.io/v2/payment-requests \ -H "Content-Type: application/json" \ -H "Authorization: Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" \ --data '{ "request_methods": [ "SMS"], "reference_number": "123", "email": "example@example.com", "merchant_phone_number": null, "mobile_number": "+12345678901", "customer_id": "", "customer_salutation": "Mr", "customer_first_name": "John", "customer_last_name" : "Preston", "redirect_url" : "https://mobipaid.com", "response_url" : "https://mobipaid.com", "cancel_url" : "https://mobipaid.com", "fixed_amount": true, "currency": "ZAR", "amount": 1500.12, "tax_id": "", "template_id": "", "moto_enabled": false, "shipping_enabled": false, "send_mms_invoice": true, "attach_invoice": true, "invoice_url": "https://mp-fixed-assets.s3.amazonaws.com/logo.png", "attach_receipt": true, "receipt_file_type": "pdf", "payment_type": "DB", "payment_methods": [ "APPLE_PAY", "GOOGLE_PAY", "NEDBANK_EFT", "AMEX" ], "expiry_date": "" }'
import requests import json url = "https://test.mobipaid.io/v2/payment-requests" payload = json.dumps( { "request_methods": [ "SMS"], "reference_number": "123", "email": "example@example.com", "merchant_phone_number": None, "mobile_number": "+12345678901", "customer_id": "", "customer_salutation": "Mr", "customer_first_name": "John", "customer_last_name" : "Preston", "redirect_url" : "https://mobipaid.com", "response_url" : "https://mobipaid.com", "cancel_url" : "https://mobipaid.com", "fixed_amount": True, "currency": "ZAR", "amount": 1500.12, "tax_id": "", "template_id": "", "moto_enabled": false, "shipping_enabled": false, "send_mms_invoice": true, "attach_invoice": true, "invoice_url": "https://mp-fixed-assets.s3.amazonaws.com/logo.png", "attach_receipt": True, "receipt_file_type": "pdf", "payment_type": "DB", "payment_methods": [ "APPLE_PAY", "GOOGLE_PAY", "NEDBANK_EFT", "AMEX" ], "expiry_date": "" } ) headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer mp_test_w3Lwv3CZIZzye4cYxxr0' } response = requests.request("POST", url, headers=headers, data = payload) print(response.text.encode('utf8'))
var request = require('request'); var options = { 'method': 'POST', 'url': 'https://test.mobipaid.io/v2/payment-requests', 'headers': { 'Content-Type': 'application/json', 'Authorization': 'Bearer mp_test_w3Lwv3CZIZzye4cYxxr0' }, body: JSON.stringify({ "request_methods": [ "SMS"], "reference_number": "123", "email": "example@example.com", "merchant_phone_number": null, "mobile_number": "+12345678901", "customer_id": "", "customer_salutation": "Mr", "customer_first_name": "John", "customer_last_name" : "Preston", "redirect_url" : "https://mobipaid.com", "response_url" : "https://mobipaid.com", "cancel_url" : "https://mobipaid.com", "fixed_amount": true, "currency": "ZAR", "amount": 1500.12, "tax_id": "", "template_id": "", "moto_enabled": false, "shipping_enabled": false, "send_mms_invoice": true, "attach_invoice": true, "invoice_url": "https://mp-fixed-assets.s3.amazonaws.com/logo.png", "attach_receipt": true, "receipt_file_type": "pdf", "payment_type": "DB", "payment_methods": [ "APPLE_PAY", "GOOGLE_PAY", "NEDBANK_EFT", "AMEX" ], "expiry_date": "" }) }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); });
$curl = curl_init(); $data = array( "request_methods" => [ "SMS"], "reference_number" => "123", "email" => "example@example.com", "merchant_phone_number" => null, "mobile_number" => "+12345678901", "customer_id" => "", "customer_salutation" => "Mr", "customer_first_name" => "John", "customer_last_name" => "Preston", "redirect_url" => "https://mobipaid.com", "response_url" => "https://mobipaid.com", "cancel_url" => "https://mobipaid.com", "fixed_amount" => true, "currency" => "ZAR", "amount" => 1500.12, "tax_id" => "", "template_id" => "", "moto_enabled" => false, "shipping_enabled" => false, "send_mms_invoice" => true, "attach_invoice" => true, "invoice_url" => "https://mp-fixed-assets.s3.amazonaws.com/logo.png", "attach_receipt" => true, "receipt_file_type" => "pdf", "payment_type": "DB", "payment_methods" => [ "APPLE_PAY", "GOOGLE_PAY", "NEDBANK_EFT", "AMEX" ], "expiry_date" => "" ); $data = json_encode($data); curl_setopt_array($curl, array( CURLOPT_URL => "https://test.mobipaid.io/v2/payment-requests", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => $data, CURLOPT_HTTPHEADER => array( "Content-Type: application/json", "Authorization: Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
require "uri" require "net/http" require 'json' url = URI("https://test.mobipaid.io/v2/payment-requests") https = Net::HTTP.new(url.host, url.port); https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request["Authorization"] = "Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" request.body = { request_methods: [ "SMS"], reference_number: "123", email: "example@example.com", merchant_phone_number: nil, mobile_number: "+12345678901", customer_id: "", customer_salutation: "Mr", customer_first_name: "John", customer_last_name: "Preston", redirect_url: "https://mobipaid.com", response_url: "https://mobipaid.com", cancel_url: "https://mobipaid.com", fixed_amount: true, currency: "ZAR", amount: 1500.12, tax_id: "", template_id: "", moto_enabled: false, shipping_enabled: false, send_mms_invoice: true, attach_invoice: true, invoice_url: "https://mp-fixed-assets.s3.amazonaws.com/logo.png", attach_receipt: true, receipt_file_type: "pdf", payment_type: "DB", payment_methods: [ "APPLE_PAY", "GOOGLE_PAY", "NEDBANK_EFT", "AMEX" ], expiry_date: "" }.to_json response = https.request(request) puts response.read_body
Result Format
{ "amount": "1500.12", "attach_invoice": true, "attach_receipt": true, "cancel_url": "https://google.com", "created_at": "2020-02-19T06:43:50.000Z", "currency": "ZAR", "customer_first_name": "John", "customer_id": "", "customer_last_name": "Preston", "customer_salutation": "Mr", "email": "example@example.com", "expiry_date": "", "fixed_amount": true, "invoice_url": "https://upload.wikimedia.org/wikipedia/commons/a/a8/CCU_Logo.jpeg", "long_url": "https://long-url", "merchant_phone_number": null, "mobile_number": "+12345678901", "modified_at": "", "payment_methods": [ "GOOGLE_PAY", "AMEX" ], "payment_type": "DB", "qrcode_link": "https://qrcodelink", "receipt_file_type": "pdf", "redirect_url": "https://google.com", "reference_number": "123", "request_methods": [ "SMS" ], "response_url": "https://google.com", "result": "success", "send_mms_invoice": true, "send_mms_receipt": false, "shipping_enabled": false, "short_url": "https://short-url", "tax_id": "", "template_id": "", "transaction_id": "145510OO", "payment_frequency": "ONE-TIME" }
{ "message": "Forbidden" }
{ "is_valid": false, "error_field": "", "error_message": "Apple Pay is not enabled. Please check your cofiguration and/or contact your administrator.", "result": "failed" }
Request Samples
You can update the payment request by using the same parameters from create a payment request, but you have to add transaction_id to the body.
Required Header:
- Authorization
Request URL
https://test.mobipaid.io/v2/payment-requests/Request Body
{ "transaction_id": "2116376OO", "request_methods": [ "WEB"], "reference_number": "123", "email": "example@example.com", "merchant_phone_number": null, "mobile_number": "+12345678901", "customer_id": "", "customer_salutation": "Mr", "customer_first_name": "John", "customer_last_name" : "Preston", "redirect_url" : "https://mobipaid.com", "response_url" : "https://mobipaid.com", "cancel_url" : "https://mobipaid.com", "fixed_amount": true, "currency": "ZAR", "amount": 1500.12, "tax_id": "", "template_id": "", "moto_enabled": false, "shipping_enabled": false, "send_mms_invoice": true, "attach_invoice": true, "invoice_url": "https://mp-fixed-assets.s3.amazonaws.com/logo.png", "attach_receipt": true, "receipt_file_type": "pdf", "payment_type": "DB", "payment_methods": ["APPLE_PAY", "GOOGLE_PAY", "NEDBANK_EFT", "AMEX"], "expiry_date": "" }
Examples
curl -X PUT https://test.mobipaid.io/v2/payment-requests \ -H "Content-Type: application/json" \ -H "Authorization: Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" \ --data '{ "transaction_id": "2116376OO", "request_methods": [ "WEB"], "reference_number": "123", "email": "example@example.com", "merchant_phone_number": null, "mobile_number": "+12345678901", "customer_id": "", "customer_salutation": "Mr", "customer_first_name": "John", "customer_last_name" : "Preston", "redirect_url" : "https://mobipaid.com", "response_url" : "https://mobipaid.com", "cancel_url" : "https://mobipaid.com", "fixed_amount": true, "currency": "ZAR", "amount": 1500.12, "tax_id": "", "template_id": "", "moto_enabled": false, "shipping_enabled": false, "send_mms_invoice": true, "attach_invoice": true, "invoice_url": "https://mp-fixed-assets.s3.amazonaws.com/logo.png", "attach_receipt": true, "receipt_file_type": "pdf", "payment_type": "DB", "payment_methods": [ "APPLE_PAY", "GOOGLE_PAY", "NEDBANK_EFT", "AMEX" ], "expiry_date": "" }'
import requests import json url = "https://test.mobipaid.io/v2/payment-requests" payload = json.dumps( { "transaction_id": "2116376OO", "request_methods": [ "WEB"], "reference_number": "123", "email": "example@example.com", "merchant_phone_number": None, "mobile_number": "+12345678901", "customer_id": "", "customer_salutation": "Mr", "customer_first_name": "John", "customer_last_name" : "Preston", "redirect_url" : "https://mobipaid.com", "response_url" : "https://mobipaid.com", "cancel_url" : "https://mobipaid.com", "fixed_amount": True, "currency": "ZAR", "amount": 1500.12, "tax_id": "", "template_id": "", "moto_enabled": False, "shipping_enabled": False, "send_mms_invoice": True, "attach_invoice": True, "invoice_url": "https://mp-fixed-assets.s3.amazonaws.com/logo.png", "attach_receipt": True, "receipt_file_type": "pdf", "payment_type": "DB", "payment_methods": [ "APPLE_PAY", "GOOGLE_PAY", "NEDBANK_EFT", "AMEX" ], "expiry_date": "" } ) headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer mp_test_w3Lwv3CZIZzye4cYxxr0' } response = requests.request("PUT", url, headers=headers, data = payload) print(response.text.encode('utf8'))
var request = require('request'); var options = { 'method': 'PUT', 'url': 'https://test.mobipaid.io/v2/payment-requests', 'headers': { 'Content-Type': 'application/json', 'Authorization': 'Bearer mp_test_w3Lwv3CZIZzye4cYxxr0' }, body: JSON.stringify({ "transaction_id": "2116376OO", "request_methods": [ "WEB"], "reference_number": "123", "email": "example@example.com", "merchant_phone_number": null, "mobile_number": "+12345678901", "customer_id": "", "customer_salutation": "Mr", "customer_first_name": "John", "customer_last_name" : "Preston", "redirect_url" : "https://mobipaid.com", "response_url" : "https://mobipaid.com", "cancel_url" : "https://mobipaid.com", "fixed_amount": true, "currency": "ZAR", "amount": 1500.12, "tax_id": "", "template_id": "", "moto_enabled": false, "shipping_enabled": false, "send_mms_invoice": true, "attach_invoice": true, "invoice_url": "https://mp-fixed-assets.s3.amazonaws.com/logo.png", "attach_receipt": true, "receipt_file_type": "pdf", "payment_type": "DB", "payment_methods": [ "APPLE_PAY", "GOOGLE_PAY", "NEDBANK_EFT", "AMEX" ], "expiry_date": "" }) }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); });
$curl = curl_init(); $data = array( "transaction_id" => "2116376OO", "request_methods" => [ "WEB"], "reference_number" => "123", "email" => "example@example.com", "merchant_phone_number" => null, "mobile_number" => "+12345678901", "customer_id" => "", "customer_salutation" => "Mr", "customer_first_name" => "John", "customer_last_name" => "Preston", "redirect_url" => "https://mobipaid.com", "response_url" => "https://mobipaid.com", "cancel_url" => "https://mobipaid.com", "fixed_amount" => true, "currency" => "ZAR", "amount" => 1500.12, "tax_id" => "", "template_id" => "", "moto_enabled" => false, "shipping_enabled" => false, "send_mms_invoice" => true, "attach_invoice" => true, "invoice_url" => "https://mp-fixed-assets.s3.amazonaws.com/logo.png", "attach_receipt" => true, "receipt_file_type" => "pdf", "payment_type": "DB", "payment_methods" => [ "APPLE_PAY", "GOOGLE_PAY", "NEDBANK_EFT", "AMEX" ], "expiry_date" => "" ); $data = json_encode($data); curl_setopt_array($curl, array( CURLOPT_URL => "https://test.mobipaid.io/v2/payment-requests", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "PUT", CURLOPT_POSTFIELDS => $data, CURLOPT_HTTPHEADER => array( "Content-Type: application/json", "Authorization: Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
require "uri" require "net/http" require 'json' url = URI("https://test.mobipaid.io/v2/payment-requests") https = Net::HTTP.new(url.host, url.port); https.use_ssl = true request = Net::HTTP::Put.new(url) request["Content-Type"] = "application/json" request["Authorization"] = "Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" request.body = { transaction_id: "2116376OO", request_methods: [ "WEB"], reference_number: "123", email: "example@example.com", merchant_phone_number: nil, mobile_number: "+12345678901", customer_id: "", customer_salutation: "Mr", customer_first_name: "John", customer_last_name: "Preston", redirect_url: "https://mobipaid.com", response_url: "https://mobipaid.com", cancel_url: "https://mobipaid.com", fixed_amount: true, currency: "ZAR", amount: 1500.12, tax_id: "", template_id: "", moto_enabled: false, shipping_enabled: false, send_mms_invoice: true, attach_invoice: true, invoice_url: "https://mp-fixed-assets.s3.amazonaws.com/logo.png", attach_receipt: true, receipt_file_type: "pdf", payment_type: "DB", payment_methods: [ "APPLE_PAY", "GOOGLE_PAY", "NEDBANK_EFT", "AMEX" ], expiry_date: "" }.to_json response = https.request(request) puts response.read_body
Result Format
{ "result": "success", "transaction_id": "145497OO", "request_methods": [ "WEB" ], "reference_number": "123", "email": "example@example.com", "mobile_number": "+12345678901", "merchant_phone_number": null, "customer_id": "", "customer_salutation": "Mr", "customer_first_name": "John", "customer_last_name": "Preston", "payment_type": "DB", "currency": "ZAR", "amount": "1500.12", "fixed_amount": true, "short_url": "https://shorturl", "long_url": "https://longurl", "qrcode_link": "https://qrlink", "tax_id": "", "template_id": "", "payment_methods": [ "GOOGLE_PAY", "AMEX" ], "shipping_enabled": false, "send_mms_invoice": true, "attach_invoice": true, "invoice_url": "https://upload.wikimedia.org/wikipedia/commons/a/a8/CCU_Logo.jpeg", "send_mms_receipt": false, "attach_receipt": true, "receipt_file_type": "pdf", "expiry_date": "", "response_url": "https://google.com", "redirect_url": "https://google.com", "cancel_url": "https://google.com", "created_at": "2020-02-18T06:53:07.000Z", "modified_at": "2020-02-19T09:02:46.000Z" }
{ "is_valid": false, "error_field": "transaction_id", "error_message": "transaction_id is not valid" }
{ "message": "Forbidden" }
Request Samples
You can fetch a single payment request by using the GET method with a transaction_id in the route parameter.
Required Header:
- Authorization
Request URL
https://test.mobipaid.io/v2/payment-requests/{transaction_id}Examples
curl -X GET https://test.mobipaid.io/v2/payment-requests/{transaction_id} \ --header "Authorization: Bearer mp_test_w3Lwv3CZIZzye4cYxxr0"
import requests url = "https://test.mobipaid.io/v2/payment-requests?page=5&limit=1" payload = {} headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer mp_test_w3Lwv3CZIZzye4cYxxr0' } response = requests.request("GET", url, headers=headers, data = payload) print(response.text.encode('utf8'))
var request = require('request'); var options = { 'method': 'GET', 'url': 'https://test.mobipaid.io/v2/payment-requests?page=5&limit=1', 'headers': { 'Content-Type': 'application/json', 'Authorization': 'Bearer mp_test_w3Lwv3CZIZzye4cYxxr0' } }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); });
$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://test.mobipaid.io/v2/payment-requests?page=5&limit=1", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "Content-Type: application/json", "Authorization: Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
require "uri" require "net/http" url = URI("https://test.mobipaid.io/v2/payment-requests?page=5&limit=1") https = Net::HTTP.new(url.host, url.port); https.use_ssl = true request = Net::HTTP::Get.new(url) request["Content-Type"] = "application/json" request["Authorization"] = "Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" response = https.request(request) puts response.read_body
Result Format
{ "limit": "1", "page": "1", "page_count": 84, "total_count": 84, "transactions": [ { "amount": 739.88, "attach_receipt_on_email": false, "chargeback": [], "created_at": "2020-01-30T10:53:45.000Z", "currency": "EUR", "email": "saad.jamalkhan@gmail.com", "expiration_date": "2020-02-06T10:53:00.000Z", "fixed_amount": true, "invoice_url": null, "merchant_phone_number": "+19196894607", "mobile_number": "+23059418021", "modified_at": null, "payment_date": "2020-01-30T10:56:01.000Z", "payment_id": "8ac7a4a26ff5c0c4016ff617ed2128fa", "payment_methods": ["AMEX"], "payment_type": "DB", "receipt_file_type": null, "reference_number": "44923", "refund": [], "request_methods": [ "SMS", "EMAIL" ], "reversal": [], "send_mms_receipt": false, "shipping_information": false, "status": "success", "status_description": "", "tax_id": "PKZMknlE", "transaction_id": "145429OO", "url": "https://s.mpaid.us/37cfJ" } ] }
{ "message": "Forbidden" }
Request Samples
You can delete a single payment request by using the DELETE method with a transaction_id in the route parameter.
Please note that you will not be allowed to delete a transaction that already has a payment history.
Required Header:
- Authorization
Request URL
https://test.mobipaid.io/v2/payment-requests/{transaction_id}Examples
curl -X DELETE https://test.mobipaid.io/v2/payment-requests/{transaction_id} \ --header "Authorization: Bearer mp_test_w3Lwv3CZIZzye4cYxxr0"
import requests url = "https://test.mobipaid.io/v2/payment-requests/2116376OO" payload = {} headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer mp_live_9Au2ABAwToHDfMf1kiwr' } response = requests.request("DELETE", url, headers=headers, data = payload) print(response.text.encode('utf8'))
var request = require('request'); var options = { 'method': 'DELETE', 'url': 'https://test.mobipaid.io/v2/payment-requests/2116376OO', 'headers': { 'Content-Type': 'application/json', 'Authorization': 'Bearer mp_live_9Au2ABAwToHDfMf1kiwr' } }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); });
$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://test.mobipaid.io/v2/payment-requests/2116376OO", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "DELETE", CURLOPT_HTTPHEADER => array( "Content-Type: application/json", "Authorization: Bearer mp_live_9Au2ABAwToHDfMf1kiwr" ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
require "uri" require "net/http" url = URI("https://test.mobipaid.io/v2/payment-requests/2116376OO") https = Net::HTTP.new(url.host, url.port); https.use_ssl = true request = Net::HTTP::Delete.new(url) request["Content-Type"] = "application/json" request["Authorization"] = "Bearer mp_live_9Au2ABAwToHDfMf1kiwr" response = https.request(request) puts response.read_body
Result Format
{ "result": "success", "transaction_id": "145493OO" }
{ "is_valid": false, "error_field": "transaction_id", "error_message": "Transaction is not found.", "result": "failed" }
Request Samples
The payment response is sent via the payment response URL that you provided in your payment request.We send a JSON response in a POST parameter called response.On your payment response provided URL you will need to check for a post parameter called response and read the JSON payload contained within the post variable.
Two possible result codes of NOK for failure in the payment attempt and ACK for a successful payment.
Sample payment response
response {
"result": "ACK",
"token": "9b6352ab516a043cd33cf65cf8210af35bd4d3c9",
"transaction_id": "211PO",
"payment_id": "8ac7a4a074726760017472b283ce070f",
"amount": "50.33",
"currency": "USD",
"currency_symbol": "$",
"result_code": "000.100.110",
"result_description": "Request successfully processed in 'Merchant in Integrator Test Mode'",
"additional_info_text": {
"Type": "baju baru"
},
"additional_info_dropdown": {
"Size": "M"
},
"cart_items": "[{\"sku\":\"123\",\"name\":\"Blue Shirt XL\",\"qty\":1,\"unit_price\":11.2},{\"sku\":\"456\",\"name\":\"Black Short Pant XL\",\"qty\":2,\"unit_price\":22.4}]"
}
Fetch your payment history from Mobipaid in order to show how many payments have been done through our application.
Our payment history API support fetching payment history and refund a paid transaction
You can get a list of payment history using our GET method.
Here are the available query string parameters to help you fetch the right payment history:
Query | Description |
---|---|
start_date |
string
Start search for payment history from the date entered into this parameter. The format is "YYYY-MM-DD" |
end_date
required with condition |
string
You need to specify the end_date if you specify the start_date. It use the same format of "YYYY-MM-DD" |
page |
number
Select the payment history |
limit |
number
Limit the amount of items fetched from payment history. The default value is 10 |
keywords |
string
Search for a payment history that has the specified keyword in email, mobile number or reference number |
Request URL
https://test.mobipaid.io/v2/payments?{optional_parameter}Examples
curl -X GET https://test.mobipaid.io/v2/payments?{optional parameters here} \ --header "Authorization: Bearer mp_test_w3Lwv3CZIZzye4cYxxr0"
import requests url = "https://test.mobipaid.io/v2/payments?limit=5&page=1" payload = {} headers = { 'Authorization': 'Bearer mp_test_w3Lwv3CZIZzye4cYxxr0', 'Content-Type': 'application/json' } response = requests.request("GET", url, headers=headers, data = payload) print(response.text.encode('utf8'))
var request = require('request'); var options = { 'method': 'GET', 'url': 'https://test.mobipaid.io/v2/payments?limit=5&page=1', 'headers': { 'Authorization': 'Bearer mp_test_w3Lwv3CZIZzye4cYxxr0', 'Content-Type': 'application/json' } }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); });
$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://test.mobipaid.io/v2/payments?limit=5&page=1", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "Authorization: Bearer mp_test_w3Lwv3CZIZzye4cYxxr0", "Content-Type: application/json" ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
require "uri" require "net/http" url = URI("https://test.mobipaid.io/v2/payments?limit=5&page=1") https = Net::HTTP.new(url.host, url.port); https.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = "Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" request["Content-Type"] = "application/json" response = https.request(request) puts response.read_body
Result Format
{ "payments": [ { "payment_id": "8ac7a4a2735bed2301736a2e1cd40318", "reference_payment_id": null, "transaction_id": "1130OO", "transaction_type": "once-off", "reference_number": "123", "mobile_number": "+12345678901", "email": "email@domain.com", "amount": 1500.12, "currency": "ZAR", "payment_type": "CC.PA", "payment_date": "2020-07-20T03:04:33.000Z", "status": "success", "result_description": "Request successfully processed in 'Merchant in Integrator Test Mode'", "payment_url": "https://s.mpaid.us/sMBaf", "transaction_date": "2020-07-20T03:03:54.000Z", "request_detail": { "tip_amount": 0, "tax_percentage": "0.00 %", "tax_amount": 0, "additional_info": {}, "additional_info_text": {}, "additional_info_dropdown": {}, "cart_items": {} } }, { "payment_id": "8ac7a4a1730e6e3e017313846dd54eeb", "reference_payment_id": null, "transaction_id": "11PO", "transaction_type": "pos_payment", "reference_number": "MP1", "mobile_number": null, "email": null, "amount": 50.33, "currency": "EUR", "payment_type": "CC.DB", "payment_date": "2020-07-03T07:11:52.000Z", "status": "failed", "result_description": "Invalid payment data. You are not configured for this currency or sub type (country or brand)", "payment_url": "https://sandbox-pay.mobipaid.com/pos_link/GpWv30S-OqDAtU3tOjO6NQ", "transaction_date": "2020-04-03T06:21:44.000Z", "request_detail": { "tip_amount": 0, "tax_percentage": "0.00 %", "tax_amount": 0, "additional_info": {}, "additional_info_text": { "text": "asd" }, "additional_info_dropdown": { "size": "S" }, "cart_items": [ { "sku": "-", "name": "Blue Shirt XL", "qty": 3, "unit_price": 2 }, { "sku": "456", "name": "Black Short Pant XL", "qty": 2, "unit_price": 22.4 } ] } } ], "page": 1, "limit": 2, "start_date": "2020-07-01", "end_date": "2020-08-30", "page_count": 3, "total_count": 5 }
{ "message": "Forbidden" }
Request Samples
Fetch a single payment history from Mobipaid
You can use the same GET method like in Payment History, but you have to add payment_id in the route parameter.
Request URL
https://test.mobipaid.io/v2/payments/{payment_id}Examples
curl -X GET https://test.mobipaid.io/v2/payments/{payment_id} \ --header "Authorization: Bearer mp_test_w3Lwv3CZIZzye4cYxxr0"
import requests url = "https://test.mobipaid.io/v2/payments/8ac7a4a26ff5c0c4016ff617ed2128fa99999999" payload = {} headers = { 'Content-Type': ' application/json', 'Authorization': 'Bearer mp_test_w3Lwv3CZIZzye4cYxxr0' } response = requests.request("GET", url, headers=headers, data = payload) print(response.text.encode('utf8'))
var request = require('request'); var options = { 'method': 'GET', 'url': 'https://test.mobipaid.io/v2/payments/8ac7a4a26ff5c0c4016ff617ed2128fa99999999', 'headers': { 'Content-Type': ' application/json', 'Authorization': 'Bearer mp_test_w3Lwv3CZIZzye4cYxxr0' } }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); });
$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://test.mobipaid.io/v2/payments/8ac7a4a26ff5c0c4016ff617ed2128fa99999999", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "Content-Type: application/json", "Authorization: Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
require "uri" require "net/http" url = URI("https://test.mobipaid.io/v2/payments/8ac7a4a26ff5c0c4016ff617ed2128fa99999999") https = Net::HTTP.new(url.host, url.port); https.use_ssl = true request = Net::HTTP::Get.new(url) request["Content-Type"] = " application/json" request["Authorization"] = "Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" response = https.request(request) puts response.read_body
Result Format
{ "payment": { "payment_id": "8ac7a4a1730e6e3e017313846dd54eeb", "reference_payment_id": null, "transaction_id": "11PO", "transaction_type": "pos_payment", "reference_number": "MP1", "mobile_number": null, "email": null, "amount": 50.33, "currency": "EUR", "payment_type": "CC.DB", "payment_date": "2020-07-03T07:11:52.000Z", "status": "failed", "result_description": "Invalid payment data. You are not configured for this currency or sub type (country or brand)", "payment_url": "https://sandbox-pay.mobipaid.com/pos_link/GpWv30S-OqDAtU3tOjO6NQ", "transaction_date": "2020-04-03T06:21:44.000Z", "request_detail": { "tip_amount": 0, "tax_percentage": "0.00 %", "tax_amount": 0, "additional_info": {}, "additional_info_text": { "text": "asd" }, "additional_info_dropdown": { "size": "S" }, "cart_items": [ { "sku": "-", "name": "Blue Shirt XL", "qty": 3, "unit_price": 2 }, { "sku": "456", "name": "Black Short Pant XL", "qty": 2, "unit_price": 22.4 } ] } } }
{ "message": "Your Payment history data is not found", "result": "failed" }
{ "message": "Forbidden" }
Request Samples
Refund a paid payment history from Mobipaid. You have to include the payment_id of the payment history you want to refund.
Body Params
Field | Description |
---|---|
amount
required |
number
The amount to be refunded to the customer |
string
A refund receipt will be send to this email address if you add it. |
|
mobile_number |
string
A refund receipt will be send to this mobile number if you add it. |
Request URL
https://test.mobipaid.io/v2/refunds/{unique_id}Request Body
{ "email": "example@example.com", "amount": 1, "mobile_number": "+12345678" }
Examples
curl -X POST https://test.mobipaid.io/v2/refunds/{payment_id} \ --header "Authorization: Bearer mp_test_w3Lwv3CZIZzye4cYxxr0"
import requests url = "https://test.mobipaid.io/v2/refunds" payload = "{\n\"email\": \"example@example.com\",\n\"amount\": 1,\n\"mobile_number\": \"+12345678\"\n}\n\n" headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer mp_test_w3Lwv3CZIZzye4cYxxr0' } response = requests.request("POST", url, headers=headers, data = payload) print(response.text.encode('utf8'))
var request = require('request'); var options = { 'method': 'POST', 'url': 'https://test.mobipaid.io/v2/refunds', 'headers': { 'Content-Type': 'application/json', 'Authorization': 'Bearer mp_test_w3Lwv3CZIZzye4cYxxr0' }, body: JSON.stringify({"email":"example@example.com","amount":1,"mobile_number":"+12345678"}) }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); });
$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://test.mobipaid.io/v2/refunds", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS =>"{\n\"email\": \"example@example.com\",\n\"amount\": 1,\n\"mobile_number\": \"+12345678\"\n}\n\n", CURLOPT_HTTPHEADER => array( "Content-Type: application/json", "Authorization: Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
require "uri" require "net/http" url = URI("https://test.mobipaid.io/v2/refunds") https = Net::HTTP.new(url.host, url.port); https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request["Authorization"] = "Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" request.body = "{\n\"email\": \"example@example.com\",\n\"amount\": 1,\n\"mobile_number\": \"+12345678\"\n}\n\n" response = https.request(request) puts response.read_body
Result Format
{ "amount": 45, "balance": 31, "currency": "ZAR", "email": "example@example.com", "mobile_number": "", "payment_id": "8ac7a49f70664e4f01706677b1e64a2e", "ref_number": "000211582016283", "refund_date": "2020-02-21T06:38:05.000Z", "refunded_amount": 1, "shipping_information": true, "status": "refund", "transaction_id": 495, "transaction_type": "once-off" }
{ "result": "failed", "message": "Payment is not found." }
{ "is_valid": false, "error_field": "amount", "error_message": "amount is required.", "result": "failed" }
Request Samples
Capture a pre-authorization payment. You have to include the payment_id of the payment history you want to capture.
Body Params
Field | Description |
---|---|
amount
required |
number
The amount to be captured, cannot more than the actual payment. |
Request URL
https://test.mobipaid.io/v2/captures/{payment_id}Request Body
{ "amount": 10 }
Examples
curl -X POST https://test.mobipaid.io/v2/captures/8ac7a49f7297dc2701729954fc4c1f71 \ -H "Content-Type: application/json" \ -H "Authorization: Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" \ --data '{ "amount": 10 }'
import requests import json url = "https://test.mobipaid.io/v2/captures/8ac7a49f7297dc2701729954fc4c1f71" payload = json.dumps( { "amount": 10 } ) headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer mp_test_w3Lwv3CZIZzye4cYxxr0' } response = requests.request("POST", url, headers=headers, data = payload) print(response.text.encode('utf8'))
var request = require('request'); var options = { 'method': 'POST', 'url': 'https://test.mobipaid.io/v2/captures/8ac7a49f7297dc2701729954fc4c1f71', 'headers': { 'Content-Type': 'application/json', 'Authorization': 'Bearer mp_test_w3Lwv3CZIZzye4cYxxr0' }, body: JSON.stringify({ "amount": 10 }) }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); });
$curl = curl_init(); $data = array( "amount" => 10 ); $data = json_encode($data); curl_setopt_array($curl, array( CURLOPT_URL => "https://test.mobipaid.io/v2/captures/8ac7a49f7297dc2701729954fc4c1f71", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => $data, CURLOPT_HTTPHEADER => array( "Content-Type: application/json", "Authorization: Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
require "uri" require "net/http" require 'json' url = URI("https://test.mobipaid.io/v2/captures/8ac7a49f7297dc2701729954fc4c1f71") https = Net::HTTP.new(url.host, url.port); https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request["Authorization"] = "Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" request.body = { amount: 10 }.to_json response = https.request(request) puts response.read_body
Result Format
{ "transaction_type": "once-off", "payment_id": "8ac7a4a07297e42e01729955d6f40fa2", "transaction_id": "171OO", "captured_amount": 10, "amount": 1500.12, "balance": 10, "currency": "ZAR", "ref_number": "123", "shipping_information": true, "status": "capture", "capture_date": "2020-06-09T13:47:19.000Z" }
{ "result": "failed", "message": "Payment is not found." }
Request Samples
Cancel a subscription that is already paid in the payment history with type scheduled. You have to include the payment_id of the scheduled payment in the payment history in order to cancel it.
Request URL
https://live.mobipaid.io/v2/payments/subscription/{payment_id}Examples
curl -X DELETE https://live.mobipaid.io/v2/payments/subscription/{payment_id} \ --header "Authorization: Bearer mp_test_w3Lwv3CZIZzye4cYxxr0"
import requests import json url = "https://live.mobipaid.io/v2/payments/subscription/8ac7a49f7297dc2701729954fc4c1f71" payload = {} headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer mp_test_A83ucDEekfzqOATsxfrj' } response = requests.request("DELETE", url, headers=headers, data = payload) print(response.text.encode('utf8'))
var request = require("request"); var options = { method: "DELETE", url: "https://live.mobipaid.io/v2/payments/subscription/8ac7a4a07532805d017540b10b420dbd", headers: { "Content-Type": "application/json", "Authorization": "Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" }, }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); });
$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://live.mobipaid.io/v2/payments/subscription/8ac7a4a07532805d017540b10b420dbd", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "DELETE", CURLOPT_HTTPHEADER => array( "Content-Type: application/json", "Authorization: Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
require "uri" require "net/http" require "json" url = URI("https://live.mobipaid.io/v2/payments/subscription/8ac7a4a07532805d017540b10b420dbd") https = Net::HTTP.new(url.host, url.port); https.use_ssl = true request = Net::HTTP::Delete.new(url) request["Content-Type"] = "application/json" request["Authorization"] = "Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" response = https.request(request) puts response.read_body
Result Format
{ "transaction_type": "scheduled", "payment_id": "8ac7a4a2753280600175404c232c4189", "email": "whibi9999@gmail.com", "mobile_number": "+6282115888911", "amount": 56, "currency": "ZAR", "ref_number": "ref001", "status": "subscription_ended" }
{ "result": "failed", "message": "Payment is not found." }
Request Samples
Create a POS payment link with this feature.
We support Credit Card, Direct Debit, Paypal, Apple Pay, Google Pay, Nedbank, etc. With mobipaid wallet in place, customer can pay quickly with payment options that has been saved.
You can create one POS link for many payments.
Create a POS payment link for the merchant. One merchant can only have one POS link.
Body Params
Field | Description |
---|---|
currency
|
array
The currency of this payment request in 3 digit ISO format Example: ["USD","ZAR"] |
redirect_url
|
string
After payment, we will redirect to this URL. If empty, we will show the receipt page instead. Example: "http://mymobipaidmerchant.com/receipt/" |
response_url
|
string
Response_url is the URL where the customer will get the payment result. After the transaction is paid, the payment response will be posted to the response_url. Example: "http://mymobipaidmerchant.com/response/" |
cancel_url
|
string
The url where the customer will redirect when customer click cancels button on the payment page. Example: "https://mywebsite.com" |
tax_id
|
string
Tax profile ID to calculate the tax amount for this payment. If it does not exist, the amount of value will be tax-free. |
additional_info
|
object
Add additional notes for this payment. |
additional_info_text
|
object
Enable the customer to input additional info using a text input. |
additional_info_dropdown
|
object
Enable the customer to input additional info by selecting an option from a select input. |
tip_enabled
|
boolean
Use "true" if you want the customer to be able to input the tip amount. |
moto_enabled
|
boolean
Enable MOTO card mode which has no additional authentication on payment widget |
share_button_enabled
|
boolean
Enable share button on the payment page. Customer will be able to share the payment request to social media such as Facebook, Twitter, etc |
auto_generate_ref_number
|
boolean
Use "true" if you want the payment reference number to be auto-generated. Else, the customer will need to input reference number manually. |
ref_number_suffix
|
number
Add a suffix to the reference number when the reference number is auto-generated. |
ref_number_prefix
|
string
Add a prefix to reference number when the reference number is auto-generated. |
payment_methods
|
array
Add optional payment methods that can be used to pay this request. You can add "APPLE_PAY", "GOOGLE_PAY", "NEDBANK_EFT" or "AMEX" in a single array. |
repeat_payment
|
boolean
Use "true" if you want the customer to be able to make a recurring payment. |
Request URL
https://test.mobipaid.io/v2/posRequest Body
{ "redirect_url": "https://mobipaid.com", "response_url": "https://yourshop.com/response_handler", "cancel_url": "https://yourshop.com", "currency": ["ZAR", "USD", "EUR"], "tax_id": "", "additional_info": {"Product" : "Shirt", "Color": "Red"}, "additional_info_text": {"text" : "input text on front"}, "additional_info_dropdown": { "size": "S, M, L, XL" }, "tip_enabled": true, "moto_enabled": true, "share_button_enabled": true, "auto_generate_ref_number": true, "ref_number_suffix": 1, "ref_number_prefix": "MP", "payment_methods": ["GOOGLE_PAY", "APPLE_PAY", "NEDBANK_EFT", "AMEX"] }
Examples
curl -X POST https://test.mobipaid.io/v2/pos \ -H "Content-Type: application/json" \ -H "Authorization: Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" \ --data '{ "redirect_url": "https://mobipaid.com", "response_url": "https://yourshop.com/response_handler", "cancel_url": "https://yourshop.com", "currency": ["ZAR", "USD", "EUR"], "tax_id": "", "additional_info": {"Product" : "Shirt", "Color": "Red"}, "additional_info_text": {"text" : "input text on front"}, "additional_info_dropdown": { "size": "S, M, L, XL" }, "tip_enabled": true, "moto_enabled": true, "share_button_enabled": true, "auto_generate_ref_number": true, "ref_number_suffix": 1, "ref_number_prefix": "MP", "payment_methods": ["GOOGLE_PAY", "APPLE_PAY", "NEDBANK_EFT","AMEX"] }'
import requests import json url = "https://test.mobipaid.io/v2/pos" payload = json.dumps( { "redirect_url": "https://mobipaid.com", "response_url": "https://yourshop.com/response_handler", "cancel_url": "https://yourshop.com", "currency": ["ZAR", "USD", "EUR"], "tax_id": "", "additional_info": {"Product" : "Shirt", "Color": "Red"}, "additional_info_text": {"text" : "input text on front"}, "additional_info_dropdown": { "size": "S, M, L, XL" }, "tip_enabled": true, "moto_enabled": true, "share_button_enabled": true, "auto_generate_ref_number": true, "ref_number_suffix": 1, "ref_number_prefix": "MP", "payment_methods": ["GOOGLE_PAY", "APPLE_PAY", "NEDBANK_EFT","AMEX"] } ) headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer mp_test_w3Lwv3CZIZzye4cYxxr0' } response = requests.request("POST", url, headers=headers, data = payload) print(response.text.encode('utf8'))
var request = require("request"); var options = { method: "POST", url: "https://test.mobipaid.io/v2/pos", headers: { "Content-Type": "application/json", "Authorization": "Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" }, body: JSON.stringify({ redirect_url: "https://mobipaid.com", response_url: "https://yourshop.com/response_handler", cancel_url: "https://yourshop.com", currency: ["ZAR", "USD", "EUR"], tax_id: "", additional_info: {"Product": "Shirt", "Color": "Red"}, additional_info_text: {"text": "input text on front"}, additional_info_dropdown: { size: "S, M, L, XL" }, tip_enabled: true, moto_enabled: true, share_button_enabled: true, auto_generate_ref_number: true, ref_number_suffix: 1, ref_number_prefix: "MP", payment_methods: ["GOOGLE_PAY", "APPLE_PAY", "NEDBANK_EFT","AMEX"] }) }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); });
$curl = curl_init(); $data = array( "redirect_url" => "https://mobipaid.com", "response_url" => "https://yourshop.com/response_handler", "cancel_url" => "https://yourshop.com", "currency" => ["ZAR", "USD", "EUR"], "tax_id" => "", "additional_info" => array( "Product" => "Shirt", "Color" => "Red" ), "additional_info_text" => array( "text" => "input text on front" ), "additional_info_dropdown" => array( "size" => "S, M, L, XL" ), "tip_enabled" => true, "moto_enabled" => true, "share_button_enabled" => true, "auto_generate_ref_number" => true, "ref_number_suffix" => 1, "ref_number_prefix" => "MP", "payment_methods" => ["GOOGLE_PAY", "APPLE_PAY", "NEDBANK_EFT","AMEX"] ); $data = json_encode($data); curl_setopt_array($curl, array( CURLOPT_URL => "https://test.mobipaid.io/v2/pos", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => $data, CURLOPT_HTTPHEADER => array( "Content-Type: application/json", "Authorization: Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
require "uri" require "net/http" require "json" url = URI("https://test.mobipaid.io/v2/pos") https = Net::HTTP.new(url.host, url.port); https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request["Authorization"] = "Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" request.body = { redirect_url: "https://mobipaid.com", response_url: "https://yourshop.com/response_handler", cancel_url: "https://yourshop.com", currency: ["ZAR", "USD", "EUR"], tax_id: "", additional_info: {"Product": "Shirt", "Color": "Red"}, additional_info_text: {"text": "input text on front"}, additional_info_dropdown: { size: "S, M, L, XL" }, tip_enabled: true, moto_enabled: true, share_button_enabled: true, auto_generate_ref_number: true, ref_number_suffix: 1, ref_number_prefix: "MP", payment_methods: ["GOOGLE_PAY", "APPLE_PAY", "NEDBANK_EFT","AMEX"] }.to_json response = https.request(request) puts response.read_body
Result Format
{ "result": "success", "auto_generate_ref_number": true, "ref_number_prefix": "MP", "ref_number_suffix": 1, "additional_info": { "Product": "Shirt", "Color": "Red" }, "additional_info_text": { "text": "input text on front" }, "additional_info_dropdown": { "size": "S, M, L, XL" }, "tip_enabled": true, "currency": [ "ZAR", "USD", "EUR" ], "moto_enabled": true, "tax_id": "", "payment_methods": [ "APPLE_PAY", "GOOGLE_PAY", "NEDBANK_EFT", "AMEX" ], "cancel_url": "https://yourshop.com", "response_url": "https://yourshop.com/response_handler", "redirect_url": "https://mobipaid.com", "db_transaction_id": "111PO", "db_payment_url": "https://sandbox-pay.mobipaid.com/pos_link/FIIZBbASgUeJ7sRrJE3eRA", "db_short_url": "https://s.mpaid.us/F7QSR", "db_qrcode_link": "https://mp-qrcodes.s3.amazonaws.com/stage/pos/httpssmpaidusF7QSR.png", "pa_transaction_id": "112PO", "pa_payment_url": "https://sandbox-pay.mobipaid.com/pos_link/X2x1fAMib0N0LsidbiB9xw", "pa_short_url": "https://s.mpaid.us/rby8Z", "pa_qrcode_link": "https://mp-qrcodes.s3.amazonaws.com/stage/pos/httpssmpaidusrby8Z.png" }
{ "is_valid": false, "error_field": "tax_id", "error_message": "tax_id is not valid" }
Request Samples
Update an existing POS payment link for the merchant.
Body Params
Field | Description |
---|---|
currency
|
array
The currency of this payment request in 3 digit ISO format Example: ["USD","ZAR"] |
redirect_url
|
string
After payment we will redirect to this URL. If empty, we will show the receipt page instead. Example: "http://mymobipaidmerchant.com/receipt/" |
response_url
|
string
Response_url is the url where customer will get the payment result. After the transaction is paid, the payment response will be posted to the response_url. Example: "http://mymobipaidmerchant.com/response/" |
cancel_url
|
string
The url where customer will redirected when customer click cancel button on payment page. Example: "https://mywebsite.com" |
tax_id
|
string
Tax profile ID to calculate the tax amount for this payment. If it does not exist, the amount value will be tax free. |
additional_info
|
object
Add additional notes for this payment. |
additional_info_text
|
object
Enable customer to input additional info using a text input. |
additional_info_dropdown
|
object
Enable customer to input additional info by selecting an option from a select input. |
tip_enabled
|
boolean
Use "true" if you want the customer to be able to input tip amount. |
moto_enabled
|
boolean
Enable MOTO card mode which have no additional authentication on payment widget |
share_button_enabled
|
boolean
Enable share button on payment page. Customer will be able to share the payment request to social media such as Facebook, Twitter, etc |
auto_generate_ref_number
|
boolean
Use "true" if you want the payment reference number to be auto generated. Else, customer will need to input reference number manually. |
ref_number_suffix
|
number
Add a suffix to reference number when reference number is auto generated. |
ref_number_prefix
|
string
Add a prefix to reference number when reference number is auto generated. |
payment_methods
|
array
Add optional payment methods that can be used to pay this request. You can add "APPLE_PAY", "GOOGLE_PAY", "NEDBANK_EFT" or "AMEX" in a single array. |
Request URL
https://test.mobipaid.io/v2/posRequest Body
{ "redirect_url": "https://mobipaid.com", "response_url": "https://yourshop.com/response_handler", "cancel_url": "https://yourshop.com", "currency": ["ZAR", "USD", "EUR"], "tax_id": "", "additional_info": {"Product" : "Shirt", "Color": "Red"}, "additional_info_text": {"text" : "input text on front"}, "additional_info_dropdown": { "size": "S, M, L, XL" }, "tip_enabled": true, "moto_enabled": true, "share_button_enabled": true, "auto_generate_ref_number": true, "ref_number_suffix": 1, "ref_number_prefix": "MP", "payment_methods": ["GOOGLE_PAY", "APPLE_PAY", "NEDBANK_EFT", "AMEX"] }
Examples
curl -X PUT https://test.mobipaid.io/v2/pos \ -H "Content-Type: application/json" \ -H "Authorization: Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" \ --data '{ "redirect_url": "https://mobipaid.com", "response_url": "https://yourshop.com/response_handler", "cancel_url": "https://yourshop.com", "currency": ["ZAR", "USD", "EUR"], "tax_id": "", "additional_info": {"Product" : "Shirt", "Color": "Red"}, "additional_info_text": {"text" : "input text on front"}, "additional_info_dropdown": { "size": "S, M, L, XL" }, "tip_enabled": true, "moto_enabled": true, "share_button_enabled": true, "auto_generate_ref_number": true, "ref_number_suffix": 1, "ref_number_prefix": "MP", "payment_methods": ["GOOGLE_PAY", "APPLE_PAY", "NEDBANK_EFT","AMEX"] }'
import requests import json url = "https://test.mobipaid.io/v2/pos" payload = json.dumps( { "redirect_url": "https://mobipaid.com", "response_url": "https://yourshop.com/response_handler", "cancel_url": "https://yourshop.com", "currency": ["ZAR", "USD", "EUR"], "tax_id": "", "additional_info": {"Product" : "Shirt", "Color": "Red"}, "additional_info_text": {"text" : "input text on front"}, "additional_info_dropdown": { "size": "S, M, L, XL" }, "tip_enabled": true, "moto_enabled": true, "share_button_enabled": true, "auto_generate_ref_number": true, "ref_number_suffix": 1, "ref_number_prefix": "MP", "payment_methods": ["GOOGLE_PAY", "APPLE_PAY", "NEDBANK_EFT","AMEX"] } ) headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer mp_test_w3Lwv3CZIZzye4cYxxr0' } response = requests.request("PUT", url, headers=headers, data = payload) print(response.text.encode('utf8'))
var request = require("request"); var options = { method: "PUT", url: "https://test.mobipaid.io/v2/pos", headers: { "Content-Type": "application/json", "Authorization": "Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" }, body: JSON.stringify({ redirect_url: "https://mobipaid.com", response_url: "https://yourshop.com/response_handler", cancel_url: "https://yourshop.com", currency: ["ZAR", "USD", "EUR"], tax_id: "", additional_info: {"Product": "Shirt", "Color": "Red"}, additional_info_text: {"text": "input text on front"}, additional_info_dropdown: { size: "S, M, L, XL" }, tip_enabled: true, moto_enabled: true, share_button_enabled: true, auto_generate_ref_number: true, ref_number_suffix: 1, ref_number_prefix: "MP", payment_methods: ["GOOGLE_PAY", "APPLE_PAY", "NEDBANK_EFT","AMEX"] }) }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); });
$curl = curl_init(); $data = array( "redirect_url" => "https://mobipaid.com", "response_url" => "https://yourshop.com/response_handler", "cancel_url" => "https://yourshop.com", "currency" => ["ZAR", "USD", "EUR"], "tax_id" => "", "additional_info" => array( "Product" => "Shirt", "Color" => "Red" ), "additional_info_text" => array( "text" => "input text on front" ), "additional_info_dropdown" => array( "size" => "S, M, L, XL" ), "tip_enabled" => true, "moto_enabled" => true, "share_button_enabled" => true, "auto_generate_ref_number" => true, "ref_number_suffix" => 1, "ref_number_prefix" => "MP", "payment_methods" => ["GOOGLE_PAY", "APPLE_PAY", "NEDBANK_EFT","AMEX"] ); $data = json_encode($data); curl_setopt_array($curl, array( CURLOPT_URL => "https://test.mobipaid.io/v2/pos", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "PUT", CURLOPT_POSTFIELDS => $data, CURLOPT_HTTPHEADER => array( "Content-Type: application/json", "Authorization: Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
require "uri" require "net/http" require "json" url = URI("https://test.mobipaid.io/v2/pos") https = Net::HTTP.new(url.host, url.port); https.use_ssl = true request = Net::HTTP::Put.new(url) request["Content-Type"] = "application/json" request["Authorization"] = "Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" request.body = { redirect_url: "https://mobipaid.com", response_url: "https://yourshop.com/response_handler", cancel_url: "https://yourshop.com", currency: ["ZAR", "USD", "EUR"], tax_id: "", additional_info: {"Product": "Shirt", "Color": "Red"}, additional_info_text: {"text": "input text on front"}, additional_info_dropdown: { size: "S, M, L, XL" }, tip_enabled: true, moto_enabled: true, share_button_enabled: true, auto_generate_ref_number: true, ref_number_suffix: 1, ref_number_prefix: "MP", payment_methods: ["GOOGLE_PAY", "APPLE_PAY", "NEDBANK_EFT","AMEX"] }.to_json response = https.request(request) puts response.read_body
Result Format
{ "result": "success", "auto_generate_ref_number": true, "ref_number_prefix": "MP", "ref_number_suffix": 1, "additional_info": { "Product": "Shirt", "Color": "Red" }, "additional_info_text": { "text": "input text on front" }, "additional_info_dropdown": { "size": "S, M, L, XL" }, "tip_enabled": true, "currency": [ "ZAR", "USD", "EUR" ], "moto_enabled": true, "tax_id": "", "payment_methods": [ "APPLE_PAY", "GOOGLE_PAY", "NEDBANK_EFT" ], "cancel_url": "https://yourshop.com", "response_url": "https://yourshop.com/response_handler", "redirect_url": "https://mobipaid.com", "db_transaction_id": "111PO", "db_payment_url": "https://sandbox-pay.mobipaid.com/pos_link/FIIZBbASgUeJ7sRrJE3eRA", "db_short_url": "https://s.mpaid.us/F7QSR", "db_qrcode_link": "https://mp-qrcodes.s3.amazonaws.com/stage/pos/httpssmpaidusF7QSR.png", "pa_transaction_id": "112PO", "pa_payment_url": "https://sandbox-pay.mobipaid.com/pos_link/X2x1fAMib0N0LsidbiB9xw", "pa_short_url": "https://s.mpaid.us/rby8Z", "pa_qrcode_link": "https://mp-qrcodes.s3.amazonaws.com/stage/pos/httpssmpaidusrby8Z.png" }
{ "is_valid": false, "error_field": "tax_id", "error_message": "tax_id is not valid" }
Request Samples
Get existing POS link for the connected merchant.
Request URL
https://test.mobipaid.io/v2/posExamples
curl -X GET https://test.mobipaid.io/v2/pos \ -H "Content-Type: application/json" \ -H "Authorization: Bearer mp_test_w3Lwv3CZIZzye4cYxxr0"
import requests import json url = "https://test.mobipaid.io/v2/pos" headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer mp_test_w3Lwv3CZIZzye4cYxxr0' } response = requests.request("GET", url, headers=headers) print(response.text.encode('utf8'))
var request = require("request"); var options = { method: "GET", url: "https://test.mobipaid.io/v2/pos", headers: { "Content-Type": "application/json", "Authorization": "Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" }, }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); });
$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://test.mobipaid.io/v2/pos", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "Content-Type: application/json", "Authorization: Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
require "uri" require "net/http" require "json" url = URI("https://test.mobipaid.io/v2/pos") https = Net::HTTP.new(url.host, url.port); https.use_ssl = true request = Net::HTTP::Get.new(url) request["Content-Type"] = "application/json" request["Authorization"] = "Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" response = https.request(request) puts response.read_body
Result Format
{ "result": "success", "auto_generate_ref_number": true, "ref_number_prefix": "MP", "ref_number_suffix": 1, "additional_info": { "Product": "Shirt", "Color": "Red" }, "additional_info_text": { "text": "input text on front" }, "additional_info_dropdown": { "size": "S, M, L, XL" }, "tip_enabled": true, "currency": [ "ZAR", "USD", "EUR" ], "moto_enabled": true, "tax_id": "", "payment_methods": [ "APPLE_PAY", "GOOGLE_PAY", "NEDBANK_EFT" ], "cancel_url": "https://yourshop.com", "response_url": "https://yourshop.com/response_handler", "redirect_url": "https://mobipaid.com", "db_transaction_id": "111PO", "db_payment_url": "https://sandbox-pay.mobipaid.com/pos_link/FIIZBbASgUeJ7sRrJE3eRA", "pa_transaction_id": "112PO", "pa_payment_url": "https://sandbox-pay.mobipaid.com/pos_link/X2x1fAMib0N0LsidbiB9xw" }
{ "result": "failed", "message": "Merchant DB POS link is not found." }
Request Samples
Generate a POS link with pre-filled parameters for the connected merchant.
* You need to create POS Link before run this request
Body Params
Field | Description |
---|---|
currency
|
string
The currency of this payment request in 3 digit ISO format Example: "USD" |
amount
|
string
The payment amount for this payment link. |
tip_amount
|
string
The tip amount for this payment link. |
payment_type
|
string
The payment type of this POS link. You can select between "PA" and "DB" |
reference
|
string
You can input reference number for this link |
cancel_url
|
string
The url where customer will redirected when customer click cancel button on payment page. Example: "https://mywebsite.com" |
response_url
|
string
response_url is the url where customer will get the payment result. After the transaction is paid, the payment response will be posted to the response_url. Example: "http://mymobipaidmerchant.com/response/" |
return_url
|
string
The URL that will be set for "return to shop" button. |
additional_text_fields
|
object
Additional text input generated for this link. |
additional_dropdown_fields
|
object
Additional select input for this link. |
cart_items
|
array of object
Additional cart items that will be created for this payment the parameter must be an array of objects with "sku", "name", "qty" and "unit_price" property. Example: [{ "sku": "p1", "name": "product_1", "qty": 1, "unit_price": 10.15 }, { "sku": "p2", "name": "product_2", "qty": 3, "unit_price": 20.25 }] |
Request URL
https://test.mobipaid.io/v2/pos/generate-linkRequest Body
{ "payment_type": "DB", "tip_amount": 0, "amount": 50.33, "reference": "RED-SHIRT-123", "currency": "ZAR", "return_url": "https://yourshop.com", "response_url": "https://yourshop.com/response_handler", "cart_items": [{ "sku": "p1", "name": "Blue Shirt XL", "qty": 1, "unit_price": 10.15 }, { "sku": "p2", "name": "Black Short Pant XL", "qty": 3, "unit_price": 20.25 }], "additional_text_fields": { "text": "Hey guys" }, "additional_dropdown_fields": { "size": "XL" } }
Examples
curl -X PUT https://test.mobipaid.io/v2/pos \ -H "Content-Type: application/json" \ -H "Authorization: Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" \ --data '{ "payment_type": "DB", "tip_amount": 0, "amount": 50.33, "reference": "RED-SHIRT-123", "currency": "ZAR", "return_url": "https://yourshop.com", "response_url": "https://yourshop.com/response_handler", "cart_items": [{ "sku": "p1", "name": "Blue Shirt XL", "qty": 1, "unit_price": 10.15 }, { "sku": "p2", "name": "Black Short Pant XL", "qty": 3, "unit_price": 20.25 }], "additional_text_fields": { "text": "Hey guys" }, "additional_dropdown_fields": { "size": "XL" } }'
import requests import json url = "https://test.mobipaid.io/v2/pos/generate-link" payload = json.dumps( { "payment_type": "DB", "tip_amount": 0, "amount": 50.33, "reference": "RED-SHIRT-123", "currency": "ZAR", "return_url": "https://yourshop.com", "response_url": "https://yourshop.com/response_handler", "cart_items": [{ "sku": "p1", "name": "Blue Shirt XL", "qty": 1, "unit_price": 10.15 }, { "sku": "p2", "name": "Black Short Pant XL", "qty": 3, "unit_price": 20.25 }], "additional_text_fields": { "text": "Hey guys" }, "additional_dropdown_fields": { "size": "XL" } } ) headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer mp_test_w3Lwv3CZIZzye4cYxxr0' } response = requests.request("POST", url, headers=headers, data = payload) print(response.text.encode('utf8'))
var request = require("request"); var options = { method: "POST", url: "https://test.mobipaid.io/v2/pos/generate-link", headers: { "Content-Type": "application/json", "Authorization": "Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" }, body: JSON.stringify({ payment_type: "DB", tip_amount: 0, amount: 50.33, reference: "RED-SHIRT-123", currency: "ZAR", return_url: "https://yourshop.com", response_url: "https://yourshop.com/response_handler", cart_items: [{ "sku": "p1", "name": "Blue Shirt XL", "qty": 1, "unit_price": 10.15 }, { "sku": "p2", "name": "Black Short Pant XL", "qty": 3, "unit_price": 20.25 }], additional_text_fields: { text: "Hey guys" }, additional_dropdown_fields: { size: "XL" } }) }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); });
$curl = curl_init(); $data = array( "payment_type" => "DB", "tip_amount" => 0, "amount" => 50.33, "reference" => "RED-SHIRT-123", "currency" => "ZAR", "return_url" => "https://yourshop.com", "response_url" => "https://yourshop.com/response_handler", "cart_items" => [ array( "sku" => "p1", "name" => "Blue Shirt XL", "qty" => 1, "unit_price" => 10.15 ), array( "sku" => "p2", "name" => "Black Short Pant XL", "qty" => 3, "unit_price" => 20.25 ) ], "additional_text_fields" => array( "text" => "Hey guys" ), "additional_dropdown_fields" => array( "size" => "XL" ) ); $data = json_encode($data); curl_setopt_array($curl, array( CURLOPT_URL => "https://test.mobipaid.io/v2/pos/generate-link", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => $data, CURLOPT_HTTPHEADER => array( "Content-Type: application/json", "Authorization: Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
require "uri" require "net/http" require "json" url = URI("https://test.mobipaid.io/v2/pos/generate-link") https = Net::HTTP.new(url.host, url.port); https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request["Authorization"] = "Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" request.body = { payment_type: "DB", tip_amount: 0, amount: 50.33, reference: "RED-SHIRT-123", currency: "ZAR", return_url: "https://yourshop.com", response_url: "https://yourshop.com/response_handler", cart_items: [{ "sku": "p1", "name": "Blue Shirt XL", "qty": 1, "unit_price": 10.15 }, { "sku": "p2", "name": "Black Short Pant XL", "qty": 3, "unit_price": 20.25 }], additional_text_fields: { text: "Hey guys" }, additional_dropdown_fields: { size: "XL" } }.to_json response = https.request(request) puts response.read_body
Result Format
{ "result": "success", "long_url": "https://sandbox-pay.mobipaid.com/pos_link/FIIZBbASgUeJ7sRrJE3eRA?q=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXltZW50X3JlcXVlc3RfY3JpdGVyaWEiOnsidGlwX2Ftb3VudCI6MCwiYW1vdW50Ijo1MC4zMywicmVmZXJlbmNlIjoiUkVELVNISVJULTEyMyIsImN1cnJlbmN5IjoiWkFSIiwicmV0dXJuX3VybCI6Imh0dHBzOi8veW91cnNob3AuY29tIiwicmVzcG9uc2VfdXJsIjoiaHR0cHM6Ly95b3Vyc2hvcC5jb20vcmVzcG9uc2VfaGFuZGxlciIsImNhcnRfaXRlbXMiOlt7Im5hbWUiOiJCbHVlIFNoaXJ0IFhMIiwicXR5IjoxfSx7Im5hbWUiOiJCbGFjayBTaG9ydCBQYW50IFhMIiwicXR5IjozfV0sImFkZGl0aW9uYWxfdGV4dF9maWVsZHMiOnsidGV4dCI6IkhleSBndXlzIn0sImFkZGl0aW9uYWxfZHJvcGRvd25fZmllbGRzIjp7InNpemUiOiJYTCJ9LCJhY2Nlc3Nfa2V5X2lkIjoxfSwiaWF0IjoxNTg1ODAxOTAwfQ.FhkUuFU9OHguYNLZU0JNCqawhSytzdeU9xgnk8BeE20", "short_url": "https://s.mpaid.us/gici3", "qrcode_link": "https://mp-qrcodes.s3.amazonaws.com/stage/pos/httpssmpaidusgici3.png" }
{ "is_valid": false, "error_field": "currency", "error_message": "The POS link does not support the specified currency", "result": "failed" }
Request Samples
The payment response is sent via the payment response URL that you provided in your payment request.We send a JSON response in a POST parameter called response.On your payment response provided URL you will need to check for a post parameter called response and read the JSON payload contained within the post variable.
Two possible result codes of NOK for failure in the payment attempt and ACK for a successful payment.
Sample payment response
response {
"result": "ACK",
"token": "9b6352ab516a043cd33cf65cf8210af35bd4d3c9",
"transaction_id": "211PO",
"payment_id": "8ac7a4a074726760017472b283ce070f",
"amount": "50.33",
"currency": "USD",
"currency_symbol": "$",
"result_code": "000.100.110",
"result_description": "Request successfully processed in 'Merchant in Integrator Test Mode'",
"additional_info_text": {
"Type": "baju baru"
},
"additional_info_dropdown": {
"Size": "M"
},
"cart_items": "[{\"sku\":\"123\",\"name\":\"Blue Shirt XL\",\"qty\":1,\"unit_price\":11.2},{\"sku\":\"456\",\"name\":\"Black Short Pant XL\",\"qty\":2,\"unit_price\":22.4}]"
}
Create new message template for SMS and Email with this feature.
We support Credit Card, Direct Debit, Paypal, Apple Pay, Google Pay, Nedbank, etc. With mobipaid wallet in place, customer can pay quickly with payment options that has been saved.
You can create message template based on transaction type.
Create a new message template for the merchant.
Body Params
Field | Description |
---|---|
template_name
|
string
Message template name. Example : "Once-off payment request template". |
transaction_type
|
string
The transaction type which message template belongs to. Can only be filled with "once-off" or "scheduled". |
email_subject
|
string
The subject of message template. For example : "Payment due to Mad Decent". |
email_content
|
string
The content of email message template. |
sms_content
|
string
The content of SMS message template. |
default
|
boolean
Use "true" if you want to set this message template as default once-off/scheduled message template for this merchant. |
global_template
|
boolean
Use "true" if you want to set this message template available for other user under this merchant. Use "false" if you want message template can only be used by the owner. |
You can update the message template by using the same parameters from create a message template, but you have to add template_id to the body.
Required Header:
- Authorization
You can fetch a message template detail by using GET method with a template_id in the route parameter
Required Header:
- Authorization
You can delete a message template by using the DELETE method with a template_id in the route parameter.
Required Header:
- Authorization
You can get, create, edit and delete customer with this feature.
Create a new customer for the merchant.
Body Params
Field | Description |
---|---|
email
required with condition |
string
Customer's email. You must fill either email or mobile_no field. Example : "john@doe.com". |
mobile_no
required with condition |
string
Customer's mobile number. You must fill either email or mobile_no field. Example : "+1234567890". |
customer_group_id
|
string
Customer's group id. Example : "K1Z2J2Zl". |
salutation
|
string
Customer's salutation. Example : "Mr.". |
first_name
required |
string
Customer's first name. |
last_name
|
string
Customer's last name. |
description
|
string
Customer's specific description. |
country_iso
|
string
Customer's country ISO. Example : "DE". |
state
|
string
Customer's state. Example : "DE". |
city
|
string
Customer's city. Example : "Munchen". |
postal_code
|
string
Customer's postal code. Example : "12345". |
reference_number
|
string
Customer's reference number. Example : "12345". |
additional_value
|
json
Customer's additional value. Example : {"age": 20, "gender": "male"}. |
Request URL
https://live.mobipaid.io/v2/customersRequest Body
{ "email": "john@doe.com", "mobile_no": "+1234567890", "customer_group_id": "K1Z2J2Zl", "salutation": "Mr.", "first_name": "john", "last_name": "doe", "description": "customer john doe", "country_iso": "DE", "state": "Bayern", "city": "Munchen", "postal_code": "12345", "reference_number": "1234", "additional_value": {"age": 20, "gender": "male"} }
Examples
curl -X POST https://live.mobipaid.io/v2/customers \ -H "Content-Type: application/json" \ -H "Authorization: Bearer mp_test_A83ucDEekfzqOATsxfrj" \ --data '{ "email": "john@doe.com", "mobile_no": "+1234567890", "customer_group_id": "K1Z2J2Zl", "salutation": "Mr.", "first_name": "john", "last_name": "doe", "description": "customer john doe", "country_iso": "DE", "state": "Bayern", "city": "Munchen", "postal_code": "12345", "reference_number": "1234", "additional_value": {"age": 20, "gender": "male"} }'
import requests import json url = "https://live.mobipaid.io/v2/customers" payload = json.dumps( { "email": "john@doe.com", "mobile_no": "+1234567890", "customer_group_id": "K1Z2J2Zl", "salutation": "Mr.", "first_name": "john", "last_name": "doe", "description": "customer john doe", "country_iso": "DE", "state": "Bayern", "city": "Munchen", "postal_code": "12345", "reference_number": "1234", "additional_value": {"age": 20, "gender": "male"} } ) headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer mp_test_w3Lwv3CZIZzye4cYxxr0' } response = requests.request("POST", url, headers=headers, data = payload) print(response.text.encode('utf8'))
var request = require("request"); var options = { method: "POST", url: "https://live.mobipaid.io/v2/customers", headers: { "Content-Type": "application/json", "Authorization": "Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" }, body: JSON.stringify({ "email": "john@doe.com", "mobile_no": "+1234567890", "customer_group_id": "K1Z2J2Zl", "salutation": "Mr.", "first_name": "john", "last_name": "doe", "description": "customer john doe", "country_iso": "DE", "state": "Bayern", "city": "Munchen", "postal_code": "12345", "reference_number": "1234", "additional_value": {"age": 20, "gender": "male"} }) }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); });
$curl = curl_init(); $data = array( "email" => "john@doe.com", "mobile_no" => "+1234567890", "customer_group_id" => "K1Z2J2Zl", "salutation" => "Mr.", "first_name" => "john", "last_name" => "doe", "description" => "customer john doe", "country_iso" => "DE", "state" => "Bayern", "city" => "Munchen", "postal_code" => "12345", "reference_number" => "1234", "additional_value" => array("age" => 20, "gender" => "male") ); $data = json_encode($data); curl_setopt_array($curl, array( CURLOPT_URL => "https://live.mobipaid.io/v2/customers", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => $data, CURLOPT_HTTPHEADER => array( "Content-Type: application/json", "Authorization: Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
require "uri" require "net/http" require "json" url = URI("https://live.mobipaid.io/v2/customers") https = Net::HTTP.new(url.host, url.port); https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request["Authorization"] = "Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" request.body = { "email": "john@doe.com", "mobile_no": "+1234567890", "customer_group_id": "K1Z2J2Zl", "salutation": "Mr.", "first_name": "john", "last_name": "doe", "description": "customer john doe", "country_iso": "DE", "state": "Bayern", "city": "Munchen", "postal_code": "12345", "reference_number": "1234", "additional_value": {"age": 20, "gender": "male"} }.to_json response = https.request(request) puts response.read_body
Result Format
{ "result": "success", "customer_id": "2BD8rYXr", "mobile_no": "+1234567890", "email": "john@doe.com", "salutation": "Mr.", "first_name": "john", "last_name": "doe", "customer_group_id": "K1Z2J2Zl", "description": "customer john doe", "country_iso": "DE", "country_name": "Germany", "state": "Bayern", "city": "Munchen", "postal_code": "12345", "reference_number": "1234", "additional_value": { "age": 20, "gender": "male" } }
{ "is_valid": false, "error_field": "mobile_no", "error_message": "mobile_no already exists.", "result": "failed" }
Request Samples
You can update the customer by using the same parameters from create a customer, but you have to add customer_id to the body.
Required Header:
- Authorization
Request URL
https://live.mobipaid.io/v2/customersRequest Body
{ "customer_id": "j4nJ74Xa", "email": "john@doe.com", "mobile_no": "+1234567890", "customer_group_id": "K1Z2J2Zl", "salutation": "Mr.", "first_name": "john", "last_name": "doe", "description": "customer john doe", "country_iso": "DE", "state": "Bayern", "city": "Munchen", "postal_code": "12345", "reference_number": "1234", "additional_value": {"age": 20, "gender": "male"} }
Examples
curl -X POST https://live.mobipaid.io/v2/customers \ -H "Content-Type: application/json" \ -H "Authorization: Bearer mp_test_A83ucDEekfzqOATsxfrj" \ --data '{ "customer_id": "j4nJ74Xa", "email": "john@doe.com", "mobile_no": "+1234567890", "customer_group_id": "K1Z2J2Zl", "salutation": "Mr.", "first_name": "john", "last_name": "doe", "description": "customer john doe", "country_iso": "DE", "state": "Bayern", "city": "Munchen", "postal_code": "12345", "reference_number": "1234", "additional_value": {"age": 20, "gender": "male"} }'
import requests import json url = "https://live.mobipaid.io/v2/customers" payload = json.dumps( { "customer_id": "j4nJ74Xa", "email": "john@doe.com", "mobile_no": "+1234567890", "customer_group_id": "K1Z2J2Zl", "salutation": "Mr.", "first_name": "john", "last_name": "doe", "description": "customer john doe", "country_iso": "DE", "state": "Bayern", "city": "Munchen", "postal_code": "12345", "reference_number": "1234", "additional_value": {"age": 20, "gender": "male"} } ) headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer mp_test_w3Lwv3CZIZzye4cYxxr0' } response = requests.request("POST", url, headers=headers, data = payload) print(response.text.encode('utf8'))
var request = require("request"); var options = { method: "POST", url: "https://live.mobipaid.io/v2/customers", headers: { "Content-Type": "application/json", "Authorization": "Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" }, body: JSON.stringify({ "customer_id": "j4nJ74Xa", "email": "john@doe.com", "mobile_no": "+1234567890", "customer_group_id": "K1Z2J2Zl", "salutation": "Mr.", "first_name": "john", "last_name": "doe", "description": "customer john doe", "country_iso": "DE", "state": "Bayern", "city": "Munchen", "postal_code": "12345", "reference_number": "1234", "additional_value": {"age": 20, "gender": "male"} }) }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); });
$curl = curl_init(); $data = array( "customer_id" => "j4nJ74Xa", "email" => "john@doe.com", "mobile_no" => "+1234567890", "customer_group_id" => "K1Z2J2Zl", "salutation" => "Mr.", "first_name" => "john", "last_name" => "doe", "description" => "customer john doe", "country_iso" => "DE", "state" => "Bayern", "city" => "Munchen", "postal_code" => "12345", "reference_number" => "1234", "additional_value" => array("age" => 20, "gender" => "male") ); $data = json_encode($data); curl_setopt_array($curl, array( CURLOPT_URL => "https://live.mobipaid.io/v2/customers", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => $data, CURLOPT_HTTPHEADER => array( "Content-Type: application/json", "Authorization: Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
require "uri" require "net/http" require "json" url = URI("https://live.mobipaid.io/v2/customers") https = Net::HTTP.new(url.host, url.port); https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request["Authorization"] = "Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" request.body = { "customer_id": "j4nJ74Xa", "email": "john@doe.com", "mobile_no": "+1234567890", "customer_group_id": "K1Z2J2Zl", "salutation": "Mr.", "first_name": "john", "last_name": "doe", "description": "customer john doe", "country_iso": "DE", "state": "Bayern", "city": "Munchen", "postal_code": "12345", "reference_number": "1234", "additional_value": {"age": 20, "gender": "male"} }.to_json response = https.request(request) puts response.read_body
Result Format
{ "result": "success", "customer_id": "2BD8rYXr", "mobile_no": "+1234567890", "email": "john@doe.com", "salutation": "Mr.", "first_name": "john", "last_name": "doe", "customer_group_id": "K1Z2J2Zl", "description": "customer john doe", "country_iso": "DE", "country_name": "Germany", "state": "Bayern", "city": "Munchen", "postal_code": "12345", "reference_number": "1234", "additional_value": { "age": 20, "gender": "male" } }
{ "is_valid": false, "error_field": "mobile_no", "error_message": "mobile_no already exists.", "result": "failed" }
Request Samples
You can fetch a customer detail by using GET method with a customer_id in the route parameter
Required Header:
- Authorization
Request URL
https://live.mobipaid.io/v2/customers/{customer_id}Examples
curl -X GET https://live.mobipaid.io/v2/customers/{customer_id} \ -H "Content-Type: application/json" \ -H "Authorization: Bearer mp_test_w3Lwv3CZIZzye4cYxxr0"
import requests import json url = "https://live.mobipaid.io/v2/customers?page=5&limit=1" payload = {} headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer mp_test_w3Lwv3CZIZzye4cYxxr0' } response = requests.request("GET", url, headers=headers, data = payload) print(response.text.encode('utf8'))
var request = require("request"); var options = { method: "GET", url: "https://live.mobipaid.io/v2/customers?page=5&limit=1", headers: { "Content-Type": "application/json", "Authorization": "Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" }, }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); });
$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://live.mobipaid.io/v2/customers?page=5&limit=1", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "Content-Type: application/json", "Authorization: Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
require "uri" require "net/http" require "json" url = URI("https://live.mobipaid.io/v2/customers?page=5&limit=1") https = Net::HTTP.new(url.host, url.port); https.use_ssl = true request = Net::HTTP::Get.new(url) request["Content-Type"] = "application/json" request["Authorization"] = "Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" response = https.request(request) puts response.read_body
Result Format
{ "result": "success", "limit": 10, "page": 1, "page_count": 1, "total_count": 1, "customers": [ { "customer_id": "2BD8rYXr", "mobile_no": "+1234567890", "email": "john@doe.com", "salutation": "Mr.", "first_name": "john", "last_name": "doe", "customer_group_id": "K1Z2J2Zl", "description": "customer john doe", "country_iso": "DE", "country_name": "Germany", "state": "Bayern", "city": "Munchen", "postal_code": "12345", "reference_number": "1234", "additional_value": { "age": 20, "gender": "male" } } ] }
{ "is_valid": false, "error_field": "customer_id", "error_message": "customer_id is not found.", "result": "failed" }
Request Samples
You can delete a customer by using the DELETE method with a customer_id in the route parameter.
Required Header:
- Authorization
Request URL
https://live.mobipaid.io/v2/customers/{customer_id}Examples
curl -X DELETE https://live.mobipaid.io/v2/customers/j4nJ74Xa \ -H "Content-Type: application/json" \ -H "Authorization: Bearer mp_test_w3Lwv3CZIZzye4cYxxr0"
import requests import json url = "https://live.mobipaid.io/v2/customers/j4nJ74Xa" payload = {} headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer mp_test_w3Lwv3CZIZzye4cYxxr0' } response = requests.request("DELETE", url, headers=headers, data = payload) print(response.text.encode('utf8'))
var request = require("request"); var options = { method: "DELETE", url: "https://live.mobipaid.io/v2/customers/j4nJ74Xa", headers: { "Content-Type": "application/json", "Authorization": "Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" }, }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); });
$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://live.mobipaid.io/v2/customers/j4nJ74Xa", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "DELETE", CURLOPT_HTTPHEADER => array( "Content-Type: application/json", "Authorization: Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
require "uri" require "net/http" require "json" url = URI("https://live.mobipaid.io/v2/customers/j4nJ74Xa") https = Net::HTTP.new(url.host, url.port); https.use_ssl = true request = Net::HTTP::Delete.new(url) request["Content-Type"] = "application/json" request["Authorization"] = "Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" response = https.request(request) puts response.read_body
Result Format
{ "result": "success", "customer_id": "2BD8rYXr" }
{ "is_valid": false, "error_field": "customer_id", "error_message": "customer_id is not found.", "result": "failed" }
Request Samples
You can get, create, edit and delete customer group with this feature.
Create a new customer group for the customer.
Body Params
Field | Description |
---|---|
group_name
required |
string
Customer group's name. |
description
|
string
Customer group's specific description. |
Request URL
https://live.mobipaid.io/v2/customers/groupsRequest Body
{ "group_name" : "Card", "description" : "group for card" }
Examples
curl -X POST https://live.mobipaid.io/v2/customers/groups \ -H "Content-Type: application/json" \ -H "Authorization: Bearer mp_test_A83ucDEekfzqOATsxfrj" \ --data '{ "group_name" : "Card", "description" : "group for card" }'
import requests import json url = "https://live.mobipaid.io/v2/customers/groups" payload = json.dumps( { "group_name" : "Card", "description" : "group for card" } ) headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer mp_test_w3Lwv3CZIZzye4cYxxr0' } response = requests.request("POST", url, headers=headers, data = payload) print(response.text.encode('utf8'))
var request = require("request"); var options = { method: "POST", url: "https://live.mobipaid.io/v2/customers/groups", headers: { "Content-Type": "application/json", "Authorization": "Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" }, body: JSON.stringify({ "group_name" : "Card", "description" : "group for card" }) }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); });
$curl = curl_init(); $data = array( "group_name" => "Card", "description" => "group for card" ); $data = json_encode($data); curl_setopt_array($curl, array( CURLOPT_URL => "https://live.mobipaid.io/v2/customers/groups", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => $data, CURLOPT_HTTPHEADER => array( "Content-Type: application/json", "Authorization: Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
require "uri" require "net/http" require "json" url = URI("https://live.mobipaid.io/v2/customers/groups") https = Net::HTTP.new(url.host, url.port); https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request["Authorization"] = "Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" request.body = { "group_name" : "Card", "description" : "group for card" }.to_json response = https.request(request) puts response.read_body
Result Format
{ "result": "success", "customer_group_id": "K1Z2J2Zl", "group_name": "card", "description": "group for card" }
{ "is_valid": false, "error_field": "group_name", "error_message": "group_name already exists.", "result": "failed" }
Request Samples
You can update the customer group by using the same parameters from create a customer group, but you have to add customer_group_id to the body.
Required Header:
- Authorization
Request URL
https://live.mobipaid.io/v2/customers/groupsRequest Body
{ "customer_group_id" : "K1Z2J2Zl", "group_name" : "Card", "description" : "group for card" }
Examples
curl -X POST https://live.mobipaid.io/v2/customers/groups \ -H "Content-Type: application/json" \ -H "Authorization: Bearer mp_test_A83ucDEekfzqOATsxfrj" \ --data '{ "customer_group_id" : "K1Z2J2Zl", "group_name" : "Card", "description" : "group for card" }'
import requests import json url = "https://live.mobipaid.io/v2/customers/groups" payload = json.dumps( { "customer_group_id" : "K1Z2J2Zl", "group_name" : "Card", "description" : "group for card" } ) headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer mp_test_w3Lwv3CZIZzye4cYxxr0' } response = requests.request("POST", url, headers=headers, data = payload) print(response.text.encode('utf8'))
var request = require("request"); var options = { method: "POST", url: "https://live.mobipaid.io/v2/customers/groups", headers: { "Content-Type": "application/json", "Authorization": "Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" }, body: JSON.stringify({ "customer_group_id" : "K1Z2J2Zl", "group_name" : "Card", "description" : "group for card" }) }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); });
$curl = curl_init(); $data = array( "customer_group_id" => "K1Z2J2Zl", "group_name" => "Card", "description" => "group for card" ); $data = json_encode($data); curl_setopt_array($curl, array( CURLOPT_URL => "https://live.mobipaid.io/v2/customers/groups", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => $data, CURLOPT_HTTPHEADER => array( "Content-Type: application/json", "Authorization: Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
require "uri" require "net/http" require "json" url = URI("https://live.mobipaid.io/v2/customers/groups") https = Net::HTTP.new(url.host, url.port); https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request["Authorization"] = "Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" request.body = { "customer_group_id" : "K1Z2J2Zl", "group_name" : "Card", "description" : "group for card" }.to_json response = https.request(request) puts response.read_body
Result Format
{ "result": "success", "customer_group_id": "K1Z2J2Zl", "group_name": "card", "description": "group for card" }
{ "is_valid": false, "error_field": "group_name", "error_message": "group_name already exists.", "result": "failed" }
Request Samples
You can fetch a customer group detail by using GET method with a customer_group_id in the route parameter
Required Header:
- Authorization
Request URL
https://live.mobipaid.io/v2/customers/groups/{customer_group_id}Examples
curl -X GET https://live.mobipaid.io/v2/customers/groups/{customer_group_id} \ -H "Content-Type: application/json" \ -H "Authorization: Bearer mp_test_w3Lwv3CZIZzye4cYxxr0"
import requests import json url = "https://live.mobipaid.io/v2/customers/groups?page=5&limit=1" payload = {} headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer mp_test_w3Lwv3CZIZzye4cYxxr0' } response = requests.request("GET", url, headers=headers, data = payload) print(response.text.encode('utf8'))
var request = require("request"); var options = { method: "GET", url: "https://live.mobipaid.io/v2/customers/groups?page=5&limit=1", headers: { "Content-Type": "application/json", "Authorization": "Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" }, }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); });
$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://live.mobipaid.io/v2/customers/groups?page=5&limit=1", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "Content-Type: application/json", "Authorization: Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
require "uri" require "net/http" require "json" url = URI("https://live.mobipaid.io/v2/customers/groups?page=5&limit=1") https = Net::HTTP.new(url.host, url.port); https.use_ssl = true request = Net::HTTP::Get.new(url) request["Content-Type"] = "application/json" request["Authorization"] = "Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" response = https.request(request) puts response.read_body
Result Format
{ "result": "success", "limit": 10, "page": 1, "page_count": 1, "total_count": 1, "customer_groups": [ { "customer_group_id": "K1Z2J2Zl", "group_name": "card", "description": "group for card" } ] }
{ "is_valid": false, "error_field": "customer_group_id", "error_message": "customer_group_id is not found.", "result": "failed" }
Request Samples
You can delete a customer group by using the DELETE method with a customer_group_id in the route parameter.
Required Header:
- Authorization
Request URL
https://live.mobipaid.io/v2/customers/groups/{customer_group_id}Examples
curl -X DELETE https://live.mobipaid.io/v2/customers/groups/K1Z2J2Zl \ -H "Content-Type: application/json" \ -H "Authorization: Bearer mp_test_w3Lwv3CZIZzye4cYxxr0"
import requests import json url = "https://live.mobipaid.io/v2/customers/groups/K1Z2J2Zl" payload = {} headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer mp_test_w3Lwv3CZIZzye4cYxxr0' } response = requests.request("DELETE", url, headers=headers, data = payload) print(response.text.encode('utf8'))
var request = require("request"); var options = { method: "DELETE", url: "https://live.mobipaid.io/v2/customers/groups/K1Z2J2Zl", headers: { "Content-Type": "application/json", "Authorization": "Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" }, }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); });
$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://live.mobipaid.io/v2/customers/groups/K1Z2J2Zl", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "DELETE", CURLOPT_HTTPHEADER => array( "Content-Type: application/json", "Authorization: Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
require "uri" require "net/http" require "json" url = URI("https://live.mobipaid.io/v2/customers/groups/K1Z2J2Zl") https = Net::HTTP.new(url.host, url.port); https.use_ssl = true request = Net::HTTP::Delete.new(url) request["Content-Type"] = "application/json" request["Authorization"] = "Bearer mp_test_w3Lwv3CZIZzye4cYxxr0" response = https.request(request) puts response.read_body
Result Format
{ "result": "success", "customer_group_id": "K1Z2J2Zl" }
{ "is_valid": false, "error_field": "customer_group_id", "error_message": "customer_group_id is not found.", "result": "failed" }