Create Payment Link
code examples curl request post \\ \ url https //api pay monoova com/v1/api/payment links \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{ "amount" 100 5, "currency" "aud" }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "amount" 100 5, "currency" "aud" }); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("https //api pay monoova com/v1/api/payment links", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "json" require "net/http" url = uri("https //api pay monoova com/v1/api/payment links") https = net http new(url host, url port) https use ssl = true request = net http post new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request body = json dump({ "amount" 100 5, "currency" "aud" }) response = https request(request) puts response read body import requests import json url = "https //api pay monoova com/v1/api/payment links" payload = json dumps({ "amount" 100 5, "currency" "aud" }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // payment link successfully created { "merchantreference" "ref 123456", "paymenturl" "https //payment example com/pay/ref 123456", "expiry" "2026 05 30t12 00 00z" }// validation error { "type" "https //tools ietf org/html/rfc7231#section 6 5 1", "title" "one or more validation errors occurred ", "status" 400, "errors" "{\\"amount\\" \[\\"'amount' must be greater than 0 \\"],\\"currency\\" \[\\"currency must be one of aud, usd, eur, gbp, nzd \\"]}" }// missing or invalid bearer token { "type" "https //tools ietf org/html/rfc7231#section 6 5 1", "title" "problem details", "status" 400, "detail" "bearer token is required " }// server error { "type" "https //tools ietf org/html/rfc7231#section 6 5 1", "title" "problem details", "status" 400, "detail" "bearer token is required " }