# Dodo Payments

> Create checkout sessions and manage customers, payments, subscriptions, and refunds.

App · 20 actions. Web page: https://docs.lodol.com/docs/integrations/dodo-payments

## Actions

### Create checkout

Create checkout in Dodo Payments.

**Inputs**

- Billing address (`billing_address`, object): Billing address information for the session.
- Cancel URL (`cancel_url`, text): The URL to redirect the customer if they cancel or go back from the checkout.
- Customer (`customer`, text): Customer details for the session.
- Discount code (`discount_code`, text): DEPRECATED: Use discount_codes instead. Cannot be used together with discount_codes.
- Metadata (`metadata`, object): Additional metadata associated with the payment. Defaults to empty if not provided.
- Product cart (`product_cart`, list, required): The products of the checkout. A cart holds at most 20 of them, one-time and.
- Return URL (`return_url`, text): The url to redirect after payment failure or success.

**Outputs**

- `data` (object): The result returned by Dodo Payments.

**Example output**

```json
{
  "data": {
    "checkout_url": "example",
    "client_secret": "example",
    "payment_id": "example",
    "publishable_key": "example",
    "session_id": "example"
  }
}
```

### Create customer

Create customer in Dodo Payments.

**Inputs**

- Email (`email`, text, required): Email.
- Metadata (`metadata`, object): Additional metadata for the customer.
- Name (`name`, text, required): Name.
- Phone number (`phone_number`, text): Phone number.

**Outputs**

- `data` (object): The result returned by Dodo Payments.

**Example output**

```json
{
  "data": {
    "blocked_at": "example",
    "blocklist_entry_id": "example",
    "business_id": "example",
    "created_at": "example",
    "customer_id": "example",
    "email": "example",
    "metadata": {},
    "name": "example",
    "phone_number": "example"
  }
}
```

### Create customer portal session

Create customer portal session in Dodo Payments.

**Inputs**

- Send email (`send_email`, true/false): If true, will send link to user.
- Return URL (`return_url`, text): Optional return URL for this session. Overrides the business-level default.
- Customer (`customer_id`, text, required): Customer Id.

**Outputs**

- `data` (object): The result returned by Dodo Payments.

**Example output**

```json
{
  "data": {
    "link": "example"
  }
}
```

### Create refund

Create refund in Dodo Payments.

**Inputs**

- Currency (`currency`, text): The currency of every `items[].amount`. It must be the currency the customer paid in. One of: `AED`, `ALL`, `AMD`, `ANG`, `AOA`, `ARS`, `AUD`, `AWG`, `AZN`, `BAM`, and 135 more.
- Items (`items`, list): Partially Refund an Individual Item.
- Metadata (`metadata`, object): Additional metadata associated with the refund.
- Payment (`payment_id`, text, required): The unique identifier of the payment to be refunded.
- Reason (`reason`, text): The reason for the refund, if any. Maximum length is 3000 characters. Optional.

**Outputs**

- `data` (object): The result returned by Dodo Payments.

**Example output**

```json
{
  "data": {
    "amount": 1,
    "brand_id": "example",
    "business_id": "example",
    "created_at": "example",
    "currency": null,
    "customer": {
      "customer_id": "example",
      "email": "example",
      "metadata": {},
      "name": "example",
      "phone_number": "example"
    },
    "is_partial": false,
    "metadata": {},
    "network_reference": "example",
    "network_reference_type": null,
    "network_reference_updated_at": "example",
    "payment_id": "example",
    "reason": "example",
    "refund_id": "example",
    "status": "succeeded"
  }
}
```

### Get checkout

Retrieve checkout from Dodo Payments.

**Inputs**

- Checkout ID (`checkout_id`, text, required): Checkout Session ID.

**Outputs**

- `data` (object): The result returned by Dodo Payments.

**Example output**

```json
{
  "data": {
    "created_at": "example",
    "customer_email": "example",
    "customer_name": "example",
    "id": "example",
    "payment_id": "example",
    "payment_status": null
  }
}
```

### Get customer

Retrieve customer from Dodo Payments.

**Inputs**

- Customer (`customer_id`, text, required): Customer Id.

**Outputs**

- `data` (object): The result returned by Dodo Payments.

