# Razorpay

> Take payments with your own Razorpay account: create orders and payment links, invoice customers, capture and refund payments, keep customers in step, and see settlements. Start workflows when a payment is captured, an order or payment link is paid, or a refund is made.

App · 26 actions. Web page: https://docs.lodol.com/docs/integrations/razorpay

## Actions

### Cancel invoice

Cancel an issued invoice so it can no longer be paid.

**Inputs**

- Invoice ID (`invoice_id`, text, required): The invoice's id, starting inv_, from 'List invoices' or an earlier step.

**Outputs**

- `amount` (number): The amount in the main unit of the currency, such as 499.5
- `currency` (text): The currency, such as INR
- `invoice` (object): The invoice

**Example output**

```json
{
  "amount": 499.0,
  "currency": "INR",
  "invoice": {
    "amount": 49900,
    "amount_due": 49900,
    "amount_paid": 0,
    "cancelled_at": 1660734500,
    "created_at": 1660734398,
    "currency": "INR",
    "customer_details": {
      "contact": "+919876543210",
      "email": "gaurav.kumar@example.com",
      "id": "cust_1Aa00000000004",
      "name": "Gaurav Kumar"
    },
    "customer_id": "cust_1Aa00000000004",
    "description": "Invoice for October",
    "email_status": null,
    "entity": "invoice",
    "expire_by": null,
    "id": "inv_K6g5bviu09mXo1",
    "invoice_number": null,
    "issued_at": 1660734398,
    "line_items": [
      {
        "amount": 49900,
        "currency": "INR",
        "description": "Cotton Cloth",
        "id": "li_K6g5bwLZuBmb1Q",
        "name": "Cloth",
        "net_amount": 49900,
        "quantity": 1
      }
    ],
    "notes": {},
    "order_id": "order_K6g5bxSIwYIXJS",
    "paid_at": null,
    "partial_payment": false,
    "payment_id": null,
    "receipt": "INV-1042",
    "short_url": "https://rzp.io/i/ksYThDL",
    "sms_status": null,
    "status": "cancelled"
  }
}
```

### Cancel payment link

Cancel a payment link so it can no longer be paid.

**Inputs**

- Payment link ID (`payment_link_id`, text, required): The payment link's id, starting plink_, from 'List payment links' or an earlier step.

**Outputs**

- `amount` (number): The amount in the main unit of the currency, such as 499.5
- `currency` (text): The currency, such as INR
- `payment_link` (object): The payment link

**Example output**

```json
{
  "amount": 499.0,
  "currency": "INR",
  "payment_link": {
    "accept_partial": false,
    "amount": 49900,
    "amount_paid": 0,
    "cancelled_at": 1591097270,
    "created_at": 1591097057,
    "currency": "INR",
    "customer": {
      "contact": "+919876543210",
      "email": "gaurav.kumar@example.com",
      "name": "Gaurav Kumar"
    },
    "description": "Payment for policy no #23456",
    "expire_by": 1691097057,
    "expired_at": 0,
    "first_min_partial_amount": 0,
    "id": "plink_ExjpAUN3gVHrPJ",
    "notes": {},
    "notify": {
      "email": false,
      "sms": false
    },
    "order_id": "order_KBneAVhT2zbzsU",
    "reference_id": "TS1989",
    "reminder_enable": false,
    "short_url": "https://rzp.io/i/nxrHnLJ",
    "status": "cancelled",
    "updated_at": 1591097057
  }
}
```

### Capture payment

Capture an authorized payment so the money is settled to you. Only needed when your account doesn't capture payments automatically. Uses the payment's own currency.

**Inputs**

- Payment ID (`payment_id`, text, required): The payment's id, starting pay_, from 'List payments', a trigger or an earlier step.
- Amount (`amount`, number): How much to capture, in the main unit, such as 499.00. Leave empty to capture the whole payment. At least 0.

**Outputs**

- `amount` (number): The amount in the main unit of the currency, such as 499.5
- `currency` (text): The currency, such as INR
- `payment` (object): The payment

**Example output**

```json
{
  "amount": 499.0,
  "currency": "INR",
  "payment": {
    "amount": 49900,
    "amount_refunded": 0,
    "bank": null,
    "captured": true,
    "card_id": null,
    "contact": "+919876543210",
    "created_at": 1678452635,
    "currency": "INR",
    "customer_id": null,
    "description": "Test Transaction",
    "email": "gaurav.kumar@example.com",
    "entity": "payment",
    "error_code": null,
    "error_description": null,
    "error_reason": null,
    "fee": 1180,
    "id": "pay_DG4ZdRK8ZnXC3k",
    "international": false,
    "invoice_id": null,
    "method": "upi",
    "notes": {
      "address": "Corporate Office"
    },
    "order_id": "order_RB58MiP5SPFYyM",
    "refund_status": null,
    "status": "captured",
    "tax": 180,
    "vpa": "gaurav.kumar@exampleupi",
    "wallet": null
  }
}
```

