Skip to main content

Payments

Learn more about the Payment resource

A Payment represents the money paid by your customer. A Payment resource is 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 ₱ 120.50, the payment amount is 12050.


amount_refunded string

The amount refunded from the Payment. This is a positive integer 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 is in test mode.


billing hash

Show child attributes

name string

The billing name of the customer


email string

The billing e-mail address of the customer


phone string

The billing phone of the customer


address hash

Show child attribute

line1 string

The billing Address Line1 of the customer


line2 string

The billing address line2 of the customer


city string

The billing address city of the customer


state string

The billing address state of the customer


postal_code string

The billing address postal code of the customer


country string

The billing address country of the customer in two-letter ISO format.


metadata hash

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


created_at timestamp

The time the resource was created and measured in seconds since the Unix epoch.


updated_at timestamp

The time the resource was updated and measured in seconds since the Unix epoch.