> ## Documentation Index
> Fetch the complete documentation index at: https://studio.assembly.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Payments

> Represents a payment associated with an invoice, including details about the payment method used, payment status, and any applicable fees.

This resource represents a payment.

A payment is associated with an invoice and contains details about the payment method used, payment status, and any applicable fees.

**Note:** All amounts are in the minor unit of the currency. For example, 1000 represents \$10.00 for USD, £10.00 for GBP, or ¥1000 for JPY.

## Properties

**id** `string`
The unique identifier for this payment.

**createdAt** `string`
The date this payment was created in RFC3339 format.

**updatedAt** `string`
The date this payment was updated in RFC3339 format.

**object** `string`
The object type of this resource.

**invoiceId** `string`
The ID of the invoice this payment is associated with.

**status** `string`

The current status of the payment. One of:

| Status       | Description                                               |
| :----------- | :-------------------------------------------------------- |
| `pending`    | Further action required by the customer                   |
| `processing` | Payment is being processed by the bank (for ACH payments) |
| `succeeded`  | Payment has been successfully received                    |
| `failed`     | Payment failed to process                                 |

**amount** `integer`
The payment amount in cents. Will be 0 for failed payments.

**message** `string`
A message describing why the payment failed, if applicable.

**declineCode** `string`
The decline code from the payment processor in case of payment failure.

**paymentMethod** `string`
The type of payment method used. One of:

| Payment Method | Description              |
| :------------- | :----------------------- |
| `creditCard`   | Credit card payment      |
| `bankAccount`  | Bank account/ACH payment |

**last4Digits** `string`
The last 4 digits of the payment method used.

**brand** `string`
The brand of the payment method:

| Brand                  | Payment method |
| :--------------------- | :------------- |
| Visa, Mastercard, etc. | `creditCard`   |
| Bank name              | `bankAccount`  |

<br />

**feeAmount** `object`
Details of fees applied to successful payments:

* paidByPlatform `integer`
  Transaction fee which was passed on to the SB
* paidByClient `integer`
  Transaction fee passed on to the client

```json Example Payment Object theme={null}
{
    "id": "py_01HN4V8K5P7RNQJ6MGXKDZ8T2W",
    "object": "payment",
    "createdAt": "2024-02-21T15:31:16.789Z",
    "invoiceId": "inv_01HN4V8K5P7RNQJ6MGXKDZ8T2W",
    "status": "succeeded",
    "amount": 107635,
    "message": null,
    "declineCode": null,
    "paymentMethod": "creditCard",
    "last4Digits": "4242",
    "brand": "visa",
    "feeAmount": {
        "paidByPlatform": 2500,
        "paidByClient": 0
    },
    "updatedAt": "2024-02-21T15:31:16.789Z"
}
```
