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-demo

Production Environment:

GET https://restapi.paylink.sa/rest/partner/v2/merchant/{key}/{value}/themes-demo

Headers

HeaderValue
AuthorizationBearer <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:

    • cr or freelancer: 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

Testing 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-TypeValue
JSONapplication/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

FieldTypeDescription
gatewayOrderRequestObjectDetails of the gateway order request, if available.
amountNumberThe amount associated with the demo invoice.
transactionNoStringThe transaction number for the created demo invoice.
orderStatusStringThe status of the order. Typically CREATED for a newly generated demo invoice.
paymentErrorsObjectAny payment errors encountered, if applicable.
urlStringThe URL to view the demo invoice.
qrUrlStringThe QR code URL, if available.
mobileUrlStringThe mobile URL, if available.
checkUrlStringThe check URL, if available.
successBooleanIndicates whether the demo invoice was successfully created.
digitalOrderBooleanIndicates if the order is digital.
foreignCurrencyRateObjectThe exchange rate if the payment involves foreign currency, otherwise null.
paymentReceiptObjectThe payment receipt details, if available.
metadataObjectAny additional metadata associated with the demo invoice.

Security

CodeMeaning
401Unauthorized: If the provided token is invalid or expired.
403Forbidden: If the user does not have the required PARTNER role.
404Not 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.