# Commas

> Create checkout links and read products, subscribers, payments and invoices.

App · 19 actions. Web page: https://docs.lodol.com/docs/integrations/commas

## Actions

### Create a one-time checkout session

Create a payment link for a one-time purchase.

**Inputs**

- Title (`title`, text, required): The product name customers see at checkout.
- Description (`description`, text): A short product description for customers.
- Amount Cents (`amount_cents`, number, required): The purchase price in cents. For example, enter 2500 for $25.00. At least 100.
- Type (`type`, text, required): Whether this link may be used once or repeatedly. One of: `onetime_non_reusable` (Onetime non reusable), `onetime_reusable` (Onetime reusable).
- Expiration Date (`expiration_date`, date): The date the payment link stops accepting payments.
- Success Url (`success_url`, text): The page to show after a successful payment.

**Outputs**

- `data` (object): The response from Commas.

**Example output**

```json
{
  "data": {
    "data": {
      "checkout_session_id": "example",
      "payment_link": "example",
      "product_id": "example"
    },
    "message": "example",
    "request_id": "example",
    "status": "example"
  }
}
```

### Delete a checkout session

Permanently deactivate a checkout session and its payment link.

**Inputs**

- Session Id (`session_id`, text, required): The session id.

**Outputs**

- `data` (object): The response from Commas.

**Example output**

```json
{
  "data": {
    "data": [
      {}
    ],
    "message": "example",
    "request_id": "example",
    "status": "example"
  }
}
```

### Get a checkout session

Read checkout settings and the checkout’s numeric product ID.

**Inputs**

- Session Id (`session_id`, text, required): The session id.

**Outputs**

- `data` (object): The response from Commas.

**Example output**

```json
{
  "data": {
    "data": {
      "amount_cents": 1,
      "expiration_date": "example",
      "product": {
        "description": "example",
        "id": 1,
        "title": "example"
      },
      "subscription": {},
      "success_url": "example",
      "type": "example"
    },
    "message": "example",
    "request_id": "example",
    "status": "example"
  }
}
```

### Get a discount code

Read a discount code’s terms, expiration and usage.

**Inputs**

- Discount Code (`discount_code_id`, text, required): The discount code id.

**Outputs**

- `data` (object): The response from Commas.

**Example output**

```json
{
  "data": {
    "data": {
      "code": "example",
      "description": "example",
      "duration": "example",
      "expiry": "example",
      "id": "example",
      "type": "example",
      "usable_number": 1,
      "usage_count": 1,
      "value": "example"
    },
    "message": "example",
    "request_id": "example",
    "status": "example"
  }
}
```

### Get a transaction

Read the details of one payment by its public transaction ID.

**Inputs**

- Transaction Id (`transaction_id`, text, required): The transaction id.

**Outputs**

- `data` (object): The response from Commas.

**Example output**

```json
{
  "data": {
    "data": {
      "amount": 1,
      "fan": {
        "email": "example",
        "id": "example",
        "name": "example"
      },
      "fee_amount": 1,
      "id": 1,
      "net_amount": 1,
      "product": {
        "description": "example",
        "id": "example",
        "payment_link": "example",
        "price": "example",
        "title": "example"
      },
      "refunds": [
        {}
      ],
      "transaction_date": "example"
    },
    "message": "example",
    "request_id": "example",
    "status": "example"
  }
}
```

### Get an invoice

Read line items, totals and activity for an invoice.

**Inputs**

- Invoice (`invoice_id`, text, required): The invoice id.

**Outputs**

- `data` (object): The response from Commas.

**Example output**

```json
{
  "data": {
    "data": {
      "currency": "example",
      "dueDate": "example",
      "id": "example",
      "invoiceNo": "example",
      "issueDate": "example",
      "publicId": "example",
      "status": "example",
      "total": 1
    },
    "message": "example",
    "request_id": "example",
    "status": "example"
  }
}
```

### Get the next invoice number

Read the next available sequence number for a new invoice.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Commas.

**Example output**

```json
{
  "data": {
    "data": {},
    "message": "example",
    "request_id": "example",
    "status": "example"
  }
}
```

### List customer payment methods

Read payment methods saved by a customer.

**Inputs**

- Customer (`customer_id`, number, required): A customer from List customers. At least 1.

**Outputs**

- `data` (object): The response from Commas.

**Example output**

```json
{
  "data": {
    "data": {},
    "message": "example",
    "request_id": "example",
    "status": "example"
  }
}
```

### List customers

Find customers by name, email or phone number.

**Inputs**

- Search (`search`, text): A name, email address or phone number to search for.
- Page (`page`, number): Which page of results to read. At least 1.
- Per Page (`per_page`, number): How many results to return per page. From 1 to 100.

