Zid Docs
Merchant APIPayment APIAppsThemes
Merchant APIPayment APIAppsThemes
Help Center
Slack
  1. Payment
  • Merchant Activation
  • Submitting
  • Gateway Error Codes
  • Webhooks
    • Link Merchant Event
      POST
    • Payment Paid Event
      POST
    • Refund Event
      POST
  • Payment
    • Embedded Payment
    • Execute Payment Request
      POST
    • Get payment status
      GET
    • Direct Payment
      POST
  • ApplePay
    • ApplePay Checkout
    • On Payment Authorized
    • Register ApplePay Domain
      POST
    • On Providing Merchant Validation
      POST
  • Refund
    • Request Refund
      POST
  1. Payment

Direct Payment

POST
https://api.zid.sa/{ProviderUrl}/tokens
This is the endpoint where the card information will be shared and a session is initiated. This request will be sent from the client side directly in the checkout and will not pass through ZidPay backend nor any data will be saved.

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
Body Params application/json
Request body for initiating a direct payment session with card details.
publishableApiKey
string 
required
Merchant's public API key provided by the payment provider.
Example:
pk_test_abc123xyz
providerMerchantId
string 
required
Merchant ID on the provider's side.
Example:
merchant_456789
name
string 
required
Cardholder's full name as printed on the card.
Example:
John Doe
number
string 
required
Credit or debit card number.
Example:
4111111111111111
cvc
string 
required
Card Verification Code (CVC/CVV) from the back of the card.
Example:
123
month
string 
required
Card expiry month (MM format).
Example:
09
year
string 
required
Card expiry year (YYYY format).
Example:
2027
Example
{
    "publishableApiKey": "pk_test_abc123xyz",
    "providerMerchantId": "merchant_456789",
    "name": "John Doe",
    "number": "4111111111111111",
    "cvc": "123",
    "month": "09",
    "year": "2027"
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.paymentprovider.com/tokens' \
--header 'Content-Type: application/json' \
--data-raw '{
    "publishableApiKey": "pk_test_abc123xyz",
    "providerMerchantId": "merchant_456789",
    "name": "John Doe",
    "number": "4111111111111111",
    "cvc": "123",
    "month": "09",
    "year": "2027"
}'

Responses

🟢200OK
application/json
Body
Successful response after card session initiation.
token
string 
required
Tokenized representation of the card for future use.
Example:
tok_abc123xyz
brand
enum<string> 
required
Card brand/type.
Allowed values:
visamastermadaamex
Example:
visa
funding
enum<string> 
required
Type of funding source.
Allowed values:
Creditdebit
Example:
Credit
country
string 
required
Issuing country of the card.
Example:
SA
network
enum<string> 
required
Network used to process the payment.
Allowed values:
visamastermadaamex
Example:
visa
lastFour
string 
required
Last four digits of the card number.
Example:
4242
Example
{
    "token": "tok_abc123xyz",
    "brand": "visa",
    "funding": "Credit",
    "country": "SA",
    "network": "visa",
    "lastFour": "4242"
}
🟠422Parameter Error
Modified at 2025-06-13 05:39:05
Previous
Get payment status
Next
ApplePay
Built with