Update an embedded payment request (amount and/or rewards) before payment initiation
curl --request PATCH \
--url https://core.quidkey.com/api/v1/embedded/payment-requests \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"merchant_id": "550e8400-e29b-41d4-a716-446655440000",
"payment_token": "ptok_abcd1234",
"amount": 1530,
"rewards": {
"extra_rewards": 150,
"total_rewards": 300,
"description": "Updated loyalty bonus"
}
}
'import requests
url = "https://core.quidkey.com/api/v1/embedded/payment-requests"
payload = {
"merchant_id": "550e8400-e29b-41d4-a716-446655440000",
"payment_token": "ptok_abcd1234",
"amount": 1530,
"rewards": {
"extra_rewards": 150,
"total_rewards": 300,
"description": "Updated loyalty bonus"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
merchant_id: '550e8400-e29b-41d4-a716-446655440000',
payment_token: 'ptok_abcd1234',
amount: 1530,
rewards: {extra_rewards: 150, total_rewards: 300, description: 'Updated loyalty bonus'}
})
};
fetch('https://core.quidkey.com/api/v1/embedded/payment-requests', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://core.quidkey.com/api/v1/embedded/payment-requests",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'merchant_id' => '550e8400-e29b-41d4-a716-446655440000',
'payment_token' => 'ptok_abcd1234',
'amount' => 1530,
'rewards' => [
'extra_rewards' => 150,
'total_rewards' => 300,
'description' => 'Updated loyalty bonus'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://core.quidkey.com/api/v1/embedded/payment-requests"
payload := strings.NewReader("{\n \"merchant_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"payment_token\": \"ptok_abcd1234\",\n \"amount\": 1530,\n \"rewards\": {\n \"extra_rewards\": 150,\n \"total_rewards\": 300,\n \"description\": \"Updated loyalty bonus\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://core.quidkey.com/api/v1/embedded/payment-requests")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"merchant_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"payment_token\": \"ptok_abcd1234\",\n \"amount\": 1530,\n \"rewards\": {\n \"extra_rewards\": 150,\n \"total_rewards\": 300,\n \"description\": \"Updated loyalty bonus\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://core.quidkey.com/api/v1/embedded/payment-requests")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"merchant_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"payment_token\": \"ptok_abcd1234\",\n \"amount\": 1530,\n \"rewards\": {\n \"extra_rewards\": 150,\n \"total_rewards\": 300,\n \"description\": \"Updated loyalty bonus\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"payment_token": "ptok_abcd1234",
"amount": 1530,
"rewards": {
"extra_rewards": 150,
"total_rewards": 300,
"description": "Updated loyalty bonus"
},
"expires_in": 750
}
}{
"success": false,
"error": {
"message": "Invalid input provided"
}
}{
"success": false,
"error": {
"message": "Invalid input provided"
}
}Embedded Payment Flow
Update an embedded payment request (amount and/or rewards) before payment initiation
Update an embedded payment request (amount and/or rewards) before payment initiation
PATCH
/
api
/
v1
/
embedded
/
payment-requests
Update an embedded payment request (amount and/or rewards) before payment initiation
curl --request PATCH \
--url https://core.quidkey.com/api/v1/embedded/payment-requests \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"merchant_id": "550e8400-e29b-41d4-a716-446655440000",
"payment_token": "ptok_abcd1234",
"amount": 1530,
"rewards": {
"extra_rewards": 150,
"total_rewards": 300,
"description": "Updated loyalty bonus"
}
}
'import requests
url = "https://core.quidkey.com/api/v1/embedded/payment-requests"
payload = {
"merchant_id": "550e8400-e29b-41d4-a716-446655440000",
"payment_token": "ptok_abcd1234",
"amount": 1530,
"rewards": {
"extra_rewards": 150,
"total_rewards": 300,
"description": "Updated loyalty bonus"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
merchant_id: '550e8400-e29b-41d4-a716-446655440000',
payment_token: 'ptok_abcd1234',
amount: 1530,
rewards: {extra_rewards: 150, total_rewards: 300, description: 'Updated loyalty bonus'}
})
};
fetch('https://core.quidkey.com/api/v1/embedded/payment-requests', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://core.quidkey.com/api/v1/embedded/payment-requests",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'merchant_id' => '550e8400-e29b-41d4-a716-446655440000',
'payment_token' => 'ptok_abcd1234',
'amount' => 1530,
'rewards' => [
'extra_rewards' => 150,
'total_rewards' => 300,
'description' => 'Updated loyalty bonus'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://core.quidkey.com/api/v1/embedded/payment-requests"
payload := strings.NewReader("{\n \"merchant_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"payment_token\": \"ptok_abcd1234\",\n \"amount\": 1530,\n \"rewards\": {\n \"extra_rewards\": 150,\n \"total_rewards\": 300,\n \"description\": \"Updated loyalty bonus\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://core.quidkey.com/api/v1/embedded/payment-requests")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"merchant_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"payment_token\": \"ptok_abcd1234\",\n \"amount\": 1530,\n \"rewards\": {\n \"extra_rewards\": 150,\n \"total_rewards\": 300,\n \"description\": \"Updated loyalty bonus\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://core.quidkey.com/api/v1/embedded/payment-requests")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"merchant_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"payment_token\": \"ptok_abcd1234\",\n \"amount\": 1530,\n \"rewards\": {\n \"extra_rewards\": 150,\n \"total_rewards\": 300,\n \"description\": \"Updated loyalty bonus\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"payment_token": "ptok_abcd1234",
"amount": 1530,
"rewards": {
"extra_rewards": 150,
"total_rewards": 300,
"description": "Updated loyalty bonus"
},
"expires_in": 750
}
}{
"success": false,
"error": {
"message": "Invalid input provided"
}
}{
"success": false,
"error": {
"message": "Invalid input provided"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Request body
Payment token identifying the request to update
Example:
"ptok_abcd1234"
Merchant ID. Defaults to the logged-in merchant if not provided. Required for admin tokens.
Example:
"550e8400-e29b-41d4-a716-446655440000"
Minor-unit amount (e.g. cents)
Required range:
x >= 1Example:
1530
Show child attributes
Show child attributes
Create a payment request and return a payment_token for iframe flowInitiate a payment for an embedded flow using payment_token (query or body) and selected bank
⌘I