API reference / Payments
Retrieve a payment
GET
/v1/payments/{reference_id} Reads one payment. Use it to confirm a status, for example after your customer returns from a checkout page.
A payment that belongs to another merchant, or to the other mode, returns 404.
Path parameters
reference_idstringRequiredWeav's payment reference.Pattern: ^PY[0-9A-Z]{12}$
Headers
AuthorizationstringRequiredBearerplus your API key. See Authentication.
Responses
200 OK
The payment.
What data holds
paymentobject32 fields in
paymentreference_idstringexternal_reference_idstring | nullYours. For a checkout's payment, the checkout's (null when it has none).checkout_reference_idstring | nullThe checkout this payment was started from, if any.payment_method_idstring | nullThe saved payment method it was charged to, or the one it saves the card to (save_payment_method), if any.provider_reference_idstring | nullThe provider's transaction ID, once the provider has one.channel_reference_idstring | nullA reference from the channel that is unique to this payment, once the payment completes. Null for channels whose numbers can repeat; those are in references.referencesobjectThe provider's other numbers for this payment, keyed by type:invoice_number(the 6-digit QR Ph invoice number),receipt_number(Maya) ortransaction_id(GCash). Saved once the provider confirms the payment; {} until then. They can repeat across payments: search with them, never identify a payment by one alone.3 fields in
referencesinvoice_numberstringreceipt_numberstringtransaction_idstring
channelstringOne ofQR_PH,GCASH,MAYA,CARD,PAY_AND_GO,PALAWANPAY,BAYAD.One of:QR_PHGCASHMAYACARDPAY_AND_GOPALAWANPAYBAYADcustomerobjectThe person paying, as you sent it. The email and mobile number turn null once Weav's retention period ends.3 fields in
customernamestring | nullemailstring | nullmobile_nostring | null
currencystringISO 4217. PHP today; more as they're enabled for your account.One of:PHPamountnumberfeenumber | nullNull until a rate applies.totalnumber | nullamountplusfee, calculated by Weav. Null whilefeeis null.fee_bearerstringMERCHANT, the fee comes out ofamount(default).PAYER(fees on top), the customer is chargedamount+feeand you receive the fullamount.One of:MERCHANTPAYERamount_chargednumberWhat the customer is charged.amount, ortotalwhenfee_bearerisPAYER.amount_refundednumberThe total refunded so far. The payment turnsREFUNDEDonce it equalsamount.refundsarray of objectsRefunds Weav recorded for this payment, oldest first. Refunds are made by Weav support on request.4 fields in
refundsreference_idstringamountnumberprovider_reference_idstring | nullrefunded_atstring (date-time)
statusstringOne of:PENDINGCOMPLETEDFAILEDCANCELLEDREVERSEDREFUNDEDdescriptionstring | nullAs you sent it.success_urlstring (uri) | nullcancel_urlstring (uri) | nullwebhook_urlstring | nullWhere this payment's webhooks go, when not your webhook URL.next_actionobjectWhat your customer does next.typeisDISPLAY_QR,REDIRECT,PAY_AT_COUNTER, or null once the payment is final.qr_string,checkout_urlandpayment_codeare each null unless they apply. WithHOSTED(the default),typeisREDIRECTandcheckout_urlis Weav's payment page (the test checkout with a test key), for every channel. For QR Ph,qr_ph_appis the app you chose, andinstructionslists the how-to-pay steps (title,description) when you asked forDIRECT.6 fields in
next_actiontypestring | nullOne of:DISPLAY_QRREDIRECTPAY_AT_COUNTERqr_stringstring | nullQR Ph payload to render as a QR code: error correction Q (M at minimum), a white quiet zone of at least 4 modules, and the full-color QR Ph symbol on a white box 23.81% of the code width (quiet zone excluded) in the exact center.checkout_urlstring (uri) | nullpayment_codestring | nullFor over-the-counter channels.qr_ph_appstring | nullQR Ph only. The bank or e-wallet app the steps are tailored to.instructionsarray of objects | nullQR Ph withnext_action_formatDIRECTonly. How-to-pay steps to show the customer.2 fields in
instructionstitlestringdescriptionstring
test_checkout_urlstring (uri) | nullTest mode only: the test checkout page, where you pay, decline or let this payment expire, for every channel (a counter payment withDIRECThas no other way to finish). Anyone with the link can open it. Null in live mode.failureobject | nullcodeandmessagewhen the payment failed. Codes:EXPIRED,DECLINED,PROVIDER_ERROR.2 fields in
failurecodestringOne of:EXPIREDDECLINEDPROVIDER_ERRORmessagestring
expires_atstring (date-time)When an unpaid payment fails (failure.codeEXPIRED).completed_atstring (date-time) | nullWhen the customer paid, as the provider reports it.failed_atstring (date-time) | nullWhen the payment failed.cancelled_atstring (date-time) | nullWhen the payment was canceled.reversed_atstring (date-time) | nullWhen the payment was reversed.created_atstring (date-time)When Weav created the payment.updated_atstring (date-time)When the payment last changed.
401 Unauthorized
Missing, malformed or unknown API key (code 4010000).
403 Forbidden
The key can't make this request (code 4030000): an address outside the key's IP allowlist, a live key before your live mode is on, or an account that isn't active. A live key sent from a browser is refused (code 4030001): keep live keys on your server.
404 Not Found
Not found in this mode for your account (code 4040000).