### Create Payment using cURL Source: https://nowpayments.io/api/index This snippet demonstrates how to create a payment using the NOWPayments API via cURL. It requires an API key and specifies payment details such as amount, currencies, and callback URL. This is a fundamental operation for initiating transactions. ```cURL curl --location 'https://api.nowpayments.io/v1/payment' \ --header 'x-api-key: {{api-key}}' \ --header 'Content-Type: application/json' \ --data '{ "price_amount": 3999.5, "price_currency": "usd", "pay_currency": "btc", "ipn_callback_url": "https://nowpayments.io", "order_id": "RGDBP-21314", "order_description": "Apple Macbook Pro 2019 x 1" }' ``` -------------------------------- ### POST /v1/payment - Create Payment Source: https://nowpayments.io/api/index This endpoint allows you to create a new payment transaction. You can specify the amount, currencies, callback URL, and order details. ```APIDOC ## POST /v1/payment ### Description Allows you to create a new payment transaction. You can specify the amount, currencies, callback URL, and order details. ### Method POST ### Endpoint /v1/payment ### Parameters #### Request Body - **price_amount** (number) - Required - The amount to be paid. - **price_currency** (string) - Required - The currency of the amount to be paid (e.g., "usd"). - **pay_currency** (string) - Required - The cryptocurrency to be paid with (e.g., "btc"). - **ipn_callback_url** (string) - Required - The URL to receive IPN (Instant Payment Notification) callbacks. - **order_id** (string) - Optional - Your internal order ID. - **order_description** (string) - Optional - A description for the order. ### Request Example ```json { "price_amount": 3999.5, "price_currency": "usd", "pay_currency": "btc", "ipn_callback_url": "https://nowpayments.io", "order_id": "RGDBP-21314", "order_description": "Apple Macbook Pro 2019 x 1" } ``` ### Response #### Success Response (200) - **payment_id** (string) - The unique identifier for the payment. - **payment_address** (string) - The address to send the payment to. - **pay_currency** (string) - The cryptocurrency to be paid with. - **order_id** (string) - Your internal order ID. - **order_description** (string) - Description for the order. - **created_at** (string) - Timestamp of payment creation. - **updated_at** (string) - Timestamp of last update. - **price_amount** (number) - The amount to be paid. - **price_currency** (string) - The currency of the amount to be paid. - **pay_amount** (number) - The amount to be paid in the cryptocurrency. - **actually_paid_amount** (number) - The amount actually paid in the cryptocurrency. - **deposit_address** (string) - The deposit address for the payment. - **transaction_hash** (string) - The transaction hash if the payment is confirmed. - **payment_status** (string) - The status of the payment (e.g., "waiting", "partially_paid", "finished"). #### Response Example ```json { "payment_id": "pn_example_id", "payment_address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa", "pay_currency": "btc", "order_id": "RGDBP-21314", "order_description": "Apple Macbook Pro 2019 x 1", "created_at": "2023-10-27T10:00:00Z", "updated_at": "2023-10-27T10:05:00Z", "price_amount": 3999.5, "price_currency": "usd", "pay_amount": 0.15, "actually_paid_amount": 0.15, "deposit_address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa", "transaction_hash": "0xabc123...", "payment_status": "finished" } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.