# Payment

Payments describe the amount charged for an order or subscription using a given payment method.

## Properties

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `object` | string | Yes | Type of object is always `payment`. |
| `id` | string | Yes | Unique identifier for the payment. |
| `amount` | object | Yes | The total amount charged for this payment. |
| `attemptedAt` | string,null | Yes | Time when the payment was last attempted. `null` if the payment has never been attempted. |
| `createdAt` | string | Yes | Time when the payment was created. |
| `disputeClosedAt` | string,null | Yes | Time when the payment dispute was closed. Only present if the payment is disputed. |
| `disputeOutcome` | null | lost | won | Yes | The outcome of a payment dispute. Only present if the payment is disputed. |
| `failedAttempts` | integer | Yes | The number of failed payment attempts so far. |
| `failureCode` | string,null | Yes | An error code indicating the reason for the payment failure. Only present if the payment failed. |
| `failureMessage` | string,null | Yes | A human-readable message indicating the reason for the payment failure. Only present if the payment failed. |
| `method` | mixed | Yes |  |
| `reason` | subscriptionCreation | subscriptionRenewal | other | Yes | The reason for this payment. It can have one of the following values:          - `subscriptionCreation`: The payment is due to a new subscription.         - `subscriptionRenewal`: The payment is due to a recurring subscription renewal.         - `other`: The invoice is not related to a subscription but due an e.g. one-time addon.        |
| `references` | object[] | Yes | List of payment references. Supported reference types are `order` and `subscription`. |
| `refunded` | object | Yes | The total amount refunded from this payment. |
| `refundedAt` | string,null | Yes | Time when the payment was fully refunded. Only present if the payment was refunded. |
| `status` | pending | succeeded | requiresConfirmation | failed | refunded | disputed | requiresPaymentMethod | Yes | The status of the payment. It can have one of the following values:          - `pending`: The payment has been created but not yet processed by the payment provider.         - `succeeded`: The payment was completed successfully.         - `failed`: The payment failed. Payments are retried automatically for up to 3 weeks.         - `refunded`: The payment was fully refunded. Partially refunded payments do not have this status.         - `disputed`: The payment is under dispute.         - `requiresConfirmation`: The payment requires user confirmation before being processed.         - `requiresPaymentMethod`: The payment is awaiting for a payment method to be attached.        |
| `user` | object | Yes | Users are end consumers of subscriptions. Users can have multiple devices, SIMs, and subscriptions. |
