Request Network Docs
WebsiteGithubStatusDiscord
  • Request Network Docs
  • Request Network API
    • Create and Pay Requests
    • Crosschain Payments
    • Crypto-to-fiat Payments
    • EasyInvoice: API Demo App
    • API Portal: Manage API Keys and Webhooks
    • Full API Reference
  • General
    • Lifecycle of a Request
    • Request Scan
    • Supported Chains
      • Smart Contract Addresses
    • Request Network Token List
  • Advanced
    • Request Network SDK
      • Get Started
        • Quickstart - Browser
        • Quickstart - Node.js
        • Installation
        • SDK Injector
        • Request Node Gateways
      • SDK Demo Apps
        • Request Invoicing
          • Pay from Safe Multisig
        • Request Checkout
        • Components
          • Create Invoice Form
          • Invoice Dashboard
          • Payment Widget
          • Add Stakeholder
      • SDK Guides
        • Request Client
          • Configure the Request Client
          • Updating a Request
          • Payment Reference
          • Compute a Request ID without creating the request
          • Use your own signature mechanism
          • Support a new currency
          • In-Memory Requests
        • Encryption and Decryption
          • Encrypt with a wallet signature using Lit Protocol
          • Encrypt with an Ethereum private key
          • Share an encrypted request
        • Payment
          • Detect a payment
          • Native Payment
          • Conversion Payment
          • Declarative Payment
          • Configuring Payment Fees
          • Single Request Forwarder
          • Batch Payment
          • Swap-to-Pay Payment
          • Swap-to-Conversion Payment
          • Transferable Receivable Payment
          • Meta Payments
          • Escrow Payment
          • Streaming Payment
          • Pay through a proxy-contract with a multisig
          • Hinkal Private Payments
        • Mobile using Expo
      • SDK Reference
        • request-client.js
          • RequestNetwork
            • createRequest()
            • computeRequestId()
            • fromRequestId()
            • fromIdentity()
            • fromTopic()
          • Request
            • waitForConfirmation()
            • getData()
            • refresh()
            • cancel()
            • accept()
            • increaseExpectedAmountRequest()
            • reduceExpectedAmountRequest()
          • IIdentity
          • IRequestDataWithEvents
          • PaymentReferenceCalculator
        • payment-processor
          • payRequest()
        • web3-signature
          • Web3SignatureProvider
        • epk-signature
          • EthereumPrivateKeySignatureProvider
        • epk-decryption
          • EthereumPrivateKeyDecryptionProvider
    • Protocol Overview
      • SDK and Request Node Overview
      • Payment Networks
      • Private Requests using Encryption
      • Smart Contracts Overview
    • Internal SDK Architecture
      • Request Logic
      • Advanced Logic
      • Transaction
      • Data-access
      • Storage
      • Data flow
      • Request IPFS network
  • FAQ
  • Glossary
  • Contributing
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
Export as PDF
  1. Request Network API

Crypto-to-fiat Payments

A Guide to Crypto-to-fiat Payments, Compliance, and Webhooks with the Request Network API (V2)

PreviousCrosschain PaymentsNextEasyInvoice: API Demo App

Last updated 23 hours ago

Was this helpful?

Crypto-to-fiat payments are only available in V2.

Crypto-to-fiat payments let a payer pay a Request in cryptocurrency, while the payee receives fiat directly in their bank account. This is achieved by combining compliance (KYC/Agreement) and bank account registration (payment detail) flows, and combining the Request Network crypto payment with offramp infrastructure.

includes a reference implementation for this flow.

Understanding clientUserId

Many /payer endpoints in the Request Network API require a clientUserId as a path parameter. This value is an arbitrary identifier chosen by your platform to represent a user (the payer) in your own system.

  • You control the format: The clientUserId can be any unique string that makes sense for your application. It can be a UUID, email address, database ID, or anything unique per user on your platform.

  • EasyInvoice Example: In the EasyInvoice demo app, clientUserId is set to the user's email address.

  • Why is this useful? This approach allows you to integrate the Request Network API without having to change your existing user management logic. You simply pass your own identifier to the API, and all payer-related compliance, agreement, and payment detail records will be associated with that value.

Example usage:

GET /v2/payer/{clientUserId}
PATCH /v2/payer/{clientUserId}
POST /v2/payer/{clientUserId}/payment-details
GET  /v2/payer/{clientUserId}/payment-details

In each case, replace {clientUserId} with your chosen identifier for the user.

1. Compliance & Payer Onboarding

