Funding Intents
Create a funding intent
Creates a funding intent and registers it with the Useroutr protocol on Stellar. Requires an Idempotency-Key header; repeating a request with the same key and body returns the original result.
POST
/
v1
/
funding-intents
Node.js SDK
import { Useroutr } from "@useroutr/sdk";
const useroutr = new Useroutr({ apiKey: process.env.USEROUTR_API_KEY });
const intent = await useroutr.fundingIntents.create(
{
amount: "25",
asset: "asset_usdc_stellar",
reference: "ORDER-1042",
},
{ idempotencyKey: "ORDER-1042" },
);
// Send the payer to intent.hosted_funding_url, or embed the checkoutcurl -X POST "https://sandbox-api.useroutr.com/v1/funding-intents" \
-H "Authorization: Bearer $USEROUTR_API_KEY" \
-H "Idempotency-Key: ORDER-1042" \
-H "Content-Type: application/json" \
-d '{"amount":"25","asset":"asset_usdc_stellar","reference":"ORDER-1042"}'{
"id": "<string>",
"object": "funding_intent",
"application_id": "<string>",
"requirement": {
"amount": "<string>",
"asset": "<string>"
},
"destination": {
"network": "<string>",
"asset": "<string>",
"address": "<string>"
},
"source": {
"network": "<string>",
"asset": "<string>",
"amount": "<string>"
},
"quote": {
"id": "<string>",
"object": "quote",
"funding_intent_id": "<string>",
"application_id": "<string>",
"type": "EXACT_INPUT",
"status": "ACTIVE",
"stellar_network": "testnet",
"source": {
"network": "<string>",
"asset": "<string>",
"amount": "<string>",
"expected_amount": "<string>"
},
"destination": {
"network": "<string>",
"asset": "<string>",
"address": "<string>",
"amount": "<string>",
"minimum_amount": "<string>"
},
"route": {
"type": "DIRECT_STELLAR",
"provider": "<string>",
"steps": [
{
"type": "<string>",
"provider": "<string>",
"source_asset": "<string>",
"destination_asset": "<string>"
}
],
"estimated_duration_seconds": 0,
"confidence": 0,
"price_impact_bps": 0,
"score": "<string>"
},
"fees": {
"items": [
{
"type": "NETWORK",
"asset": "<string>",
"amount": "<string>"
}
],
"total": "<string>"
},
"exchange_rate": "<string>",
"slippage_bps": 0,
"execution": {
"id": "<string>",
"object": "route_execution",
"quote_id": "<string>",
"funding_intent_id": "<string>",
"provider": "<string>",
"route_type": "DIRECT_STELLAR",
"status": "PENDING",
"phase": "CREATED",
"provider_execution_id": "<string>",
"transaction_hashes": [
"<string>"
],
"failure": {
"code": "<string>",
"message": "<string>"
},
"started_at": "<string>",
"completed_at": "<string>"
},
"failure": {
"code": "<string>",
"message": "<string>"
},
"expires_at": "<string>",
"lock_expires_at": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
},
"route": {
"type": "DIRECT_STELLAR",
"provider": "<string>"
},
"status": "CREATED",
"received_amount": "<string>",
"deposit_account": {
"id": "<string>",
"object": "deposit_account",
"network": "stellar",
"address": "<string>",
"asset": "<string>",
"status": "PROVISIONING",
"created_at": "<string>",
"activated_at": "<string>",
"retired_at": "<string>"
},
"reference": "<string>",
"metadata": {},
"protocol": {
"intent_id": "<string>",
"contract_id": "<string>",
"status": "PENDING",
"transaction_hash": "<string>"
},
"funding_instructions": {
"network": "stellar",
"stellar_network": "testnet",
"deposit": {
"address": "<string>",
"type": "account"
},
"asset": {
"id": "<string>",
"symbol": "<string>",
"stellar_asset": "<string>",
"code": "<string>",
"issuer": "<string>",
"contract": "<string>",
"decimals": 0
},
"amount": "<string>",
"required_amount": "<string>",
"received_amount": "<string>",
"expires_at": "<string>"
},
"payment": {
"id": "<string>",
"object": "payment",
"funding_intent_id": "<string>",
"network": "<string>",
"stellar_network": "testnet",
"asset": "<string>",
"stellar_asset": "<string>",
"amount": "<string>",
"payer_address": "<string>",
"destination_address": "<string>",
"transaction_hash": "<string>",
"operation_id": "<string>",
"ledger": 0,
"memo": {
"type": "text",
"value": "<string>"
},
"status": "DETECTED",
"failure": {
"code": "<string>",
"message": "<string>"
},
"detected_at": "<string>",
"confirmed_at": "<string>"
},
"settlement": {
"id": "<string>",
"object": "settlement",
"funding_intent_id": "<string>",
"application_id": "<string>",
"payment_id": "<string>",
"network": "stellar",
"stellar_network": "testnet",
"route": "direct",
"source": {
"asset": "<string>",
"amount": "<string>"
},
"destination": {
"network": "<string>",
"asset": "<string>",
"address": "<string>",
"amount": "<string>"
},
"transaction_hash": "<string>",
"transfer_transaction_hash": "<string>",
"protocol": {
"settlement_id": "<string>",
"contract_id": "<string>",
"create_transaction_hash": "<string>",
"confirm_transaction_hash": "<string>"
},
"status": "PENDING",
"reconciliation_status": "UNRECONCILED",
"failure": {
"code": "<string>",
"message": "<string>"
},
"submitted_at": "<string>",
"confirmed_at": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
},
"failure": {
"code": "<string>",
"message": "<string>"
},
"hosted_funding_url": "<string>",
"expires_at": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>",
"requestId": "<string>",
"retryable": true,
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>",
"requestId": "<string>",
"retryable": true,
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>",
"requestId": "<string>",
"retryable": true,
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>",
"requestId": "<string>",
"retryable": true,
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>",
"requestId": "<string>",
"retryable": true,
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>",
"requestId": "<string>",
"retryable": true,
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}Authorizations
Body
application/json
Pattern:
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$Response
Default Response
⌘I
Node.js SDK
import { Useroutr } from "@useroutr/sdk";
const useroutr = new Useroutr({ apiKey: process.env.USEROUTR_API_KEY });
const intent = await useroutr.fundingIntents.create(
{
amount: "25",
asset: "asset_usdc_stellar",
reference: "ORDER-1042",
},
{ idempotencyKey: "ORDER-1042" },
);
// Send the payer to intent.hosted_funding_url, or embed the checkoutcurl -X POST "https://sandbox-api.useroutr.com/v1/funding-intents" \
-H "Authorization: Bearer $USEROUTR_API_KEY" \
-H "Idempotency-Key: ORDER-1042" \
-H "Content-Type: application/json" \
-d '{"amount":"25","asset":"asset_usdc_stellar","reference":"ORDER-1042"}'{
"id": "<string>",
"object": "funding_intent",
"application_id": "<string>",
"requirement": {
"amount": "<string>",
"asset": "<string>"
},
"destination": {
"network": "<string>",
"asset": "<string>",
"address": "<string>"
},
"source": {
"network": "<string>",
"asset": "<string>",
"amount": "<string>"
},
"quote": {
"id": "<string>",
"object": "quote",
"funding_intent_id": "<string>",
"application_id": "<string>",
"type": "EXACT_INPUT",
"status": "ACTIVE",
"stellar_network": "testnet",
"source": {
"network": "<string>",
"asset": "<string>",
"amount": "<string>",
"expected_amount": "<string>"
},
"destination": {
"network": "<string>",
"asset": "<string>",
"address": "<string>",
"amount": "<string>",
"minimum_amount": "<string>"
},
"route": {
"type": "DIRECT_STELLAR",
"provider": "<string>",
"steps": [
{
"type": "<string>",
"provider": "<string>",
"source_asset": "<string>",
"destination_asset": "<string>"
}
],
"estimated_duration_seconds": 0,
"confidence": 0,
"price_impact_bps": 0,
"score": "<string>"
},
"fees": {
"items": [
{
"type": "NETWORK",
"asset": "<string>",
"amount": "<string>"
}
],
"total": "<string>"
},
"exchange_rate": "<string>",
"slippage_bps": 0,
"execution": {
"id": "<string>",
"object": "route_execution",
"quote_id": "<string>",
"funding_intent_id": "<string>",
"provider": "<string>",
"route_type": "DIRECT_STELLAR",
"status": "PENDING",
"phase": "CREATED",
"provider_execution_id": "<string>",
"transaction_hashes": [
"<string>"
],
"failure": {
"code": "<string>",
"message": "<string>"
},
"started_at": "<string>",
"completed_at": "<string>"
},
"failure": {
"code": "<string>",
"message": "<string>"
},
"expires_at": "<string>",
"lock_expires_at": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
},
"route": {
"type": "DIRECT_STELLAR",
"provider": "<string>"
},
"status": "CREATED",
"received_amount": "<string>",
"deposit_account": {
"id": "<string>",
"object": "deposit_account",
"network": "stellar",
"address": "<string>",
"asset": "<string>",
"status": "PROVISIONING",
"created_at": "<string>",
"activated_at": "<string>",
"retired_at": "<string>"
},
"reference": "<string>",
"metadata": {},
"protocol": {
"intent_id": "<string>",
"contract_id": "<string>",
"status": "PENDING",
"transaction_hash": "<string>"
},
"funding_instructions": {
"network": "stellar",
"stellar_network": "testnet",
"deposit": {
"address": "<string>",
"type": "account"
},
"asset": {
"id": "<string>",
"symbol": "<string>",
"stellar_asset": "<string>",
"code": "<string>",
"issuer": "<string>",
"contract": "<string>",
"decimals": 0
},
"amount": "<string>",
"required_amount": "<string>",
"received_amount": "<string>",
"expires_at": "<string>"
},
"payment": {
"id": "<string>",
"object": "payment",
"funding_intent_id": "<string>",
"network": "<string>",
"stellar_network": "testnet",
"asset": "<string>",
"stellar_asset": "<string>",
"amount": "<string>",
"payer_address": "<string>",
"destination_address": "<string>",
"transaction_hash": "<string>",
"operation_id": "<string>",
"ledger": 0,
"memo": {
"type": "text",
"value": "<string>"
},
"status": "DETECTED",
"failure": {
"code": "<string>",
"message": "<string>"
},
"detected_at": "<string>",
"confirmed_at": "<string>"
},
"settlement": {
"id": "<string>",
"object": "settlement",
"funding_intent_id": "<string>",
"application_id": "<string>",
"payment_id": "<string>",
"network": "stellar",
"stellar_network": "testnet",
"route": "direct",
"source": {
"asset": "<string>",
"amount": "<string>"
},
"destination": {
"network": "<string>",
"asset": "<string>",
"address": "<string>",
"amount": "<string>"
},
"transaction_hash": "<string>",
"transfer_transaction_hash": "<string>",
"protocol": {
"settlement_id": "<string>",
"contract_id": "<string>",
"create_transaction_hash": "<string>",
"confirm_transaction_hash": "<string>"
},
"status": "PENDING",
"reconciliation_status": "UNRECONCILED",
"failure": {
"code": "<string>",
"message": "<string>"
},
"submitted_at": "<string>",
"confirmed_at": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
},
"failure": {
"code": "<string>",
"message": "<string>"
},
"hosted_funding_url": "<string>",
"expires_at": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>",
"requestId": "<string>",
"retryable": true,
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>",
"requestId": "<string>",
"retryable": true,
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>",
"requestId": "<string>",
"retryable": true,
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>",
"requestId": "<string>",
"retryable": true,
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>",
"requestId": "<string>",
"retryable": true,
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>",
"requestId": "<string>",
"retryable": true,
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}