**Example output**

```json
{
  "data": {
    "blocked_at": "example",
    "blocklist_entry_id": "example",
    "business_id": "example",
    "created_at": "example",
    "customer_id": "example",
    "email": "example",
    "metadata": {},
    "name": "example",
    "phone_number": "example"
  }
}
```

### Get payment

Retrieve payment from Dodo Payments.

**Inputs**

- Payment (`payment_id`, text, required): Payment Id.

**Outputs**

- `data` (object): The result returned by Dodo Payments.

**Example output**

```json
{
  "data": {
    "billing": {
      "city": "example",
      "country": "AF",
      "state": "example",
      "street": "example",
      "zipcode": "example"
    },
    "brand_id": "example",
    "business_id": "example",
    "card_exp_month": "example",
    "card_exp_year": "example",
    "card_holder_name": "example",
    "card_issuing_country": null,
    "card_last_four": "example",
    "card_network": "example",
    "card_type": "example",
    "charge_type": null,
    "checkout_session_id": "example",
    "created_at": "example",
    "currency": "AED",
    "custom_field_responses": [],
    "customer": {
      "customer_id": "example",
      "email": "example",
      "metadata": {},
      "name": "example",
      "phone_number": "example"
    },
    "digital_products_delivered": false,
    "discount_id": "example",
    "discounts": [],
    "disputes": [],
    "error_code": "example",
    "error_message": "example",
    "includes_usage": false,
    "invoice_id": "example",
    "invoice_url": "example",
    "is_multi_subscription": false,
    "is_update_payment_method": false,
    "metadata": {},
    "payment_id": "example",
    "payment_link": "example",
    "payment_method": "example",
    "payment_method_id": "example",
    "payment_method_type": "example",
    "payment_provider": "stripe",
    "product_cart": [],
    "refund_status": null,
    "refunds": [],
    "retry_attempt": 1,
    "service_periods": [],
    "settlement_amount": 1,
    "settlement_currency": "AED",
    "settlement_tax": 1,
    "status": null,
    "subscription_id": "example",
    "subscription_ids": [],
    "tax": 1,
    "three_ds_flow": null,
    "three_ds_status": null,
    "three_ds_version": "example",
    "total_amount": 1,
    "updated_at": "example"
  }
}
```

### Get product

Retrieve product from Dodo Payments.

**Inputs**

- Product (`product_id`, text, required): Product Id.

**Outputs**

- `data` (object): The result returned by Dodo Payments.

**Example output**

```json
{
  "data": {
    "addons": [],
    "brand_id": "example",
    "business_id": "example",
    "created_at": "example",
    "credit_entitlements": [],
    "description": "example",
    "digital_product_delivery": null,
    "entitlements": [],
    "image": "example",
    "is_recurring": false,
    "license_key_activation_message": "example",
    "license_key_activations_limit": 1,
    "license_key_duration": null,
    "license_key_enabled": false,
    "metadata": {},
    "name": "example",
    "price": "example",
    "pricing_mode": null,
    "product_collection_id": "example",
    "product_id": "example",
    "tax_category": "digital_products",
    "updated_at": "example"
  }
}
```

### Get refund

Retrieve refund from Dodo Payments.

**Inputs**

- Refund (`refund_id`, text, required): Refund Id.

**Outputs**

- `data` (object): The result returned by Dodo Payments.

**Example output**

```json
{
  "data": {
    "amount": 1,
    "brand_id": "example",
    "business_id": "example",
    "created_at": "example",
    "currency": null,
    "customer": {
      "customer_id": "example",
      "email": "example",
      "metadata": {},
      "name": "example",
      "phone_number": "example"
    },
    "is_partial": false,
    "metadata": {},
    "network_reference": "example",
    "network_reference_type": null,
    "network_reference_updated_at": "example",
    "payment_id": "example",
    "reason": "example",
    "refund_id": "example",
    "status": "succeeded"
  }
}
```

### Get subscription

Retrieve subscription from Dodo Payments.

**Inputs**

- Subscription (`subscription_id`, text, required): Subscription Id.

**Outputs**

- `data` (object): The result returned by Dodo Payments.

**Example output**

