Get paypal transaction ID from shopify Order API using ordertransaction object (graphql)

based on this reply from the shopify community, paypal transaction ID can be found in the “receiptJson” field data or the “receipt” field data (deprecated field) from ordertransaction object through the order “API”.
https://community.shopify.com/c/Shopify-APIs-SDKs/How-do-I-get-paypal-transaction-ID-from-transactions-API/m-p/563794/highlight/true#M37345

if that was the case, i would be very thankful if someone could provide me this receipt data for an order, as long as the order was checked out through PayPal express checkout.

peace out

by the way i’m using “graphql” to query data from the API.

We’re facing the same issue with one of our clients. Is there any way that we can get it? We’re facing this issue with Klarna and Paypal

Better late than never.

The value of receiptJson is a string. After parsing, it looks like this (at least in my case):

"receiptJson": {
    "timestamp": "1970-01-01T00:00:00Z",
    "ack": "Success",
    "correlation_id": "xxxxxxxxxxxxx",
    "version": "XXX",
    "build": "XXXXXXXX",
    "token": "EC-XXXXXXXXXXXXXXXXX",
    "transaction_id": "XXXXXXXXXXXXXXXXX",
    "parent_transaction_id": null,
    "receipt_id": null,
    "transaction_type": "cart",
    "payment_type": "instant",
    "payment_date": "1970-01-01T00:00:00Z",
    "gross_amount": "1.00",
    "gross_amount_currency_id": "EUR",
    "fee_amount": "1.00",
    "fee_amount_currency_id": "EUR",
    "tax_amount": "0.00",
    "tax_amount_currency_id": "EUR",
    "exchange_rate": null,
    "payment_status": "Completed",
    "pending_reason": "none",
    "reason_code": "none",
    "protection_eligibility": "Eligible",
    "protection_eligibility_type": "ItemNotReceivedEligible,UnauthorizedPaymentEligible",
    "pay_pal_account_id": "mail@example.com",
    "secure_merchant_account_id": "XXXXXXXXXXXXX",
    "success_page_redirect_requested": "false",
    "coupled_payment_info": null,
    "Token": "EC-XXXXXXXXXXXXXXXXX",
    "PaymentInfo": {
        "TransactionID": "XXXXXXXXXXXXXXXXX",
        "ParentTransactionID": null,
        "ReceiptID": null,
        "TransactionType": "cart",
        "PaymentType": "instant",
        "PaymentDate": "1970-01-01T00:00:00Z",
        "GrossAmount": "1.00",
        "FeeAmount": "1.00",
        "TaxAmount": "0.00",
        "ExchangeRate": null,
        "PaymentStatus": "Completed",
        "PendingReason": "none",
        "ReasonCode": "none",
        "ProtectionEligibility": "Eligible",
        "ProtectionEligibilityType": "ItemNotReceivedEligible,UnauthorizedPaymentEligible",
        "SellerDetails": {
            "PayPalAccountID": "mail@example.com",
            "SecureMerchantAccountID": "XXXXXXXXXXXXX"
        }
    },
    "SuccessPageRedirectRequested": "false",
    "CoupledPaymentInfo": null
}