Before a payer can use crypto-to-fiat, they must complete compliance steps:

  • KYC: The payer must submit a KYC application.

  • Agreement: The payer must sign a compliance agreement (via an iframe flow).

  • Bank Account: The payee's bank account must be associated with a payer for compliance reasons, even though the payee owns the account.

Compliance Flow Diagram

Flow Explanation

  1. Submit KYC: The platform collects KYC information from the payer and submits it to the API.

  2. KYC Review: The platform receives webhook updates as the KYC is processed (compliance.updated with kycStatus).

  3. Agreement Signature: The platform displays an iframe for the payer to sign the compliance agreement. Once signed, the platform calls the API to update the agreement status.

  4. Agreement Confirmation: The platform receives a webhook update when the agreement is completed (compliance.updated with agreementStatus).

Relevant Endpoints

  • POST /payer: Submit KYC application.

  • GET /payer/{clientUserId}: Get compliance status for a payer.

  • PATCH /payer/{clientUserId}: Update agreement status after signature.

2. Setting Up a Crypto-to-Fiat Request (Payee Flow)

Before a payer can pay in crypto and the payee can receive fiat, the platform must:

  • Submit the payee’s bank account details (associated with a payer for compliance).

  • Wait for approval of those payment details (usually less than 60 seconds, confirmed via webhook).

  • Create a new request with isCryptoToFiatAllowed = true.

Payment Details Flow Diagram

Flow Explanation

  1. Submit Bank Account: The platform submits the payee’s bank account details, associating them with a payer. The Request Network API forwards these details to the offramp provider (Request Tech).

  2. Approval: The platform receives a webhook (payment_detail.updated) indicating if the payment details are approved, failed, or pending.

  3. Create Request: Once approved, the platform creates a new request as usual, but with the isCryptoToFiatAllowed flag set to true. This signals that the request is eligible for crypto-to-fiat payment.

In EasyInvoice, the Payee Bank Account Registration is integrated directly into the Create Invoice Form. If the user clicks Create before the Payee Bank Account has been approved, a loading indicator appears until approval is granted.

Relevant Endpoints

  • POST /payer/{clientUserId}/payment-details: Create payment details (register bank account) for a payee.

  • GET /payer/{clientUserId}/payment-details: Get payment details (bank accounts) for a payee.

  • POST /v2/request with isCryptoToFiatAllowed = true: Create a new crypto-to-fiat request

3. Paying a Crypto-to-Fiat Request

The payer pays in crypto; Request Tech handles offramping and fiat payout.

Payment Flow Diagram

Flow Explanation

  1. Get Payment Calldata: The platform fetches payment calldata for the request.

  2. User Pays: The payer signs and submits the transaction, sending crypto to Request Tech.

  3. Offramp Processing: Request Tech receives the crypto and begins the offramp process.

Crypto-to-fiat Webhook Event Reference

Event

Description

subStatus values (if any)

compliance.updated

KYC/Agreement status updates

kycStatus: initiated, pending, approved, rejected, failed agreementStatus: not_started, pending, completed, rejected, failed

payment_detail.updated

Payment detail (bank account) status

approved, failed, pending

payment.processing

Offramp in progress

initiated, pending_internal_assessment, ongoing_checks, sending_fiat, fiat_sent, bounced, retry_required

payment.failed

Offramp or payment failed

failed, bounced

payment.confirmed

Payment fully settled (fiat delivered)

Status Updates: The platform receives webhook events as the offramp progresses (, ), with indicating the current offramp stage.

Fiat Delivered: When the offramp is complete, the platform receives a final webhook ( with ), and then a event.

Request Tech
EasyInvoice
payment.processing
payment.failed
subStatus
payment.processing
subStatus: fiat_sent
payment.confirmed

Get compliance status for a user

get

Retrieves the comprehensive compliance status for a specific user, including KYC and agreement status.

Path parameters
clientUserIdstringRequired

The client user ID to check compliance status for

Example: user-123
Header parameters
x-api-keystringRequired

API key for authentication