**Outputs**

- `data` (object): The response from Commas.

**Example output**

```json
{
  "data": {
    "data": {
      "customers": [
        {
          "email": "example",
          "id": 1,
          "last_transaction_date": "example",
          "name": "example",
          "total_spent": "example",
          "total_transactions": 1
        }
      ],
      "pagination": {
        "current_page": 1,
        "has_more": true,
        "per_page": 1,
        "total_items": 1,
        "total_pages": 1
      }
    },
    "message": "example",
    "request_id": "example",
    "status": "example"
  }
}
```

### List discount codes

Read discount codes and their usage.

**Inputs**

- Search (`search`, text): Search by code, discount or product title.
- Page (`page`, number): Which page of results to read. At least 1.
- Per Page (`per_page`, number): How many results to return per page. From 1 to 100.

**Outputs**

- `data` (object): The response from Commas.

**Example output**

```json
{
  "data": {
    "data": {
      "current_page": 1,
      "data": [
        {
          "code": "example",
          "description": "example",
          "duration": "example",
          "expiry": "example",
          "id": "example",
          "type": "example",
          "usable_number": 1,
          "usage_count": 1,
          "value": "example"
        }
      ],
      "last_page": 1,
      "total": 1
    },
    "message": "example",
    "request_id": "example",
    "status": "example"
  }
}
```

### List invoices

Read invoices by status or issue and due dates.

**Inputs**

- Status (`status`, text): Only include invoices with this payment status. One of: `pending`, `paid`, `paid_off_platform` (Paid off platform), `canceled`, `overdue`.
- Search (`search`, text): Part of an invoice number or recipient name.
- Start Date (`start_date`, date): Earliest issue date.
- End Date (`end_date`, date): Latest issue date.
- Due After (`due_after`, date): Earliest due date.
- Due Before (`due_before`, date): Latest due date.
- Limit (`limit`, number): How many invoices to return. At least 1.
- Offset (`offset`, number): How many invoices to skip. At least 0.

**Outputs**

- `data` (object): The response from Commas.

**Example output**

```json
{
  "data": {
    "data": {
      "invoices": [
        {
          "currency": "example",
          "dueDate": "example",
          "id": "example",
          "invoiceNo": "example",
          "issueDate": "example",
          "publicId": "example",
          "status": "example",
          "total": 1
        }
      ],
      "total": 1
    },
    "message": "example",
    "request_id": "example",
    "status": "example"
  }
}
```

### List payment products

Read payment products and their checkout links.

**Inputs**

- Page (`page`, number): Which page of results to read. At least 1.
- Per Page (`per_page`, number): How many results to return per page. From 1 to 100.

**Outputs**

- `data` (object): The response from Commas.

**Example output**

```json
{
  "data": {
    "data": {
      "current_page": 1,
      "data": [
        {
          "description": "example",
          "id": "example",
          "payment_link": "example",
          "price": "example",
          "title": "example"
        }
      ],
      "last_page": 1,
      "total": 1
    },
    "message": "example",
    "request_id": "example",
    "status": "example"
  }
}
```

### List subscribers

Read subscribers and optionally filter by product.

**Inputs**

- Product (`product_id`, text): A payment product to filter by.
- Page (`page`, number): Which page of results to read. At least 1.
- Per Page (`per_page`, number): How many results to return per page. From 1 to 100.

**Outputs**

- `data` (object): The response from Commas.

**Example output**

```json
{
  "data": {
    "data": {
      "pagination": {
        "current_page": 1,
        "has_more": true,
        "per_page": 1,
        "total_items": 1,
        "total_pages": 1
      },
      "subscribers": [
        {
          "customer": {},
          "id": 1,
          "product": {
            "description": "example",
            "id": "example",
            "payment_link": "example",
            "price": "example",
            "title": "example"
          },
          "subscription": {
            "created_at": "example",
            "id": 1,
            "payment_frequency": "example",
            "status": "example",
            "updated_at": "example"
          }
        }
      ]
    },
    "message": "example",
    "request_id": "example",
    "status": "example"
  }
}
```

### List subscriptions for a checkout

Read subscriptions from a checkout session.

**Inputs**

- Session Id (`session_id`, text, required): The session id.
- Page (`page`, number): Which page of results to read. At least 1.
- Per Page (`per_page`, number): How many results to return per page. From 1 to 100.

**Outputs**

- `data` (object): The response from Commas.

**Example output**