```json
{
  "data": {
    "addons": [],
    "billing": {
      "city": "example",
      "country": "AF",
      "state": "example",
      "street": "example",
      "zipcode": "example"
    },
    "billing_mode": "normal",
    "brand_id": "example",
    "cancel_at_next_billing_date": false,
    "cancellation_comment": "example",
    "cancellation_feedback": null,
    "cancelled_at": "example",
    "cancelled_by": null,
    "collection_method": null,
    "created_at": "example",
    "credit_entitlement_cart": [],
    "currency": "AED",
    "custom_field_responses": [],
    "customer": {
      "customer_id": "example",
      "email": "example",
      "metadata": {},
      "name": "example",
      "phone_number": "example"
    },
    "customer_business_name": "example",
    "discount_cycles_remaining": 1,
    "discount_id": "example",
    "discounts": [],
    "expires_at": "example",
    "has_payment_method": false,
    "metadata": {},
    "meter_credit_entitlement_cart": [],
    "meters": [],
    "next_billing_date": "example",
    "on_demand": false,
    "paused_at": "example",
    "payment_frequency_count": 1,
    "payment_frequency_interval": "Day",
    "payment_method_id": "example",
    "payment_terms_days": 1,
    "previous_billing_date": "example",
    "product_id": "example",
    "quantity": 1,
    "recurring_pre_tax_amount": 1,
    "scheduled_change": null,
    "status": "pending",
    "subscription_id": "example",
    "subscription_period_count": 1,
    "subscription_period_interval": "Day",
    "tax_id": "example",
    "tax_inclusive": false,
    "trial_amount": 1,
    "trial_period_days": 1
  }
}
```

### List customer payment methods

Retrieve a page of customer payment methods from Dodo Payments.

**Inputs**

- Customer (`customer_id`, text, required): Customer Id.
- Currency (`currency`, text): Currency. One of: `AED`, `ALL`, `AMD`, `ANG`, `AOA`, `ARS`, `AUD`, `AWG`, `AZN`, `BAM`, and 135 more.
- Billing country (`billing_country`, text): Billing country. One of: `AF`, `AX`, `AL`, `DZ`, `AS`, `AD`, `AO`, `AI`, `AQ`, `AG`, and 239 more.

**Outputs**

- `data` (object): The result returned by Dodo Payments.

**Example output**

```json
{
  "data": {
    "items": []
  }
}
```

### List customers

Retrieve a page of customers from Dodo Payments.

**Inputs**

- Page size (`page_size`, number): Page size default is 10 max is 100. At least 0.
- Page number (`page_number`, number): Page number default is 0. At least 0.
- Email (`email`, text): Filter by customer email.
- Name (`name`, text): Filter by customer name (partial match, case-insensitive).
- Created at gte (`created_at_gte`, date and time): Filter customers created on or after this timestamp.
- Created at lte (`created_at_lte`, date and time): Filter customers created on or before this timestamp.

**Outputs**

- `data` (object): The result returned by Dodo Payments.

**Example output**

```json
{
  "data": {
    "items": []
  }
}
```

### List payment line items

Retrieve a page of payment line items from Dodo Payments.

**Inputs**

- Payment (`payment_id`, text, required): Payment Id.
- Currency (`currency`, text): The currency of the amounts. It must be the currency that the customer paid in. Without. One of: `AED`, `ALL`, `AMD`, `ANG`, `AOA`, `ARS`, `AUD`, `AWG`, `AZN`, `BAM`, and 135 more.

**Outputs**

- `data` (object): The result returned by Dodo Payments.

**Example output**

```json
{
  "data": {
    "currency": "AED",
    "items": [],
    "partial_refund_allowed": false
  }
}
```

### List payments

Retrieve a page of payments from Dodo Payments.

**Inputs**

