Skip to main content
POST
/
payment_requests
/
{payment_request_id}
/
confirm
Confirm a payment request
curl --request POST \
  --url https://api.withacclaim.com/v1/payment_requests/{payment_request_id}/confirm \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "description": "Updated premium payment for policy #POL-2025-001",
  "reference": "ORD-2025-002",
  "amount": 20000,
  "currency": "USD",
  "requires_tokenization": true,
  "allows_tokenization": true,
  "expires_at": "2025-12-31T23:59:59Z",
  "payer_id": "pyr_AbC123XyZ",
  "payment_method_id": "pm_AbC123XyZ",
  "payment_method": {},
  "ip_address": "192.168.1.1",
  "user_agent": "Mozilla/5.0...",
  "metadata": {
    "custom_field": "value",
    "source": "api"
  }
}
'
import requests

url = "https://api.withacclaim.com/v1/payment_requests/{payment_request_id}/confirm"

payload = {
"description": "Updated premium payment for policy #POL-2025-001",
"reference": "ORD-2025-002",
"amount": 20000,
"currency": "USD",
"requires_tokenization": True,
"allows_tokenization": True,
"expires_at": "2025-12-31T23:59:59Z",
"payer_id": "pyr_AbC123XyZ",
"payment_method_id": "pm_AbC123XyZ",
"payment_method": {},
"ip_address": "192.168.1.1",
"user_agent": "Mozilla/5.0...",
"metadata": {
"custom_field": "value",
"source": "api"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: 'Updated premium payment for policy #POL-2025-001',
reference: 'ORD-2025-002',
amount: 20000,
currency: 'USD',
requires_tokenization: true,
allows_tokenization: true,
expires_at: '2025-12-31T23:59:59Z',
payer_id: 'pyr_AbC123XyZ',
payment_method_id: 'pm_AbC123XyZ',
payment_method: {},
ip_address: '192.168.1.1',
user_agent: 'Mozilla/5.0...',
metadata: {custom_field: 'value', source: 'api'}
})
};

fetch('https://api.withacclaim.com/v1/payment_requests/{payment_request_id}/confirm', 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://api.withacclaim.com/v1/payment_requests/{payment_request_id}/confirm",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'description' => 'Updated premium payment for policy #POL-2025-001',
'reference' => 'ORD-2025-002',
'amount' => 20000,
'currency' => 'USD',
'requires_tokenization' => true,
'allows_tokenization' => true,
'expires_at' => '2025-12-31T23:59:59Z',
'payer_id' => 'pyr_AbC123XyZ',
'payment_method_id' => 'pm_AbC123XyZ',
'payment_method' => [

],
'ip_address' => '192.168.1.1',
'user_agent' => 'Mozilla/5.0...',
'metadata' => [
'custom_field' => 'value',
'source' => 'api'
]
]),
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://api.withacclaim.com/v1/payment_requests/{payment_request_id}/confirm"

payload := strings.NewReader("{\n \"description\": \"Updated premium payment for policy #POL-2025-001\",\n \"reference\": \"ORD-2025-002\",\n \"amount\": 20000,\n \"currency\": \"USD\",\n \"requires_tokenization\": true,\n \"allows_tokenization\": true,\n \"expires_at\": \"2025-12-31T23:59:59Z\",\n \"payer_id\": \"pyr_AbC123XyZ\",\n \"payment_method_id\": \"pm_AbC123XyZ\",\n \"payment_method\": {},\n \"ip_address\": \"192.168.1.1\",\n \"user_agent\": \"Mozilla/5.0...\",\n \"metadata\": {\n \"custom_field\": \"value\",\n \"source\": \"api\"\n }\n}")

