Zid Docs
  1. ApplePay
Zid Docs
  • Merchant API
    • Start Here 🚀
    • Overview to Zid Apps
    • Authorization
    • Responses
    • Webhooks
    • Rate Limiting
    • APIs
      • Orders
        • Update Order by ID
        • Get Order Credit Notes
        • Get Order by ID
        • List of Orders
      • Reverse Orders
        • Reverse Order Reasons
        • Create Reverse Orders
        • Create Reverse Orders Waybill
        • Add Reverse Order Reasons
      • Carts
        • Get Abandoned Cart Details
        • List Abandoned Carts
      • Products
        • Managing Products
          • Get a Product by ID
          • Retrieve a list of products
          • Create a new product
          • Update an existing product.
          • Bulk update of products using their IDs or SKUs
          • Delete a product.
          • Product Setting
          • List Product Reviews
        • Digital Vouchers
          • Product Vouchers
          • Order Voucher
          • Add Product Voucher
          • Import Vouchers
          • Export Vouchers
          • Update Product Voucher
          • Remove Product Voucher
        • Product Categories
          • Get Single Category Details
          • Get all categories
          • Create Store Category
          • Update a Store Category
          • Add a product to a certain category
          • Publish/Unpublish a Category
          • Detach Category from All Products
          • Remove Category from Product
        • Product Badge
          • Product Badge
        • Product Attributes
          • Get Product Attributes
          • Get Product Attributes
          • Retrieve a product attribute
          • Add a New Product Attribute
          • Add a New Product Attribute
          • Update a product attribute
          • Delete a product attribute
        • Product Attribute Presets
          • Get attribute presets
          • Create Attribute Preset
          • Update Attribute Preset
          • Delete an attribute preset
        • Product Customizations
          • Add Product Variants
          • Insert Custom Options to a Product
          • Insert Custom User-Input Fields to a Product
        • Product Manual Sorting
          • Set Custom Product Order
          • Reset the manual sorting of all products
        • Product Images
          • Get List of images of a product.
          • Add an image to a product
          • Update a product Image Order
          • Delete a product image
        • Product Notifications
          • Availability Notification Stats
          • Availability Notifications Settings
          • List Availability Notifications
          • Add Availability Notification
          • Save Availability Notifications Settings
          • Manually Send Availability Notification Email
          • Export Availability Notifications
        • Product Import
          • Email All Products to Store Owner
          • Import Products via CSV or xlsx File
        • Product Stock (Multi-Inventory)
          • Get Product Stock by ID
          • List Product Stocks
          • Add Product Stock
          • Update Single Product Stock
          • Bulk Update Product Stocks
        • Product Questions & Answers
          • Get Question
          • Get Answer
          • Get All Questions
          • List Question Answers
          • Create Question
          • Create Answer
          • Update Question
          • Update Answer
          • Delete Question
          • Delete Answer
        • Product Reviews
          • List Reviews
          • New Reviews Total
          • Change Review Status
          • Bulk Change all Review Statuses
          • Delete Review
          • Import Product Reviews
          • Reply to Review
          • Delete Reply
          • Update Reply to Review
        • Digital Products
          • Create Downloadable Product
          • Generate an Upload URL
          • Upload File to S3
          • Create Product Downloadables
          • Get Product Downloadables
          • Delete Product Downloadables
          • Get Store Downloadables
          • Create Store Downloadables
          • Delete Store Downloadables
      • Inventories
        • Get Store Location by ID
        • List Store Locations
        • Add a New Location
        • Update a Location by ID
        • Update Products Stock by Location ID
      • Shipping
        • List Store Delivery Options
        • Add Shipping Option
      • Marketing
        • Gift Cards
          • Get Store Settings
          • Add gift card to the cart
          • Update Store Settings
          • Upload gift card designs
          • Remove gift card from the cart
        • Coupons
          • Create a New Coupon
          • List Coupons
          • Get Coupon Details
          • Update Coupon
          • Delete Coupon
        • Bundle Offers
          • Retrieve all Bundle Offers
        • Loyalty Program
          • Customer Wallet
          • Customer Points
          • Loyalty Program Points per Order
          • Store Loyalty Status
          • Redemption Methods
          • Cashback Rules
          • Add Redemption to Cart
          • Remove Redemption from Cart
          • Info Page
          • Loyalty Program Activation
          • Loyalty Status
          • Set Points Expiration
          • Cashback Rule Method Update
          • Cashback Rule Method Update Status
          • Add Points Redemption Method
          • Update Points Redemption Method
          • Delete Points Redemption Method
          • Toggle Redemption Method Status
          • Show Loyalty Points Info for Specific Customer
          • Customer Profile
          • List Data
          • Customer Points History
          • Info Page - Managers
          • Update Info Page
          • Adjust Customer Points
      • Customers
        • List of Customers
        • Get Customer by ID
      • Store Settings
        • 📄 User Roles and Permissions
        • Get Manager's Profile
        • Get VAT Settings
        • List of Payment Method
      • Countries and Cities
        • Retrieve Store Operating Countries
        • Retrieve Cities by Country ID
        • Countries List
      • Webhook
        • List of Webhooks
        • Create a Webhook
        • Delete a Webhook by OriginalId
        • Delete a Webhook by Subscriber
    • Store Events
      • Order
      • Product
      • Abandoned Cart
      • Customer
      • Product Category
  • Payment API
    • Merchant Activation
    • Submitting
    • Webhooks
      • Link Merchant Event
      • Payment Paid Event
      • Refund Event
    • Payment
      • Direct Payment
      • Embedded Payment
    • ApplePay
      • ApplePay Checkout
      • On Payment Authorized
      • Register ApplePay Domain
        POST
      • On Providing Merchant Validation
        POST
      • Execute Payment Request
        POST
  • Apps
    • Create your First App
    • Embedded Apps
    • App Scripts
    • App Events
    • App Subscription
      • Get Subscription Details
      • Update Usage-Based Charges
  • Themes
    • 🚨 Important Update: Zid Themes
    • Adding Video URL Feature to Third-Party Themes
    • Landing Page Development
    • Getting Started with Zid Themes
      • Introduction to Theme Development
      • Manage your Themes
      • Building Themes in Zid
      • Theme File Structure
      • Twig Syntax and Features
      • Zid Theme Packager
    • Templates
      • Layout
      • Home Page
      • Products
      • Cart
      • Store Language and Currency
    • Settings Schema
      • Text
      • Number
      • Text-Area
      • Select
      • Radio Buttons
      • Checkbox
      • Range
      • Color
      • Image
      • Product
      • Category
      • List
      • Fieldset
    • Code Snippets
      • Apple Pay Quick Checkout
      • Custom CSS Injection
      • Displaying the Store's Business Center Logo
      • Customizing Copyright Text
      • Store's Main Navigation Menu
      • Customer Wishlist
      • Store Social Media
      • Products
        • Products Badges
        • Product Ratings
        • Remaining Product Stock
        • Sold Items Count
        • Product Filtration by Attributes
        • Grouped Products
        • Product Questions & Answers
        • Product Restock Notfication
      • SEO
        • Images alt text
        • Themes SEO Marketing Tags
      • Marketing
        • Metafields
        • Gift Feature
        • Loyalty Program
    • Zid Themes Library: API Integration
      • Products
      • Product Categories
      • Cart
      • Blog
      • Customer
      • Store Settings
    • Data Reference
      • Locals
      • Store
      • Cart
      • Product
      • Products List
      • Category
      • Categories List
      • Session
      • FAQs
      • Customer
      • Blogs
      • Page
      • Main Menu
      • Main Navigation Menu
      • Request
      • Orders
      • Addresses
      • Store Payment Methods
      • Store Shipping Methods
      • Store Banks
      • Asset URL
      • Header Meta Tags
      • Loyalty pogram Wallet
    • Themes CLI
      • CLI Authentication
      • Theme Create
      • Theme Package
      • Theme Update
      • Themes List
      • Theme Preview
  1. ApplePay

