Postman Collection

Try the SADAD Pay API in Postman, with authentication handled for you.

The SADAD Pay Postman collection lets you try the API without writing code. It handles authentication for you, saves the IDs each request creates, and runs the main flows in order: create an invoice, get its payment link, check its status and refund it. It covers every endpoint in the API Reference.

ItemDetails
CollectionSADAD Pay API on Postman
Requests98 requests in 12 folders, covering all 93 API endpoints
EnvironmentsSandbox (default) and Live

Step 1: Get the collection

  1. Open the SADAD Pay API collection.
  2. Click Fork to copy it into your own Postman workspace. You need a free Postman account.

Forking keeps your keys in your own workspace, and lets you pull updates when we change the collection.

Step 2: Add your keys

  1. In your copy, click the collection name, then open the Variables tab.
  2. Fill in the Current value column:
VariableValue
client_keyYour Client Key, from Profile → Update Profile → API in the portal
client_secretYour Client Secret, from the same page
vendor_idYour vendor ID. Needed for installment plans, subscriptions, packages and customers. Ask [email protected] if you do not know it.
supplier_id_1, supplier_id_2Only for 03 - Multi-Supplier and Refund Supplier Items: the IDs of two of your suppliers. See Multi-Supplier Payments.
supplier_invoice_idSaved by 03 - Multi-Supplier > Get Supplier Invoice IDs once the invoice is paid. Used as invoice_Id by Refund Supplier Items.
  1. Click Save.

🚧

Use Current value for your keys

Postman shares the Initial value column with anyone you share the collection with. Put your Client Key and Client Secret in Current value only, which stays on your computer.

The collection points to Sandbox by default. Use your Sandbox keys with it. See Sandbox & Live Accounts.

Step 3: Authenticate

Open 01 - Authentication and send Generate Refresh Token. It saves the refresh token in the refresh_token variable.

That is the only manual step. Before every other request, the collection checks the access token and gets a new one when it is missing or about to expire. To see this happen, open the Postman Console (bottom left).

Step 4: Send requests

Send the requests in a folder from top to bottom. Each request saves what it creates, so the next one can use it:

RequestSavesUsed by
Create Invoiceinvoice_idGet Invoice By ID, Refund Invoice
Get Invoice By IDinvoice_keyThe payment page: {{pay_url}}/{{invoice_key}}
Create Productproduct_idCreate Product Link
Create Product Linkproduct_link_keyCreate Invoice From Product Link
Create Installment Planplan_keyCreate Invoice For Plan

Every request checks that the response has HTTP 200 and "isValid": true. When a request fails, the Test Results tab shows the errorKey. See the common errors on each guide page.

Try a full payment

  1. Send 02 - Invoices → Create Invoice.
  2. Send Get Invoice By ID. The Console shows the payment page URL.
  3. Open the URL and pay with a test card.
  4. Send Get Invoice By ID again. The status is now Paid.
  5. Send 05 - Refunds → Refund Invoice to refund part of it.

What's in the collection

FolderWhat it coversGuide
01 - AuthenticationRefresh token and access tokenAPI Keys & Authentication
02 - InvoicesCreate, get, list, page through, export (CSV) and update invoicesHosted Payment Page
03 - Multi-SupplierAn invoice split between suppliers, and the supplier invoice IDs used for supplier refundsMulti-Supplier Payments
04 - Embedded PaymentRegister your domain, create KNET, card and Apple Pay sessionsEmbedded Payment
05 - RefundsRefund an invoice or a supplier's items, and check refundsRefunds
06 - Payment LinksCreate, get and update a payment link, create an invoice from it, and list the invoices paid through itInvoicing & Payment Links
07 - Products & Product LinksCreate, get, list and update categories, products and product links, and create an invoice from a linkProduct Links
08 - InstallmentsCreate, get and update a plan, and create an invoice for a paymentInstallments
09 - SubscriptionsCreate, get and update templates, links and subscriptions, preview a billing schedule, and create bill, cancellation and suspension invoicesSubscriptions
10 - CustomersCreate, get, list and update saved customers
11 - PackagesCreate, get, list and update package templates, package links and packages, and renew or cancel a packageAPI Reference
99 - Clean UpDeletes the test data the collection created

Each request's description says what it does, what it saves, and whether it has been verified in Sandbox.

📘

Multi-supplier and supplier IDs

Before you use 03 - Multi-Supplier, set supplier_id_1 and supplier_id_2 to Approved supplier IDs from Suppliers in the portal. Multi-supplier must be enabled on your account.

Switch to Live

When you are ready to test in Live, change these variables and use your Live keys:

VariableSandboxLive
base_urlhttps://apisandbox.sadadpay.nethttps://api.sadadpay.net
pay_urlhttps://sandbox.sadadpay.net/payhttps://sadadpay.net/pay

Then clear refresh_token, access_token and access_token_expires_at, and send Generate Refresh Token again.

❗️

Live requests are real

In Live, invoices are real and refunds return real money. Do not run 99 - Clean Up or Refund Invoice against Live data you want to keep.

Troubleshooting

ProblemWhat to check
Generate Refresh Token returns an errorKeyThe Client Key and Client Secret are wrong, or belong to the other environment
InvalidAccessToken (HTTP 401) on every requestSend Generate Refresh Token again. The Console shows whether the access token was refreshed.
isValid is true fails with an errorKeyThe request data does not fit your account, for example an unknown supplier ID or a product that was deleted. Check the errorKey in the guide for that feature.
A variable such as {{product_id}} is emptySend the request that creates it first. See Send requests.

Next steps