The Transaction Object
Required scope: view-transactions
Attributes
| Parameter | Type | Description |
|---|---|---|
object | string | Always v2.transaction. |
id | string | The unique identifier for the transaction. |
status | string | One of paid, canceled, pending, refunded, failed, authorized. |
is_live_mode | boolean | Intended to indicate whether the transaction ran in live mode. |
paid_at | string|null | Date and time the transaction was paid. |
amount | object|null | The transaction amount, as a money object. |
fees | object|null | The fees charged on the transaction, as a money object. |
order_id | string|null | The identifier of the associated order or invoice. |
customer_id | string|null | The unique identifier of the customer involved in the transaction. |
customer_ip | string|null | IP address of the customer. |
payment_method.type | string | Type of the payment method used in the transaction. |
payment_method.id | string|null | Unique identifier for the payment method used. |
is_fully_refunded | boolean | Whether the transaction has been fully refunded. |
amount_refunded | object|null | Amount refunded so far, as a money object. |
hold_released_at | string|null | Date and time the held funds were released, if applicable. |
success_url | string|null | Redirect URL used on successful payment. |
error_url | string|null | Redirect URL used on failed payment. |
metadata | object | Arbitrary metadata attached to the transaction. |
created_at | string|null | Date and time the transaction was created. |
Includes
Pass ?include= on the details endpoint below to embed related resources (list responses don't support include):
| Include | Description |
|---|---|
customer | Embeds the Customer object under a customer key. |
refunds | Embeds an array of Refund objects under a refunds key, only populated if the transaction has been partially or fully refunded. |
Request
Endpoint: https://youcanpay.com/api/v2/transactions/{transaction_id}Method: GET
bash
$ curl --location -g --request GET 'https://youcanpay.com/api/v2/transactions/0142cd46-5813-4c62-8fd3-081e4a9fb964' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_TOKEN_eyJpc3...'Response
json
{
"object": "v2.transaction",
"id": "10e7691c-14a2-4936-833b-ec154c817ce9",
"status": "paid",
"is_live_mode": false,
"paid_at": "2024-01-29 10:31:39",
"amount": {
"amount": "100.00",
"currency": "MAD",
"localized": "MAD 100.00"
},
"fees": {
"amount": "6.90",
"currency": "MAD",
"localized": "MAD 6.90"
},
"order_id": "inv_028ef20c-5065-4515-a0d6-a1c17ff0d53e",
"customer_id": "38678dea-d23a-4388-bb78-648892bce85b",
"customer_ip": "192.168.0.113",
"payment_method": {
"type": "credit_card",
"id": "0fd9bb2c-f14b-411c-bc90-deb73ddaf9ff"
},
"is_fully_refunded": false,
"amount_refunded": {
"amount": "0.00",
"currency": "MAD",
"localized": "MAD 0.00"
},
"hold_released_at": null,
"success_url": null,
"error_url": null,
"metadata": {
"type": "youcan_pay.invoice"
},
"created_at": "2024-01-29 10:31:30"
}The Customer Object
| Parameter | Type | Description |
|---|---|---|
object | string | Always v2.customer. |
id | string | The object's unique identifier. |
email | string|null | The customer's email address. |
phone | string|null | The customer's phone number. |
full_name | string|null | The customer's full name. |
description | string|null | A description of the customer. |
address.country | string|null | Country code. |
address.state | string|null | State/province. |
address.city | string|null | City. |
address.line1 | string|null | Street address. |
address.postal_code | string|null | Postal/zip code. |
metadata | object | Arbitrary metadata attached to the customer. |
created_at | string|null | Date and time the customer was created. |
updated_at | string|null | Date and time the customer was last updated. |