Tutoriel d'accès au catalogue
Introduction
This documentation aims to guide developers in integrating the sales catalog and order placement, with or without payment, using the Yoplanning.pro API. The goal is to enable the sale of Yoplanning activities within your system. We assume you have already reviewed the API documentation and possess your API token.
Integration Workflow Steps
1. Retrieving your Team's Data
Endpoint:
/api/v3.1/teams/Essential Information:
team_idandvendor_idUsage: The
team_idis required for almost all API requests. Thevendor_idis required if you want to use the Payment Manager.
2. Obtaining the Product List
Endpoint:
/api/v3.1/teams/[teamId]/online-products/Function: Retrieves the list of products that can be sold online.
Additional parameters:
lang: (string) Indicates the language of translatable fields (such as title, description, etc.). Use an ISO2 code. Default:
en(English). Possible options:fr(French),de(German).start_date: (date) Filters the results to return only those with availability after this date. Date format:
YYYY-MM-DD.end_date: (date) Filters results to return only those with availability before this date. Date format:
YYYY-MM-DD.category: (string) Filters products by specific category.
3. Retrieving Product Availability
Endpoint:
/api/v3.1/teams/[teamId]/online-products/[productId]/availabilities/Function: Displays the sessions available for a specific product.
Filtering: Date, price, number of tickets, staff (instructor), etc.
4. (Optional) Retrieving Available Options (Equipment)
Endpoint:
/api/v3.1/teams/[teamId]/availability-details/[pk]/Function: Retrieves details of the options available for a specific session.
5. (Optional) Availability Check
Endpoint:
/api/v3.1/teams/[teamId]/order-validationFunction: Allows you to check if the contents of the cart are still available before finalizing the order.
6. (Optional) Creating a Payment via the Payment Manager
Endpoint:
https://payment.yoplanning.pro/api/create-paymentFunction: Creates a payment and retrieves the payment link.
IPN Management: Management of Instant Payment Notification on the provided callback URL.
7. Placing the Order
Endpoint:
/api/v3.1/teams/[teamId]/orders/Function: Registers the order in Yoplanning, updates the schedule, displays the order and participants in Yoplanning, notifies staff and updates availability.
Example of Use with cURL
Product Recovery:
\* **Retrieving Product Availability**: ```bash curl https://yoplanning.pro/api/v3.1/teams/5a90332e-568f-4980-9859-88a984844a4d/online-products/f16ed6c6-e972-4232-b452-ecd393e61642/availabilities -H 'Authorization: Token 4504c2cb0d87a93106d4de029f407c86149f2ada' ``` * **Place the Order**: ```bash curl -H "Content-Type: application/json" -X POST -d '{"external_reference" : "956", "items" : [{"session_group" : "4f655815-58d9-4c7c-b1c9-2ea152073371", "price" : {"amount" : 51.25}, "client" : {"id" : "71ea849f-226c-4302-a433-528179634aa7", "first_name" : "John", "last_name" : "Doe", "email" : "[email protected]"}}], "payments" : [{"amount" : 51.25, "client" : {"first_name" : "Framold", "last_name" : "Doe", "email" : "[email protected]"}}]}' https://yoplanning.pro/api/v3.1/teams/5a90332e-568f-4980-9859-88a984844a4d/orders -H 'Authorization: Token 4504c2cb0d87a93106d4de029f407c86149f2ada' ```
Make sure to replace the IDs and tokens with those of your Team for all requests.
Note: This documentation is a basic integration example. For more specific details and advanced use cases, please refer to the official Yoplanning.pro API documentation.
Last updated