### Create customer

Add a customer with their name, email or phone. If one with the same details exists, it is returned instead, unless you choose to fail.

**Inputs**

- Name (`name`, text): The customer's name, 3 to 50 characters.
- Email (`email`, text): The customer's email address.
- Phone (`contact`, text): Their phone number with the country code, like +919876543210.
- GSTIN (`gstin`, text): The customer's GST number, if they have one.
- Notes (`notes`, object): Your own keys and values to keep with it, such as an order number from your shop. Up to 15, each up to 256 characters.
- If they already exist (`if_exists`, text): What to do when a customer with the same details is already in Razorpay. One of: `return` (Return the existing customer (default)), `fail` (Fail the step). Default: `return`.

**Outputs**

- `customer` (object): The customer

**Example output**

```json
{
  "customer": {
    "contact": "+919876543210",
    "created_at": 1678580352,
    "email": "gaurav.kumar@example.com",
    "entity": "customer",
    "gstin": null,
    "id": "cust_1Aa00000000004",
    "name": "Gaurav Kumar",
    "notes": {}
  }
}
```

### Create invoice

Create an invoice for a customer with one or more items, issued at once with a link to pay it, or saved as a draft. Razorpay sends it only if you switch on Email it or Text it.

**Inputs**

- Items (`line_items`, list, required): What the invoice charges for: each item's name, the price of one in the main unit, and how many.
- Customer (`customer_id`, text): Who the invoice is for. Pick a customer, or leave empty and give their name with an email or phone.
- Customer name (`customer_name`, text): The name of the person billed.
- Customer email (`customer_email`, text): The email address of the person billed.
- Customer phone (`customer_contact`, text): The phone number of the person billed, with the country code, like +919876543210.
- Currency (`currency`, text): The currency to charge in. Defaults to INR; others need international payments switched on in Razorpay. One of: `INR` (INR (Indian rupee)), `AED` (AED (United Arab Emirates Dirham)), `ALL` (ALL (Albanian lek)), `AMD` (AMD (Armenian dram)), `AUD` (AUD (Australian dollar)), `AWG` (AWG (Aruban florin)), `AZN` (AZN (Azerbaijan Manat)), `BAM` (BAM (Convertible Mark)), `BBD` (BBD (Barbadian dollar)), `BDT` (BDT (Bangladeshi taka)), and 118 more. Default: `INR`.
- Description (`description`, text): A short description shown on the invoice.
- Receipt number (`receipt`, text): Your own reference for it, up to 40 characters, such as INV-1042.
- Expires (`expire_by`, date and time): When the invoice can no longer be paid.
- Save as draft (`draft`, true/false): Keep it as a draft to issue later with 'Issue invoice', instead of issuing it now.
- Allow part payments (`partial_payment`, true/false): Let the customer pay in more than one part.
- Email it (`send_email`, true/false): Have Razorpay email the invoice to the customer. Off by default.
- Text it (`send_sms`, true/false): Have Razorpay text the invoice to the customer. Off by default.
- Notes (`notes`, object): Your own keys and values to keep with it, such as an order number from your shop. Up to 15, each up to 256 characters.

**Outputs**

- `amount` (number): The amount in the main unit of the currency, such as 499.5
- `currency` (text): The currency, such as INR
- `invoice` (object): The invoice

**Example output**

```json
{
  "amount": 499.0,
  "currency": "INR",
  "invoice": {
    "amount": 49900,
    "amount_due": 49900,
    "amount_paid": 0,
    "cancelled_at": null,
    "created_at": 1660734398,
    "currency": "INR",
    "customer_details": {
      "contact": "+919876543210",
      "email": "gaurav.kumar@example.com",
      "id": "cust_1Aa00000000004",
      "name": "Gaurav Kumar"
    },
    "customer_id": "cust_1Aa00000000004",
    "description": "Invoice for October",
    "email_status": null,
    "entity": "invoice",
    "expire_by": null,
    "id": "inv_K6g5bviu09mXo1",
    "invoice_number": null,
    "issued_at": 1660734398,
    "line_items": [
      {
        "amount": 49900,
        "currency": "INR",
        "description": "Cotton Cloth",
        "id": "li_K6g5bwLZuBmb1Q",
        "name": "Cloth",
        "net_amount": 49900,
        "quantity": 1
      }
    ],
    "notes": {},
    "order_id": "order_K6g5bxSIwYIXJS",
    "paid_at": null,
    "partial_payment": false,
    "payment_id": null,
    "receipt": "INV-1042",
    "short_url": "https://rzp.io/i/ksYThDL",
    "sms_status": null,
    "status": "issued"
  }
}
```

