{ "success": false, "code": 2, "message": "`CallBackUrl` is a required parameter."}
Redirect Integration
Initiate Session
Initiate new session for a payment. This endpoint will help you get the paymentURL that you can use to redirect the customer to in order to complete the payment.
Any value you want to store with the invoice (you can get it later using the Payment Inquiry method). This can be a user identifier or a transaction Id in your system.
The payment URL that you’ll use to redirect the cusotmer to complete the
payment. It’s a link for a hosted page that will provide multiple payment
methods that can be choosed by the customer to pay the invoice.
Here’s a list of possible error codes of this endpoint.
Code
Description
1
Missing or invalid api key
2
CallBackUrl is a required parameter.
3
UserDefinedField is a required parameter.
4
InvoiceValue is a required parameter.
5
Suppliers is a required parameter.
6
ErrorUrl is a required parameter.
7
CallBackUrl should be a valid URL.
8
UserDefinedField should be an array.
9
InvoiceValue should be greater than zero.
10
Suppliers should be an array.
11
ErrorUrl should be a valid URL.
{"docsConfig":{"$schema":"https://mintlify.com/docs.json","theme":"mint","name":"DashPay API Documentation","colors":{"primary":"#1b75bc","light":"#1b75bc","dark":"#1b75bc"},"favicon":"/favicon.svg","logo":{"light":"https://mintcdn.com/dashu/5r5wSG5t3MSSkm2z/logo/light.svg?fit=max\u0026auto=format\u0026n=5r5wSG5t3MSSkm2z\u0026q=85\u0026s=b09bb49bb6104654f782df69a83c1266","dark":"https://mintcdn.com/dashu/5r5wSG5t3MSSkm2z/logo/dark.svg?fit=max\u0026auto=format\u0026n=5r5wSG5t3MSSkm2z\u0026q=85\u0026s=b7e64bf1d437db6bdc25e5f314b1d82d"},"api":{"playground":{"display":"interactive"},"mdx":{"server":"https://dashu.sa/api/external"}},"navbar":{"links":[{"label":"Support","href":"mailto:dashpay@dashu.sa"}],"primary":{"type":"button","label":"Dashboard","href":"https://dashu.sa/login"}},"footer":{"socials":{"x":"https://x.com/mintlify","github":"https://github.com/mintlify","linkedin":"https://www.linkedin.com/company/mintsearch"}},"navigation":{"global":{"anchors":[{"anchor":"DashPay Website","href":"https://dashu.sa","icon":"earth-americas"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"dashu","hasAudioNarration":false,"actualSubdomain":"dashu","customDomains":["paydocs.dashu.sa"],"gitSource":{"type":"github","owner":"dashu-sa","repo":"dashpay-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6a20c511a72b99776ad7df25","collectionId":"c901993d-1991-4115-940e-2ba6e061a748","schemaVersion":"v2"},"entitlements":{},"buildId":"6a20c511a72b99776ad7df25:success","clientVersion":"0.0.3971","searchFilterCounts":[{"language":"default","tag":"API Reference","count":8},{"language":"default","tag":"General Endpoints","count":5},{"language":"default","tag":"Embedded Integration","count":2},{"language":"default","tag":"Documentation","count":2},{"language":"default","tag":"Get Started","count":2},{"language":"default","tag":"Redirect Integration","count":1}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api-reference/endpoint/initSession","slug":"/api-reference/endpoint/initSession","pageMetadata":{"title":"Initiate Session","description":"Initiate new session for a payment. This endpoint will help you get the `paymentURL` that you can use to redirect the customer to in order to complete the payment.","api":"POST /initSession","href":"/api-reference/endpoint/initSession"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n code: \"code\",\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_components.p, {\n children: [\"Initiate new session for a payment. This endpoint will help you get the \", _jsx(_components.code, {\n children: \"paymentURL\"\n }), \" that you can use to redirect the customer to in order to complete the payment.\"]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,p:`p`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{Expandable,Heading,ParamField,ResponseField,Table}=_components;if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`3`,id:`query-parameters`,children:`Query Parameters`}),`\n`,_jsx(ParamField,{body:`apiKey`,type:`string`,placeholder:`API Key`,required:true,id:`param-api-key`,children:_jsx(_components.p,{children:`The API Key of your account.`})}),`\n`,_jsx(ParamField,{body:`data`,type:`object`,required:true,id:`param-data`,children:_jsxs(Expandable,{title:`properties`,defaultOpen:true,children:[_jsx(ResponseField,{name:`CallBackUrl`,type:`string`,required:true,id:`param-call-back-url`,children:_jsx(_components.p,{children:`The URL that will be used to redirect the customer after the payment process is done.`})}),_jsx(ResponseField,{name:`ErrorUrl`,type:`string`,required:true,id:`param-error-url`,children:_jsx(_components.p,{children:`The URL that will be used to redirect the customer after the payment process is failed.`})}),_jsx(ResponseField,{name:`UserDefinedField`,type:`array`,required:true,id:`param-user-defined-field`,children:_jsx(_components.p,{children:`Any value you want to store with the invoice (you can get it later using the Payment Inquiry method). This can be a user identifier or a transaction Id in your system.`})}),_jsx(ResponseField,{name:`InvoiceValue`,type:`string`,required:true,id:`param-invoice-value`,children:_jsx(_components.p,{children:`The total amount you want the customer to pay.`})}),_jsx(ParamField,{body:`Suppliers`,type:`array`,required:true,id:`param-suppliers`,children:_jsx(Expandable,{title:`properties`,defaultOpen:true,children:_jsxs(ResponseField,{name:`SupplierCode`,type:`integer`,required:true,id:`param-supplier-code`,children:[_jsx(_components.p,{children:`Your Supplier Code (you’ll get it after joining DashPay)`}),_jsxs(_components.p,{children:[`Sample: `,_jsx(_components.code,{children:`123`}),`.`]})]})})})]})}),`\n`,_jsx(ParamField,{body:`test`,type:`boolean`,initialValue:true,id:`param-test`,children:_jsxs(_components.p,{children:[`Set this property to `,_jsx(_components.code,{children:`true`}),` to send the request to the development\nenvironment.`]})}),`\n`,`\n`,_jsx(Heading,{level:`3`,id:`response-properties`,children:`Response properties`}),`\n`,` `,`\n`,_jsx(ResponseField,{name:`success`,type:`boolean`,required:true,id:`param-success`,children:_jsx(_components.p,{children:`A boolean value indicates the response status.`})}),`\n`,_jsx(ResponseField,{name:`test`,type:`boolean`,required:true,id:`param-test-1`,children:_jsx(_components.p,{children:`A boolean value indicates the development environment status.`})}),`\n`,_jsx(ResponseField,{name:`paymentURL`,type:`string`,required:true,id:`param-payment-url`,children:_jsx(_components.p,{children:`The payment URL that you’ll use to redirect the cusotmer to complete the\npayment. It’s a link for a hosted page that will provide multiple payment\nmethods that can be choosed by the customer to pay the invoice.`})}),`\n`,_jsx(Heading,{level:`2`,id:`error-codes`,children:`Error Codes`}),`\n`,_jsx(_components.p,{children:`Here’s a list of possible error codes of this endpoint.`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:_jsx(_components.strong,{children:`Code`})}),_jsx(_components.th,{children:_jsx(_components.strong,{children:`Description`})})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`1`}),_jsx(_components.td,{children:`Missing or invalid api key`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`2`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`CallBackUrl`}),` is a required parameter.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`3`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`UserDefinedField`}),` is a required parameter.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`4`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`InvoiceValue`}),` is a required parameter.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`5`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`Suppliers`}),` is a required parameter.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`6`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`ErrorUrl`}),` is a required parameter.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`7`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`CallBackUrl`}),` should be a valid URL.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`8`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`UserDefinedField`}),` should be an array.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`9`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`InvoiceValue`}),` should be greater than zero.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`10`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`Suppliers`}),` should be an array.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`11`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`ErrorUrl`}),` should be a valid URL.`]})]})]})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Initiate Session","description":"Initiate new session for a payment. This endpoint will help you get the `paymentURL` that you can use to redirect the customer to in order to complete the payment.","api":"POST /initSession","href":"/api-reference/endpoint/initSession"}}},"mdxSourceWithNoJs":null,"noJsSplices":[[199,217,"pre:`pre`,span:`span`,strong:`strong`,tb"],[313,394,"CodeBlock,Expandable,Heading,ParamField,ResponseExample,ResponseField,Table}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Expandable)_mi"],[547,562,"Example)_missingMdxReference(`ResponseExample`,true);if(!ResponseField)_missingM"],[2714,2715,"_jsxs(ResponseExample,{children:[_jsx(CodeBlock,{filename:`Success`,numberOfLines:`5`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"success\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"test\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"paymentURL\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://dashu.sa/api/external/pay?hash=h3qds2paiy-fko9bgd0et-mj94pv32tn\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Error`,numberOfLines:`5`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"success\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:'\"`CallBackUrl` is a required parameter.\"'})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})]}),`"]]},"mdxExtracts":{"tableOfContents":[{"title":"Query Parameters","slug":"query-parameters","depth":3,"children":[]},{"title":"Response properties","slug":"response-properties","depth":3,"children":[]},{"title":"Error Codes","slug":"error-codes","depth":2,"children":[]}],"codeExamples":{"response":{"type":"ResponseExample","children":[{"filename":"Success","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"5\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"success\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">true\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"test\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">false\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"paymentURL\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"https://dashu.sa/api/external/pay?hash=h3qds2paiy-fko9bgd0et-mj94pv32tn\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"Error","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"5\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"success\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">false\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"code\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">2\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"message\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"`CallBackUrl` is a required parameter.\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]}},"endpoint":{"title":"Initiate Session","path":"/initSession","servers":[{"url":"https://dashu.sa/api/external"}],"method":"post","request":{"security":[],"parameters":{"query":{},"header":{},"cookie":{},"path":{}},"body":{"application/json":{"schemaArray":[{"type":"object","properties":{"apiKey":[{"type":"string","description":"The API Key of your account.","required":true,"placeholder":"API Key"}],"data":[{"type":"object","properties":{"Suppliers":[{"type":"array","items":[{"type":"object","properties":{}}],"required":true}]},"required":true}],"test":[{"type":"boolean","description":"Set this property to `true` to send the request to the development environment."}]}}],"examples":{"example":{"value":{"apiKey":"\u003cstring>","data":{"Suppliers":[{}]},"test":true}}}}}},"response":{"200":{"application/json":{"schemaArray":[{"type":"object","properties":{"success":[{"type":"boolean","description":"A boolean value indicates the response status.","required":true}],"test":[{"type":"boolean","description":"A boolean value indicates the development environment status.","required":true}],"paymentURL":[{"type":"string","description":"The payment URL that you’ll use to redirect the cusotmer to complete the payment. It’s a link for a hosted page that will provide multiple payment methods that can be choosed by the customer to pay the invoice.","required":true}]}}],"examples":{"example":{"value":{"success":true,"test":true,"paymentURL":"\u003cstring>"}}}}}},"deprecated":false}},"jsLinks":["/_mintlify/custom/dashu/b0c57b70ab27a5a6/.github/format/plugin-php/src/clean.js","/_mintlify/custom/dashu/0ff733e693d8ee3d/.github/format/plugin-php/src/comments.js","/_mintlify/custom/dashu/0f53ad38c7a9ffc2/.github/format/plugin-php/src/index.js","/_mintlify/custom/dashu/c56a6eaa5bd6dbff/.github/format/plugin-php/src/module.js","/_mintlify/custom/dashu/e0ec5d34b617c26c/.github/format/plugin-php/src/needs-parens.js","/_mintlify/custom/dashu/2db4c3f15bbd4af6/.github/format/plugin-php/src/options.js","/_mintlify/custom/dashu/72c8a3867eed0bce/.github/format/plugin-php/src/parser.js","/_mintlify/custom/dashu/b912973af510c005/.github/format/plugin-php/src/pragma.js","/_mintlify/custom/dashu/305805b8b305f752/.github/format/plugin-php/src/printer.js","/_mintlify/custom/dashu/2e1430ec8187c62e/.github/format/plugin-php/src/util.js","/_mintlify/custom/dashu/d68a44dd4e8fdcb5/.github/format/plugin-php/standalone.js"],"subdomain":"dashu","siteName":"DashPay API Documentation","title":"Initiate Session - DashPay API Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-01-07T02:43:53.378Z","originalFileLocation":"api-reference/endpoint/initSession.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Initiate new session for a payment. This endpoint will help you get the paymentURL that you can use to redirect the customer to in order to complete the payment.\">\u003cmeta data-mint-head name=\"application-name\" content=\"DashPay API Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/dashu/UThAPjnlgRlGtOHj/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/dashu/UThAPjnlgRlGtOHj/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/dashu/UThAPjnlgRlGtOHj/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/dashu/UThAPjnlgRlGtOHj/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/dashu/UThAPjnlgRlGtOHj/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/dashu/UThAPjnlgRlGtOHj/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/dashu/UThAPjnlgRlGtOHj/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/dashu/UThAPjnlgRlGtOHj/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/dashu/UThAPjnlgRlGtOHj/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Initiate Session - DashPay API Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Initiate new session for a payment. This endpoint will help you get the paymentURL that you can use to redirect the customer to in order to complete the payment.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"DashPay API Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://paydocs.dashu.sa/api-reference/endpoint/initSession\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://dashu.mintlify.app/_mintlify/api/og/v2?division=Redirect+Integration\u0026amp;title=Initiate+Session\u0026amp;description=Initiate+new+session+for+a+payment.+This+endpoint+will+help+you+get+the+%60paymentURL%60+that+you+can+use+to+redirect+the+customer+to+in+order+to+complete+the+payme\u0026amp;theme=1e9265a35ddb093207085dad\u0026amp;signature=73613dfcdc850d0d5a918fd937c816b903895d6732e7fba4411dc6cc657a5e4f\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Initiate Session - DashPay API Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Initiate new session for a payment. This endpoint will help you get the paymentURL that you can use to redirect the customer to in order to complete the payment.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://dashu.mintlify.app/_mintlify/api/og/v2?division=Redirect+Integration\u0026amp;title=Initiate+Session\u0026amp;description=Initiate+new+session+for+a+payment.+This+endpoint+will+help+you+get+the+%60paymentURL%60+that+you+can+use+to+redirect+the+customer+to+in+order+to+complete+the+payme\u0026amp;theme=1e9265a35ddb093207085dad\u0026amp;signature=73613dfcdc850d0d5a918fd937c816b903895d6732e7fba4411dc6cc657a5e4f\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/dashu/UThAPjnlgRlGtOHj/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"DashPay API Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#1b75bc\">\u003clink data-mint-head rel=\"canonical\" href=\"https://paydocs.dashu.sa/api-reference/endpoint/initSession\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/endpoint/initSession.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://paydocs.dashu.sa/#organization\",\"name\":\"DashPay API Documentation\",\"url\":\"https://paydocs.dashu.sa\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/dashu/5r5wSG5t3MSSkm2z/logo/light.svg?fit=max\u0026auto=format\u0026n=5r5wSG5t3MSSkm2z\u0026q=85\u0026s=b09bb49bb6104654f782df69a83c1266\"}},{\"@type\":\"WebSite\",\"@id\":\"https://paydocs.dashu.sa#website\",\"name\":\"DashPay API Documentation\",\"url\":\"https://paydocs.dashu.sa\",\"publisher\":{\"@id\":\"https://paydocs.dashu.sa/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://paydocs.dashu.sa/api-reference/endpoint/initSession#webpage\",\"url\":\"https://paydocs.dashu.sa/api-reference/endpoint/initSession\",\"name\":\"Initiate Session\",\"description\":\"Initiate new session for a payment. This endpoint will help you get the paymentURL that you can use to redirect the customer to in order to complete the payment.\",\"dateModified\":\"2026-01-07T02:43:53.378Z\",\"isPartOf\":{\"@id\":\"https://paydocs.dashu.sa#website\"},\"breadcrumb\":{\"@id\":\"https://paydocs.dashu.sa/api-reference/endpoint/initSession#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://paydocs.dashu.sa/api-reference/endpoint/initSession#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"DashPay API Documentation\",\"item\":\"https://paydocs.dashu.sa\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Initiate Session\",\"item\":\"https://paydocs.dashu.sa/api-reference/endpoint/initSession\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://paydocs.dashu.sa/api-reference/endpoint/initSession#apireference\",\"headline\":\"Initiate Session\",\"name\":\"Initiate Session\",\"description\":\"Initiate new session for a payment. This endpoint will help you get the paymentURL that you can use to redirect the customer to in order to complete the payment.\",\"url\":\"https://paydocs.dashu.sa/api-reference/endpoint/initSession\",\"mainEntityOfPage\":{\"@id\":\"https://paydocs.dashu.sa/api-reference/endpoint/initSession#webpage\"},\"dateModified\":\"2026-01-07T02:43:53.378Z\",\"publisher\":{\"@id\":\"https://paydocs.dashu.sa/#organization\"},\"isPartOf\":{\"@id\":\"https://paydocs.dashu.sa#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"DashPay API Documentation\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"DashPay API Documentation","nav":{"global":{"anchors":[{"anchor":"DashPay Website","href":"https://dashu.sa","icon":"earth-americas"}]},"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/introduction"}]},{"tab":"API Reference","groups":[{"group":"Redirect Integration","pages":[{"title":"Initiate Session","api":"POST /initSession","href":"/api-reference/endpoint/initSession"}]},{"group":"Embedded Integration","pages":[{"title":"Initiate Session","description":"Initiate new session for a payment. This endpoint will help you get the SessionId that will be used to execute the payment later.","api":"POST /initiateSession","href":"/api-reference/endpoint/initiateSession"},{"title":"executePayment","api":"POST /executePayment","href":"/api-reference/endpoint/executePayment"}]},{"group":"General Endpoints","pages":[{"title":"Payment Inquiry","api":"POST /paymentInquiry","href":"/api-reference/endpoint/paymentInquiry"},{"title":"Make Refund","api":"POST /makeRefund","href":"/api-reference/endpoint/refund"},{"title":"Get Deposits","api":"GET /getDeposits","href":"/api-reference/endpoint/getDeposits"},{"title":"Get Deposit Details","api":"GET /getDepositDetails","href":"/api-reference/endpoint/getDepositsDetails"},{"title":"Get Transactions","api":"GET /getTransactions","href":"/api-reference/endpoint/getTransactions"}]}]}]},"title":"Initiate Session - DashPay API Documentation","buildId":"dpl_DFJrtvUi8HS5F9nkooKuDJsuD5BM","deploymentId":"dpl_DFJrtvUi8HS5F9nkooKuDJsuD5BM","dynamics":["c2aa737661","2b790eda92","b0f84f53ff"],"chunks":["OpenApiReferenceProvider-rfhihCWU.js","utils-BmH1XFxk.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-BcNsxPKB.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-BAES3tkd.js","snippetPresets-DCMQBKLP.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-D6l_bzE9.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-BOktbnNh.js","shallow-BCs8SgM7.js","getApiPlaygroundDisplay-DEmW5bJB.js","CodeSnippet-CpZOpB9C.js","CodeSnippets-BOBDqibl.js","Page-D5fEM6aW.js","getPastedJson-DH2JBvmr.js","icon-BBJH-kKh.js","MethodPill-D2Sd5NLC.js","DuplicateIcon-CGgfL2qN.js","createIcon-BKudBBzi.js","DynamicMarkdown-85clUA0i.js","SectionHeading-D0JiMgDx.js","axios-vUo_bRtp.js"]}