NOWPayments orders require an account session; the provider alone calls IPN with x-nowpayments-sig. Check current capabilities and distinguish USD cents from credit_micro. Preserve the original order and Idempotency-Key; unknown does not recreate invoices. Only a verified, sufficiently paid finished payment is credited once. IPN uses recursively sorted JSON HMAC SHA512, not browser-supplied proof.
Authentication
Public endpoints. Session/administrative writes are not executed in the public Playground.
Endpoint
curl --request POST 'https://api.oneaster.ai/core/v1/billing/nowpayments/ipn' \ --header 'x-nowpayments-sig: '"$NOWPAYMENTS_SIGNATURE" \ --header 'Content-Type: application/json' \ --data-binary @"$NOWPAYMENTS_IPN_FILE"
Parameters
- x-nowpayments-sig (header, Required): {"type":"string","pattern":"^[a-fA-F0-9]{128}$"} NOWPayments 官方 HMAC SHA512 签名。
Request JSON Schema
{
"type": "object",
"description": "NOWPayments 原始 IPN JSON;保留 body 和 x-nowpayments-sig,递归排序/HMAC SHA512 验签后查询支付证据。不得通过浏览器伪造付款结果。"
}
Responses
200
NOWPayments IPN 验签、查询核实与原子唯一入账
{
"application/json": {
"schema": {
"type": "object",
"additionalProperties": false,
"properties": {
"success": {
"const": true
},
"data": {
"oneOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"reused": {
"type": "boolean"
}
},
"required": [
"reused"
]
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"ignored": {
"const": true
}
},
"required": [
"ignored"
]
}
]
}
},
"required": [
"success",
"data"
]
}
}
}
default
错误代码见 core-api.md;供应商/数据库错误已隐藏。
{
"application/json": {
"schema": {
"type": "object",
"additionalProperties": false,
"properties": {
"success": {
"const": false
},
"error": {
"type": "object",
"additionalProperties": false,
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"type": {
"const": "oneaster_error"
}
},
"required": [
"code",
"message",
"type"
]
},
"data": {
"type": "null"
}
},
"required": [
"success",
"error",
"data"
]
}
}
}