### Create order

Create an order for an amount a customer is about to pay, to hand to Razorpay Checkout on your site or app. Create a new one for every payment attempt.

**Inputs**

- Amount (`amount`, number, required): How much to charge, in the main unit, such as 499.00. At least 0.
- Currency (`currency`, text): The currency to charge in. Defaults to INR; others need international payments switched on in Razorpay. One of: `INR` (INR (Indian rupee)), `AED` (AED (United Arab Emirates Dirham)), `ALL` (ALL (Albanian lek)), `AMD` (AMD (Armenian dram)), `AUD` (AUD (Australian dollar)), `AWG` (AWG (Aruban florin)), `AZN` (AZN (Azerbaijan Manat)), `BAM` (BAM (Convertible Mark)), `BBD` (BBD (Barbadian dollar)), `BDT` (BDT (Bangladeshi taka)), and 118 more. Default: `INR`.
- Receipt number (`receipt`, text): Your own reference for it, up to 40 characters, such as INV-1042.
- Notes (`notes`, object): Your own keys and values to keep with it, such as an order number from your shop. Up to 15, each up to 256 characters.

**Outputs**

- `amount` (number): The amount in the main unit of the currency, such as 499.5
- `currency` (text): The currency, such as INR
- `order` (object): The order

**Example output**

```json
{
  "amount": 499.0,
  "currency": "INR",
  "order": {
    "amount": 49900,
    "amount_due": 49900,
    "amount_paid": 0,
    "attempts": 0,
    "created_at": 1756455561,
    "currency": "INR",
    "entity": "order",
    "id": "order_RB58MiP5SPFYyM",
    "notes": {
      "shop_order": "1042"
    },
    "receipt": "receipt#1",
    "status": "created"
  }
}
```

### Create payment link

Create a link anyone can open to pay an amount, by UPI, card, netbanking or wallet. Razorpay sends it to the customer only if you switch on Email it or Text it.

**Inputs**

- Amount (`amount`, number, required): How much to collect, in the main unit, such as 499.00. At least 0.
- Currency (`currency`, text): The currency to charge in. Defaults to INR; others need international payments switched on in Razorpay. One of: `INR` (INR (Indian rupee)), `AED` (AED (United Arab Emirates Dirham)), `ALL` (ALL (Albanian lek)), `AMD` (AMD (Armenian dram)), `AUD` (AUD (Australian dollar)), `AWG` (AWG (Aruban florin)), `AZN` (AZN (Azerbaijan Manat)), `BAM` (BAM (Convertible Mark)), `BBD` (BBD (Barbadian dollar)), `BDT` (BDT (Bangladeshi taka)), and 118 more. Default: `INR`.
- Description (`description`, text): What the payment is for, shown to the customer.
- Customer name (`customer_name`, text): The name of the person paying.
- Customer email (`customer_email`, text): The email address of the person paying.
- Customer phone (`customer_contact`, text): The phone number of the person paying, with the country code, like +919876543210.
- Email it (`send_email`, true/false): Have Razorpay email the link to the customer. Off by default.
- Text it (`send_sms`, true/false): Have Razorpay text the link to the customer. Off by default.
- Expires (`expire_by`, date and time): When the link stops working, at most six months away. Leave empty for six months.
- Reference (`reference_id`, text): Your own reference for the link, up to 40 characters, different for every link.
- Allow part payments (`accept_partial`, true/false): Let the customer pay in more than one part.
- Smallest first part (`first_min_partial_amount`, number): With part payments, the least the first part can be, such as 100.00. At least 0.
- Send reminders (`reminder_enable`, true/false): Have Razorpay remind the customer until they pay.
- Return address (`callback_url`, text): A web address to send the customer to once they have paid, starting https://.
- Notes (`notes`, object): Your own keys and values to keep with it, such as an order number from your shop. Up to 15, each up to 256 characters.

**Outputs**

- `amount` (number): The amount in the main unit of the currency, such as 499.5
- `currency` (text): The currency, such as INR
- `payment_link` (object): The payment link

**Example output**

```json
{
  "amount": 499.0,
  "currency": "INR",
  "payment_link": {
    "accept_partial": false,
    "amount": 49900,
    "amount_paid": 0,
    "cancelled_at": 0,
    "created_at": 1591097057,
    "currency": "INR",
    "customer": {
      "contact": "+919876543210",
      "email": "gaurav.kumar@example.com",
      "name": "Gaurav Kumar"
    },
    "description": "Payment for policy no #23456",
    "expire_by": 1691097057,
    "expired_at": 0,
    "first_min_partial_amount": 0,
    "id": "plink_ExjpAUN3gVHrPJ",
    "notes": {},
    "notify": {
      "email": false,
      "sms": false
    },
    "order_id": "order_KBneAVhT2zbzsU",
    "reference_id": "TS1989",
    "reminder_enable": false,
    "short_url": "https://rzp.io/i/nxrHnLJ",
    "status": "created",
    "updated_at": 1591097057
  }
}
```

