Get all payments
GET
https://wemx.app/api/v1/payments
Returns all payments made on your application
200: OK
Copy {
"status" : true ,
"current_page" : 1 ,
"data" : [
{
"id" : "21087b8f-532c-4a83-86ce-35d5406d5932" ,
"user_id" : 1 ,
"order_id" : 2 ,
"package_id" : 1 ,
"price_id" : 1 ,
"type" : "once" ,
"description" : "Universal" ,
"status" : "paid" ,
"currency" : "USD" ,
"amount" : 5 ,
"transaction_id" : "21087b8f-532c-4a83-86ce-35d5406d5932" ,
"handler" : "App\\Handlers\\NewOrder" ,
"gateway" : {
"id" : 1 ,
"name" : "Balance" ,
"type" : "once" ,
"driver" : "Balance" ,
"class" : "App\\Models\\Gateways\\BalanceGateway" ,
"endpoint" : "balance" ,
"refund_support" : 1 ,
"blade_edit_path" : null ,
"status" : 1 ,
"created_at" : "2024-01-09T18:29:17.000000Z" ,
"updated_at" : "2024-01-09T18:29:17.000000Z" ,
"default" : 0
} ,
"data" : [] ,
"options" : {
"coupon" : null
} ,
"show_as_unpaid_invoice" : 0 ,
"notes" : null ,
"due_date" : null ,
"created_at" : "2024-01-09T18:29:25.000000Z" ,
"updated_at" : "2024-01-09T18:29:25.000000Z"
}
] ,
"first_page_url" : "http://wemx.app/api/v1/payments?page=1" ,
"from" : 1 ,
"last_page" : 1 ,
"last_page_url" : "http://wemx.app/api/v1/payments?page=1" ,
"links" : [
{
"url" : null ,
"label" : "Previous" ,
"active" : false
} ,
{
"url" : "http://wemx.app/api/v1/payments?page=1" ,
"label" : "1" ,
"active" : true
} ,
{
"url" : null ,
"label" : "Next" ,
"active" : false
}
] ,
"next_page_url" : null ,
"path" : "http://wemx.app/api/v1/payments" ,
"per_page" : 15 ,
"prev_page_url" : null ,
"to" : 2 ,
"total" : 2
}
Available Relationships (optional)
Copy https://wemx.app/api/v1/payments?include=user,order,price
Available relationships:
user
, order
, package
, price
Filters (optional)
Copy https://wemx.app/api/v1/payments?filter[transaction_id]=test
Available Filters:
id
, payment_id
, price_id
, order_id
, user_id
, status
, type
, currency
, amount
, transaction_id
, gateway
, data
, options
Tip: To filter JSON columns such as gateway, data and options, you can specify the key using
?filter[gateway->driver]=PayPal
Sorting (optional)
Copy https://wemx.app/api/v1/payments?sort[created_at]=asc
Available Sorting Parameters:
description
, status
, type
, currency
, amount
, options
, created_at
Sorting operators
asc
, desc
, random
Dates (optional)
Copy https://wemx.app/api/v1/payments?date=30days
Generate a payment
POST
https://wemx.app/api/v1/payments/generate
Generate a payment on your application and redirect the user to pay it
If the payment is generated successfully, the API responds with a list of links in the links object for each gateway that the user can use to directly pay the payment. You can display these links for the user to choose a gateway.
Request Body
200: OK
Copy {
"success" : true ,
"payment" : "43d5c727-df50-4826-8c33-01d4e5213fd4" ,
"links" : [
{
"Balance" : "https://wemx.app/payment/invoice/43d5c727-df50-4826-8c33-01d4e5213fd4/pay?gateway=1"
} ,
{
"PayPal" : "https://wemx.app/payment/invoice/43d5c727-df50-4826-8c33-01d4e5213fd4/pay?gateway=2"
} ,
{
"Tebex" : "https://wemx.app/payment/invoice/43d5c727-df50-4826-8c33-01d4e5213fd4/pay?gateway=3"
} ,
{
"Tebex" : "https://wemx.app/payment/invoice/43d5c727-df50-4826-8c33-01d4e5213fd4/pay?gateway=4"
} ,
{
"stripecheckout" : "https://wemx.app/payment/invoice/43d5c727-df50-4826-8c33-01d4e5213fd4/pay?gateway=7"
} ,
{
"Pay By Link" : "https://wemx.app/payment/invoice/43d5c727-df50-4826-8c33-01d4e5213fd4/pay?gateway=9"
}
]
}
Last updated 10 months ago