The Transaction Object
Attributes
| Parameter | Type | Description |
|---|---|---|
id | string | The unique identifier for the transaction. |
created_at | integer | Timestamp of when the transaction was created. |
paid_at | integer | Timestamp of when the transaction was paid. |
status | integer | Numeric status code of the transaction. |
status_text | string | Textual representation of the transaction status. |
customer | string | The unique identifier of the customer involved in the transaction. |
order_id | string | The identifier of the associated order or invoice. |
payment_method.type | string | Type of the payment method used in the transaction. |
payment_method.id | string | Unique identifier for the payment method used. |
amount.amount | string | The total amount of the transaction. |
amount.currency | string | The currency of the transaction amount. |
amount.localized | string | The localized representation of the transaction amount. |
fees.amount | string | The amount of fees associated with the transaction. |
fees.currency | string | The currency of the transaction fees. |
fees.localized | string | The localized representation of the transaction fees. |
metadata.type | string | A metadata type to provide additional information about the transaction. |
customer_ip | string | IP address of the customer. |
Request
Endpoint: https://api.youcanpay.com/transactions/{transaction_id}Method: GET
bash
$ curl --location -g --request GET 'https://api.youcanpay.com/transactions/0142cd46-5813-4c62-8fd3-081e4a9fb964' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_TOKEN_eyJpc3...'Response
json
{
"data": {
"object": "transaction",
"id": "10e7691c-14a2-4936-833b-ec154c817ce9",
"created_at": 1706515890,
"paid_at": 1706515899,
"status": 1,
"status_text": "paid",
"customer": "38678dea-d23a-4388-bb78-648892bce85b",
"order_id": "inv_028ef20c-5065-4515-a0d6-a1c17ff0d53e",
"payment_method": {
"type": "credit_card",
"id": "0fd9bb2c-f14b-411c-bc90-deb73ddaf9ff"
},
"amount": {
"amount": "10000",
"currency": "MAD",
"localized": "MAD 100.00"
},
"fees": {
"amount": "690",
"currency": "MAD",
"localized": "MAD 6.90"
},
"metadata": {
"type": "youcan_pay.invoice"
},
"customer_ip": "192.168.0.113"
}
}