- Created at gte (`created_at_gte`, date and time): Get events after this created time.
- Created at lte (`created_at_lte`, date and time): Get events created before this time.
- Page size (`page_size`, number): Page size default is 10 max is 100. At least 0.
- Page number (`page_number`, number): Page number default is 0. Capped to bound OFFSET-based deep pagination,. At least 0.
- Customer (`customer_id`, text): Filter by customer id.
- Subscription (`subscription_id`, text): Filter by subscription id.
- Status (`status`, text): Filter by status. One of: `succeeded`, `failed`, `cancelled`, `processing`, `requires_customer_action` (Requires customer action), `requires_merchant_action` (Requires merchant action), `requires_payment_method` (Requires payment method), `requires_confirmation` (Requires confirmation), `requires_capture` (Requires capture), `partially_captured` (Partially captured), `partially_captured_and_capturable` (Partially captured and capturable).
- Brand ID (`brand_id`, text): filter by Brand id.
- Product (`product_id`, text): Filter by product id.
- Currency (`currency`, text): Filter by currency. One of: `AED`, `ALL`, `AMD`, `ANG`, `AOA`, `ARS`, `AUD`, `AWG`, `AZN`, `BAM`, and 135 more.

**Outputs**

- `data` (object): The result returned by Dodo Payments.

**Example output**

```json
{
  "data": {
    "items": []
  }
}
```

### List products

Retrieve a page of products from Dodo Payments.

**Inputs**

- Page size (`page_size`, number): Page size default is 10 max is 100. At least 0.
- Page number (`page_number`, number): Page number default is 0. At least 0.
- Archived (`archived`, true/false): List archived products.
- Recurring (`recurring`, true/false): Filter products by pricing type:.
- Brand ID (`brand_id`, text): filter by Brand id.

**Outputs**

- `data` (object): The result returned by Dodo Payments.

**Example output**

```json
{
  "data": {
    "items": []
  }
}
```

### List refunds

Retrieve a page of refunds from Dodo Payments.

**Inputs**

- Created at gte (`created_at_gte`, date and time): Get events after this created time.
- Created at lte (`created_at_lte`, date and time): Get events created before this time.
- Page size (`page_size`, number): Page size default is 10 max is 100. At least 0.
- Page number (`page_number`, number): Page number default is 0. At least 0.
- Status (`status`, text): Filter by status. One of: `succeeded`, `failed`, `pending`, `review`.
- Subscription (`subscription_id`, text): Filter by subscription id.
- Customer (`customer_id`, text): Filter by customer_id.

**Outputs**

- `data` (object): The result returned by Dodo Payments.

**Example output**

```json
{
  "data": {
    "items": []
  }
}
```

### List subscriptions

Retrieve a page of subscriptions from Dodo Payments.

**Inputs**

- Created at gte (`created_at_gte`, date and time): Get events after this created time.
- Created at lte (`created_at_lte`, date and time): Get events created before this time.
- Page size (`page_size`, number): Page size default is 10 max is 100. At least 0.
- Page number (`page_number`, number): Page number default is 0. At least 0.
- Customer (`customer_id`, text): Filter by customer id.
- Status (`status`, text): Filter by status. One of: `pending`, `active`, `on_hold` (On hold), `paused`, `cancelled`, `failed`, `expired`, `past_due` (Past due).
- Brand ID (`brand_id`, text): filter by Brand id.
- Product (`product_id`, text): Filter by product id.
- Cancel at next billing date (`cancel_at_next_billing_date`, true/false): Filter by cancel_at_next_billing_date (subscriptions scheduled for cancellation).

**Outputs**

- `data` (object): The result returned by Dodo Payments.

**Example output**

```json
{
  "data": {
    "items": []
  }
}
```

### List webhooks

Retrieve a page of webhooks from Dodo Payments.

**Inputs**

- Limit (`limit`, number): Limit the number of returned items.
- Iterator (`iterator`, text): The iterator returned from a prior invocation.

**Outputs**

- `data` (object): The result returned by Dodo Payments.

**Example output**

```json
{
  "data": {
    "data": [],
    "done": false,
    "iterator": "example",
    "prev_iterator": "example"
  }
}
```

### Update customer

Update customer in Dodo Payments.

**Inputs**

- Customer (`customer_id`, text, required): Customer Id.
- Email (`email`, text): Email.
- Metadata (`metadata`, object): Additional metadata for the customer.
- Name (`name`, text): Name.
- Phone number (`phone_number`, text): Phone number.

**Outputs**

- `data` (object): The result returned by Dodo Payments.

**Example output**

```json
{
  "data": {
    "blocked_at": "example",
    "blocklist_entry_id": "example",
    "business_id": "example",
    "created_at": "example",
    "customer_id": "example",
    "email": "example",
    "metadata": {},
    "name": "example",
    "phone_number": "example"
  }
}
```

