# QRIS

Overview Steps

Overview of integration process with QRIS

1. [Generate QRIS](#id-1.-generate-qris)
2. [Query QRIS](#id-2.-query-qris)
3. [Refund QRIS](#id-3.-refund-qris)
4. [Decode QRIS](#id-4.-decode-qris)
5. [Payment QRIS](#id-5.-payment-qris)
6. [Cancel QRIS](#id-6.-cancel-qris)

***

### 1. Generate QRIS

After customer creates an order and choose QRIS as the payment method, merchant will hit this API to generate QRIS that will be shown to the customer. To generate QRIS, you need to hit this API through your Backend:

#### API Endpoint

| Environment    | Endpoint                                                      |
| -------------- | ------------------------------------------------------------- |
| HTTP Method    | POST                                                          |
| API Sandbox    | [https://api-sandbox.doku.com](https://api-sandbox.doku.com/) |
| API Production | [https://api.doku.com](https://api.doku.com/)                 |
| Path           | `/snap-adapter/b2b/v1.0/qr/qr-mpm-generate`                   |

Here is the sample request header, request body and response body for generate QRIS:

## POST /snap-adapter/b2b/v1.0/qr/qr-mpm-generate

> POST Generate QRIS

```json
{"openapi":"3.0.0","info":{"title":"doku-wallet-snap-api-qris","version":"1.0.0"},"tags":[{"name":"QRIS","description":"QRIS operations B2B"}],"servers":[{"url":"https://api-sandbox.doku.com"}],"paths":{"/snap-adapter/b2b/v1.0/qr/qr-mpm-generate":{"post":{"tags":["QRIS"],"summary":"POST Generate QRIS","operationId":"qr-mpm-generate","parameters":[{"$ref":"#/components/parameters/xPartnerId"},{"$ref":"#/components/parameters/xExternalId"},{"$ref":"#/components/parameters/xTimeStamp"},{"$ref":"#/components/parameters/xSignature"},{"$ref":"#/components/parameters/authorization"},{"$ref":"#/components/parameters/channelId"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateQrisRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateQrisResponse"}}}}}}}},"components":{"parameters":{"xPartnerId":{"name":"X-PARTNER-ID","in":"header","description":"Client Id for merchant that generated by DOKU","required":true,"schema":{"type":"string"}},"xExternalId":{"name":"X-EXTERNAL-ID","in":"header","description":"Numeric String. Reference number that should be unique in the same day (Request Id)","required":true,"schema":{"type":"string"}},"xTimeStamp":{"name":"X-TIMESTAMP","in":"header","description":"Client's current local time with format YYYY-MM-DDTHH:mm:ssZD","required":true,"schema":{"type":"string"}},"xSignature":{"name":"X-SIGNATURE","in":"header","description":"Symmetric Signature with Get Token (Default)HMAC_SHA512 (clientSecret, stringToSign) dengan formula stringToSign = HTTPMethod +”:“+ EndpointUrl +\":\"+ AccessToken +\":“+ Lowercase(HexEncode(SHA-256(minify(RequestBody))))+ \":“ + TimeStamp","required":true,"schema":{"type":"string"}},"authorization":{"name":"Authorization","required":true,"in":"header","description":"String starts with keyword “Bearer ” followed by token B2B (e.g. Bearer eyJraWQiOi...Jzc29zIiwiY)","schema":{"type":"string"}},"channelId":{"name":"CHANNEL-ID","in":"header","description":"Channel ID for QRIS please fill with H2H (Host-To-Host)","required":true,"schema":{"type":"string"}}},"schemas":{"GenerateQrisRequest":{"type":"object","required":["partnerReferenceNo","amount","merchantId","terminalId","additionalInfo"],"properties":{"partnerReferenceNo":{"type":"string","description":"Transaction ID from partners. | Mandatory  | min length: 1 | max length: 64"},"amount":{"type":"object","required":["value","currency"],"description":"Detail Amount","properties":{"value":{"type":"string","description":" Net amount of the transaction. If it's IDR then the value includes 2 decimal digits. e.g. IDR 10.000,- will be placed with 10000.00 with 2 decimal. | Mandatory  | min length: 1 | max length: 16.2 "},"currency":{"type":"string","description":"Currency (ISO4217) Default “IDR”. | Mandatory | min length: 1 | max length: 3 "}}},"merchantId":{"description":"Credential mall ID from DOKU. | Mandatory  | min length: 1 | max length: 64 ","type":"string"},"terminalId":{"type":"string","description":" Terminal Identification alphanumeric. | Mandatory  | min length: 1 | max length: 16 "},"validityPeriod":{"type":"string","description":"Expired Time QRIS using ISO 8601 Format, if not sent will use Default value 30 days"},"additionalInfo":{"type":"object","description":"Additional Information use to determine QRIS postal code & feeType, also used in order to fulfill non-mandatory parameters for QRIS Merchant","required":["postalCode","feeType"],"properties":{"postalCode":{"type":"string","description":" User postal code address Numeric. | Mandatory  | min length: 1 | max length: 5"},"feeType":{"type":"string","enum":[1],"description":"Parameter to describe fee type that will be used:\n1. No Tips"}}}}},"GenerateQrisResponse":{"type":"object","properties":{"responseCode":{"type":"string"},"responseMessage":{"type":"string"},"referenceNo":{"type":"string"},"partnerReferenceNo":{"type":"string"},"qrContent":{"type":"string"},"terminalId":{"type":"string"},"additionalInfo":{"type":"object","description":"Additional Information, values are based from object additionalInfo in generate qris request operation","properties":{"validityPeriod":{"type":"string"},"postalCode":{"type":"string","maxLength":5,"description":"User postal code address Numeric"},"feeType":{"type":"string","enum":[1],"description":"Parameter to describe fee type that will be used:\n1. No Tips"}}}}}}}}
```

### 2. Query QRIS

To query QRIS, you need to hit this API through your Backend:

#### API Endpoint

| Environment    | Endpoint                                                      |
| -------------- | ------------------------------------------------------------- |
| HTTP Method    | POST                                                          |
| API Sandbox    | [https://api-sandbox.doku.com](https://api-sandbox.doku.com/) |
| API Production | [https://api.doku.com](https://api.doku.com/)                 |
| Path           | `/snap-adapter/b2b/v1.0/qr/qr-mpm-query`                      |

Here is the sample request header, request body and response body for query QRIS:

## POST /snap-adapter/b2b/v1.0/qr/qr-mpm-query

> POST Query QRIS

```json
{"openapi":"3.0.0","info":{"title":"doku-wallet-snap-api-qris","version":"1.0.0"},"tags":[{"name":"QRIS","description":"QRIS operations B2B"}],"servers":[{"url":"https://api-sandbox.doku.com"}],"paths":{"/snap-adapter/b2b/v1.0/qr/qr-mpm-query":{"post":{"tags":["QRIS"],"summary":"POST Query QRIS","operationId":"qr-mpm-query","parameters":[{"$ref":"#/components/parameters/xPartnerId"},{"$ref":"#/components/parameters/xTimeStamp"},{"$ref":"#/components/parameters/xExternalId"},{"$ref":"#/components/parameters/xSignature"},{"$ref":"#/components/parameters/authorization"},{"$ref":"#/components/parameters/channelId"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryQrisRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryQrisResponse"}}}}}}}},"components":{"parameters":{"xPartnerId":{"name":"X-PARTNER-ID","in":"header","description":"Client Id for merchant that generated by DOKU","required":true,"schema":{"type":"string"}},"xTimeStamp":{"name":"X-TIMESTAMP","in":"header","description":"Client's current local time with format YYYY-MM-DDTHH:mm:ssZD","required":true,"schema":{"type":"string"}},"xExternalId":{"name":"X-EXTERNAL-ID","in":"header","description":"Numeric String. Reference number that should be unique in the same day (Request Id)","required":true,"schema":{"type":"string"}},"xSignature":{"name":"X-SIGNATURE","in":"header","description":"Symmetric Signature with Get Token (Default)HMAC_SHA512 (clientSecret, stringToSign) dengan formula stringToSign = HTTPMethod +”:“+ EndpointUrl +\":\"+ AccessToken +\":“+ Lowercase(HexEncode(SHA-256(minify(RequestBody))))+ \":“ + TimeStamp","required":true,"schema":{"type":"string"}},"authorization":{"name":"Authorization","required":true,"in":"header","description":"String starts with keyword “Bearer ” followed by token B2B (e.g. Bearer eyJraWQiOi...Jzc29zIiwiY)","schema":{"type":"string"}},"channelId":{"name":"CHANNEL-ID","in":"header","description":"Channel ID for QRIS please fill with H2H (Host-To-Host)","required":true,"schema":{"type":"string"}}},"schemas":{"QueryQrisRequest":{"type":"object","required":["originalReferenceNo","originalPartnerReferenceNo","serviceCode","merchantId"],"properties":{"originalReferenceNo":{"type":"string","description":"refund | Mandatory  | min length: 1 | max length: 64 "},"originalPartnerReferenceNo":{"type":"string","description":"Transaction ID from partners when Generate QRIS | min length: 1 | max length: 64 "},"serviceCode":{"type":"string","description":"Unique service API “47”"},"merchantId":{"type":"string","description":"Merchant ID registered in DOKU | min length: 1 | max length: 64 "}}},"QueryQrisResponse":{"type":"object","properties":{"responseCode":{"type":"string"},"responseMessage":{"type":"string"},"originalReferenceNo":{"maxLength":64,"type":"string"},"originalPartnerReferenceNo":{"type":"string","maxLength":64},"serviceCode":{"type":"string"},"latestTransactionStatus":{"type":"string"},"transactionStatusDesc":{"type":"string"},"paidTime":{"type":"string"},"amount":{"type":"object","required":["value","currency"],"properties":{"value":{"type":"string","pattern":"^\\d{1,16}\\.00$"},"currency":{"type":"string"}}},"feeAmount":{"type":"object","required":["value","currency"],"properties":{"value":{"type":"string","pattern":"^\\d{1,16}\\.00$"},"currency":{"type":"string"}}},"additionalInfo":{"type":"object","required":["approvalCode"],"properties":{"approvalCode":{"type":"string"},"convenienceFee":{"type":"string"},"issuerId":{"type":"string"},"issuerName":{"type":"string"},"terminalId":{"type":"string"},"customerName":{"type":"string"}}}}}}}}
```

### 3. Refund QRIS

This endpoint is used to create refund request for previous successful payment, merchant can request a transaction refund to DOKU. To refund, you need to hit this API through your Backend:

#### API Endpoint

| Environment    | Endpoint                                                      |
| -------------- | ------------------------------------------------------------- |
| HTTP Method    | POST                                                          |
| API Sandbox    | [https://api-sandbox.doku.com](https://api-sandbox.doku.com/) |
| API Production | [https://api.doku.com](https://api.doku.com/)                 |
| Path           | `/snap-adapter/b2b/v1.0/qr/qr-mpm-refund`                     |

Here is the sample request header, request body and response body for refund QRIS:

## POST /snap-adapter/b2b/v1.0/qr/qr-mpm-refund

> POST Refund QRIS

```json
{"openapi":"3.0.0","info":{"title":"doku-wallet-snap-api-qris","version":"1.0.0"},"tags":[{"name":"QRIS","description":"QRIS operations B2B"}],"servers":[{"url":"https://api-sandbox.doku.com"}],"paths":{"/snap-adapter/b2b/v1.0/qr/qr-mpm-refund":{"post":{"tags":["QRIS"],"summary":"POST Refund QRIS","operationId":"qr-mpm-refund","parameters":[{"$ref":"#/components/parameters/xPartnerId"},{"$ref":"#/components/parameters/xTimeStamp"},{"$ref":"#/components/parameters/xExternalId"},{"$ref":"#/components/parameters/xSignature"},{"$ref":"#/components/parameters/authorization"},{"$ref":"#/components/parameters/channelId"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundQrisRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundQrisResponse"}}}}}}}},"components":{"parameters":{"xPartnerId":{"name":"X-PARTNER-ID","in":"header","description":"Client Id for merchant that generated by DOKU","required":true,"schema":{"type":"string"}},"xTimeStamp":{"name":"X-TIMESTAMP","in":"header","description":"Client's current local time with format YYYY-MM-DDTHH:mm:ssZD","required":true,"schema":{"type":"string"}},"xExternalId":{"name":"X-EXTERNAL-ID","in":"header","description":"Numeric String. Reference number that should be unique in the same day (Request Id)","required":true,"schema":{"type":"string"}},"xSignature":{"name":"X-SIGNATURE","in":"header","description":"Symmetric Signature with Get Token (Default)HMAC_SHA512 (clientSecret, stringToSign) dengan formula stringToSign = HTTPMethod +”:“+ EndpointUrl +\":\"+ AccessToken +\":“+ Lowercase(HexEncode(SHA-256(minify(RequestBody))))+ \":“ + TimeStamp","required":true,"schema":{"type":"string"}},"authorization":{"name":"Authorization","required":true,"in":"header","description":"String starts with keyword “Bearer ” followed by token B2B (e.g. Bearer eyJraWQiOi...Jzc29zIiwiY)","schema":{"type":"string"}},"channelId":{"name":"CHANNEL-ID","in":"header","description":"Channel ID for QRIS please fill with H2H (Host-To-Host)","required":true,"schema":{"type":"string"}}},"schemas":{"RefundQrisRequest":{"type":"object","required":["originalPartnerReferenceNo","partnerRefundNo","originalReferenceNo","refundAmount","reason","additionalInfo","merchantId"],"properties":{"merchantId":{"description":"Credential mall ID from DOKU | Mandatory | min length: 1 | max length: 64","type":"string"},"originalPartnerReferenceNo":{"type":"string","description":"Transaction ID from DOKU when Generate QRIS from SNAP (same as originalReferenceNo value from Generate QRIS Request) | Mandatory | min length: 1 | max length: 64"},"originalReferenceNo":{"type":"string","description":"New Transaction ID used as transactions ID for this refund transaction | Mandatory | min length: 1 | max length: 64"},"partnerRefundNo":{"type":"string"},"refundAmount":{"type":"object","required":["value","currency"],"properties":{"value":{"type":"string","description":" Refund amount of the transaction. If it's IDR then the value includes 2 decimal digits. e.g. IDR 10.000,- will be placed with 10000.00 with 2 decimal. | Mandatory  | min length: 1 | max length: 16.2 "},"currency":{"type":"string","description":"Currency (ISO4217) Default “IDR”. | Mandatory | min length: 1 | max length: 3 "}}},"reason":{"type":"string","description":"Refund Reason | Mandatory | min length: 1 | max length: 256"},"additionalInfo":{"type":"object","required":["approvalCode"],"properties":{"approvalCode":{"type":"string","description":"DOKU Unique ID for success transaction from response payment QRIS | Mandatory | min length: 1 | max length: 32 "}}}}},"RefundQrisResponse":{"type":"object","properties":{"responseCode":{"type":"string"},"responseMessage":{"type":"string","maxLength":150},"originalReferenceNo":{"type":"string","maxLength":32},"originalPartnerReferenceNo":{"type":"string","maxLength":64},"refundNo":{"type":"string","maxLength":64},"partnerRefundNo":{"type":"string","maxLength":30},"refundAmount":{"type":"object","required":["value","currency"],"properties":{"value":{"type":"string","pattern":"^\\d{1,16}\\.00$"},"currency":{"type":"string"}}},"refundTime":{"type":"string"}}}}}}
```

### 4. Decode QRIS

To decode QRIS, you need to hit this API through your Backend:

#### API Endpoint

| Environment    | Endpoint                                                      |
| -------------- | ------------------------------------------------------------- |
| HTTP Method    | POST                                                          |
| API Sandbox    | [https://api-sandbox.doku.com](https://api-sandbox.doku.com/) |
| API Production | [https://api.doku.com](https://api.doku.com/)                 |
| Path           | `/snap-adapter/b2b/v1.0/qr/qr-mpm-decode`                     |

Here is the sample request header, request body and response body for decode QRIS:

## POST /snap-adapter/b2b/v1.0/qr/qr-mpm-decode

> POST Decode QRIS

```json
{"openapi":"3.0.0","info":{"title":"doku-wallet-snap-api-qris","version":"1.0.0"},"tags":[{"name":"QRIS-PARTNER","description":"QRIS operations B2B2C"}],"servers":[{"url":"https://api-sandbox.doku.com"}],"paths":{"/snap-adapter/b2b/v1.0/qr/qr-mpm-decode":{"post":{"tags":["QRIS-PARTNER"],"summary":"POST Decode QRIS","operationId":"qr-mpm-decode","parameters":[{"$ref":"#/components/parameters/xPartnerId"},{"$ref":"#/components/parameters/xTimeStamp"},{"$ref":"#/components/parameters/xExternalId"},{"$ref":"#/components/parameters/xSignature"},{"$ref":"#/components/parameters/authorization"},{"$ref":"#/components/parameters/channelId"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecodeQrisRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecodeQrisResponse"}}}}}}}},"components":{"parameters":{"xPartnerId":{"name":"X-PARTNER-ID","in":"header","description":"Client Id for merchant that generated by DOKU","required":true,"schema":{"type":"string"}},"xTimeStamp":{"name":"X-TIMESTAMP","in":"header","description":"Client's current local time with format YYYY-MM-DDTHH:mm:ssZD","required":true,"schema":{"type":"string"}},"xExternalId":{"name":"X-EXTERNAL-ID","in":"header","description":"Numeric String. Reference number that should be unique in the same day (Request Id)","required":true,"schema":{"type":"string"}},"xSignature":{"name":"X-SIGNATURE","in":"header","description":"Symmetric Signature with Get Token (Default)HMAC_SHA512 (clientSecret, stringToSign) dengan formula stringToSign = HTTPMethod +”:“+ EndpointUrl +\":\"+ AccessToken +\":“+ Lowercase(HexEncode(SHA-256(minify(RequestBody))))+ \":“ + TimeStamp","required":true,"schema":{"type":"string"}},"authorization":{"name":"Authorization","required":true,"in":"header","description":"String starts with keyword “Bearer ” followed by token B2B (e.g. Bearer eyJraWQiOi...Jzc29zIiwiY)","schema":{"type":"string"}},"channelId":{"name":"CHANNEL-ID","in":"header","description":"Channel ID for QRIS please fill with H2H (Host-To-Host)","required":true,"schema":{"type":"string"}}},"schemas":{"DecodeQrisRequest":{"type":"object","required":["partnerReferenceNo","qrContent","scanTime"],"properties":{"partnerReferenceNo":{"type":"string","maxLength":64,"description":"Transaction ID from partners"},"qrContent":{"type":"string","maxLength":512,"description":"QRIS content. QRIS generated by DOKU or other PJSP. Can be dynamic or static QRIS."},"scanTime":{"type":"string","description":"The time when the QRIS scanned by the User, ISO 8601 Format"}}},"DecodeQrisResponse":{"type":"object","required":["responseCode","responseMessage","merchantInfos","currency","transactionAmount"],"properties":{"responseCode":{"type":"string"},"postalCode":{"type":"string"},"responseMessage":{"type":"string"},"referenceNo":{"type":"string"},"partnerReferenceNo":{"type":"string","maxLength":64},"merchantName":{"type":"string"},"transactionAmount":{"type":"object","required":["value","currency"],"properties":{"value":{"type":"string","pattern":"^\\d{1,16}\\.00$"},"currency":{"type":"string"}}},"merchantInfos":{"type":"array","description":"Merchant account information","items":{"required":["merchantPAN","acquirerName"],"properties":{"merchantPAN":{"type":"string","maxLength":19,"description":"Merchant PAN Mandatory if using Host to host mode"},"acquirerName":{"type":"string","maxLength":50,"description":"Merchant PAN Mandatory if using Host to host mode"}}}},"feeAmount":{"type":"object","required":["value","currency"],"properties":{"value":{"type":"string","pattern":"^\\d{1,16}\\.00$"},"currency":{"type":"string"}}},"additionalInfo":{"type":"object","required":["pointOfInitiationMethod","pointOfInitiationMethodDescription","feeType","feeTypeDescription"],"properties":{"pointOfInitiationMethod":{"type":"string"},"pointOfInitiationMethodDescription":{"type":"string"},"feeType":{"type":"string"},"feeTypeDescription":{"type":"string"}}}}}}}}
```

### 5. Payment QRIS

You need to hit this API through your Backend:

#### API Endpoint

| Environment    | Endpoint                                                      |
| -------------- | ------------------------------------------------------------- |
| HTTP Method    | POST                                                          |
| API Sandbox    | [https://api-sandbox.doku.com](https://api-sandbox.doku.com/) |
| API Production | [https://api.doku.com](https://api.doku.com/)                 |
| Path           | `/snap-adapter/b2b2c/v1.0/qr/qr-mpm-payment`                  |

Here is the sample request header, request body and response body for payment QRIS:

## POST /snap-adapter/b2b2c/v1.0/qr/qr-mpm-payment

> POST Payment QRIS

```json
{"openapi":"3.0.0","info":{"title":"doku-wallet-snap-api-qris","version":"1.0.0"},"tags":[{"name":"QRIS-PARTNER","description":"QRIS operations B2B2C"}],"servers":[{"url":"https://api-sandbox.doku.com"}],"paths":{"/snap-adapter/b2b2c/v1.0/qr/qr-mpm-payment":{"post":{"tags":["QRIS-PARTNER"],"summary":"POST Payment QRIS","operationId":"qr-mpm-payment","parameters":[{"$ref":"#/components/parameters/xPartnerId"},{"$ref":"#/components/parameters/xTimeStamp"},{"$ref":"#/components/parameters/xExternalId"},{"$ref":"#/components/parameters/xSignature"},{"$ref":"#/components/parameters/authorization"},{"$ref":"#/components/parameters/authorization-customer"},{"$ref":"#/components/parameters/channelId"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentQrisRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentQrisResponse"}}}}}}}},"components":{"parameters":{"xPartnerId":{"name":"X-PARTNER-ID","in":"header","description":"Client Id for merchant that generated by DOKU","required":true,"schema":{"type":"string"}},"xTimeStamp":{"name":"X-TIMESTAMP","in":"header","description":"Client's current local time with format YYYY-MM-DDTHH:mm:ssZD","required":true,"schema":{"type":"string"}},"xExternalId":{"name":"X-EXTERNAL-ID","in":"header","description":"Numeric String. Reference number that should be unique in the same day (Request Id)","required":true,"schema":{"type":"string"}},"xSignature":{"name":"X-SIGNATURE","in":"header","description":"Symmetric Signature with Get Token (Default)HMAC_SHA512 (clientSecret, stringToSign) dengan formula stringToSign = HTTPMethod +”:“+ EndpointUrl +\":\"+ AccessToken +\":“+ Lowercase(HexEncode(SHA-256(minify(RequestBody))))+ \":“ + TimeStamp","required":true,"schema":{"type":"string"}},"authorization":{"name":"Authorization","required":true,"in":"header","description":"String starts with keyword “Bearer ” followed by token B2B (e.g. Bearer eyJraWQiOi...Jzc29zIiwiY)","schema":{"type":"string"}},"authorization-customer":{"name":"Authorization-Customer","in":"header","description":"String starts with keyword “Bearer ” followed by token B2B2C (e.g. Bearer eyJraWQiOi...Jzc29zIiwiY)","required":true,"schema":{"type":"string"}},"channelId":{"name":"CHANNEL-ID","in":"header","description":"Channel ID for QRIS please fill with H2H (Host-To-Host)","required":true,"schema":{"type":"string"}}},"schemas":{"PaymentQrisRequest":{"type":"object","required":["partnerReferenceNo","amount","value","currency","qrContent"],"properties":{"partnerReferenceNo":{"type":"string"},"amount":{"type":"object","required":["value","currency"],"properties":{"value":{"type":"string","pattern":"^\\d{1,16}\\.00$"},"currency":{"type":"string"}}},"feeAmount":{"description":"When decode response consist of fee amount then fee amount becomes required","type":"object","required":["value","currency"],"properties":{"value":{"type":"string","pattern":"^\\d{1,16}\\.00$"},"currency":{"type":"string"}}},"additionalInfo":{"type":"object","required":["qrContent"],"properties":{"qrContent":{"type":"string"}}}}},"PaymentQrisResponse":{"type":"object","properties":{"responseCode":{"type":"string"},"responseMessage":{"type":"string"},"referenceNo":{"type":"string"},"partnerReferenceNo":{"type":"string"},"amount":{"type":"object","required":["value","currency"],"properties":{"value":{"type":"string","pattern":"^\\d{1,16}\\.00$"},"currency":{"type":"string"}}},"feeAmount":{"type":"object","required":["value","currency"],"properties":{"value":{"type":"string","pattern":"^\\d{1,16}\\.00$"},"currency":{"type":"string"}}},"additionalInfo":{"type":"object","required":["approvalCode"],"properties":{"approvalCode":{"type":"string"}}}}}}}}
```

### 6. Cancel QRIS

You need to hit this API through your Backend:

#### API Endpoint

| Environment    | Endpoint                                                      |
| -------------- | ------------------------------------------------------------- |
| HTTP Method    | POST                                                          |
| API Sandbox    | [https://api-sandbox.doku.com](https://api-sandbox.doku.com/) |
| API Production | [https://api.doku.com](https://api.doku.com/)                 |
| Path           | `/snap-adapter/b2b/v1.0/qr/qr-expire`                         |

Here is the sample request header, request body and response body for payment QRIS:

## POST /snap-adapter/b2b/v1.0/qr/qr-expire

> POST Cancel QRIS

```json
{"openapi":"3.0.0","info":{"title":"doku-wallet-snap-api-qris","version":"1.0.0"},"tags":[{"name":"QRIS","description":"QRIS operations B2B"}],"servers":[{"url":"https://api-sandbox.doku.com"}],"paths":{"/snap-adapter/b2b/v1.0/qr/qr-expire":{"post":{"tags":["QRIS"],"summary":"POST Cancel QRIS","operationId":"qr-mpm-cancel","parameters":[{"$ref":"#/components/parameters/xPartnerId"},{"$ref":"#/components/parameters/xTimeStamp"},{"$ref":"#/components/parameters/xExternalId"},{"$ref":"#/components/parameters/xSignature"},{"$ref":"#/components/parameters/authorization"},{"$ref":"#/components/parameters/channelId"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QrisExpireRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QrisExpireResponse"}}}}}}}},"components":{"parameters":{"xPartnerId":{"name":"X-PARTNER-ID","in":"header","description":"Client Id for merchant that generated by DOKU","required":true,"schema":{"type":"string"}},"xTimeStamp":{"name":"X-TIMESTAMP","in":"header","description":"Client's current local time with format YYYY-MM-DDTHH:mm:ssZD","required":true,"schema":{"type":"string"}},"xExternalId":{"name":"X-EXTERNAL-ID","in":"header","description":"Numeric String. Reference number that should be unique in the same day (Request Id)","required":true,"schema":{"type":"string"}},"xSignature":{"name":"X-SIGNATURE","in":"header","description":"Symmetric Signature with Get Token (Default)HMAC_SHA512 (clientSecret, stringToSign) dengan formula stringToSign = HTTPMethod +”:“+ EndpointUrl +\":\"+ AccessToken +\":“+ Lowercase(HexEncode(SHA-256(minify(RequestBody))))+ \":“ + TimeStamp","required":true,"schema":{"type":"string"}},"authorization":{"name":"Authorization","required":true,"in":"header","description":"String starts with keyword “Bearer ” followed by token B2B (e.g. Bearer eyJraWQiOi...Jzc29zIiwiY)","schema":{"type":"string"}},"channelId":{"name":"CHANNEL-ID","in":"header","description":"Channel ID for QRIS please fill with H2H (Host-To-Host)","required":true,"schema":{"type":"string"}}},"schemas":{"QrisExpireRequest":{"type":"object","required":["partnerReferenceNo","referenceNo","merchantId"],"properties":{"partnerReferenceNo":{"type":"string","maxLength":64,"description":"Transaction ID from partners when Generate QRIS | Mandatory | min length: 1 | max length: 64 "},"referenceNo":{"type":"string","maxLength":64,"description":"Transaction ID from partners when Generate QRIS | Mandatory | min length: 1 | max length: 64 "},"merchantId":{"type":"string","maxLength":64,"description":"Credential mall ID from DOKU | Mandatory | min length: 1 | max length: 64"},"reason":{"type":"string","maxLength":128,"description":"Cancel Reason | Mandatory | min length: 1 | max length: 128"}}},"QrisExpireResponse":{"type":"object","properties":{"responseCode":{"type":"string"},"responseMessage":{"type":"string"},"partnerReferenceNo":{"type":"string","maxLength":64},"referenceNo":{"type":"string","maxLength":64},"expiredDate":{"type":"string"}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.doku.com/accept-payments/direct-api/snap/integration-guide/qris.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
