API Integration
Learn how to use payment links with Xendit in 3 simple steps
Step 1 : Generate API Key
- In your Xendit dashboard, go to Settings > API Key
- Click "Create New Secret Key"
- Enter API Key name for your reference
- Set WRITE permission for Money In
- Click generate API Key
For more information about API Key, you can refer to our documentation here
Step 2 : Create Payment Links
Required parameter | Type | Descriptions |
---|---|---|
External ID | String | ID of your choice (typically the unique identifier of a payment link in your system). Min : 1 character Max : 255 characters. |
Amount | Int | Amount on the payment link. Min and max amounts are stated here. |
Items* | Array | Array of items. JSON objects describing the item(s) purchased. Max array size: 75. *This is only mandatory for PayLater payment option in payment links. |
Refer to this document for other parameters that you can use.
Create your payment link. Send a POST request to Create Invoice with the required parameters.
POST https://api.xendit.co/v2/invoices
{
"external_id": "payment-link-example",
"amount": 100000,
"items": [
{
"name": "Air Conditioner",
"quantity": 1,
"price": 100000,
"category": "Electronic",
"url": "https://yourcompany.com/example_item"
}
]
}
Step 3 : Pay the Payment Links
After requesting to create a payment link, you will get a response payload, which will include the payment link URL
Your customer can pay the payment links using the checkout URL provided in the response payload.
- Refer to this document to learn the payment flow in live mode.
- Refer to this document to learn more about payment flow in test mode.
Last Updated on 2023-05-17