```json
{
  "data": {
    "data": {
      "pagination": {
        "current_page": 1,
        "has_more": true,
        "per_page": 1,
        "total_items": 1,
        "total_pages": 1
      },
      "subscriptions": [
        {
          "created_at": "example",
          "id": 1,
          "payment_frequency": "example",
          "status": "example",
          "updated_at": "example"
        }
      ]
    },
    "message": "example",
    "request_id": "example",
    "status": "example"
  }
}
```

### List subscriptions for a product

Read subscribers to a product by its numeric ID.

**Inputs**

- Product Id (`product_id`, number, required): The numeric product ID returned by Get a checkout session. At least 1.
- Page (`page`, number): Which page of results to read. At least 1.
- Per Page (`per_page`, number): How many results to return per page. From 1 to 100.

**Outputs**

- `data` (object): The response from Commas.

**Example output**

```json
{
  "data": {
    "data": {
      "pagination": {
        "current_page": 1,
        "has_more": true,
        "per_page": 1,
        "total_items": 1,
        "total_pages": 1
      },
      "subscriptions": [
        {
          "created_at": "example",
          "id": 1,
          "payment_frequency": "example",
          "status": "example",
          "updated_at": "example"
        }
      ]
    },
    "message": "example",
    "request_id": "example",
    "status": "example"
  }
}
```

### List transactions

Read recorded payments and net proceeds for your products.

**Inputs**

- Product (`product_id`, text): A payment product to filter by.
- Page (`page`, number): Which page of results to read. At least 1.
- Per Page (`per_page`, number): How many results to return per page. From 1 to 100.

**Outputs**

- `data` (object): The response from Commas.

**Example output**

```json
{
  "data": {
    "data": {
      "pagination": {
        "current_page": 1,
        "has_more": true,
        "per_page": 1,
        "total_items": 1,
        "total_pages": 1
      },
      "transactions": [
        {
          "amount": 1,
          "fan": {
            "email": "example",
            "id": "example",
            "name": "example"
          },
          "fee_amount": 1,
          "id": 1,
          "net_amount": 1,
          "product": {
            "description": "example",
            "id": "example",
            "payment_link": "example",
            "price": "example",
            "title": "example"
          },
          "refunds": [
            {}
          ],
          "transaction_date": "example"
        }
      ]
    },
    "message": "example",
    "request_id": "example",
    "status": "example"
  }
}
```

### List transactions for a checkout

Read payments recorded for a checkout session.

**Inputs**

- Session Id (`session_id`, text, required): The session id.
- Page (`page`, number): Which page of results to read. At least 1.
- Per Page (`per_page`, number): How many results to return per page. From 1 to 100.

**Outputs**

- `data` (object): The response from Commas.

**Example output**

```json
{
  "data": {
    "data": {
      "pagination": {
        "current_page": 1,
        "has_more": true,
        "per_page": 1,
        "total_items": 1,
        "total_pages": 1
      },
      "transactions": [
        {
          "amount": 1,
          "fan": {
            "email": "example",
            "id": "example",
            "name": "example"
          },
          "fee_amount": 1,
          "id": 1,
          "net_amount": 1,
          "product": {
            "description": "example",
            "id": "example",
            "payment_link": "example",
            "price": "example",
            "title": "example"
          },
          "refunds": [
            {}
          ],
          "transaction_date": "example"
        }
      ]
    },
    "message": "example",
    "request_id": "example",
    "status": "example"
  }
}
```

### List transactions for a product

Read payments recorded against the product’s numeric ID.

**Inputs**

- Product Id (`product_id`, number, required): The numeric product ID returned by Get a checkout session. At least 1.
- Page (`page`, number): Which page of results to read. At least 1.
- Per Page (`per_page`, number): How many results to return per page. From 1 to 100.

**Outputs**

- `data` (object): The response from Commas.

**Example output**

```json
{
  "data": {
    "data": {
      "pagination": {
        "current_page": 1,
        "has_more": true,
        "per_page": 1,
        "total_items": 1,
        "total_pages": 1
      },
      "transactions": [
        {
          "amount": 1,
          "fan": {
            "email": "example",
            "id": "example",
            "name": "example"
          },
          "fee_amount": 1,
          "id": 1,
          "net_amount": 1,
          "product": {
            "description": "example",
            "id": "example",
            "payment_link": "example",
            "price": "example",
            "title": "example"
          },
          "refunds": [
            {}
          ],
          "transaction_date": "example"
        }
      ]
    },
    "message": "example",
    "request_id": "example",
    "status": "example"
  }
}
```

### List webhook subscriptions

Read active and inactive webhook registrations.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Commas.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "event_types": [
          "example"
        ],
        "id": "example",
        "is_active": true,
        "webhook_url": "example"
      }
    ],
    "message": "example",
    "request_id": "example",
    "status": "example"
  }
}
```
