Skip to main content

Create a rule

POST 

https://api.sandbox.noah.com/v1/beta1/rule

Create a rule used to create automated responses to events.

Request

Header Parameters

    Api-Signature string

    Digitally signed JWT.

Bodyrequired

    Trigger objectrequired
    Type

    Possible values: [DepositSourceTriggerInput]

    Conditions object[]required

    Conditions that trigger the rule.

  • Array [
  • AmountConditions object[]required

    Amount conditions for the rule.

  • Array [
  • ComparisonOperatorComparisonOperator (string)required

    Comparison operator for the field value:

    • EQ (Equals)
    • LTEQ (Less Than Or Equals)
    • GTEQ (Greater Than Or Equals)

    Possible values: [EQ, LTEQ, GTEQ]

    ValuePositiveDecimal (string)required

    Possible values: non-empty and <= 38 characters, Value must match regular expression ^[+]?([.]\d+|\d+[.]?\d*)$

    Example: 10.1
  • ]
  • CryptoCurrencyCryptoCurrencyCode (string)required

    Cryptocurrency (prod/sandbox):

    • BTC/BTC_TEST
    • USDC/USDC_TEST
    Example: BTC
    NetworkNetwork (string)required

    Account-based network (prod/sandbox):

    • Ethereum/EthereumTestSepolia
    • PolygonPos/PolygonTestAmoy
    Example: Ethereum
  • ]
  • SourceAddressAddress (string)required

    Address for transfer

    Example: bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4
    CustomerIDCustomerID (string)required

    A unique ID which identifies the customer in the Business' internal system and in NOAH.

    Possible values: non-empty and <= 36 characters

    Example: 550e8400-e29b-41d4-a716-446655440000
    Actions object[]required
  • Array [
  • oneOf
    Typestringrequired

    Possible values: [SellActionInput]

    CryptoCurrencystringrequired

    Cryptocurrency code or output reference.

    Example: ../CryptoCurrency
    CryptoAuthorizedAmount objectrequired

    Maximum amount that can be charged for this transaction.

    Valuestringrequired

    Decimal or output reference.

    Example: ../Amount
    Operations object[]

    Operations are applied to StepDecimal.Value in the order they appear in the array.

  • Array [
  • Operatorstringrequired

    Possible values: [Add, Sub, Mul]

    Valuestringrequired

    Decimal or output reference.

    Example: ../Value
  • ]
  • FiatAmount objectrequired

    Amount sent to customer's payment method.

    Valuestringrequired

    Decimal or output reference.

    Example: ../Amount
    Operations object[]

    Operations are applied to StepDecimal.Value in the order they appear in the array.

  • Array [
  • Operatorstringrequired

    Possible values: [Add, Sub, Mul]

    Valuestringrequired

    Decimal or output reference.

    Example: ../Value
  • ]
  • FormSessionIDuuidrequired

    Unique identifier for the Form Session. Form Session allows ramping using provided form data.

    ExternalIDExternalID (string)

    A unique identifier used in the business system to store a reference for the transaction. This field allows businesses to track and manage transactions within their internal systems.

    Possible values: non-empty and <= 36 characters

  • ]
  • Expirydate-time
    Example: 2024-04-16T08:00:55Z
    Permanentboolean

    If True, a rule can be executed repeatedly. Default is False.

    NonceNonce (string)required

    A string which must be unique each time a new transaction is created, like a UUID or operation sequence number. Request can be idempotently retried by using the same Nonce.

    Possible values: non-empty and <= 36 characters

    Example: dc879b38-494b-4de7-98a9-068703144328

Responses

Created rule

Schema
    Trigger objectrequired
    Typerequired

    Possible values: [DepositDestinationTrigger, DepositSourceTrigger]

    AmountPositiveDecimal (string)required

    Amount deposited

    Possible values: non-empty and <= 38 characters, Value must match regular expression ^[+]?([.]\d+|\d+[.]?\d*)$

    Example: 10.1
    CryptoCurrencyCryptoCurrencyCode (string)required

    Cryptocurrency (prod/sandbox):

    • BTC/BTC_TEST
    • USDC/USDC_TEST
    Example: BTC
    NetworkNetwork (string)

    Payments network (prod/sandbox):

    • Bitcoin/BitcoinTest
    • Lightning/LightningTest
    • Ethereum/EthereumTestSepolia
    • PolygonPos/PolygonTestAmoy
    • Solana/SolanaDevnet
    • OffNetwork/OffNetwork
    Example: Bitcoin
    CustomerIDCustomerID (string)

    A unique ID which identifies the customer in the Business' internal system and in NOAH.

    Possible values: non-empty and <= 36 characters

    Example: 550e8400-e29b-41d4-a716-446655440000
    RefundAddress object

    Address for refunds in case actions were not executed successfully.

    AddressAddress (string)required

    Address for transfer

    Example: bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4
    DepositAddress objectrequired

    Address generated for the deposit trigger.

    AddressAddress (string)required

    Address for transfer

    Example: bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4
    IDuuidrequired

Authorization: X-Api-Key

name: X-Api-Keytype: apiKeydescription: This security scheme requires an API Key to successfully authenticate.in: header
curl -L 'https://api.sandbox.noah.com/v1/beta1/rule' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-Api-Key: <X-Api-Key>' \
-d '{
"Trigger": {
"Type": "DepositSourceTriggerInput",
"Conditions": [
{
"AmountConditions": [
{
"ComparisonOperator": "EQ",
"Value": "10.1"
}
],
"CryptoCurrency": "BTC",
"Network": "Ethereum"
}
],
"SourceAddress": "bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4",
"CustomerID": "550e8400-e29b-41d4-a716-446655440000"
},
"Actions": [
{
"Type": "SellActionInput",
"CryptoCurrency": "../CryptoCurrency",
"CryptoAuthorizedAmount": {
"Value": "../Amount",
"Operations": [
{
"Operator": "Add",
"Value": "../Value"
}
]
},
"FiatAmount": {
"Value": "../Amount",
"Operations": [
{
"Operator": "Add",
"Value": "../Value"
}
]
},
"FormSessionID": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"ExternalID": "string"
}
],
"Expiry": "2024-04-16T08:00:55Z",
"Permanent": true,
"Nonce": "dc879b38-494b-4de7-98a9-068703144328"
}'
Request Collapse all
Base URL
https://api.sandbox.noah.com/v1
Auth
Parameters
— header
Body required
{
  "Trigger": {
    "Type": "DepositSourceTriggerInput",
    "Conditions": [
      {
        "AmountConditions": [
          {
            "ComparisonOperator": "EQ",
            "Value": "10.1"
          }
        ],
        "CryptoCurrency": "BTC",
        "Network": "Ethereum"
      }
    ],
    "SourceAddress": "bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4",
    "CustomerID": "550e8400-e29b-41d4-a716-446655440000"
  },
  "Actions": [
    {
      "Type": "SellActionInput",
      "CryptoCurrency": "../CryptoCurrency",
      "CryptoAuthorizedAmount": {
        "Value": "../Amount",
        "Operations": [
          {
            "Operator": "Add",
            "Value": "../Value"
          }
        ]
      },
      "FiatAmount": {
        "Value": "../Amount",
        "Operations": [
          {
            "Operator": "Add",
            "Value": "../Value"
          }
        ]
      },
      "FormSessionID": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "ExternalID": "string"
    }
  ],
  "Expiry": "2024-04-16T08:00:55Z",
  "Permanent": true,
  "Nonce": "dc879b38-494b-4de7-98a9-068703144328"
}
ResponseClear

Click the Send API Request button above and see the response here!