---
agentTools:
  projectIndex: https://onebrick.readme.io/llms.txt
---

# Generate Dynamic QRIS (SNAP)

We need to build one standalone APIs for clients to consume of QRIS product. This API will help clients to create new dynamic QRIS for clients.

## Request Parameters

[block:parameters]
{
  "data": {
    "h-0": "Key Parameters",
    "h-1": "Data Type",
    "h-2": "Description",
    "0-0": "Content-Type",
    "0-1": "string",
    "0-2": "String representing the content type (application/json)",
    "1-0": "X-CLIENT-KEY",
    "1-1": "string",
    "1-2": "Client's client_id",
    "2-0": "X-TIMESTAMP",
    "2-1": "datetime",
    "2-2": "Client's current local time in ISO 8601 format",
    "3-0": "Authorization",
    "3-1": "string",
    "3-2": "One-time access token generated for the request",
    "4-0": "X-SIGNATURE",
    "4-1": "String",
    "4-2": "Non-repudiation & integrity validation checking.  \n  \nGenerated by client and created using asymmetric  \nsignature SHA256withRSA (clientSecret,  \nstringToSign) with  \nstringToSign = HTTPMethod  \n+”:“+ EndpointUrl +\":“+  \nLowercase(HexEncode(SHA-  \n256(minify(RequestBody)))) + \":“ +  \nTimeStamp",
    "5-0": "X-PARTNER-ID",
    "5-1": "String",
    "5-2": "Brick's client ID",
    "6-0": "X-EXTERNAL-ID",
    "6-1": "String",
    "6-2": "Unique external identifier for the API request that can be found on Brick Dashboard Credentials",
    "7-0": "CHANNEL-ID",
    "7-1": "String",
    "7-2": "Brick's channel ID",
    "8-0": "partnerReferenceNo",
    "8-1": "String",
    "8-2": "Unique reference number provided by the client to identify the transaction. Maximum length of 25 characters.",
    "9-0": "amount.value",
    "9-1": "String",
    "9-2": "Amount to be processed, represented as a string with two decimal places (e.g., \"12345678.00\")",
    "10-0": "amount.currency",
    "10-1": "String",
    "10-2": "Currency of the transaction amount. Set as default to \"IDR\" (Indonesian Rupiah).",
    "11-0": "validityPeriod",
    "11-1": "String",
    "11-2": "Value in seconds. The expiry time must be between 600 seconds (10 minutes) and 86,400 seconds (24 hours) from the creation time.  \n  \nIf not provided, the default expiry time is 24 hours. Any request exceeding 24 hours will be automatically adjusted to 24 hours.  \n  \nWhen set to 86,400 seconds (24 hours), the actual expiry time of the generated QRIS may vary between 600 seconds (10 minutes) and 86,400 seconds (24 hours). Please refer to the response for the exact expiry time."
  },
  "cols": 3,
  "rows": 12,
  "align": [
    "left",
    "left",
    "left"
  ]
}
[/block]

## Response Parameters

