Create Demo Invoice for Theme Preview
Apologies for the mistake. Let's correct that. Here's the updated documentation for the GET request:
API Endpoint: Create Demo Invoice for Theme Preview
Description
This API endpoint creates a demo invoice to allow users to preview the look and feel of a theme configuration. It is secured and can only be accessed by users with the PARTNER role.
HTTP Request
Testing Environment:
GET https://restpilot.paylink.sa/rest/partner/v2/merchant/{key}/{value}/themes-demoProduction Environment:
GET https://restapi.paylink.sa/rest/partner/v2/merchant/{key}/{value}/themes-demoHeaders
| Header | Value |
|---|---|
| Authorization | Bearer <your_token_here> |
Note: To obtain the Bearer token required for authentication, refer to the Partner Authentication Guide.
Path Parameters
-
key: The key used to identify the merchant attribute. Possible values:crorfreelancer: Search by the merchant's license number.mobile: Search by the merchant's phone number.email: Search by the merchant's email address.accountNo: Search by the merchant's account number.
-
value: The value associated with the key (e.g., specific license number, phone number, email, or account number).
Example curl Request
curl RequestTesting Environment:
curl --location 'https://restpilot.paylink.sa/rest/partner/v2/merchant/email/[email protected]/themes-demo' \
--header 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJoYXNzYW4uYXlvdWIuMTk4MEBnbWFpbC5jb20iLCJhdXRoIjoiUk9MRV9NRVJDSEFOVCxST0xFX01FUkNIQU5UX0FDQ09VTlQsUk9MRV9QQVJUTkVSIiwiaXNzIjoiQVBJIiwiZXhwIjoxNzI1MDYwNDYwfQ.PyzoR4YCxcVlls3ne7ApvvW9wSQoURVzoPNTO7stiPuuGAsAXexFIOZJ79tXI8v-b5HGESr20K0-I2_yFbUPvQ'Production Environment:
curl --location 'https://restapi.paylink.sa/rest/partner/v2/merchant/email/[email protected]/themes-demo' \
--header 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJoYXNzYW4uYXlvdWIuMTk4MEBnbWFpbC5jb20iLCJhdXRoIjoiUk9MRV9NRVJDSEFOVCxST0xFX01FUkNIQU5UX0FDQ09VTlQsUk9MRV9QQVJUTkVSIiwiaXNzIjoiQVBJIiwiZXhwIjoxNzI1MDYwNDYwfQ.PyzoR4YCxcVlls3ne7ApvvW9wSQoURVzoPNTO7stiPuuGAsAXexFIOZJ79tXI8v-b5HGESr20K0-I2_yFbUPvQ'Response
| Content-Type | Value |
|---|---|
| JSON | application/json |
Response Example
The response will include details about the created demo invoice, including a URL to view the invoice.
{
"gatewayOrderRequest": null,
"amount": 5.0,
"transactionNo": "1722473413317",
"orderStatus": "CREATED",
"paymentErrors": null,
"url": "https://payment.paylink.sa/pay/order/1722473413317",
"qrUrl": null,
"mobileUrl": null,
"checkUrl": null,
"success": true,
"digitalOrder": false,
"foreignCurrencyRate": null,
"paymentReceipt": null,
"metadata": null
}Response Details
| Field | Type | Description |
|---|---|---|
gatewayOrderRequest | Object | Details of the gateway order request, if available. |
amount | Number | The amount associated with the demo invoice. |
transactionNo | String | The transaction number for the created demo invoice. |
orderStatus | String | The status of the order. Typically CREATED for a newly generated demo invoice. |
paymentErrors | Object | Any payment errors encountered, if applicable. |
url | String | The URL to view the demo invoice. |
qrUrl | String | The QR code URL, if available. |
mobileUrl | String | The mobile URL, if available. |
checkUrl | String | The check URL, if available. |
success | Boolean | Indicates whether the demo invoice was successfully created. |
digitalOrder | Boolean | Indicates if the order is digital. |
foreignCurrencyRate | Object | The exchange rate if the payment involves foreign currency, otherwise null. |
paymentReceipt | Object | The payment receipt details, if available. |
metadata | Object | Any additional metadata associated with the demo invoice. |
Security
| Code | Meaning |
|---|---|
| 401 | Unauthorized: If the provided token is invalid or expired. |
| 403 | Forbidden: If the user does not have the required PARTNER role. |
| 404 | Not Found: If no merchant or demo invoice is found for the specified key and value. |
This updated documentation correctly reflects the GET request to create a demo invoice for previewing theme configurations, including the necessary headers, path parameters, response structure, and security codes.
Updated about 2 months ago