req, _ := http.NewRequest("POST", 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.post("https://api.withacclaim.com/v1/payment_requests/{payment_request_id}/confirm")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Updated premium payment for policy #POL-2025-001\",\n \"reference\": \"ORD-2025-002\",\n \"amount\": 20000,\n \"currency\": \"USD\",\n \"requires_tokenization\": true,\n \"allows_tokenization\": true,\n \"expires_at\": \"2025-12-31T23:59:59Z\",\n \"payer_id\": \"pyr_AbC123XyZ\",\n \"payment_method_id\": \"pm_AbC123XyZ\",\n \"payment_method\": {},\n \"ip_address\": \"192.168.1.1\",\n \"user_agent\": \"Mozilla/5.0...\",\n \"metadata\": {\n \"custom_field\": \"value\",\n \"source\": \"api\"\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.withacclaim.com/v1/payment_requests/{payment_request_id}/confirm")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"Updated premium payment for policy #POL-2025-001\",\n \"reference\": \"ORD-2025-002\",\n \"amount\": 20000,\n \"currency\": \"USD\",\n \"requires_tokenization\": true,\n \"allows_tokenization\": true,\n \"expires_at\": \"2025-12-31T23:59:59Z\",\n \"payer_id\": \"pyr_AbC123XyZ\",\n \"payment_method_id\": \"pm_AbC123XyZ\",\n \"payment_method\": {},\n \"ip_address\": \"192.168.1.1\",\n \"user_agent\": \"Mozilla/5.0...\",\n \"metadata\": {\n \"custom_field\": \"value\",\n \"source\": \"api\"\n }\n}"

response = http.request(request)
puts response.read_body
{
  "id": "pat_AbC123XyZ",
  "payment_request_id": "prq_Def456UvW",
  "payment_id": "pay_GhI789JkL",
  "payment": {
    "id": "pay_AbC123XyZ",
    "payment_request_id": "prq_Def456UvW",
    "payer_id": "pyr_GhI789JkL",
    "status": "Succeeded",
    "amount": 125000,
    "currency": "USD",
    "reference": "ORD-2025-001",
    "description": "Premium payment for policy #POL-2025-001",
    "processor_transaction_id": "txn_processor_123",
    "created_at": "2025-10-08T18:20:31Z",
    "updated_at": "2025-10-08T18:25:00Z"
  },
  "payer_id": "pyr_GhI789JkL",
  "status": "Succeeded",
  "amount": 125000,
  "currency": "USD",
  "reference": "ORD-2025-001",
  "description": "Premium payment for policy #POL-2025-001",
  "processor_transaction_id": "txn_processor_123",
  "failure_code": "card_declined",
  "failure_message": "Card was declined",
  "created_at": "2025-10-08T18:20:31Z",
  "updated_at": "2025-10-08T18:25:00Z"
}
{
"error": {
"code": "invalid_request",
"message": "Missing required field: amount",
"details": {},
"request_id": "req_7lYt4o2x"
}
}
{
"error": {
"code": "invalid_request",
"message": "Missing required field: amount",
"details": {},
"request_id": "req_7lYt4o2x"
}
}
{
"error": {
"code": "invalid_request",
"message": "Missing required field: amount",
"details": {},
"request_id": "req_7lYt4o2x"
}
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

payment_request_id
string
required

ID of the payment request.

Body

application/json
description
string | null

Description of the payment request

Maximum string length: 255
Example:

"Updated premium payment for policy #POL-2025-001"

reference
string | null

Client-supplied identifier for reconciliation

Maximum string length: 255
Example:

"ORD-2025-002"

amount
integer | null

Amount in smallest currency unit (must provide both amount and currency)

Required range: x >= 1
Example:

20000

currency
string | null

ISO 4217 currency code (3 uppercase letters, must provide both amount and currency)

Required string length: 3
Pattern: ^[A-Z]{3}$
Example:

"USD"

requires_tokenization
boolean

Whether this payment request requires tokenization of the payment method

allows_tokenization
boolean

Whether this payment request allows tokenization of the payment method

expires_at
string<date-time> | null

When the payment request expires (ISO 8601 date-time string)

Example:

"2025-12-31T23:59:59Z"

payer_id
string | null

ID of the payer to associate with this payment request

Example:

"pyr_AbC123XyZ"

payment_method_id
string | null

ID of an existing payment method to use (must belong to the payer if payer_id is provided)

Maximum string length: 255
Example:

"pm_AbC123XyZ"

payment_method
object | null

Payment method data (e.g., payment_token, payment_method type)

ip_address
string | null

IP address of the client making the payment

Example:

"192.168.1.1"

user_agent
string | null

User agent string of the client making the payment

Example:

"Mozilla/5.0..."

metadata
object | null

Optional metadata as key-value pairs

Example:
{ "custom_field": "value", "source": "api" }

Response

Payment attempt created (includes nested payment when the charge succeeded).

id
string
Example:

"pat_AbC123XyZ"

payment_request_id
string

ID of the payment request this attempt belongs to

Example:

"prq_Def456UvW"

payment_id
string | null

ID of the received payment when the attempt succeeded

Example:

"pay_GhI789JkL"

payment
object | null

Received payment when the attempt succeeded

payer_id
string

ID of the payer for this payment attempt

Example:

"pyr_GhI789JkL"

status
enum<string>

Current status of the payment attempt

Available options:
Pending,
Processing,
Succeeded,
Failed
Example:

"Succeeded"

amount
integer

Amount in smallest currency unit

Example:

125000

currency
string

ISO 4217 currency code

Example:

"USD"

reference
string

Client-supplied identifier

Example:

"ORD-2025-001"

description
string | null
Example:

"Premium payment for policy #POL-2025-001"

processor_transaction_id
string | null

Processor transaction ID from the payment processor

Example:

"txn_processor_123"

failure_code
string | null

Error code if the attempt failed

Example:

"card_declined"

failure_message
string | null

Human-readable error message if the attempt failed

Example:

"Card was declined"

created_at
string<date-time>
Example:

"2025-10-08T18:20:31Z"

updated_at
string<date-time>
Example:

"2025-10-08T18:25:00Z"

Last modified on June 14, 2026