API Payment
Create a payment request
You will call our payment endpoint to generate a unique, secure link for your users that will contain all the relevant details for their particular purchase. You will use this link to redirect your users to the checkout page of ipaymy. Payment links expire 30 days after generation. ipaymy then will redirect users back to your return URL upon completion of checkout, and ipaymy also will call any payment results endpoint that you provided in your payload as a convenient web hook.
For a high-level data flow, please refer to our API Overview.
Request
Request header:
POST https://api.ipaymy.com/v2/partner/payment_collection_request HTTP/1.1
Host: api.ipaymy.com
Accept: application/json
Authorization: Bearer your_access_token
Request body:
{
"payees": [
{
"invoice_no": "INV-001",
"gross_amount": 10000
}
],
"return_url": "http://your.example.com/checkout",
"webhook_url": "http://your.example.com/webhook",
"customer_first_name": "Ethan",
"customer_last_name": "Dobson",
"customer_email": "yourcustomer@gmail.com"
}
invoice_no:
- Description: Your invoice number
- Type: alphanumeric string
- Validate: required
gross_amount:
- Description: Your gross amount in cents format stored.
- Type: number
- Validate: required
return_url:
- Description: Redirect destination from ipaymy back to your platform
- Type: string
- Validate: required | url
webhook_url:
- Description: Endpoint at your server where ipaymy can post the results of the payment
- Type: string
- Validate: required | url
customer_first_name:
- Description: Customer first name
- Type: string
- Validate: optional
customer_last_name:
- Description: Customer last name
- Type: string
- Validate: optional
customer_email:
- Description: Customer email
- Type: string
- Validate: optional | email
Response
Response body:
{
"data": {
"checkout_url_list": [
{
"url": "https://url.ipaymy.com/your-platform-name/RMp1ZVL"
}
]
},
"error": 0
}
checkout_url_list:
- Type: Array
- Elements:
url:
- Description: ipaymy payment link
- Type: string
Response code:
- 200: Good stuff, and the response body should be easy to parse.
- 422: Typically malformed JSON, such as an integer in place of the required alphanumeric string, or a missing key. Check the response body for further details.
- 401: Invalid authorization, typically an incorrect or revoked token.