Skip to main content

Payments

Learn more about the Payment resource

A Payment represents the money paid by your customer. A Payment resource is normally generated from a PaymentIntent after your customer completes the transaction.

The Payment Resource

{
"id": "pay_a32eDbfQ6ybZU6hWbsRFJy2ha3dWmHDS",
"resource": "payment",
"amount": 1500,
"amount_refunded": 0,
"currency": "PHP",
"billing": {
"name": "Juan Dela Cruz",
"email": "juan@gmail.com",
"phone": "+639178387777",
"address": {
"line1": "Block 9 Lot 6",
"line2": "Saint Claire Subdivision",
"city": "Quezon City",
"state": "Metro Manila",
"postal_code": "1902",
"country": "PH"
}
},
"description": null,
"fee": 250,
"livemode": false,
"metadata": null,
"payment_method": {
"type": "card",
"card": {
"first6": "424242",
"last4": "4242",
"brand": "visa"
}
},
"payment_intent_id": "pi_zbs3DbfQ6ybZU6hWbsRFJy2ha3dWmsDS",
"refunded": false,
"status": "failed",
"created_at": 1716291814,
"updated_at": 1716291814
}

Attributes


id string

Unique identifier for the resource. The prefix is pay_.


resource string

Represents the resource's type. The value is payment.


amount string

The amount collected from the customer. This is a positive integer that your customer paid in the smallest currency unit, cents. If the customer paid for ₱ 120.50, the amount of the Payment is 12050.


amount_refunded string

The amount refunded from the Payment. This is a positive integer that you refunded from a Payment in the smallest currency unit, cents. If you refunded for ₱ 20.45, the refunded amount in cents is 2045.


status string

The status of the Payment. Possible values are pending, paid, or failed.


currency string

A three-letter ISO currency code, in uppercase. As of the moment, we only support PHP.


description string

An arbitrary string attached to the Payment. Useful reference when viewing Payment from PayRex Dashboard.


livemode boolean

The value is true if the resource's mode is live or the value is false if the resource mode is test.


billing hash

Show child attributes

name string

Billing name of the customer


email string

Billing e-mail of the customer


phone string

Billing phone of the customer


address hash

Show child attribute

line1 string

Billing Address Line1 of the customer


line2 string

Billing Address Line2 of the customer


city string

Billing Address City of the customer


state string

Billing Address State of the customer


postal_code string

Billing Address Postal Code of the customer


country string

Billing Address Country of the customer in two-letter ISO format.


metadata hash

Set of key-value pairs attached to the Payment. This is useful for storing additional information about the Payment.


created_at timestamp

The time when the resource was created. Measured in seconds since the Unix epoch.


updated_at timestamp

The time when the resource was updated. Measured in seconds since the Unix epoch.