### Get customer

Get one customer with their name, email, phone, GSTIN and notes.

**Inputs**

- Customer (`customer_id`, text, required): The customer. Pick one, or give their id (cust_...) from an earlier step.

**Outputs**

- `customer` (object): The customer

**Example output**

```json
{
  "customer": {
    "contact": "+919876543210",
    "created_at": 1678580352,
    "email": "gaurav.kumar@example.com",
    "entity": "customer",
    "gstin": null,
    "id": "cust_1Aa00000000004",
    "name": "Gaurav Kumar",
    "notes": {}
  }
}
```

### Get invoice

Get one invoice with its customer, items, status, amount due and link to pay it.

**Inputs**

- Invoice ID (`invoice_id`, text, required): The invoice's id, starting inv_, from 'List invoices' or an earlier step.

**Outputs**

- `amount` (number): The amount in the main unit of the currency, such as 499.5
- `currency` (text): The currency, such as INR
- `invoice` (object): The invoice

**Example output**

```json
{
  "amount": 499.0,
  "currency": "INR",
  "invoice": {
    "amount": 49900,
    "amount_due": 49900,
    "amount_paid": 0,
    "cancelled_at": null,
    "created_at": 1660734398,
    "currency": "INR",
    "customer_details": {
      "contact": "+919876543210",
      "email": "gaurav.kumar@example.com",
      "id": "cust_1Aa00000000004",
      "name": "Gaurav Kumar"
    },
    "customer_id": "cust_1Aa00000000004",
    "description": "Invoice for October",
    "email_status": null,
    "entity": "invoice",
    "expire_by": null,
    "id": "inv_K6g5bviu09mXo1",
    "invoice_number": null,
    "issued_at": 1660734398,
    "line_items": [
      {
        "amount": 49900,
        "currency": "INR",
        "description": "Cotton Cloth",
        "id": "li_K6g5bwLZuBmb1Q",
        "name": "Cloth",
        "net_amount": 49900,
        "quantity": 1
      }
    ],
    "notes": {},
    "order_id": "order_K6g5bxSIwYIXJS",
    "paid_at": null,
    "partial_payment": false,
    "payment_id": null,
    "receipt": "INV-1042",
    "short_url": "https://rzp.io/i/ksYThDL",
    "sms_status": null,
    "status": "issued"
  }
}
```

### Get order

Get one order with its amount paid and due, status and attempts.

**Inputs**

- Order ID (`order_id`, text, required): The order's id, starting order_, from 'List orders' or an earlier step.

**Outputs**

- `amount` (number): The amount in the main unit of the currency, such as 499.5
- `currency` (text): The currency, such as INR
- `order` (object): The order

**Example output**

```json
{
  "amount": 499.0,
  "currency": "INR",
  "order": {
    "amount": 49900,
    "amount_due": 49900,
    "amount_paid": 0,
    "attempts": 0,
    "created_at": 1756455561,
    "currency": "INR",
    "entity": "order",
    "id": "order_RB58MiP5SPFYyM",
    "notes": {
      "shop_order": "1042"
    },
    "receipt": "receipt#1",
    "status": "created"
  }
}
```

### Get payment

Get one payment with its status, method, customer email and phone, fees and any error.

**Inputs**

- Payment ID (`payment_id`, text, required): The payment's id, starting pay_, from 'List payments', a trigger or an earlier step.

**Outputs**

- `amount` (number): The amount in the main unit of the currency, such as 499.5
- `currency` (text): The currency, such as INR
- `payment` (object): The payment

**Example output**

```json
{
  "amount": 499.0,
  "currency": "INR",
  "payment": {
    "amount": 49900,
    "amount_refunded": 0,
    "bank": null,
    "captured": true,
    "card_id": null,
    "contact": "+919876543210",
    "created_at": 1678452635,
    "currency": "INR",
    "customer_id": null,
    "description": "Test Transaction",
    "email": "gaurav.kumar@example.com",
    "entity": "payment",
    "error_code": null,
    "error_description": null,
    "error_reason": null,
    "fee": 1180,
    "id": "pay_DG4ZdRK8ZnXC3k",
    "international": false,
    "invoice_id": null,
    "method": "upi",
    "notes": {
      "address": "Corporate Office"
    },
    "order_id": "order_RB58MiP5SPFYyM",
    "refund_status": null,
    "status": "captured",
    "tax": 180,
    "vpa": "gaurav.kumar@exampleupi",
    "wallet": null
  }
}
```

### Get payment link