Execute Payment Request

Developing
POST
https://api.zid.sa/v1{ProviderUrl}/payments
This is the request that is going to be sent from ZidPay to you as a payment provider for executing payments.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.paymentprovider.com/payments' \
--header 'Authorization: Authorization: Basic secret_key' \
--header 'Content-Type: application/json' \
--data-raw '{
    "amount": 24900,
    "currency": "SAR",
    "callbackUrl": "https://zidpay.org/api/payment/98bbb6fb-bbd7-41cb-8d5f-f8854b13c9b1/ThirdPartyCallback",
    "errorUrl": "https://zidpay.org/api/payment/98bbb6fb-bbd7-41cb-8d5f-f8854b13c9b1/ThirdPartyCallbackr",
    "source": {
        "type": "token",
        "token": "###"
    },
    "metadata": {
        "PaymentReferenceId": "98bbb6fb-bbd7-41cb-8d5f-f8854b13c9b1"
    }
}'
Response Response Example
200 - Example 1
{
  "id": "pay_abc123xyz789",
  "status": "paid",
  "amount": 24900,
  "currency": "SAR",
  "transactionUrl": "https://secure.paymentprovider.com/3ds/redirect?txn_id=abc123"
}

Request

Path Params
ProviderUrl
string 
required
The base URL of the payment provider’s API. ZidPay will use this URL to send requests such as token generation, payment execution, refunds, and Apple Pay registration. This should point to the root domain or environment-specific endpoint provided by the payment provider.
Example:
https://api.paymentprovider.com
Header Params
Authorization
string 
optional
All secured endpoints require an Authorization header using Basic Authentication. The value should be the secret key provided to the payment provider during integration.
Example:
Authorization: Basic secret_key
Body Params application/json
Request body for executing a payment via ZidPay to the payment provider.
metadata
object 
optional
Optional metadata for logging purposes only. This does not affect payment processing.
Example:
{"PaymentReferenceId":"98bbb6fb-bbd7-41cb-8d5f-f8854b13c9b1"}
amount
integer 
required
Total payment amount in Halala (1 SAR = 100 Halalas).
Example:
24900
currency
string 
required
Currency code in ISO 4217 format.
Example:
SAR
callbackUrl
string 
required
The URL to which the provider should redirect or send confirmation after a successful payment.
Example:
https://zidpay.org/api/payment/98bbb6fb-bbd7-41cb-8d5f-f8854b13c9b1/ThirdPartyCallback
errorUrl
string 
required
The URL to which the provider should redirect or notify in case of payment failure.
Example:
https://zidpay.org/api/payment/98bbb6fb-bbd7-41cb-8d5f-f8854b13c9b1/ThirdPartyCallbackError
source
object 
SourceDto
required
Contains the token type and value for processing the payment.
type
enum<string> 
required
Type of token being used for the transaction.
Allowed values:
tokenapplepay
Example:
token
token
string 
required
The actual token value obtained from direct, embedded, or Apple Pay flow.
Example:
tok_1Hh1XYZabc123456
Examples

Responses

🟢200OK
application/json
Body
Response body returned by the payment provider after executing a payment request.
id
string 
required
Payment ID assigned by the provider.
Example:
pay_abc123xyz789
status
enum<string> 
required
Current payment status.
Allowed values:
paidpending
Example:
paid
amount
integer 
required
The amount processed in Halala.
Example:
24900
currency
string 
required
Currency code in ISO 4217 format.
Example:
SAR
transactionUrl
string 
required
Redirect URL for 3D Secure authentication or additional payment steps.
Example:
https://secure.paymentprovider.com/3ds/redirect?txn_id=abc123
🟠400Bad Request
Previous
On Providing Merchant Validation
Next
Create your First App
Built with