Skip to main content
POST
/
v1
/
gateway
/
payment
/
{id}
/
confirm
Confirm a payment
curl --request POST \
  --url https://api.pay.walletconnect.com/v1/gateway/payment/{id}/confirm \
  --header 'Api-Key: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "collectedData": {
    "fields": [
      {
        "id": "fullName",
        "value": "John Smith"
      },
      {
        "id": "dob",
        "value": "1990-01-01"
      },
      {
        "id": "tosConfirmed",
        "value": "true"
      },
      {
        "id": "pobCountry",
        "value": "US"
      },
      {
        "id": "pobAddress",
        "value": "New York, NY"
      }
    ]
  },
  "excludeFromRelayer": null,
  "optionId": "opt_123",
  "results": [
    {
      "data": [
        "0x123"
      ],
      "type": "walletRpc"
    }
  ]
}
'
import requests

url = "https://api.pay.walletconnect.com/v1/gateway/payment/{id}/confirm"

payload = {
"collectedData": { "fields": [
{
"id": "fullName",
"value": "John Smith"
},
{
"id": "dob",
"value": "1990-01-01"
},
{
"id": "tosConfirmed",
"value": "true"
},
{
"id": "pobCountry",
"value": "US"
},
{
"id": "pobAddress",
"value": "New York, NY"
}
] },
"excludeFromRelayer": None,
"optionId": "opt_123",
"results": [
{
"data": ["0x123"],
"type": "walletRpc"
}
]
}
headers = {
"Api-Key": "<api-key>",
"Content-Type": "application/json"
}

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

print(response.text)
const options = {
method: 'POST',
headers: {'Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
collectedData: {
fields: [
{id: 'fullName', value: 'John Smith'},
{id: 'dob', value: '1990-01-01'},
{id: 'tosConfirmed', value: 'true'},
{id: 'pobCountry', value: 'US'},
{id: 'pobAddress', value: 'New York, NY'}
]
},
excludeFromRelayer: null,
optionId: 'opt_123',
results: [{data: ['0x123'], type: 'walletRpc'}]
})
};

fetch('https://api.pay.walletconnect.com/v1/gateway/payment/{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.pay.walletconnect.com/v1/gateway/payment/{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([
'collectedData' => [
'fields' => [
[
'id' => 'fullName',
'value' => 'John Smith'
],
[
'id' => 'dob',
'value' => '1990-01-01'
],
[
'id' => 'tosConfirmed',
'value' => 'true'
],
[
'id' => 'pobCountry',
'value' => 'US'
],
[
'id' => 'pobAddress',
'value' => 'New York, NY'
]
]
],
'excludeFromRelayer' => null,
'optionId' => 'opt_123',
'results' => [
[
'data' => [
'0x123'
],
'type' => 'walletRpc'
]
]
]),
CURLOPT_HTTPHEADER => [
"Api-Key: <api-key>",
"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.pay.walletconnect.com/v1/gateway/payment/{id}/confirm"

payload := strings.NewReader("{\n \"collectedData\": {\n \"fields\": [\n {\n \"id\": \"fullName\",\n \"value\": \"John Smith\"\n },\n {\n \"id\": \"dob\",\n \"value\": \"1990-01-01\"\n },\n {\n \"id\": \"tosConfirmed\",\n \"value\": \"true\"\n },\n {\n \"id\": \"pobCountry\",\n \"value\": \"US\"\n },\n {\n \"id\": \"pobAddress\",\n \"value\": \"New York, NY\"\n }\n ]\n },\n \"excludeFromRelayer\": null,\n \"optionId\": \"opt_123\",\n \"results\": [\n {\n \"data\": [\n \"0x123\"\n ],\n \"type\": \"walletRpc\"\n }\n ]\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Api-Key", "<api-key>")
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.pay.walletconnect.com/v1/gateway/payment/{id}/confirm")
.header("Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"collectedData\": {\n \"fields\": [\n {\n \"id\": \"fullName\",\n \"value\": \"John Smith\"\n },\n {\n \"id\": \"dob\",\n \"value\": \"1990-01-01\"\n },\n {\n \"id\": \"tosConfirmed\",\n \"value\": \"true\"\n },\n {\n \"id\": \"pobCountry\",\n \"value\": \"US\"\n },\n {\n \"id\": \"pobAddress\",\n \"value\": \"New York, NY\"\n }\n ]\n },\n \"excludeFromRelayer\": null,\n \"optionId\": \"opt_123\",\n \"results\": [\n {\n \"data\": [\n \"0x123\"\n ],\n \"type\": \"walletRpc\"\n }\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.pay.walletconnect.com/v1/gateway/payment/{id}/confirm")

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

request = Net::HTTP::Post.new(url)
request["Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"collectedData\": {\n \"fields\": [\n {\n \"id\": \"fullName\",\n \"value\": \"John Smith\"\n },\n {\n \"id\": \"dob\",\n \"value\": \"1990-01-01\"\n },\n {\n \"id\": \"tosConfirmed\",\n \"value\": \"true\"\n },\n {\n \"id\": \"pobCountry\",\n \"value\": \"US\"\n },\n {\n \"id\": \"pobAddress\",\n \"value\": \"New York, NY\"\n }\n ]\n },\n \"excludeFromRelayer\": null,\n \"optionId\": \"opt_123\",\n \"results\": [\n {\n \"data\": [\n \"0x123\"\n ],\n \"type\": \"walletRpc\"\n }\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "info": null,
  "isFinal": true,
  "pollInMs": null,
  "status": "succeeded"
}
{
"message": "<string>"
}
{
"message": "<string>"
}
{
"message": "<string>"
}
{
"message": "<string>"
}

Authorizations

Api-Key
string
header
required

Headers

Api-Key
string | null
App-Id
string | null
Client-Id
string | null
WCP-Version
string | null
Sdk-Name
string | null
Sdk-Version
string | null
Sdk-Platform
string | null

Path Parameters

id
string
required

Payment ID

Example:

"pay_7fa2ecc101ARZ3NDEKTSV4RRFFQ69G5FAV"

Query Parameters

maxPollMs
integer<int64> | null

Maximum time to long-poll for payment status, in milliseconds.

Required range: x >= 0

Body

application/json
optionId
string
required

ID of the option to confirm

results
object[]
required
collectedData
null | object
Example:
{
"fields": [
{ "id": "fullName", "value": "John Smith" },
{ "id": "dob", "value": "1990-01-01" },
{ "id": "tosConfirmed", "value": "true" },
{ "id": "pobCountry", "value": "US" },
{
"id": "pobAddress",
"value": "New York, NY"
}
]
}

Response

Payment confirmed successfully

isFinal
boolean
required

True if the payment is in a final state and no longer requires polling

status
enum<string>
required

Payment status

Available options:
requires_action,
processing,
succeeded,
failed,
expired,
cancelled
info
null | object

Payment information (transaction hash). Present when status is Succeeded, null otherwise.

pollInMs
integer<int64> | null

Time to poll for payment status, in milliseconds. Not present if the payment is in a final state.

Required range: x >= 0