Get one payment link with its address, status and how much has been paid.

**Inputs**

- Payment link ID (`payment_link_id`, text, required): The payment link's id, starting plink_, from 'List payment links' or an earlier step.

**Outputs**

- `amount` (number): The amount in the main unit of the currency, such as 499.5
- `currency` (text): The currency, such as INR
- `payment_link` (object): The payment link

**Example output**

```json
{
  "amount": 499.0,
  "currency": "INR",
  "payment_link": {
    "accept_partial": false,
    "amount": 49900,
    "amount_paid": 0,
    "cancelled_at": 0,
    "created_at": 1591097057,
    "currency": "INR",
    "customer": {
      "contact": "+919876543210",
      "email": "gaurav.kumar@example.com",
      "name": "Gaurav Kumar"
    },
    "description": "Payment for policy no #23456",
    "expire_by": 1691097057,
    "expired_at": 0,
    "first_min_partial_amount": 0,
    "id": "plink_ExjpAUN3gVHrPJ",
    "notes": {},
    "notify": {
      "email": false,
      "sms": false
    },
    "order_id": "order_KBneAVhT2zbzsU",
    "reference_id": "TS1989",
    "reminder_enable": false,
    "short_url": "https://rzp.io/i/nxrHnLJ",
    "status": "created",
    "updated_at": 1591097057
  }
}
```

### Get refund

Get one refund with its amount, status and how fast it was sent.

**Inputs**

- Refund ID (`refund_id`, text, required): The refund's id, starting rfnd_, from 'List refunds' or an earlier step.

**Outputs**

- `amount` (number): The amount in the main unit of the currency, such as 499.5
- `currency` (text): The currency, such as INR
- `refund` (object): The refund

**Example output**

```json
{
  "amount": 499.0,
  "currency": "INR",
  "refund": {
    "amount": 49900,
    "batch_id": null,
    "created_at": 1597078866,
    "currency": "INR",
    "entity": "refund",
    "id": "rfnd_FP8QHiV938haTz",
    "notes": {},
    "payment_id": "pay_DG4ZdRK8ZnXC3k",
    "receipt": "Receipt No. 31",
    "speed_processed": "normal",
    "speed_requested": "normal",
    "status": "processed"
  }
}
```

### Issue invoice

Issue a draft invoice so the customer can pay it.

**Inputs**

- Invoice ID (`invoice_id`, text, required): The invoice's id, starting inv_, from 'List invoices' or an earlier step.

**Outputs**

- `amount` (number): The amount in the main unit of the currency, such as 499.5
- `currency` (text): The currency, such as INR
- `invoice` (object): The invoice

**Example output**

```json
{
  "amount": 499.0,
  "currency": "INR",
  "invoice": {
    "amount": 49900,
    "amount_due": 49900,
    "amount_paid": 0,
    "cancelled_at": null,
    "created_at": 1660734398,
    "currency": "INR",
    "customer_details": {
      "contact": "+919876543210",
      "email": "gaurav.kumar@example.com",
      "id": "cust_1Aa00000000004",
      "name": "Gaurav Kumar"
    },
    "customer_id": "cust_1Aa00000000004",
    "description": "Invoice for October",
    "email_status": null,
    "entity": "invoice",
    "expire_by": null,
    "id": "inv_K6g5bviu09mXo1",
    "invoice_number": null,
    "issued_at": 1660734398,
    "line_items": [
      {
        "amount": 49900,
        "currency": "INR",
        "description": "Cotton Cloth",
        "id": "li_K6g5bwLZuBmb1Q",
        "name": "Cloth",
        "net_amount": 49900,
        "quantity": 1
      }
    ],
    "notes": {},
    "order_id": "order_K6g5bxSIwYIXJS",
    "paid_at": null,
    "partial_payment": false,
    "payment_id": null,
    "receipt": "INV-1042",
    "short_url": "https://rzp.io/i/ksYThDL",
    "sms_status": null,
    "status": "issued"
  }
}
```

### List customers

List customers, newest first.

**Inputs**

- How many (`count`, number): How many to return, newest first, 1 to 100. Razorpay's default is 10. From 1 to 100.
- Skip (`skip`, number): How many of the newest to pass over first, to get the next ones. At least 0.

**Outputs**

- `count` (number): How many were returned
- `customers` (list): The customers
- `has_more` (true/false): True when there may be more: raise How many or use Skip

**Example output**

```json
{
  "count": 1,
  "customers": [
    {
      "contact": "+919876543210",
      "created_at": 1678580352,
      "email": "gaurav.kumar@example.com",
      "entity": "customer",
      "gstin": null,
      "id": "cust_1Aa00000000004",
      "name": "Gaurav Kumar",
      "notes": {}
    }
  ],
  "has_more": false
}
```

