Payments
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
idstring
The unique identifier for this payment.
createdAtstring
The date this payment was created in RFC3339 format.
updatedAtstring
The date this payment was updated in RFC3339 format.
objectstring
The object type of this resource.
invoiceIdstring
The ID of the invoice this payment is associated with.
statusstring
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 |
amountinteger
The payment amount in cents. Will be 0 for failed payments.
messagestring
A message describing why the payment failed, if applicable.
declineCodestring
The decline code from the payment processor in case of payment failure.
paymentMethodstring
The type of payment method used. One of:
| Payment Method | Description |
|---|---|
creditCard |
Credit card payment |
bankAccount |
Bank account/ACH payment |
last4Digitsstring
The last 4 digits of the payment method used.
brandstring
The brand of the payment method:
| Brand | Payment method |
|---|---|
| Visa, Mastercard, etc. | creditCard |
| Bank name | bankAccount |
feeAmountobject
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
Example Payment Object
{
"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"
}