Create Charge

Creates a new payment charge.

POST /v1/charges

Request

Headers

Header
Required
Description

X-API-Key

Yes

Your API key

Content-Type

Yes

Must be application/json

Body Parameters

Parameter
Type
Required
Description

orderId

string

Yes

Your unique order identifier. Must be unique per merchant.

amount

string

Yes

Payment amount in USDC (e.g., "25.00")

description

string

No

Description of the payment

metadata

object

No

Arbitrary key-value pairs for your use

Example Request

curl -X POST https://api.bedrock.io/v1/charges \
  -H "X-API-Key: sk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "orderId": "order-123",
    "amount": "25.00",
    "description": "Premium subscription",
    "metadata": {
      "customerId": "cust_456",
      "productId": "prod_789"
    }
  }'

Response

Success (201 Created)

Errors

Status
Code
Description

400

invalid_amount

Amount must be a positive number

400

duplicate_order_id

Order ID already exists for this merchant

401

unauthorized

Invalid or missing API key

403

merchant_inactive

Merchant account is not active

Example Error Response

Notes

  • The cloneAddress and chainId will be null until the customer selects a chain on the payment page

  • The charge expires after 30 minutes if no chain is selected

  • Once a chain is selected, the charge expires after 5 minutes

  • Use the orderId to correlate payments with your orders

Last updated