Prerequisites
- A Macropay account
- An organization created in the dashboard
We recommend using the Sandbox environment for this guide
so you can test without processing real payments.
Step 1: Create an Access Token
Generate an Organization Access Token (OAT) to authenticate API requests.- Go to your organization Settings in the Macropay dashboard
- Navigate to Access Tokens
- Click Create Token and copy the token
Step 2: Create a Product
product.id from the response — you will need it in the next step.
Step 3: Generate a Checkout Link
Create a checkout session that your customers can use to purchase the product.url in your browser to see the checkout page.
Step 4: Accept a Test Payment
In the sandbox environment, use the following test card details:| Field | Value |
|---|---|
| Card number | 4242 4242 4242 4242 |
| Expiry | Any future date |
| CVC | Any 3 digits |
| Name | Any name |
| Your email address |
Step 5: Receive a Webhook
Set up a webhook endpoint to get notified about events like successful payments.Create a Webhook Endpoint
Handle the Webhook
When a payment completes, you will receive anorder.paid event:
What’s Next?
Products
Create more products with different pricing models
Webhook Events
Learn about all available webhook event types
Customer Portal
Set up self-service for your customers
SDKs
Integrate with your preferred language