### List invoices

List invoices, newest first, optionally only one customer's, the one a payment paid, or one receipt number's.

**Inputs**

- Customer (`customer_id`, text): Only this customer's invoices.
- Paid by payment (`payment_id`, text): Only the invoice this payment (pay_...) paid.
- Receipt number (`receipt`, text): Only the invoice with this receipt number.
- How many (`count`, number): How many to return, newest first, 1 to 100. Razorpay's default is 10. From 1 to 100.
- Skip (`skip`, number): How many of the newest to pass over first, to get the next ones. At least 0.

**Outputs**

- `count` (number): How many were returned
- `has_more` (true/false): True when there may be more: raise How many or use Skip
- `invoices` (list): The invoices

**Example output**

```json
{
  "count": 1,
  "has_more": false,
  "invoices": [
    {
      "amount": 49900,
      "amount_due": 49900,
      "amount_paid": 0,
      "cancelled_at": null,
      "created_at": 1660734398,
      "currency": "INR",
      "customer_details": {
        "contact": "+919876543210",
        "email": "gaurav.kumar@example.com",
        "id": "cust_1Aa00000000004",
        "name": "Gaurav Kumar"
      },
      "customer_id": "cust_1Aa00000000004",
      "description": "Invoice for October",
      "email_status": null,
      "entity": "invoice",
      "expire_by": null,
      "id": "inv_K6g5bviu09mXo1",
      "invoice_number": null,
      "issued_at": 1660734398,
      "line_items": [
        {
          "amount": 49900,
          "currency": "INR",
          "description": "Cotton Cloth",
          "id": "li_K6g5bwLZuBmb1Q",
          "name": "Cloth",
          "net_amount": 49900,
          "quantity": 1
        }
      ],
      "notes": {},
      "order_id": "order_K6g5bxSIwYIXJS",
      "paid_at": null,
      "partial_payment": false,
      "payment_id": null,
      "receipt": "INV-1042",
      "short_url": "https://rzp.io/i/ksYThDL",
      "sms_status": null,
      "status": "issued"
    }
  ]
}
```

### List orders

List orders, newest first, optionally only those made in a time range, those with or without a successful payment, or one receipt number's.

**Inputs**

- Made after (`from_time`, date and time): Only those made at or after this time.
- Made before (`to_time`, date and time): Only those made at or before this time.
- Payment (`paid`, text): Only orders with a successful payment, or only those without. One of: `1` (With a successful payment), `0` (Without a successful payment yet).
- Receipt number (`receipt`, text): Only the order with this receipt number.
- How many (`count`, number): How many to return, newest first, 1 to 100. Razorpay's default is 10. From 1 to 100.
- Skip (`skip`, number): How many of the newest to pass over first, to get the next ones. At least 0.

**Outputs**

- `count` (number): How many were returned
- `has_more` (true/false): True when there may be more: raise How many or use Skip
- `orders` (list): The orders

**Example output**

```json
{
  "count": 1,
  "has_more": false,
  "orders": [
    {
      "amount": 49900,
      "amount_due": 49900,
      "amount_paid": 0,
      "attempts": 0,
      "created_at": 1756455561,
      "currency": "INR",
      "entity": "order",
      "id": "order_RB58MiP5SPFYyM",
      "notes": {
        "shop_order": "1042"
      },
      "receipt": "receipt#1",
      "status": "created"
    }
  ]
}
```

### List payment links

List payment links, or find the one a payment paid or the one with your reference.

**Inputs**

- Paid by payment (`payment_id`, text): Only the link this payment (pay_...) was made through.
- Reference (`reference_id`, text): Only the link with this reference of yours.

**Outputs**

- `count` (number): How many were returned
- `payment_links` (list): The payment links

**Example output**

```json
{
  "count": 1,
  "payment_links": [
    {
      "accept_partial": false,
      "amount": 49900,
      "amount_paid": 0,
      "cancelled_at": 0,
      "created_at": 1591097057,
      "currency": "INR",
      "customer": {
        "contact": "+919876543210",
        "email": "gaurav.kumar@example.com",
        "name": "Gaurav Kumar"
      },
      "description": "Payment for policy no #23456",
      "expire_by": 1691097057,
      "expired_at": 0,
      "first_min_partial_amount": 0,
      "id": "plink_ExjpAUN3gVHrPJ",
      "notes": {},
      "notify": {
        "email": false,
        "sms": false
      },
      "order_id": "order_KBneAVhT2zbzsU",
      "reference_id": "TS1989",
      "reminder_enable": false,
      "short_url": "https://rzp.io/i/nxrHnLJ",
      "status": "created",
      "updated_at": 1591097057
    }
  ]
}
```

### List payments

List payments, newest first, optionally only those made in a time range.

**Inputs**

