Create Price

Creating a triggerless price is straightforward: just input the desired amount and currency. Additionally, you have the option to specify whether the price is intended for a single use or multiple uses, and you can also include custom metadata for further customization.

const data = {
  currency: "usd",
  amount: 5,
};

const response = await fetch(
  `https://api.noramp.io/prices/${process.env.NORAMP_APP_ID}`,
  {
    method: "POST",
    headers: {
      "content-type": "application/json",
      authorization: `Bearer ${process.env.NORAMP_API_KEY}`,
    },
    body: JSON.stringify(data),
  }
);

Create Webhook

To ensure real-time updates on payment status, it’s crucial to establish a webhook in the seller dashboard. This enables you to receive prompt notifications whenever payments are made.

Listening Events

After a successful payment, you will receive an event notification similar to this:

{
    "type": "payment",
    "data": {
        "id": "pay_3jenZHVvQZOFqf88qfq3Gn",
        "app": {
            "id": "app_6rflfTPFV9a2lsiqlFswpg",
            "name": "Wax App",
            "kyc_return_url": null
        },
        "price": {
            "id": "price_19tZoo8wAMDpVPwALlSWZq",
            "kyc_id": null,
            "trigger_id": null,
            "trigger_intent_id": null,
            "trigger_params_data_input": null,
            "name": null,
            "type": "dynamic",
            "amount": 11,
            "currency": "usd",
            "currency_conversion": null,
            "metadata": {
                "my_platform_payment_id": 1234
            },
            "deleted": false,
            "expired": false,
            "views": 0,
            "price_item": null,
            "created_at": "2023-07-23T18:10:02.018Z",
            "updated_at": "2023-07-23T18:10:02.018Z"
        },
        "status": "paid",
        "final_amount": 11,
        "price_item": {
            "currency": "usd",
            "provider_processing_fee_percent": 2.9,
            "provider_min_amount_fee": 0.3,
            "app_fee": 0,
            "app_type": "individual",
            "platform_fee": 0.59,
            "amount": 11,
            "amount_total": 11.864055538286188,
            "amount_transaction_fee": 0,
            "amount_app_transaction_fee": 0,
            "amount_platform": 0.0649,
            "amount_seller": 0,
            "amount_app": 11
        },
        "payment_provider": "card",
        "trigger_data_input": {},
        "transaction_url": null,
        "created_at": "2023-07-23T18:11:19.622Z",
        "updated_at": "2023-07-23T18:11:22.000Z"
    }
}

Prior to executing any actions, it is imperative to verify both the type and status to ensure a seamless and appropriate process.