### Find Invoice API Request Example (Conceptual) Source: https://docs.winpay.id/docs/payments/checkout-page/find-invoice This is a conceptual example demonstrating how to make a request to the Find Invoice API. It highlights the necessary headers and the endpoint structure. Actual implementation will vary based on the chosen programming language and HTTP client library. ```bash curl -X GET \ 'https://.../api/find/{id}' \ -H 'X-Winpay-Timestamp: 2022-04-11T15:27:43+07:00' \ -H 'X-Winpay-Signature: YOUR_GENERATED_SIGNATURE' \ -H 'X-Winpay-Key: YOUR_MERCHANT_KEY' \ -H 'Content-Type: application/json' ``` -------------------------------- ### Response Query Payment QRIS Example (JSON) Source: https://docs.winpay.id/docs/payments/snap-api/qris This JSON object represents a successful response from a QRIS payment query. It includes transaction details such as response codes, status, amounts, and additional information from the issuer. ```json { "responseCode": "2005100", "responseMessage": "Success", "originalPartnerReferenceNo": "gigih-00000081", "serviceCode": "47", "latestTransactionStatus": "00", "transactionStatusDesc": "Success", "paidTime": "2023-08-24T17:03:33+07:00", "amount": { "value": "2000.00", "currency": "IDR" }, "feeAmount": { "value": "14.00", "currency": "IDR" }, "terminalId": "", "additionalInfo": { "issuer": "Dana", "rrn": "810534941939", "buyerReff": "Winpay" } } ``` -------------------------------- ### Balance Inquiry Response Example (JSON) Source: https://docs.winpay.id/docs/payments/snap-api/report This JSON object shows a successful response from the Balance Inquiry service. It contains transaction details, reference numbers, account information, and balance details including type, amount, currency, and status. ```json { "responseCode": "2001100", "responseMessage": "Request has been processed successfully", "referenceNo": "BWPRzPwFixh8sbXviruY3MnYdUxvC3Kvirvir", "partnerReferenceNo": "2020102900000000000005", "accountNo": "172188", "name": "WINPAY", "accountInfos": [ { "balanceType": "Transaction", "amount": { "value": "10000.00", "currency": "IDR" }, "status": "0001" }, { "balanceType": "Settlement", "amount": { "value": "10000.00", "currency": "IDR" }, "status": "0001" } ] } ``` -------------------------------- ### Transaction List Payload Example (JSON) Source: https://docs.winpay.id/docs/payments/snap-api/report This JSON object demonstrates the payload for the Transaction List service. It requires a partner reference number, a date range (from and to), and pagination details (page size and page number). ```json { "partnerReferenceNo" : "REF0001", "fromDateTime" : "2025-06-01T16:38:05+07:00", "toDateTime" : "2025-06-30T16:38:05+07:00", "pageSize" : 10, "pageNumber" : 1 } ``` -------------------------------- ### Winpay Callback Payload Example Source: https://docs.winpay.id/docs/payments/snap-api/virtual-account This JSON object represents the structure of the callback payload sent by Winpay to the merchant upon successful payment. It includes transaction details, customer information, and payment amounts. ```json { "partnerServiceId": " 22691", "customerNo": "41693903614", "virtualAccountNo": " 2269141693903614", "virtualAccountName": "Bayar 2269141693903614", "trxId": "INV-000000023212x2224", "paymentRequestId": "88889123", "paidAmount": { "value": "10000", "currency": "IDR" }, "trxDateTime": "2023-09-05T22:47:00+07:00", "referenceNo": 36238, "additionalInfo": { "channel": "CIMB", "contractId": "ci71a51730-2373-455f-b538-3f9912fefb73" } } ``` -------------------------------- ### Balance Inquiry Payload Example (JSON) Source: https://docs.winpay.id/docs/payments/snap-api/report This JSON object represents the payload for the Balance Inquiry service. It includes the partner's reference number, account number, and the types of balances to query (Transaction and Settlement). ```json { "partnerReferenceNo":"2020102900000000000003", "accountNo":"172188", "balanceTypes":[ "Transaction", "Settlement" ] } ``` -------------------------------- ### Winpay Callback Payload Example Source: https://docs.winpay.id/docs/payments/snap-api/qris This JSON object represents the structure of the callback payload sent by Winpay to the merchant after a customer completes a payment. It includes transaction details such as reference numbers, status, amount, and additional information. ```json { "originalReferenceNo": "38740", "originalPartnerReferenceNo": "1013225-1698047338", "latestTransactionStatus": "00", "amount": { "value": "35490", "currency": "IDR" }, "additionalInfo": { "channel": "QRIS", "contractId": "qraa6e280d-2299-45ed-a040-783af3d4e80c", "brandName": "DANA", "rrn": "737659758297", "buyerRef": "PDAM", "terminalId": "A01" } } ``` -------------------------------- ### Response Transaction List Example Source: https://docs.winpay.id/docs/payments/snap-api/report This JSON object represents a successful response from the transaction list API. It includes details about the transaction, such as response codes, reference numbers, and an array of transaction details. ```json { "responseCode": "2001200", "responseMessage": "Request has been processed successfully", "referenceNo": "HTWPp07wFi0feLyOvCvirj5EvirsmLyO0fevirjvbX", "partnerReferenceNo": "REF0001", "detailData": [ { "dateTime": "2025-06-27T19:28:00+07:00", "amount": { "value": "10000.00", "currency": "IDR" }, "status": "INIT", "type": "EXPIRED", "additionalInfo": { "merchantId": "172188", "transactionId": 447067509, "billName": null, "channel": "Permata VA SNAP Close One Off", "merchantReff": "pr9628688b-5931-4ed3-914d-73ea54e9df6d", "winpayReff": "7270041751027280", "amountDetail": { "amount": { "value": "10000.00", "currency": "IDR" }, "fee": { "value": "0.00", "currency": "IDR" }, "nettAmount": { "value": "10000.00", "currency": "IDR" } }, "callbackDetail": { "url": null, "status": "INIT" } } } ] } ``` -------------------------------- ### Winpay ID Response Inquiry Status JSON Example Source: https://docs.winpay.id/docs/payments/snap-api/virtual-account This JSON object represents a successful response when inquiring about the status of a virtual account transaction. It includes details about the transaction, virtual account, and amounts. ```json { "responseCode": "2002600", "responseMessage": "Successful", "virtualAccountData": { "virtualAccountNo": "2269141708949044", "virtualAccountName": "Valid 14", "paymentFlagStatus": "00", "transactionDate": "2024-02-26T19:04:51+00:00", "referenceNo": "50966", "totalAmount": { "value": "15000.00", "currency": "IDR" } }, "additionalInfo": { "contractId": "ciaf1b982a-9d06-4e27-ba39-a6aefd9e813d", "channel": "CIMB", "trxId": "xxxxxxxxxxx13" } } ``` -------------------------------- ### Inquiry VA Payload Example Source: https://docs.winpay.id/docs/payments/snap-api/virtual-account This code snippet demonstrates the expected JSON payload for the Inquiry VA service. It includes the transaction ID, additional information such as the contract ID, and other relevant parameters required for querying virtual account status. ```json { "trxId": "INV-000000023212x22", "additionalInfo": { "contractId": "ci302a21c9-bb4b-40c5-880d-e99691ed0af9" } } ``` -------------------------------- ### Response Status Payment JSON Example Source: https://docs.winpay.id/docs/payments/snap-api/ewallet This JSON object details the response received after querying a payment's status. It includes transaction details, response codes, and the latest transaction status. ```json { "responseCode": "2005500", "responseMessage": "Successful", "originalPartnerReferenceNo": "000000000053", "serviceCode": "54", "latestTransactionStatus": "07", "additionalInfo": { "contractId": "so748b157a-c7b2-4b2b-81cd-00fdd94c82bd" } } ``` -------------------------------- ### Inquiry VA Response Example Source: https://docs.winpay.id/docs/payments/snap-api/virtual-account This JSON object represents a successful response from the Inquiry VA service. It contains details about the virtual account, transaction, and associated metadata, including response codes, virtual account number, amount, and expiration date. ```json { "responseCode": "2003000", "responseMessage": "Success", "virtualAccountData": { "virtualAccountNo": "2269186000003212", "virtualAccountName": "Mas Nchus", "trxId": "INV-000000023212x22", "totalAmount": { "value": "25000.00", "currency": "IDR" }, "expiredDate": "2023-09-01T19:30:14+00:00", "additionalInfo": { "channel": "CIMB", "contractId": "ci302a21c9-bb4b-40c5-880d-e99691ed0af9" } } } ``` -------------------------------- ### Bank Statement Payload Example Source: https://docs.winpay.id/docs/payments/snap-api/report This JSON object demonstrates the payload structure for requesting bank statement data. It includes essential parameters like partner reference number, bank card token, account number, and date range for the statement. ```json { "partnerReferenceNo" : "REF0002", "bankCardToken" : "12iu3o1u3i1u23y1iu", "accountNo" : "91283781273", "fromDateTime" : "2025-10-01T00:00:00+07:00", "toDateTime" : "2025-10-02T23:59:59+07:00", "additionalInfo":{ "pageSize":"10", "pageNumber":"1" } } ``` -------------------------------- ### Find Invoice By Merchant Ref API Request Example (Conceptual) Source: https://docs.winpay.id/docs/payments/checkout-page/find-invoice-byMerchantRef This snippet illustrates a conceptual API request to find an invoice using a merchant reference. It highlights the necessary components such as the HTTP method, URL, and required headers. Note that actual implementation would involve specific libraries for generating signatures and handling requests. ```http GET .../api/findByRef/{merchantRef} HTTP/1.1 Host: winpay.id X-Winpay-Timestamp: 2023-10-27T10:00:00+07:00 X-Winpay-Signature: YOUR_GENERATED_SIGNATURE X-Winpay-Key: YOUR_MERCHANT_KEY Content-Type: application/json ``` -------------------------------- ### Inquiry Status Payload Example Source: https://docs.winpay.id/docs/payments/snap-api/virtual-account This code snippet illustrates the JSON payload required for the Inquiry Status service. It specifies the virtual account number, transaction ID, and additional information including the contract ID and channel, necessary to check the status of a virtual account transaction. ```json { "virtualAccountNo": " 2269141708949044", "additionalInfo": { "contractId": "ciaf1b982a-9d06-4e27-ba39-a6aefd9e813d", "channel": "CIMB", "trxId": "xxxxxxxxxxx13" } } ``` -------------------------------- ### WinPay Callback Request Sample Source: https://docs.winpay.id/docs/payments/checkout-page/callback This is a sample JSON payload that WinPay sends to the merchant's listener URL upon successful payment. It contains detailed information about the transaction, including invoice details, customer information, and payment specifics. ```json { "uuid": "40777df1-ad3d-4572-b0a3-6c90574330fa", "created_at": "2022-11-14T10:48:00+07:00", "ref": "21125", "channel": "BSI", "amount": 18940, "fee": 0, "nett_amount": 18940, "products": [ { "name": "1172164", "qty": 1, "price": 18940 } ], "invoice": { "uuid": "f6bd0574-56ca-4926-849c-8c332694966c", "ref": "1172164-1668397659", "url": "https://checkout.winpay.id/ilhwj3z75x5", "customer": { "name": "TUTIANxxxxxx", "email": "customer@pdam-sby.winpay.id", "phone": "1172164" } } } ``` -------------------------------- ### GET /websites/winpay_id/bank_statement Source: https://docs.winpay.id/docs/payments/snap-api/report Retrieves bank statement information, including transaction details and balance information. ```APIDOC ## GET /websites/winpay_id/bank_statement ### Description This endpoint retrieves bank statement information, including transaction details and balance information for a given period. ### Method GET ### Endpoint /websites/winpay_id/bank_statement ### Parameters #### Query Parameters - **startDate** (String) - Required - The start date for the bank statement period. - **endDate** (String) - Required - The end date for the bank statement period. ### Request Example ```json { "startDate": "2025-10-01T00:00:00+07:00", "endDate": "2025-10-02T23:59:59+07:00" } ``` ### Response #### Success Response (200) - **responseCode** (String) - Kode Respon - **responseMessage** (String) - Pesan Respon - **referenceNo** (String) - Nomor referensi pembayaran - **partnerReferenceNo** (String) - Nomor transaksi merchant - **balance** (Array) - Informasi saldo - **amount** (Array) - Jumlah saldo saat ini - **value** (String) - Nominal saldo - **currency** (String) - Kode mata uang - **dateTime** (String) - Waktu pencatatan saldo - **startingBalance** (Array) - Jumlah saldo awal periode - **value** (String) - Nominal saldo - **currency** (String) - Kode mata uang - **dateTime** (String) - Waktu pencatatan saldo - **endingBalance** (Array) - Jumlah saldo akhir periode - **value** (String) - Nominal saldo - **currency** (String) - Kode mata uang - **dateTime** (String) - Waktu pencatatan saldo - **lastRecordDateTime** (String) - Waktu terakhir transaksi customer - **detailData** (Object) - Object detail data - **detailBalance** (Object) - Object salso awal dan akhir - **startAmount** (String) - Nilai saldo sebelum transaksi - **endAmount** (String) - Nilai saldo setelah transaksi - **amount** (Object) - Object nominal transaksi - **value** (String) - Nominal transaksi - **currency** (String) - Kode mata uang - **originAmount** (Object) - Object nominal transaksi - **value** (String) - Nominal transaksi - **currency** (String) - Kode mata uang - **transactionDate** (String) - Tanggal dan waktu transaksi - **remark** (String) - Keterangan transaksi - **transactionId** (String) - ID transaksi dari Winpay - **type** (String) - Jenis transaksi - **transactionDetailStatus** (String) - Status transaksi - **detailInfo** (Object) - Informasi detail transaksi - **mutationId** (String) - ID mutasi dari Winpay - **transactionId** (String) - ID transaksi dari Winpay - **merchantId** (String) - MerchantId customer - **product** (String) - Nama produk #### Response Example ```json { "responseCode": "2001400", "responseMessage": "Request has been processed successfully", "referenceNo": "HTWPp07PZbX3KRzPtMd1jvirvirvirsmsmvCRzP", "partnerReferenceNo": "REF0002", "balance": [ { "amount": { "value": "914721.95", "currency": "IDR", "dateTime": "2025-10-02T09:28:29+07:00" }, "startingBalance": { "value": "904921.95", "currency": "IDR", "dateTime": "2025-10-02T09:28:29+07:00" }, "endingBalance": { "value": "914721.95", "currency": "IDR", "dateTime": "2025-10-02T09:28:29+07:00" } } ], "lastRecordDateTime": "2025-10-02T09:28:29+07:00", "detailData": [ { "detailBalance": { "startAmount": [ { "amount": { "value": "914921.95", "currency": "IDR" } } ], "endAmount": [ { "amount": { "value": "914721.95", "currency": "IDR" } } ] }, "amount": { "value": "200.00", "currency": "IDR" }, "originAmount": { "value": "200.00", "currency": "IDR" }, "transactionDate": "2025-10-02T09:28:29+07:00", "remark": "172188-gigih pras MDR : SCPISPAY", "transactionId": "461730304", "type": "DEBIT", "transactionDetailStatus": "SUCCESS", "detailInfo": { "mutationId": "166789765", "transactionId": "461730304", "merchantId": "172188", "product": "Payment channel SHOPEEPAY" } } ] } ``` #### Error Responses - **4001400**: Invalid response from biller. Check `responseMessage` for details. - **4001401**: Invalid field format { field name }. - **4001402**: Invalid mandatory field {field name}. - **4011400**: Invalid signature. `X-Signature` is incorrect. - **4041416**: Partner not found. `X-Partner-ID` is not registered. - **4091400**: Cannot use the same `X-EXTERNAL-ID` in the same day. `X-External-ID` has already been used today. ``` -------------------------------- ### Response Cancel Payment JSON Example Source: https://docs.winpay.id/docs/payments/snap-api/ewallet This JSON object represents the response after attempting to cancel a payment. It confirms the success or failure of the cancellation request with a response code and message. ```json { "responseCode": "2005700", "responseMessage": "Successful", "additionalInfo": { "contractId": "soe1f74b38-e689-4747-b4bd-5dd876928349" } } ``` -------------------------------- ### POST /v1.0/debit/payment-host-to-host Source: https://docs.winpay.id/docs/payments/snap-api/creditcard Service ini digunakan untuk membuat transaksi pembayaran Kartu Kredit. ```APIDOC ## POST /v1.0/debit/payment-host-to-host ### Description Service ini digunakan untuk membuat transaksi pembayaran Kartu Kredit. ### Method POST ### Endpoint .../v1.0/debit/payment-host-to-host ### Parameters #### Request Body - **partnerReferenceNo** (String) - Required - Nomor transaksi. Length: `5-50`. Allowed Chars: `a-z, A-Z, 0-9, _, -` - **amount** (Object) - Required - Object amount - **amount.value** (String) - Required - Nilai transaksi. Length: `1-12`. Allowed Chars: `0-9` - **amount.currency** (String) - Required - Kode mata uang. Length: `3`. Allowed Value: `IDR` - **urlParam** (Array) - Required - Array url - **urlParam.url** (String) - Required - Url callback - **urlParam.type** (String) - Required - Tipe callback. Allowed Value: `PAY_NOTIFY` and `PAY_RETURN` - **urlParam.isDeeplink** (String) - Required - Flag untuk menentukan apakah url callback merupakan deeplink atau tidak. Allowed Value: `N` - **validUpTo** (String) - Required - Waktu transaksi berakhir. Format: `YYYY-MM-DDTHH:mm:ssZ` (ISO8601). Must be more than 1 minute and max 3 months from request time. - **additionalInfo** (Object) - Required - Object additionalInfo - **additionalInfo.channel** (String) - Required - Channel Kartu Kredit. Allowed Value: `CC` - **additionalInfo.customerPhone** (String) - Required - Nomor telepon customer - **additionalInfo.customerName** (String) - Required - Nama customer. Length: `5-25`. Allowed Chars: `a-z, A-Z, 0-9, -, space (\s)` ### Request Example ```json { "partnerReferenceNo":"WP-TESTING-KK-002", "amount":{ "value":"10000", "currency":"IDR" }, "urlParam":[ { "url":"https://test1.bi.go.id/v1/test", "type":"PAY_NOTIFY", "isDeeplink":"N" }, { "url":"https://test1.bi.go.id/v1/test", "type":"PAY_RETURN", "isDeeplink":"N" } ], "validUpTo":"2024-11-14T14:59:11+07:00", "additionalInfo":{ "channel":"CC", "customerPhone":"0895633156874", "customerName": "Delina Prasetya" } } ``` ### Response #### Success Response (200) - **responseCode** (String) - Kode response - **responseMessage** (String) - Pesan response - **partnerReferenceNo** (String) - Nomor transaksi - **appRedirectUrl** (String) - Url deeplink - **webRedirectUrl** (String) - Url redirect - **additionalInfo** (Object) - Object response - **contractId** (String) - Nomor identifikasi transaksi yang dihasilkan di sistem Winpay - **expiredTime** (String) - Kartu Kredit expiration in ISO8601 format - **channel** (String) - Channel Kartu Kredit - **instructions** (Array) - Array of payment instructions #### Response Example ```json { "responseCode": "2005400", "responseMessage": "Success", "partnerReferenceNo": "WP-TESTING-KK-002", "appRedirectUrl": "", "webRedirectUrl": "https://sandbox-cc.bmstaging.id/inv/1de9025ad363fceba004e89b46687c2f67a4cc57f2fd1a72680b4357a08e06c3", "additionalInfo": { "contractId": "cc78f3c08e-b051-4db7-bd94-a958a7d69c5b", "expiredTime": "2024-11-14T14:59:11+07:00", "channel": "CC", "instructions": [] } } ``` #### List Response Code Create Payment Kartu Kredit - **2005400** - Success - **4005400** - Bad Request - Kegagalan request umum, termasuk kegagalan saat memproses pesan - **4005401** - Invalid field format { field name } - **4005402** - Invalid mandatory field {field name} - **4015400** - Invalid signature - `X-Signature` salah - **4045416** - Partner not found - `X-Partner-ID` tidak terdaftar - **4095400** - Cannot use same X-EXTERNAL-ID in same day - `X-External-ID` sudah pernah digunakan di hari yang sama - **4095401** - Duplicate partnerReferenceNo - `partnerReferenceNo` sudah pernah digunakan - **5005400** - General Error - **5005401** - Internal Server Error - Kegagalan internal server yang tidak dikenal. Silakan coba prosesnya kembali ``` -------------------------------- ### Payload Status Payment JSON Example Source: https://docs.winpay.id/docs/payments/snap-api/ewallet This JSON object represents the payload structure for requesting the status of a payment. It includes transaction identifiers and additional information required by the Winpay system. ```json { "originalPartnerReferenceNo": "000000000053", "additionalInfo": { "contractId": "so748b157a-c7b2-4b2b-81cd-00fdd94c82bd", "channel": "SPAY" } } ``` -------------------------------- ### Payload Cancel Payment JSON Example Source: https://docs.winpay.id/docs/payments/snap-api/ewallet This JSON object defines the payload for canceling a payment transaction. It requires the original transaction reference, a reason for cancellation, and additional transaction details. ```json { "originalPartnerReferenceNo": "0000000000568", "reason": "Network timeout", "additionalInfo": { "contractId": "soe1f74b38-e689-4747-b4bd-5dd876928349", "channel": "SPAY" } } ``` -------------------------------- ### Verify E-Wallet Signature (Go) Source: https://docs.winpay.id/en/docs/payments/snap-api/signature-callback-validation This Go code snippet demonstrates how to verify an e-wallet transaction signature. It constructs a string to sign by combining the HTTP method, path, a minified JSON payload, and a timestamp. The signature is then verified using RSA public key verification with SHA256. ```go package main import ( "bytes" "crypto" "crypto/rsa" "crypto/sha256" "crypto/x509" "encoding/base64" "encoding/hex" "encoding/json" "fmt" "io" "strings" ) func main() { path := "/v1/test" tStamp := "2024-01-11T17:01:35+07:00" // ambil dari header X-Timestamp method := "POST" // http method signature := "SbplyMG0x4igUO8ZqkgUDqNXIzZ6eryz1eNWFfUT499/ulgCLKDJifPtdQH/WBWg5BnKTn+AaKK6inll7h7gJbojC/85TH1QNFnzz8fR4ds+BmFhQaYhys1G5upm4h9x/2hFIznFsEYlc+Ggljs5kXi9wezsltlEkAf5w6snCf4=" // ambil dari header X-Signature payloadStr := `{ "originalPartnerReferenceNo": "0000000000591y", "originalReferenceNo": "45588", "merchantId": 170041, "amount": { "value": "1000", "currency": "IDR" }, "latestTransactionStatus": "00", "additionalInfo": { "channel": "OVO", "contractId": "ovb7b5599b-cce7-4f0f-8c34-fa283185945b" } }` minifyBody, _ := Minify([]byte(payloadStr)) stringToSign := fmt.Sprintf("%s:%s:%s:%s", method, path, string(minifyBody), tStamp) signatureOk := ValidateSignature(stringToSign, signature) fmt.Println("Apakah signature valid?") fmt.Println(signatureOk) } func Minify(body []byte) ([]byte, error) { buff := new(bytes.Buffer) errCompact := json.Compact(buff, body) if errCompact != nil { ``` -------------------------------- ### Cancel Payment QRIS Payload Example (JSON) Source: https://docs.winpay.id/docs/payments/snap-api/qris This JSON object demonstrates the payload required to cancel a QRIS payment. It includes the original transaction reference number, the reason for cancellation, and additional contract information. ```json { "originalPartnerReferenceNo":"abctoxfzxctpww", "reason":"Gagal", "additionalInfo":{ "contractId": "qre9162f14-b282-4325-a72b-25c755db7322" } } ``` -------------------------------- ### Minify JSON and Generate SHA-256 Hash in Go Source: https://docs.winpay.id/en/docs/payments/snap-api/signature-callback-validation The `Minify` function takes a byte slice representing JSON data, compacts it using `json.Compact`, and then computes its SHA-256 hash. The hash is then hex-encoded, converted to lowercase, and returned as a byte slice. This function is useful for preparing data for signing or comparison. ```go func Minify(body []byte) ([]byte, error) { buff := new(bytes.Buffer) errCompact := json.Compact(buff, body) if errCompact != nil { newErr := fmt.Errorf("failure encountered compacting json := %v", errCompact) return nil, newErr } b, err := io.ReadAll(buff) if err != nil { readErr := fmt.Errorf("read buffer error encountered := %v", err) return nil, readErr } // LowerCase(HexEncode(SHA-256(stringToMinify))) hasher := sha256.New() hasher.Write([]byte(b)) hash := hex.EncodeToString(hasher.Sum(nil)) return []byte(strings.ToLower(hash)), nil } ``` -------------------------------- ### Winpay ID Response Delete VA JSON Example Source: https://docs.winpay.id/docs/payments/snap-api/virtual-account This JSON object represents a successful response after requesting to delete a virtual account. It confirms the deletion and provides transaction and additional information. ```json { "responseCode": "2003100", "responseMessage": "Success", "virtualAccountData": { "trxId": "xxxxxxxxxxx20" }, "additionalInfo": { "contractId": "si4390d6cb-5e9f-41fb-bfa3-51f6e7c9e4b4", "channel": "BSI" } } ``` -------------------------------- ### Create String to Sign for Winpay ID in Go Source: https://docs.winpay.id/en/docs/payments/snap-api/signature-callback-validation This Go code snippet demonstrates how to construct the `stringToSign` required for signature generation or validation in the Winpay ID system. It concatenates the HTTP method, request path, minified request body, and a timestamp, separated by colons. This formatted string is then used as input for signature verification. ```go stringToSign := fmt.Sprintf("%s:%s:%s:%s", method, path, string(minifyBody), tStamp) ``` -------------------------------- ### E-Wallet Signature Verification (Go) Source: https://docs.winpay.id/en/docs/payments/snap-api/signature-callback-validation This section outlines the Go implementation for verifying E-Wallet transaction signatures. It covers the request payload structure and the signature validation process. ```APIDOC ## POST /v1/test ### Description This endpoint is used for E-Wallet transactions and requires signature verification to ensure data integrity using Go. ### Method POST ### Endpoint /v1/test ### Parameters #### Header Parameters - **X-Timestamp** (string) - Required - The timestamp of the request. - **X-Signature** (string) - Required - The signature of the request, generated using SHA256. - **X-Partner-Id** (string) - Required - The partner ID. #### Request Body - **originalPartnerReferenceNo** (string) - Required - The original partner reference number. - **originalReferenceNo** (string) - Required - The original reference number. - **merchantId** (integer) - Required - The merchant ID. - **amount** (object) - Required - The transaction amount. - **value** (string) - Required - The amount value. - **currency** (string) - Required - The currency of the amount. - **latestTransactionStatus** (string) - Required - The latest transaction status. - **additionalInfo** (object) - Optional - Additional information about the transaction. - **channel** (string) - Required - The payment channel (e.g., OVO). - **contractId** (string) - Required - The contract ID. ### Request Example ```json { "originalPartnerReferenceNo": "0000000000591y", "originalReferenceNo": "45588", "merchantId": 170041, "amount": { "value": "1000", "currency": "IDR" }, "latestTransactionStatus": "00", "additionalInfo": { "channel": "OVO", "contractId": "ovb7b5599b-cce7-4f0f-8c34-fa283185945b" } } ``` ### Response #### Success Response (200) - **responseCode** (string) - The response code indicating success. - **responseMessage** (string) - The response message indicating success. #### Error Response - **message** (string) - An error message if the signature verification fails or an exception occurs. #### Response Example (Success) ```json { "responseCode": "2005600", "responseMessage": "Successful" } ``` #### Response Example (Error) ```json { "message": "Cannot verify signature" } ``` ``` -------------------------------- ### Handle Buffer Read Errors and Compute SHA-256 Hash in Go Source: https://docs.winpay.id/docs/payments/snap-api/signature-callback-validation This Go code snippet demonstrates robust error handling when reading from a buffer and subsequently computes a SHA-256 hash of the buffer's content. The hash is then hex-encoded, converted to lowercase, and returned as a byte slice. It utilizes the 'fmt', 'io', 'crypto/sha256', 'encoding/hex', and 'strings' packages. ```go func processBuffer(buff *bytes.Buffer) ([]byte, error) { b, err := io.ReadAll(buff) if err != nil { readErr := fmt.Errorf("read buffer error encountered := %v", err) return nil, readErr } // LowerCase(HexEncode(SHA-256(stringToMinify))) hasher := sha256.New() hasher.Write([]byte(b)) hash := hex.EncodeToString(hasher.Sum(nil)) return []byte(strings.ToLower(hash)), nil } ``` -------------------------------- ### Response Cancel Payment QRIS Example (JSON) Source: https://docs.winpay.id/docs/payments/snap-api/qris This JSON object shows a successful response after canceling a QRIS payment. It confirms the cancellation with details like the response code, message, original transaction reference, and cancellation time. ```json { "responseCode": "2007700", "responseMessage": "Request has been processed successfully", "originalPartnerReferenceNo": "abctoxfzxctpww", "cancelTime": "2024-05-30T18:08:05+07:00", "additionalInfo": { "contractId": "qre9162f14-b282-4325-a72b-25c755db7322" } } ``` -------------------------------- ### POST /v1.0/debit/status Source: https://docs.winpay.id/docs/payments/snap-api/creditcard Service ini digunakan untuk cek status pembayaran dari Kartu Kredit. ```APIDOC ## POST /v1.0/debit/status ### Description Service ini digunakan untuk cek status pembayaran dari Kartu Kredit. ### Method POST ### Endpoint .../v1.0/debit/status ### Parameters #### Query Parameters - **Service Code** (Number) - Required - **55** ### Request Example (Request body and specific parameters for status check are not provided in the source text.) ### Response (Response details for status check are not provided in the source text.) ``` -------------------------------- ### Create Invoice Response Sample (JSON) Source: https://docs.winpay.id/docs/payments/checkout-page/create-invoice This is a sample JSON response from the Create Invoice API. It contains a response code, message, date, and detailed response data including the transaction ID, redirect URL, and customer information. ```json { "responseCode": "2010300", "responseMessage": "Invoice created", "responseDate": "2023-10-25T14:12:14+07:00", "responseData": { "id": "2edff262-6228-4da1-96d7-729bf9fc85f0", "ref": "0000001792131232161", "created_at": "2023-10-25 14:12:14", "redirect_url": "https://checkout.winpay.id/upu90zxyid", "back_url": "https://your-invoice-url.com", "customer": { "name": "Delina Prasetya", "email": "gigih.putri@corp.bm.co.id", "phone": "082342341" }, "products": [ { "uuid": "92cd6096-ab4a-4e79-be61-c4cdbeedd281", "name": "01002676", "qty": 1, "price": 260000 } ] } } ``` -------------------------------- ### Winpay ID Delete VA Payload JSON Example Source: https://docs.winpay.id/docs/payments/snap-api/virtual-account This JSON object is used as a payload to request the cancellation of an unpaid virtual account. It requires the virtual account number, transaction ID, and additional information including the contract ID. ```json { "virtualAccountNo": " 2269131710748503", "trxId": "XINV-000000170104", "additionalInfo": { "contractId": "ci067a0336-4ddf-4001-9cef-3eb107c331f4", "channel": "CIMB" } } ``` -------------------------------- ### Create Invoice Request Sample (JSON) Source: https://docs.winpay.id/docs/payments/checkout-page/create-invoice This is a sample JSON payload for the Create Invoice API request. It includes customer details, invoice information, a back URL, and an interval for the invoice expiration. ```json { "customer": { "name": "Delina Prasetya", "email": "gigih.putri@corp.bm.co.id", "phone": "082342341" }, "invoice": { "ref": "111130", "products": [ { "name": "01002676", "qty": 1, "price": 260000 } ] }, "back_url": "https://your-invoice-url.com", "interval": 120 } ```