Note You can use payment-attempts or create the payment directly.
A P2P (peer-to-peer) transaction is used to transfer funds between service providers or organizations . This is ideal for internal transfers, operator-to-operator flows, or any case where both origin and destination are known entities.
Although similar in structure to PURCHASE, it must not be used for customer payment flows.
01 Origin account Identify the internal account that sends funds.
02 Destination account Attach the receiving internal identity and account.
03 Create payment Submit the P2P transaction payload.
04 Capture Finalize the internal transfer.
Create payment Creates a P2P transaction by specifying the origin and destination accounts, both belonging to known internal identities.
Request HTTP curl JavaScript Python Go Rust
POST /sandbox/payments HTTP / 1.1
Host: api.conomyhq.com
x-api-key: {YOUR_API_KEY}
Authorization: Bearer {ACCESS_TOKEN}
conomyhq-api-version: 24-04-2025
User-Agent: MyApp/1.0
Content-Type: application/json
Accept: application/json
{
" identityId " : " 67f21a61d6d09fcbb4e84631 " ,
" externalId " : " p2p-transfer-001 " ,
" accountNumber " : " 1743919714051743919010211 " ,
" product " : " COP:COP " ,
" type " : " P2P " ,
" purchaseAmount " : " 15000.00 " ,
" purchaseCurrency " : " COP " ,
" currency " : " COP " ,
" origins " : [
{
" type " : " ACCOUNT " ,
" currency " : " COP " ,
" identity " : {
" identityId " : " 67f21a61d6d09fcbb4e84631 "
},
" account " : {
" accountNumber " : " 1743919714051743919010211 "
}
}
],
" destinations " : [
{
" type " : " ACCOUNT " ,
" amount " : " 15000.00 " ,
" currency " : " COP " ,
" identity " : {
" identityId " : " 67f21d17d6d09fcbb4e84632 "
},
" account " : {
" accountNumber " : " 17439204080520250406060905072 "
}
}
]
} curl -X POST ' https://api.conomyhq.com/sandbox/payments ' \
-H ' x-api-key: {YOUR_API_KEY} ' \
-H ' Authorization: Bearer {ACCESS_TOKEN} ' \
-H ' conomyhq-api-version: 24-04-2025 ' \
-H ' User-Agent: MyApp/1.0 ' \
-H ' Content-Type: application/json ' \
-H ' Accept: application/json ' \
-d ' {
"identityId": "67f21a61d6d09fcbb4e84631",
"externalId": "p2p-transfer-001",
"accountNumber": "1743919714051743919010211",
"product": "COP:COP",
"type": "P2P",
"purchaseAmount": "15000.00",
"purchaseCurrency": "COP",
"currency": "COP",
"origins": [
{
"type": "ACCOUNT",
"currency": "COP",
"identity": {
"identityId": "67f21a61d6d09fcbb4e84631"
},
"account": {
"accountNumber": "1743919714051743919010211"
}
}
],
"destinations": [
{
"type": "ACCOUNT",
"amount": "15000.00",
"currency": "COP",
"identity": {
"identityId": "67f21d17d6d09fcbb4e84632"
},
"account": {
"accountNumber": "17439204080520250406060905072"
}
}
]
} ' const response = await fetch ( ' https://api.conomyhq.com/sandbox/payments ' , {
method : ' POST ' ,
headers : {
' x-api-key ' : ' {YOUR_API_KEY} ' ,
' Authorization ' : ' Bearer {ACCESS_TOKEN} ' ,
' conomyhq-api-version ' : ' 24-04-2025 ' ,
' User-Agent ' : ' MyApp/1.0 ' ,
' Content-Type ' : ' application/json ' ,
' Accept ' : ' application/json ' ,
},
body : JSON . stringify ({
" identityId " : " 67f21a61d6d09fcbb4e84631 " ,
" externalId " : " p2p-transfer-001 " ,
" accountNumber " : " 1743919714051743919010211 " ,
" product " : " COP:COP " ,
" type " : " P2P " ,
" purchaseAmount " : " 15000.00 " ,
" purchaseCurrency " : " COP " ,
" currency " : " COP " ,
" origins " : [
{
" type " : " ACCOUNT " ,
" currency " : " COP " ,
" identity " : {
" identityId " : " 67f21a61d6d09fcbb4e84631 "
},
" account " : {
" accountNumber " : " 1743919714051743919010211 "
}
}
],
" destinations " : [
{
" type " : " ACCOUNT " ,
" amount " : " 15000.00 " ,
" currency " : " COP " ,
" identity " : {
" identityId " : " 67f21d17d6d09fcbb4e84632 "
},
" account " : {
" accountNumber " : " 17439204080520250406060905072 "
}
}
]
}),
});
const data = await response . json (); import requests
payload = {
" identityId " : " 67f21a61d6d09fcbb4e84631 " ,
" externalId " : " p2p-transfer-001 " ,
" accountNumber " : " 1743919714051743919010211 " ,
" product " : " COP:COP " ,
" type " : " P2P " ,
" purchaseAmount " : " 15000.00 " ,
" purchaseCurrency " : " COP " ,
" currency " : " COP " ,
" origins " : [
{
" type " : " ACCOUNT " ,
" currency " : " COP " ,
" identity " : {
" identityId " : " 67f21a61d6d09fcbb4e84631 "
},
" account " : {
" accountNumber " : " 1743919714051743919010211 "
}
}
],
" destinations " : [
{
" type " : " ACCOUNT " ,
" amount " : " 15000.00 " ,
" currency " : " COP " ,
" identity " : {
" identityId " : " 67f21d17d6d09fcbb4e84632 "
},
" account " : {
" accountNumber " : " 17439204080520250406060905072 "
}
}
]
}
response = requests . post (
' https://api.conomyhq.com/sandbox/payments ' ,
headers ={
' x-api-key ' : ' {YOUR_API_KEY} ' ,
' Authorization ' : ' Bearer {ACCESS_TOKEN} ' ,
' conomyhq-api-version ' : ' 24-04-2025 ' ,
' User-Agent ' : ' MyApp/1.0 ' ,
' Content-Type ' : ' application/json ' ,
' Accept ' : ' application/json ' ,
},
json = payload ,
)
data = response . json () package main
import (
" bytes "
" net/http "
)
func main () {
payload := [] byte ( ` {
"identityId": "67f21a61d6d09fcbb4e84631",
"externalId": "p2p-transfer-001",
"accountNumber": "1743919714051743919010211",
"product": "COP:COP",
"type": "P2P",
"purchaseAmount": "15000.00",
"purchaseCurrency": "COP",
"currency": "COP",
"origins": [
{
"type": "ACCOUNT",
"currency": "COP",
"identity": {
"identityId": "67f21a61d6d09fcbb4e84631"
},
"account": {
"accountNumber": "1743919714051743919010211"
}
}
],
"destinations": [
{
"type": "ACCOUNT",
"amount": "15000.00",
"currency": "COP",
"identity": {
"identityId": "67f21d17d6d09fcbb4e84632"
},
"account": {
"accountNumber": "17439204080520250406060905072"
}
}
]
} ` )
body := bytes . NewReader ( payload )
req , _ := http . NewRequest ( " POST " , " https://api.conomyhq.com/sandbox/payments " , body )
req . Header . Set ( " x-api-key " , " {YOUR_API_KEY} " )
req . Header . Set ( " Authorization " , " Bearer {ACCESS_TOKEN} " )
req . Header . Set ( " conomyhq-api-version " , " 24-04-2025 " )
req . Header . Set ( " User-Agent " , " MyApp/1.0 " )
req . Header . Set ( " Content-Type " , " application/json " )
req . Header . Set ( " Accept " , " application/json " )
client := & http . Client {}
resp , _ := client . Do ( req )
defer resp . Body . Close ()
} use reqwest :: Client ;
use serde_json :: json ;
#[ tokio :: main ]
async fn main () -> Result <(), Box < dyn std :: error :: Error >> {
let client = Client :: new ();
let payload = json! ({
" identityId " : " 67f21a61d6d09fcbb4e84631 " ,
" externalId " : " p2p-transfer-001 " ,
" accountNumber " : " 1743919714051743919010211 " ,
" product " : " COP:COP " ,
" type " : " P2P " ,
" purchaseAmount " : " 15000.00 " ,
" purchaseCurrency " : " COP " ,
" currency " : " COP " ,
" origins " : [
{
" type " : " ACCOUNT " ,
" currency " : " COP " ,
" identity " : {
" identityId " : " 67f21a61d6d09fcbb4e84631 "
},
" account " : {
" accountNumber " : " 1743919714051743919010211 "
}
}
],
" destinations " : [
{
" type " : " ACCOUNT " ,
" amount " : " 15000.00 " ,
" currency " : " COP " ,
" identity " : {
" identityId " : " 67f21d17d6d09fcbb4e84632 "
},
" account " : {
" accountNumber " : " 17439204080520250406060905072 "
}
}
]
});
let response = client
. post ( " https://api.conomyhq.com/sandbox/payments " )
. header ( " x-api-key " , " { YOUR_API_KEY } " )
. header ( " Authorization " , " Bearer { ACCESS_TOKEN } " )
. header ( " conomyhq-api-version " , " 24-04-2025 " )
. header ( " User-Agent " , " MyApp/1.0 " )
. header ( " Content-Type " , " application/json " )
. header ( " Accept " , " application/json " )
. json ( & payload )
. send ()
. await ? ;
let data : serde_json :: Value = response . json () . await ? ;
Ok (())
} {
" id " : " <PAYMENT_ID> " ,
" type " : " P2P " ,
" status " : " CREATED "
}
Capture payment Capture the P2P transaction to finalize the transfer between entities.
Request HTTP curl JavaScript Python Go Rust
POST /sandbox/payments/{PAYMENT_ID}/captured HTTP / 1.1
Host: api.conomyhq.com
x-api-key: {YOUR_API_KEY}
Authorization: Bearer {ACCESS_TOKEN}
conomyhq-api-version: 24-04-2025
User-Agent: MyApp/1.0
Accept: application/json curl -X POST ' https://api.conomyhq.com/sandbox/payments/{PAYMENT_ID}/captured ' \
-H ' x-api-key: {YOUR_API_KEY} ' \
-H ' Authorization: Bearer {ACCESS_TOKEN} ' \
-H ' conomyhq-api-version: 24-04-2025 ' \
-H ' User-Agent: MyApp/1.0 ' \
-H ' Accept: application/json ' const response = await fetch ( ' https://api.conomyhq.com/sandbox/payments/{PAYMENT_ID}/captured ' , {
method : ' POST ' ,
headers : {
' x-api-key ' : ' {YOUR_API_KEY} ' ,
' Authorization ' : ' Bearer {ACCESS_TOKEN} ' ,
' conomyhq-api-version ' : ' 24-04-2025 ' ,
' User-Agent ' : ' MyApp/1.0 ' ,
' Accept ' : ' application/json ' ,
},
});
const data = await response . json (); import requests
response = requests . post (
' https://api.conomyhq.com/sandbox/payments/ {PAYMENT_ID} /captured ' ,
headers ={
' x-api-key ' : ' {YOUR_API_KEY} ' ,
' Authorization ' : ' Bearer {ACCESS_TOKEN} ' ,
' conomyhq-api-version ' : ' 24-04-2025 ' ,
' User-Agent ' : ' MyApp/1.0 ' ,
' Accept ' : ' application/json ' ,
},
)
data = response . json () package main
import (
" net/http "
)
func main () {
req , _ := http . NewRequest ( " POST " , " https://api.conomyhq.com/sandbox/payments/{PAYMENT_ID}/captured " , nil )
req . Header . Set ( " x-api-key " , " {YOUR_API_KEY} " )
req . Header . Set ( " Authorization " , " Bearer {ACCESS_TOKEN} " )
req . Header . Set ( " conomyhq-api-version " , " 24-04-2025 " )
req . Header . Set ( " User-Agent " , " MyApp/1.0 " )
req . Header . Set ( " Accept " , " application/json " )
client := & http . Client {}
resp , _ := client . Do ( req )
defer resp . Body . Close ()
} use reqwest :: Client ;
#[ tokio :: main ]
async fn main () -> Result <(), Box < dyn std :: error :: Error >> {
let client = Client :: new ();
let response = client
. post ( " https://api.conomyhq.com/sandbox/payments/ { PAYMENT_ID } /captured " )
. header ( " x-api-key " , " { YOUR_API_KEY } " )
. header ( " Authorization " , " Bearer { ACCESS_TOKEN } " )
. header ( " conomyhq-api-version " , " 24-04-2025 " )
. header ( " User-Agent " , " MyApp/1.0 " )
. header ( " Accept " , " application/json " )
. send ()
. await ? ;
let data : serde_json :: Value = response . json () . await ? ;
Ok (())
} {
" id " : " <PAYMENT_ID> " ,
" status " : " CAPTURED "
}
Webhook simulation Simulate a webhook event to confirm the P2P transaction has been received or processed.
Request HTTP curl JavaScript Python Go Rust
POST /sandboxwebhook/payments/received/payment-provider HTTP / 1.1
Host: api.conomyhq.com
x-api-key: {YOUR_API_KEY}
Authorization: Bearer {ACCESS_TOKEN}
conomyhq-api-version: 24-04-2025
User-Agent: MyApp/1.0
Content-Type: application/json
Accept: application/json
{
" id " : " <PAYMENT_ID> "
} curl -X POST ' https://api.conomyhq.com/sandboxwebhook/payments/received/payment-provider ' \
-H ' x-api-key: {YOUR_API_KEY} ' \
-H ' Authorization: Bearer {ACCESS_TOKEN} ' \
-H ' conomyhq-api-version: 24-04-2025 ' \
-H ' User-Agent: MyApp/1.0 ' \
-H ' Content-Type: application/json ' \
-H ' Accept: application/json ' \
-d ' {
"id": "<PAYMENT_ID>"
} ' const response = await fetch ( ' https://api.conomyhq.com/sandboxwebhook/payments/received/payment-provider ' , {
method : ' POST ' ,
headers : {
' x-api-key ' : ' {YOUR_API_KEY} ' ,
' Authorization ' : ' Bearer {ACCESS_TOKEN} ' ,
' conomyhq-api-version ' : ' 24-04-2025 ' ,
' User-Agent ' : ' MyApp/1.0 ' ,
' Content-Type ' : ' application/json ' ,
' Accept ' : ' application/json ' ,
},
body : JSON . stringify ({
" id " : " <PAYMENT_ID> "
}),
});
const data = await response . json (); import requests
payload = {
" id " : " <PAYMENT_ID> "
}
response = requests . post (
' https://api.conomyhq.com/sandboxwebhook/payments/received/payment-provider ' ,
headers ={
' x-api-key ' : ' {YOUR_API_KEY} ' ,
' Authorization ' : ' Bearer {ACCESS_TOKEN} ' ,
' conomyhq-api-version ' : ' 24-04-2025 ' ,
' User-Agent ' : ' MyApp/1.0 ' ,
' Content-Type ' : ' application/json ' ,
' Accept ' : ' application/json ' ,
},
json = payload ,
)
data = response . json () package main
import (
" bytes "
" net/http "
)
func main () {
payload := [] byte ( ` {
"id": "<PAYMENT_ID>"
} ` )
body := bytes . NewReader ( payload )
req , _ := http . NewRequest ( " POST " , " https://api.conomyhq.com/sandboxwebhook/payments/received/payment-provider " , body )
req . Header . Set ( " x-api-key " , " {YOUR_API_KEY} " )
req . Header . Set ( " Authorization " , " Bearer {ACCESS_TOKEN} " )
req . Header . Set ( " conomyhq-api-version " , " 24-04-2025 " )
req . Header . Set ( " User-Agent " , " MyApp/1.0 " )
req . Header . Set ( " Content-Type " , " application/json " )
req . Header . Set ( " Accept " , " application/json " )
client := & http . Client {}
resp , _ := client . Do ( req )
defer resp . Body . Close ()
} use reqwest :: Client ;
use serde_json :: json ;
#[ tokio :: main ]
async fn main () -> Result <(), Box < dyn std :: error :: Error >> {
let client = Client :: new ();
let payload = json! ({
" id " : " <PAYMENT_ID> "
});
let response = client
. post ( " https://api.conomyhq.com/sandboxwebhook/payments/received/payment-provider " )
. header ( " x-api-key " , " { YOUR_API_KEY } " )
. header ( " Authorization " , " Bearer { ACCESS_TOKEN } " )
. header ( " conomyhq-api-version " , " 24-04-2025 " )
. header ( " User-Agent " , " MyApp/1.0 " )
. header ( " Content-Type " , " application/json " )
. header ( " Accept " , " application/json " )
. json ( & payload )
. send ()
. await ? ;
let data : serde_json :: Value = response . json () . await ? ;
Ok (())
}
Check account information Verify the origin or destination account at any time to ensure correctness.
Request HTTP curl JavaScript Python Go Rust
GET /sandbox/accounts?accountNumber=1743919714051743919010211 HTTP / 1.1
Host: api.conomyhq.com
x-api-key: {YOUR_API_KEY}
Authorization: Bearer {ACCESS_TOKEN}
conomyhq-api-version: 24-04-2025
User-Agent: MyApp/1.0
Accept: application/json curl -X GET ' https://api.conomyhq.com/sandbox/accounts?accountNumber=1743919714051743919010211 ' \
-H ' x-api-key: {YOUR_API_KEY} ' \
-H ' Authorization: Bearer {ACCESS_TOKEN} ' \
-H ' conomyhq-api-version: 24-04-2025 ' \
-H ' User-Agent: MyApp/1.0 ' \
-H ' Accept: application/json ' const response = await fetch ( ' https://api.conomyhq.com/sandbox/accounts?accountNumber=1743919714051743919010211 ' , {
method : ' GET ' ,
headers : {
' x-api-key ' : ' {YOUR_API_KEY} ' ,
' Authorization ' : ' Bearer {ACCESS_TOKEN} ' ,
' conomyhq-api-version ' : ' 24-04-2025 ' ,
' User-Agent ' : ' MyApp/1.0 ' ,
' Accept ' : ' application/json ' ,
},
});
const data = await response . json (); import requests
response = requests . get (
' https://api.conomyhq.com/sandbox/accounts?accountNumber=1743919714051743919010211 ' ,
headers ={
' x-api-key ' : ' {YOUR_API_KEY} ' ,
' Authorization ' : ' Bearer {ACCESS_TOKEN} ' ,
' conomyhq-api-version ' : ' 24-04-2025 ' ,
' User-Agent ' : ' MyApp/1.0 ' ,
' Accept ' : ' application/json ' ,
},
)
data = response . json () package main
import (
" net/http "
)
func main () {
req , _ := http . NewRequest ( " GET " , " https://api.conomyhq.com/sandbox/accounts?accountNumber=1743919714051743919010211 " , nil )
req . Header . Set ( " x-api-key " , " {YOUR_API_KEY} " )
req . Header . Set ( " Authorization " , " Bearer {ACCESS_TOKEN} " )
req . Header . Set ( " conomyhq-api-version " , " 24-04-2025 " )
req . Header . Set ( " User-Agent " , " MyApp/1.0 " )
req . Header . Set ( " Accept " , " application/json " )
client := & http . Client {}
resp , _ := client . Do ( req )
defer resp . Body . Close ()
} use reqwest :: Client ;
#[ tokio :: main ]
async fn main () -> Result <(), Box < dyn std :: error :: Error >> {
let client = Client :: new ();
let response = client
. get ( " https://api.conomyhq.com/sandbox/accounts?accountNumber=1743919714051743919010211 " )
. header ( " x-api-key " , " { YOUR_API_KEY } " )
. header ( " Authorization " , " Bearer { ACCESS_TOKEN } " )
. header ( " conomyhq-api-version " , " 24-04-2025 " )
. header ( " User-Agent " , " MyApp/1.0 " )
. header ( " Accept " , " application/json " )
. send ()
. await ? ;
let data : serde_json :: Value = response . json () . await ? ;
Ok (())
} {
" id " : " <ACCOUNT_ID> " ,
" accountNumber " : " 1743919714051743919010211 " ,
" availableFunds " : " 15000.00 " ,
" currency " : " COP " ,
" status " : " ACTIVE "
}