Skip to main content

HandCash Payment Requests API - Corrected Documentation

Based on real-world implementation and testing. This documentation corrects errors found in the official docs.

API Base URL

Authentication Headers

IMPORTANT: Headers are case-sensitive. Use lowercase:

Create Payment Request

Method: POST
URL: https://cloud.handcash.io/v3/paymentRequests

Required Fields

Common Mistakes in Official Docs

  1. WRONG: denominationCurrencyCode CORRECT: currency
  2. WRONG: instrumentCurrencyCode: "USD" CORRECT: instrumentCurrencyCode: "BSV" or "MNEE" only
  3. WRONG: receivers[].currencyCode field CORRECT: Do NOT include currencyCode in receivers array

Working Example

Response Format

List Payment Requests

Method: GET
URL: https://cloud.handcash.io/v3/paymentRequests

Query Parameters (Optional)

  • status - Filter by status (e.g., “pending”, “completed”)

Example

Response

Returns array of payment request objects in items array.

Get Single Payment Request

Method: GET
URL: https://cloud.handcash.io/v3/paymentRequests/{id}
IMPORTANT: In Next.js 16+, you must await params:

Example

Update Payment Request

Method: PUT
URL: https://cloud.handcash.io/v3/paymentRequests/{id}

Updatable Fields

  • product.name
  • product.description
  • product.imageUrl
  • redirectUrl
  • notifications.webhook.webhookUrl
  • notifications.webhook.customParameters
  • notifications.email
  • expirationInSeconds
  • decreaseRemainingUnits (only for expirationType: "limit")

Example

Delete Payment Request

Method: DELETE
URL: https://cloud.handcash.io/v3/paymentRequests/{id}
IMPORTANT: The API returns an empty response body on success. Do NOT attempt to parse as JSON.

Example

Handling Delete Response

Common Issues & Solutions

Issue: “instrumentCurrencyCode must be one of [MNEE, BSV]”

Solution: Never use “USD” for instrumentCurrencyCode. Only use “BSV” or “MNEE”.

Issue: “denominationCurrencyCode is not allowed”

Solution: The field is called currency, not denominationCurrencyCode.

Issue: “receivers[0].currencyCode is not allowed”

Solution: Do not include currencyCode in the receivers array.

Issue: “Unexpected end of JSON input” on DELETE

Solution: The DELETE endpoint returns an empty body. Handle this by reading as text first:

Issue: “id must be a valid MongoDB ObjectId”

Solution: In Next.js 16+, dynamic route params must be awaited:

Field Mapping Guide

Complete Working Implementation

See the payment-requests-package folder for a complete, tested implementation including:
  • app/api/payment-requests/route.ts - POST and GET handlers
  • app/api/payment-requests/[id]/route.ts - GET, PUT, DELETE handlers
  • components/payment-request-management.tsx - Full UI component
All code has been tested and confirmed working with the HandCash API.