Responses
200
Compliance status retrieved successfully
application/json
401
Unauthorized
404
User not found
application/json
429
Too Many Requests
get
GET /v2/payer/{clientUserId} HTTP/1.1
Host: api.request.network
x-api-key: text
Accept: */*
{
  "kycStatus": "completed",
  "agreementStatus": "completed",
  "isCompliant": true,
  "userId": "a25a4274-8f50-4579-b476-8f35b297d4ad"
}

Get payment details for a user

get

Retrieves the registered bank account details for a user. Optionally filter by payment details ID.

Path parameters
clientUserIdstringRequired

The client user ID to get payment details for

Example: user-123
Query parameters
paymentDetailsIdstringOptional

Optional ID of specific payment details to retrieve

Example: fa898aec-519c-46be-9b4c-e76ef4ff99d9
Header parameters
x-api-keystringRequired

API key for authentication

Responses
200
Payment details retrieved successfully
application/json
401
Unauthorized
404
User or payment details not found
application/json
429
Too Many Requests
get
GET /v2/payer/{clientUserId}/payment-details HTTP/1.1
Host: api.request.network
x-api-key: text
Accept: */*
{
  "paymentDetails": [
    {
      "id": "fa898aec-519c-46be-9b4c-e76ef4ff99d9",
      "userId": "a25a4274-8f50-4579-b476-8f35b297d4ad",
      "bankName": "Chase",
      "accountName": "Gordon's Chase Business Account",
      "beneficiaryType": "business",
      "accountNumber": "253009233489",
      "routingNumber": "026013356",
      "currency": "usd",
      "status": "approved",
      "rails": "local"
    }
  ]
}
  • Understanding clientUserId
  • 1. Compliance & Payer Onboarding
  • Compliance Flow Diagram
  • Flow Explanation
  • Relevant Endpoints
  • POSTCreate compliance data for a user
  • GETGet compliance status for a user
  • PATCHUpdate agreement status
  • 2. Setting Up a Crypto-to-Fiat Request (Payee Flow)
  • Payment Details Flow Diagram
  • Flow Explanation
  • Relevant Endpoints
  • POSTCreate payment details
  • GETGet payment details for a user
  • POSTCreate a new request
  • 3. Paying a Crypto-to-Fiat Request
  • Payment Flow Diagram
  • Crypto-to-fiat Webhook Event Reference

Create compliance data for a user

post

Checks compliance status and returns necessary URLs for completing compliance.

Header parameters
x-api-keystringRequired

API key for authentication

Body
clientUserIdstring · min: 1Required

Client User ID

emailstringRequired

Email

firstNamestring · min: 1Required

First Name

lastNamestring · min: 1Required

Last Name

beneficiaryTypestring · enumRequiredPossible values:
companyNamestringOptional

Company Name

dateOfBirthstringRequired

Date of birth in YYYY-MM-DD format

Pattern: ^\d{4}-\d{2}-\d{2}$
addressLine1string · min: 1Required

Address Line 1

addressLine2stringOptional

Address Line 2

citystring · min: 1Required

City

statestring · min: 1Required

State

postcodestring · min: 1Required

Postcode

countrystring · min: 2 · max: 2Required

Country

nationalitystring · min: 2 · max: 2Required

Nationality

phonestringRequired

Phone in E.164 format

Pattern: ^\+?[1-9]\d{1,14}$
ssnstring · min: 1Required

Social Security Number

sourceOfFundsstringOptional

Source of Funds

businessActivitystringOptional

Business Activity

Responses
200
Compliance data retrieved successfully
application/json
Responseany
400
Invalid request data
application/json
401
Unauthorized
404
Request not found
application/json
429
Too Many Requests
post
POST /v2/payer HTTP/1.1
Host: api.request.network
x-api-key: text
Content-Type: application/json
Accept: */*
Content-Length: 312

{
  "clientUserId": "user-123",
  "email": "john.doe@example.com",
  "firstName": "John",
  "lastName": "Doe",
  "beneficiaryType": "individual",
  "dateOfBirth": "1985-12-12",
  "addressLine1": "123 Main Street",
  "city": "New York",
  "state": "NY",
  "postcode": "10001",
  "country": "US",
  "nationality": "US",
  "phone": "+12125551234",
  "ssn": "123-45-6789"
}
{
  "agreementUrl": "https://core-api.pay.so/v1/public/agreements?email=john.doe%40example.com",
  "kycUrl": "https://sumsub.com/idensic/l/#/sbx_VvK9E9P2A23xQPoA",
  "status": {
    "agreementStatus": "not_started",
    "kycStatus": "not_started"
  }
}

Update agreement status

patch

Update the agreement completion status for a user.

Path parameters
clientUserIdstringRequired

The client user ID to update

Example: user-123
Header parameters
x-api-keystringRequired

API key for authentication

Body
agreementCompletedbooleanRequired
Responses
200
Compliance status updated successfully
application/json
400
Invalid request data
application/json
401
Unauthorized
404
User not found
application/json
429
Too Many Requests
patch
PATCH /v2/payer/{clientUserId} HTTP/1.1
Host: api.request.network
x-api-key: text
Content-Type: application/json
Accept: */*
Content-Length: 27

