Managing Customers
In Ordermentum, a purchaser represents a relationship between a retailer and a supplier. The purchaser object contains key details about the retailer, such as contact information, addresses, and purchasing preferences.
Retrieving Purchaser Details
To retrieve detailed information about a specific purchaser, use the /v1/purchasers/{id} endpoint. This provides comprehensive data, including retailer information, addresses, payment preferences, and linked price groups.
Example Request: Retrieve Purchaser Details
curl -X GET "https://api.ordermentum.com/v1/purchasers/123e4567-e89b-12d3-a456-426614174000" \
     -H "Authorization: Bearer YOUR_API_TOKEN"Example Response:
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "Retailer One",
  "retailerAddress": {
    "street1": "123 Fake Street",
    "suburb": "Melbourne",
    "state": "VIC",
    "postcode": "3000",
    "country": "Australia"
  },
  "priceGroup": {
    "id": "456e7890-e12a-34bc-d456-789012340000",
    "name": "Wholesale Tier 1"
  },
  "visibilityTags": ["default", "seasonal"],
  "paymentMethodTypes": {
    "value": ["card", "direct"],
    "display": "Credit / Debit Card, Direct Debit"
  }
}Searching for Purchasers
The /v1/purchasers endpoint allows searching for purchasers using query parameters such as retailer attributes, visibility tags, and other metadata.
Example Request: Search Purchasers by Tag
curl -X GET "https://api.ordermentum.com/v1/purchasers?tags%5B0%5D=class__contains%3Dretail" \
     -H "Authorization: Bearer YOUR_API_TOKEN"Understanding Tags
Tags, named properties inside Ordermentum, represent custom purchaser properties that suppliers can add to store additional information about their purchasers. For example, a property such as class=retail can indicate that a purchaser belongs to a specific category.
Common Filters
| Filter Type | Possible Values/Descriptions | 
|---|---|
| supplierId | The unique identifier of the supplier. Example value: 123e4567-e89b-12d3-a456-426614174000 | 
| tags | Filters based on specific tags with conditions. Example value: gln__eq=3476q87sdfa(search by GLN number). Supports__eq,__contains, and__in. | 
| surchargable | Should surcharge be applied to this customer? Possible values: True / False | 
| reference | Customer ID for the customer. Example value: 419 | 
Best Practices
- Use filtering efficiently: Retrieve only the data needed by using query parameters.
- Leverage pagination: Use pageSizeandpageNoparameters to handle large datasets.
- Verify visibility: Ensure the purchaser’s visibilityTags align with the products being ordered.
- Check pricing group assignments: Always verify the priceGroup to avoid incorrect pricing on orders.
By following these steps, you can effectively integrate Ordermentum's purchasing system into your application.
Updated 8 months ago