Skip to content

The Transaction Object

Attributes

ParameterTypeDescription
idstringThe unique identifier for the transaction.
created_atintegerTimestamp of when the transaction was created.
paid_atintegerTimestamp of when the transaction was paid.
statusintegerNumeric status code of the transaction.
status_textstringTextual representation of the transaction status.
customerstringThe unique identifier of the customer involved in the transaction.
order_idstringThe identifier of the associated order or invoice.
payment_method.typestringType of the payment method used in the transaction.
payment_method.idstringUnique identifier for the payment method used.
amount.amountstringThe total amount of the transaction.
amount.currencystringThe currency of the transaction amount.
amount.localizedstringThe localized representation of the transaction amount.
fees.amountstringThe amount of fees associated with the transaction.
fees.currencystringThe currency of the transaction fees.
fees.localizedstringThe localized representation of the transaction fees.
metadata.typestringA metadata type to provide additional information about the transaction.
customer_ipstringIP 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"
  }
}