Fetch or Filter Orders
Endpoint
https://merchant.payervault.com/api/v1/orders
Description:
This API endpoint retrieves orders based on specified filters such as email, contact, status, entity, and doc. It fetches orders from the database and returns the relevant data in JSON format.
Method:
Parameters:
Certainly! Here's the updated section with the replaced text for all the mentioned components:
Query Parameters:
- email (optional): Email address of the customer.
- contact (optional): Contact information of the customer.
- status : Status of the order. Possible values include:
- authorized
- attempted
- failed
- paid
- refund.initiated
- refunded
- refund.failed
- refund.speed_changed
- disputed
- dispute.won
- dispute.loss
- hold
- settled
- entity (optional): Type of entity. Possible values are paymentpages or paymentlinks or checkout_carts.
- doc (optional): Doc reference.
Let me know if there's anything else you need!
Request Headers
accessKey : | Access key for authentication |
---|---|
accessSecret : | Access secret for authentication. |
Request Body:
No request body is required for this endpoint.
Response:
- Success Response:
- Status Code: 200
- Content Type: JSON
- Response Body: An array of objects containing order details.
- Error Response:
- Status Codes:
- 206 (Partial Content)
- 500 (Internal Server Error)
- 401 (Unauthorized)
- Content Type: JSON
- Response Body: An error message explaining the issue encountered.
- Status Codes:
Sample Usage:
// Sample Request Headers
accessKey: your-access-key
accessSecret: your-access-secret
// Sample Request
GET https://<api-url>/api/v1/orders?email=user@example.com&status=created
// Sample Response
[
{
"createdAt": "2024-04-13T08:00:00Z",
"updatedAt": "2024-04-13T08:30:00Z",
"events": [...],
"customer": {...},
"amount": 100,
"amountPaid": 50,
"amountDue": 50,
"orderId": "123456",
"type": "paymentpages",
"doc": "doc123",
"status": "created"
},
...
]
Notes:
- This endpoint requires authentication with an access key and access secret provided in the request headers.
- Data is filtered based on the user's ID and live status.
- Filtering is performed based on the query parameters provided in the request.
- Orders are projected to include only necessary fields in the response.
Example in CURL:
curl -X GET \\
'https://<api-url>/api/v1/orders?email=user@example.com&status=created' \\
-H 'accessKey: your-access-key' \\
-H 'accessSecret: your-access-secret'
Example in Python (requests library):
import requests
url = "https://<api-url>/api/v1/orders"
headers = {
"accessKey": "your-access-key",
"accessSecret": "your-access-secret"
}
params = {
"email": "user@example.com",
"status": "created"
}
response = requests.get(url, headers=headers, params=params)
print(response.json())
Example in Node.js (axios library):
const axios = require('axios');
const url = 'https://<api-url>/api/v1/orders';
const headers = {
'accessKey': 'your-access-key',
'accessSecret': 'your-access-secret'
};
const params = {
'email': 'user@example.com',
'status': 'created'
};
axios.get(url, { headers, params })
.then(response => console.log(response.data))
.catch(error => console.error(error));
These examples demonstrate how to make requests to the API endpoint using different programming languages and libraries.