| Key parameters     | Data type | Description                                                                                |
| :----------------- | :-------- | :----------------------------------------------------------------------------------------- |
| responseCode       | Integer   | A code indicating the success or failure of the request, along with the associated reason. |
| responseMessage    | String    | A message confirming the success of the operation.                                         |
| referenceNo        | String    | A unique identifier generated for the transaction by the system.                           |
| partnerReferenceNo | String    | A unique identifier provided by the partner to track the transaction.                      |
| qrContent          | String    | The QRIS content string that can be used to generate a QR code for payment purposes.       |

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "SNAP",
    "version": "2"
  },
  "servers": [
    {
      "url": "https://sandbox.onebrick.io/v2/payments"
    }
  ],
  "security": [
    {}
  ],
  "paths": {
    "/acceptance/1.0/qr/qr-mpm-generate": {
      "post": {
        "summary": "Generate Dynamic QRIS (SNAP)",
        "description": "We need to build one standalone APIs for clients to consume of QRIS product. This API will help clients to create new dynamic QRIS for clients.",
        "operationId": "generate-dynamic-qris-snap",
        "parameters": [
          {
            "name": "Content-Type",
            "in": "header",
            "description": "String represents indicate the media type of the resource",
            "required": true,
            "schema": {
              "type": "string",
              "default": "application/json"
            }
          },
          {
            "name": "X-CLIENT-KEY",
            "in": "header",
            "description": "Client’s client_id",
            "required": true,
            "schema": {
              "type": "string",
              "default": "51de24a9-bf41-47eb-aacb-876a5c1ac323"
            }
          },
          {
            "name": "X-TIMESTAMP",
            "in": "header",
            "description": "Client's current local time in yyyy-MM- ddTHH:mm:ss.SSSTZD format",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "default": "2024-11-15T18:44:33+07:00"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "description": "One time access-token generated using the auth token API",
            "required": true,
            "schema": {
              "type": "string",
              "default": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNjQwIiwiZXhwIjoxNzMxNjYzMDUwLCJuYmYiOjE3MzE2NjIxNTAsImlhdCI6MTczMTY2MjE1MH0.4horeyrklK5JYdAh5KBMK7GS5LbMWPKb-3KA0qDajcg"
            }
          },
          {
            "name": "X-SIGNATURE",
            "in": "header",
            "description": "Non-Repudiation & Integrity check signature for the requesting",
            "required": true,
            "schema": {
              "type": "string",
              "default": "LBNvcwqen4CC4dypLMlyu4JBCzUsbXtefg6SymbEN9vIL08tckTsJkeRo+dGVLB6qC7lRkf60Y1ND1HL2KCp24q8Vz3mSUr8wRxIh9wMRRf6BVRFcZAa3tX5jO0VW58+AEevT/rl9jssm314w70l+6Uivjj8tdbvVv07EUyz775Vx2TUQ9xrdCCe2W+KzbUDsy7YKx/tsOZgbtrOekgH7RL/lmhFrcgk2uheyoo0iIt+zUwaWzjqqfqCPaXcDczgCI8DNAz3cT5GbhJzNLNVYDHlb9OLMN5Dkvgsh8zx2m0zRUWyVQDUQmp0vL7UU7lMD5Dj7uOakugnTC/xpey+rQ=="
            }
          },
          {
            "name": "X-PARTNER-ID",
            "in": "header",
            "description": "Brick's client ID",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "X-EXTERNAL-ID",
            "in": "header",
            "description": "Unique external identifier for the API request that can be found on Brick Dashboard Credentials",
            "required": true,
            "schema": {
              "type": "string",
              "default": "80deeaaf-c433-46eb-b771-b6c3ff0950e3"
            }
          },
          {
            "name": "CHANNEL-ID",
            "in": "header",
            "description": "Brick's channel id",
            "required": true,
            "schema": {
              "type": "string",
              "default": "A0"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "partnerReferenceNo",
                  "validityPeriod"
                ],
                "properties": {
                  "partnerReferenceNo": {
                    "type": "string",
                    "description": "Unique reference number provided by the partner to identify the transaction. Maximum length of 25 characters)",
                    "default": "2025111500000000000001"
                  },
                  "amount": {
                    "properties": {
                      "value": {
                        "type": "string",
                        "description": "Amount to be processed, represented as a string with two decimal places (e.g., \"12345678.00\")",
                        "default": "10000.00"
                      },
                      "currency": {
                        "type": "string",
                        "description": "Currency of the transaction amount. Set as default to \"IDR\" (Indonesian Rupiah).",
                        "default": "IDR"
                      }
                    },
                    "required": [
                      "value",
                      "currency"
                    ],
                    "type": "object"
                  },
                  "validityPeriod": {
                    "type": "string",
                    "description": "Minimum 600 seconds (10 minutes), maximum 86,400 seconds (24 hours) from the creation time. If not set, the default value will be 86,400 seconds (24 hours)",
                    "default": "600"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Success Response": {
                    "value": "{\n    \"responseCode\": \"2004700\",\n    \"responseMessage\": \"Successful\",\n    \"referenceNo\": \"QR_429529d44e1f4e22a167a8b0597f1226\",\n    \"partnerReferenceNo\": \"87457990831641724058\",\n    \"qrContent\": \"00020101021226640015ID.OTTOCASH.WWW01189360081110020080020212OP1D012981900303UME51440014ID.CO.QRIS.WWW0215ID10243527937710303UME520499995303360540410005802ID5910TULOBRICK16015JL KARYA BHAKTI61057812162720120BILL14155627188675030521SP17395233874158600180703A019612OP1D012981906304A393\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "responseCode": {
                      "type": "string",
                      "example": "2004700"
                    },
                    "responseMessage": {
                      "type": "string",
                      "example": "Successful"
                    },
                    "referenceNo": {
                      "type": "string",
                      "example": "QR_429529d44e1f4e22a167a8b0597f1226"
                    },
                    "partnerReferenceNo": {
                      "type": "string",
                      "example": "87457990831641724058"
                    },
                    "qrContent": {
                      "type": "string",
                      "example": "00020101021226640015ID.OTTOCASH.WWW01189360081110020080020212OP1D012981900303UME51440014ID.CO.QRIS.WWW0215ID10243527937710303UME520499995303360540410005802ID5910TULOBRICK16015JL KARYA BHAKTI61057812162720120BILL14155627188675030521SP17395233874158600180703A019612OP1D012981906304A393"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Invalid Payload": {
                    "value": "{\n  \"responseCode\": \"4004702\",\n  \"responseMessage\": \"Invalid Mandatory Field\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "responseCode": {
                      "type": "string",
                      "example": "4004702"
                    },
                    "responseMessage": {
                      "type": "string",
                      "example": "Invalid Mandatory Field"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "401",
            "content": {
              "application/json": {
                "examples": {
                  "Unauthorized Authorization": {
                    "value": "{\n  \"responseCode\": \"4014700\",\n  \"responseMessage\": \"Unauthorized Authorization\"\n}"
                  },
                  "Unauthorized Signature": {
                    "value": "{\n  \"responseCode\": \"4014700\",\n  \"responseMessage\": \"Unauthorized X-SIGNATURE\"\n}"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "title": "Unauthorized Authorization",
                      "type": "object",
                      "properties": {
                        "responseCode": {
                          "type": "string",
                          "example": "4014700"
                        },
                        "responseMessage": {
                          "type": "string",
                          "example": "Unauthorized Authorization"
                        }
                      }
                    },
                    {
                      "title": "Unauthorized Signature",
                      "type": "object",
                      "properties": {
                        "responseCode": {
                          "type": "string",
                          "example": "4014700"
                        },
                        "responseMessage": {
                          "type": "string",
                          "example": "Unauthorized X-SIGNATURE"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "409": {
            "description": "409",
            "content": {
              "application/json": {
                "examples": {
                  "Same x-external-id on the Same Day": {
                    "value": "{\n  \"responseCode\": \"4094700\",\n  \"responseMessage\": \"Conflict\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "responseCode": {
                      "type": "string",
                      "example": "4094700"
                    },
                    "responseMessage": {
                      "type": "string",
                      "example": "Conflict"
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "6736c09acf484e0030742e84:67370672ffa33e00126d3178"
}
```