- Made after (`from_time`, date and time): Only those made at or after this time.
- Made before (`to_time`, date and time): Only those made at or before this time.
- How many (`count`, number): How many to return, newest first, 1 to 100. Razorpay's default is 10. From 1 to 100.
- Skip (`skip`, number): How many of the newest to pass over first, to get the next ones. At least 0.

**Outputs**

- `count` (number): How many were returned
- `has_more` (true/false): True when there may be more: raise How many or use Skip
- `payments` (list): The payments

**Example output**

```json
{
  "count": 1,
  "has_more": false,
  "payments": [
    {
      "amount": 49900,
      "amount_refunded": 0,
      "bank": null,
      "captured": true,
      "card_id": null,
      "contact": "+919876543210",
      "created_at": 1678452635,
      "currency": "INR",
      "customer_id": null,
      "description": "Test Transaction",
      "email": "gaurav.kumar@example.com",
      "entity": "payment",
      "error_code": null,
      "error_description": null,
      "error_reason": null,
      "fee": 1180,
      "id": "pay_DG4ZdRK8ZnXC3k",
      "international": false,
      "invoice_id": null,
      "method": "upi",
      "notes": {
        "address": "Corporate Office"
      },
      "order_id": "order_RB58MiP5SPFYyM",
      "refund_status": null,
      "status": "captured",
      "tax": 180,
      "vpa": "gaurav.kumar@exampleupi",
      "wallet": null
    }
  ]
}
```

### List payments for order

List every payment tried on an order, successful or not.

**Inputs**

- Order ID (`order_id`, text, required): The order's id, starting order_, from 'List orders' or an earlier step.

**Outputs**

- `count` (number): How many were returned
- `has_more` (true/false): True when there may be more: raise How many or use Skip
- `payments` (list): The order's payments

**Example output**

```json
{
  "count": 1,
  "has_more": false,
  "payments": [
    {
      "amount": 49900,
      "amount_refunded": 0,
      "bank": null,
      "captured": true,
      "card_id": null,
      "contact": "+919876543210",
      "created_at": 1678452635,
      "currency": "INR",
      "customer_id": null,
      "description": "Test Transaction",
      "email": "gaurav.kumar@example.com",
      "entity": "payment",
      "error_code": null,
      "error_description": null,
      "error_reason": null,
      "fee": 1180,
      "id": "pay_DG4ZdRK8ZnXC3k",
      "international": false,
      "invoice_id": null,
      "method": "upi",
      "notes": {
        "address": "Corporate Office"
      },
      "order_id": "order_RB58MiP5SPFYyM",
      "refund_status": null,
      "status": "captured",
      "tax": 180,
      "vpa": "gaurav.kumar@exampleupi",
      "wallet": null
    }
  ]
}
```

### List refunds

List refunds, newest first: all of them, or one payment's, optionally only those made in a time range.

**Inputs**

- Payment ID (`payment_id`, text): Only this payment's refunds (pay_...). Leave empty for all.
- Made after (`from_time`, date and time): Only those made at or after this time.
- Made before (`to_time`, date and time): Only those made at or before this time.
- How many (`count`, number): How many to return, newest first, 1 to 100. Razorpay's default is 10. From 1 to 100.
- Skip (`skip`, number): How many of the newest to pass over first, to get the next ones. At least 0.

**Outputs**

- `count` (number): How many were returned
- `has_more` (true/false): True when there may be more: raise How many or use Skip
- `refunds` (list): The refunds

**Example output**

```json
{
  "count": 1,
  "has_more": false,
  "refunds": [
    {
      "amount": 49900,
      "batch_id": null,
      "created_at": 1597078866,
      "currency": "INR",
      "entity": "refund",
      "id": "rfnd_FP8QHiV938haTz",
      "notes": {},
      "payment_id": "pay_DG4ZdRK8ZnXC3k",
      "receipt": "Receipt No. 31",
      "speed_processed": "normal",
      "speed_requested": "normal",
      "status": "processed"
    }
  ]
}
```

### List settlements

List settlements, the money Razorpay has paid into your bank account, newest first, with their bank reference (UTR).

**Inputs**

- Made after (`from_time`, date and time): Only those made at or after this time.
- Made before (`to_time`, date and time): Only those made at or before this time.
- How many (`count`, number): How many to return, newest first, 1 to 100. Razorpay's default is 10. From 1 to 100.
- Skip (`skip`, number): How many of the newest to pass over first, to get the next ones. At least 0.

**Outputs**

- `count` (number): How many were returned
- `has_more` (true/false): True when there may be more: raise How many or use Skip
- `settlements` (list): The settlements

**Example output**