{
  "agreementCompleted": true
}
{
  "success": true
}

Create payment details

post

Create payment details for a user

Path parameters
clientUserIdstringRequired

The client user ID

Example: user-123
Header parameters
x-api-keystringRequired

API key for authentication

Body
bankNamestring · min: 1Required

Name of the bank

accountNamestring · min: 1Required

Name of the account holder

accountNumberstringOptional

Bank account number

routingNumberstringOptional

Bank routing number (US)

beneficiaryTypestring · enumRequired

Type of beneficiary

Possible values:
currencystring · min: 3 · max: 3Required

Three-letter currency code (ISO 4217)

addressLine1string · min: 1Required

Primary address line

addressLine2stringOptional

Secondary address line

citystring · min: 1Required

City name

statestringOptional

State or province code

countrystring · min: 2 · max: 2Required

Two-letter country code (ISO 3166-1 alpha-2)

dateOfBirthstringRequired

Date of birth in YYYY-MM-DD format

Pattern: ^\d{4}-\d{2}-\d{2}$
postalCodestring · min: 1Required

Postal or ZIP code

railsstring · enumOptional

Payment rail type

Default: localPossible values:
sortCodestringOptional

UK bank sort code

ibanstringOptional
swiftBicstringOptional
documentNumberstringOptional

Government-issued ID number

documentTypestringOptional

Type of government-issued ID (e.g., passport, driver's license)

accountTypestring · enumOptional

Type of bank account

Possible values:
ribNumberstringOptional

French RIB number

bsbNumberstringOptional
nccstringOptional

New Zealand NCC number

branchCodestringOptional

Bank branch code

bankCodestringOptional

Bank code

ifscstringOptional
Responses
201
Payment details created successfully
application/json
400
Invalid request data
application/json
401
Unauthorized
404
User not found
application/json
429
Too Many Requests
post
POST /v2/payer/{clientUserId}/payment-details HTTP/1.1
Host: api.request.network
x-api-key: text
Content-Type: application/json
Accept: */*
Content-Length: 316

{
  "bankName": "Chase",
  "accountName": "Gordon's Chase Business Account",
  "accountNumber": "253009233489",
  "routingNumber": "026013356",
  "beneficiaryType": "business",
  "currency": "usd",
  "addressLine1": "24 Theatre St.",
  "city": "Paramount",
  "state": "CA",
  "postalCode": "90723",
  "country": "US",
  "dateOfBirth": "1985-12-12",
  "rails": "local"
}
{
  "payment_detail": {
    "id": "pd_123456",
    "clientUserId": "user-123",
    "bankName": "Chase",
    "accountName": "Gordon's Chase Business Account",
    "currency": "usd",
    "beneficiaryType": "business"
  }
}

Create a new request

post

Create a new payment request

Header parameters
x-api-keystringRequired

API key for authentication

Body
payerstringOptional

The wallet address of the payer

payeestringRequired

The wallet address of the payee

amountstringRequired

The payable amount of the invoice, in human readable format

invoiceCurrencystringRequired

Invoice Currency ID, from the Request Network Token List e.g: USD

paymentCurrencystringRequired

Payment currency ID, from the Request Network Token List e.g: ETH-sepolia-sepolia

isCryptoToFiatAvailablebooleanOptional

Whether crypto-to-fiat payment is available for this request

Responses
201
Request created successfully
application/json
401
Unauthorized
404
Wallet not found
429
Too Many Requests
post
POST /v2/request HTTP/1.1
Host: api.request.network
x-api-key: text
Content-Type: application/json
Accept: */*
Content-Length: 238

{
  "payee": "0x6923831ACf5c327260D7ac7C9DfF5b1c3cB3C7D7",
  "amount": "10",
  "invoiceCurrency": "USD",
  "paymentCurrency": "ETH-sepolia-sepolia",
  "isCryptoToFiatAvailable": false,
  "recurrence": {
    "startDate": "2025-01-01T00:00:00.000Z",
    "frequency": "DAILY"
  }
}
{
  "paymentReference": "0xb3581f0b0f74cc61",
  "requestId": "01e273ecc29d4b526df3a0f1f05ffc59372af8752c2b678096e49ac270416a7cdb"
}