### Update subscription

Update subscription in Dodo Payments.

**Inputs**

- Subscription (`subscription_id`, text, required): Subscription Id.
- Billing (`billing`, object): Billing.
- Cancel at next billing date (`cancel_at_next_billing_date`, true/false): When set, the subscription will remain active until the end of billing period.
- Cancel reason (`cancel_reason`, text): Cancel reason. One of: `cancelled_by_customer` (Cancelled by customer), `cancelled_by_merchant` (Cancelled by merchant), `cancelled_by_merchant_send_dunning` (Cancelled by merchant send dunning), `cancelled_by_merchant_grace_period_expired` (Cancelled by merchant grace period expired), `dodo_team` (Dodo team).
- Cancellation comment (`cancellation_comment`, text): Free-text cancellation comment (only valid when cancelling or scheduling cancellation).
- Cancellation feedback (`cancellation_feedback`, text): Customer-supplied churn reason (only valid when cancelling or scheduling cancellation). One of: `too_expensive` (Too expensive), `missing_features` (Missing features), `switched_service` (Switched service), `unused`, `customer_service` (Customer service), `low_quality` (Low quality), `too_complex` (Too complex), `other`.
- Credit entitlement cart (`credit_entitlement_cart`, list): Update credit entitlement cart settings.
- Customer business name (`customer_business_name`, text): Optional business / legal name associated with the tax id. When provided.
- Customer name (`customer_name`, text): Customer name.
- Disable on demand (`disable_on_demand`, object): Disable on demand.
- Metadata (`metadata`, object): Arbitrary key-value metadata. Values can be string, integer, number, or boolean.
- Next billing date (`next_billing_date`, date and time): Next billing date.
- Pause (`pause`, true/false): Removed. Use `status: paused` to pause and `status: active` to resume.
- Status (`status`, text): Set to `cancelled` to cancel the subscription. See `cancel_reason`,. One of: `pending`, `active`, `on_hold` (On hold), `paused`, `cancelled`, `failed`, `expired`, `past_due` (Past due).
- Subscription period count (`subscription_period_count`, number): New number of `subscription_period_interval` units the subscription.
- Subscription period interval (`subscription_period_interval`, text): New interval unit for the subscription period. When changing the period,. One of: `Day`, `Week`, `Month`, `Year`.
- Tax ID (`tax_id`, text): Tax id.

**Outputs**

- `data` (object): The result returned by Dodo Payments.

**Example output**

```json
{
  "data": {
    "addons": [],
    "billing": {
      "city": "example",
      "country": "AF",
      "state": "example",
      "street": "example",
      "zipcode": "example"
    },
    "billing_mode": "normal",
    "brand_id": "example",
    "cancel_at_next_billing_date": false,
    "cancellation_comment": "example",
    "cancellation_feedback": null,
    "cancelled_at": "example",
    "cancelled_by": null,
    "collection_method": null,
    "created_at": "example",
    "credit_entitlement_cart": [],
    "currency": "AED",
    "custom_field_responses": [],
    "customer": {
      "customer_id": "example",
      "email": "example",
      "metadata": {},
      "name": "example",
      "phone_number": "example"
    },
    "customer_business_name": "example",
    "discount_cycles_remaining": 1,
    "discount_id": "example",
    "discounts": [],
    "expires_at": "example",
    "has_payment_method": false,
    "metadata": {},
    "meter_credit_entitlement_cart": [],
    "meters": [],
    "next_billing_date": "example",
    "on_demand": false,
    "paused_at": "example",
    "payment_frequency_count": 1,
    "payment_frequency_interval": "Day",
    "payment_method_id": "example",
    "payment_terms_days": 1,
    "previous_billing_date": "example",
    "product_id": "example",
    "quantity": 1,
    "recurring_pre_tax_amount": 1,
    "scheduled_change": null,
    "status": "pending",
    "subscription_id": "example",
    "subscription_period_count": 1,
    "subscription_period_interval": "Day",
    "tax_id": "example",
    "tax_inclusive": false,
    "trial_amount": 1,
    "trial_period_days": 1
  }
}
```