```json
{
  "count": 1,
  "has_more": false,
  "settlements": [
    {
      "amount": 9973635,
      "created_at": 1568176960,
      "entity": "settlement",
      "fees": 0,
      "id": "setl_DGlQ1Rj8os78Ec",
      "status": "processed",
      "tax": 0,
      "utr": "1568176960vxp0rj"
    }
  ]
}
```

### Refund payment

Refund a captured payment in full, or part of it. The money goes back the way the customer paid, in the payment's currency.

**Inputs**

- Payment ID (`payment_id`, text, required): The payment's id, starting pay_, from 'List payments', a trigger or an earlier step.
- Amount (`amount`, number): How much to refund, in the main unit, such as 100.00. Leave empty to refund everything not yet refunded. At least 0.
- Speed (`speed`, text): Normal takes 5 to 7 working days. Instant, where the customer's bank allows it, may cost a fee. One of: `normal` (Normal, 5 to 7 working days (default)), `optimum` (Instant where possible, normal otherwise). Default: `normal`.
- Receipt number (`receipt`, text): Your own reference for the refund, up to 40 characters. Running the step again with the same one doesn't refund twice.
- Notes (`notes`, object): Your own keys and values to keep with it, such as an order number from your shop. Up to 15, each up to 256 characters.

**Outputs**

- `amount` (number): The amount in the main unit of the currency, such as 499.5
- `currency` (text): The currency, such as INR
- `refund` (object): The refund

**Example output**

```json
{
  "amount": 499.0,
  "currency": "INR",
  "refund": {
    "amount": 49900,
    "batch_id": null,
    "created_at": 1597078866,
    "currency": "INR",
    "entity": "refund",
    "id": "rfnd_FP8QHiV938haTz",
    "notes": {},
    "payment_id": "pay_DG4ZdRK8ZnXC3k",
    "receipt": "Receipt No. 31",
    "speed_processed": "normal",
    "speed_requested": "normal",
    "status": "processed"
  }
}
```

### Send payment link

Have Razorpay send a payment link to its customer by email or SMS, again if it was sent before.

**Inputs**

- Payment link ID (`payment_link_id`, text, required): The payment link's id, starting plink_, from 'List payment links' or an earlier step.
- Send by (`medium`, text, required): Email (to the link's customer email) or SMS (to their phone). One of: `email`, `sms`.

**Outputs**

- `medium` (text): email or sms
- `payment_link_id` (text): The payment link sent
- `sent` (true/false): True once Razorpay sent it

**Example output**

```json
{
  "medium": "email",
  "payment_link_id": "plink_ExjpAUN3gVHrPJ",
  "sent": true
}
```

### Update customer

Change a customer's name, email or phone. Only the fields given change.

**Inputs**

- Customer (`customer_id`, text, required): The customer. Pick one, or give their id (cust_...) from an earlier step.
- Name (`name`, text): A new name, 3 to 50 characters. Leave empty to keep it.
- Email (`email`, text): A new email address. Leave empty to keep it.
- Phone (`contact`, text): A new phone number with the country code. Leave empty to keep it.

**Outputs**

- `customer` (object): The customer

**Example output**

```json
{
  "customer": {
    "contact": "+919876543210",
    "created_at": 1678580352,
    "email": "gaurav.kumar@example.com",
    "entity": "customer",
    "gstin": null,
    "id": "cust_1Aa00000000004",
    "name": "Gaurav Kumar",
    "notes": {}
  }
}
```

### Update payment notes

Replace the notes kept with a payment, such as your own order number.

**Inputs**

- Payment ID (`payment_id`, text, required): The payment's id, starting pay_, from 'List payments', a trigger or an earlier step.
- Notes (`notes`, object, required): The keys and values to keep with the payment. They replace its current notes. Up to 15, each up to 256 characters.

**Outputs**

- `amount` (number): The amount in the main unit of the currency, such as 499.5
- `currency` (text): The currency, such as INR
- `payment` (object): The payment

**Example output**

```json
{
  "amount": 499.0,
  "currency": "INR",
  "payment": {
    "amount": 49900,
    "amount_refunded": 0,
    "bank": null,
    "captured": true,
    "card_id": null,
    "contact": "+919876543210",
    "created_at": 1678452635,
    "currency": "INR",
    "customer_id": null,
    "description": "Test Transaction",
    "email": "gaurav.kumar@example.com",
    "entity": "payment",
    "error_code": null,
    "error_description": null,
    "error_reason": null,
    "fee": 1180,
    "id": "pay_DG4ZdRK8ZnXC3k",
    "international": false,
    "invoice_id": null,
    "method": "upi",
    "notes": {
      "address": "Corporate Office"
    },
    "order_id": "order_RB58MiP5SPFYyM",
    "refund_status": null,
    "status": "captured",
    "tax": 180,
    "vpa": "gaurav.kumar@exampleupi",
    "wallet": null
  }
}
```
