YoPlanning API
API Basic URL for production: https://api.yoplanning.pro/v2.0
If you are using https://api.yoplanning.pro with no version indicator, then it means you are using precisely version v2.0, and not the last version of the API.
{team_id}
{team_id}
Get basic data about the given team staffs. Retrieve the staffs name, email and id for the given team.
Path variables
team ID
Notes
If a staff never activated his or her account, first_name will be filled with his or her email address and last_name will be a single white space.
Responses
Body
Note that if a staff never activated his or her account, first_name will be filled with his or her email address and last_name will be a single white space.
{
"staffs":[
{
"email": "john.snow@gmail.com",
"first_name": "John",
"last_name": "Snow",
"user_id": "e5564303-1422-4390-bdc0-2d1d8492c594",
"phone_number": "065588995544",
"is_active": true
},
{
"email": "eddard.stark@gmail.com",
"first_name": "Eddard",
"last_name": "Stark",
"user_id": "23ce4d04-5627-4297-a6d6-d34dd42e1705",
"phone_number": "+33674669923",
"is_active": true
},
{
"email": "sansa.stark@gmail.com",
"first_name": "Eddard",
"last_name": "Stark",
"user_id": "72a27b17-9f26-45fa-80a0-d83ac0cc6607",
"phone_number": null,
"is_active": true
},
{
"email": "robb.stark@hotmail.fr",
"first_name": "robb@stark.com",
"last_name": " ",
"user_id": "72a27b17-9f26-45fa-80a0-d83ac0cc6607",
"phone_number": null,
"is_active": false
}
]
}
Get the planning of some staffs.
Provides the schedules of all sessions and unavailabilities for the given staffs in the given period.
Request parameters
The period start date. Format YYYY-MM-DD.
The period end date. Format YYYY-MM-DD.
The ids of all the staffs you want to retrieve.
Responses
Body
{
"staffs":[
{
"id":"6c0847fc-1c06-47c3-b17e-64dcf3eb0ae8",
"email":"john@gmail.com",
"schedules":[
{
"start_date":"2016-12-03 19:45:00",
"end_date":"2016-12-03 20:45:00"
},
{
"start_date":"2016-12-04 19:30:00",
"end_date":"2016-12-04 22:00:00"
}
]
},
{
"id":"c4371c08-132c-48d2-9578-6c7c81bb3a0f",
"email":"paul@hotmail.fr",
"schedules":[]
}
]
}
Get the planning of all the given team members.
Provides the schedules of all sessions and unavailabilities for the given team members in the given period.
Request parameters
The period start date. Format YYYY-MM-DD.
The period end date. Format YYYY-MM-DD.
The team id
Responses
Body
{
"staffs":[
{
"id":"6c0847fc-1c06-47c3-b17e-64dcf3eb0ae8",
"email":"john@gmail.com",
"schedules":[
{
"start_date":"2016-12-03 19:45:00",
"end_date":"2016-12-03 20:45:00"
},
{
"start_date":"2016-12-04 19:30:00",
"end_date":"2016-12-04 22:00:00"
}
]
},
{
"id":"c4371c08-132c-48d2-9578-6c7c81bb3a0f",
"email":"paul@hotmail.fr",
"schedules":[]
}
]
}
Get products for the given team (pIdStructure).
Depending on the parameters you give, you can also retrieve availabilities.
Request body
Responses
Get all products
curl -X POST -H "Content-Type: application/json" -H 'Authorization: Token 9318da00d6adc0e8229809606c060c792ef65115' -d '{"pSerialiseOn" : 0,"pIdStructure" : "DEMOMU", "pLanguage":"FRA","pParameters":{"DisplayCategory":1,"DisplayProduct":1,"DisplayField":1,"DisplayAccessory":1,"DisplayDiscount":1,"DisplayAvailability":0,"CategoryIn":"","CategoryOut":"","ProductIn":"","ProductOut":"","StartDate":""}}' 'https://api.yoplanning.pro/product/v1/get-products'
Get available sessions for one product
curl -X POST -H "Content-Type: application/json" -H 'Authorization: Token 9318da00d6adc0e8229809606c060c792ef65198' -d '{"pSerialiseOn" : 0,"pIdStructure" : "DEMOMU", "pLanguage":"FRA","pParameters":{"DisplayCategory":1,"DisplayProduct":1,"DisplayField":1,"DisplayAccessory":1,"DisplayDiscount":1,"DisplayAvailability":1,"CategoryIn":"","CategoryOut":"","ProductIn":"my_product_id","ProductOut":"","StartDate":""}}' 'https://api.yoplanning.pro/product/v1/get-products'
{team_id}
{team_id}
Add a new session to the planning. The given order will be related to some new sessions (instead of simply adding new participants in existing ones like order/{team_id} method).
Path variables
Request body
Note that if you provide several dates (in the schedule list), several linked-sessions will be created.
REQUIRED : Will be provided to you on demand
REQUIRED : This is your internal order id
REQUIRED : This is the actual price that will be payed for this order
REQUIRED : The currency should be the same as the one chosen in your team account
REQUIRED
REQUIRED
REQUIRED
OPTIONAL
["8ea878e1-8e05-4dcb-b00e-5121522052a7","5f36bca1-8a9c-4640-906a-4be647d6a62c"]
REQUIRED
At least 1 title (english or french) is required
At least 1 title (english or french) is required
The required level to participate to this session. 0: All, 1: begginer, 2: intermediate, 3: Advanced
0 : All, 1: Childreen, 3: Adults
This correpond to your timezone. If you are in GMT +2, the value will be 120. It is preferable that you don’t hardcode this value and get it programatically due to saving times in some countries
REQUIRED
REQUIRED
REQUIRED
REQUIRED
OPTIONAL This correspond to specific data setup in the team account like weight, size, etc…
REQUIRED
If the participant have a special price (member card, children, etc…), this is the id corresponding to the discount in yoplanning
OPTIONAL. A list of accessories that will be provided to the participant for this activity
REQUIRED
REQUIRED
REQUIRED
Responses
Body
This field will be present only if there was an erreur. For example, you will get an error if some staff are unavailable at the time you want to create a session
{
"order": {
"team_id": "DEMOMU",
"merchant_order_id": "nk0000001",
"payment": {
"price": {
"amount": 11.50,
"currency": "EUR"
},
"payer": {
"first_name": "Jon",
"last_name": "Doe",
"company": "",
"email": "jon@doe.com",
"phone_number": "+3366998855",
"mobile_number": "+3366998855",
"billing_address": {
"street": "rue de l'inconnu",
"city": "Annecy",
"zip_code": "74000",
"country": "FR",
"state": "Auvergne-Rhône-Alpes"
}
}
},
"packages": [
{
"activities": [
{
"session" : {
"staff_ids" : ["8ea878e1-8e05-4dcb-b00e-5121522052a7","5f36bca1-8a9c-4640-906a-4be647d6a62c"],
"team_id": "6d3caeb3-0f03-4cff-9b9d-fa19c68126e2",
"title_fr": "Ski alpin piste rouge",
"title_en": "Downhill skiing red slope",
"description_fr": "Le but est d'apprendre les bases et de s'amuser.",
"description_en": "The goal is to teach the basics and to have fun.",
"activity_place": "Chamonix",
"meeting_point_fr" : "Next to the cable car",
"meeting_point_en": "a coté du téléphérique",
"level": 1,
"target_participants": 0,
"utc_time_offset": -60,
"schedules" : [
{
"start_date" : "2016-12-20 15:00:00",
"end_date": "2016-12-20 17:00:00"
}
]
},
"participants": [
{
"first_name": "Jean",
"last_name": "Dupont",
"email": "jean.dupont@gmail.com",
"birth_date": "1970-05-04",
"phone_number": "+3366998855",
"language": "fr",
"specific_data": [
{
"id": "0c7934fe-7c88-4e83-a1d2-b4382533894c",
"value": "35"
}
],
"ticket": {
"price": 50,
"price_variation_id":"5858a8ef-1102-474d-8660-029dc1a98613"
},
"accessories": [
{
"id": "TSHIRT",
"quantity": 1,
"price": {
"unit_price": 30
}
}
]
}
]
}
]
}
]
}
}
{team_id}
{team_id}
Path variables
Request body
pn_url: this url will be used to notify your system that the payment have been successful. This url must accept POST request without any authentication. A good and secure way to handle this is to provide a private order id (an id that is only known by your system) in the url. Something like https://mysite/payment-success/6846551. You can use this id to retrieve which order was payed in your system. The data received will be structured like this { order_id : String. The order_id you provided when you created the order success : Boolean. Should always be True if you received this IPN. payer_lang : String. The language used by the payer when he paid (2 characters). ex : fr }
redirection_url : The payer will be redirected on this url when he clicks on “back to merchant site” after his payment.
order: A complex data structure describing the order.
You can provide any number of activities. Note that an activity without session_group_id is NOT scheduled on a specific time. Thus, the participant will be able to choose the date of its activity.
Responses
Body
the url that can be used to pay the order
{
"ipn_url": "https://mysite/payment-success/my-private-id",
"redirection_url": "https://mysite/my-merchant-page",
"cancel_url": "https://mysite/my-merchant-page/error",
"order": {
"team_id": "DEMOMU",
"merchant_order_id": "nk0000001",
"payment": {
"price": {
"amount": 11.50,
"currency": "EUR"
},
"payer": {
"first_name": "Jon",
"last_name": "Doe",
"company": "",
"email": "jon@doe.com",
"phone_number": "+3366998855",
"mobile_number": "+3366998855",
"billing_address": {
"street": "rue de l'inconnu",
"city": "Annecy",
"zip_code": "74000",
"country": "FR",
"state": "Auvergne-Rhône-Alpes"
}
},
"vendor": {
"id": "0e12f5d1-0b5a-4d98-b504-f6297f82e8f1"
}
},
"packages": [
{
"activities": [
{
"product_id": "6b24bcf9-bd7a-41c1-b0fe-fa39dc955a6d",
"session_group": {
"id": "61f15885-c468-4ee7-9dd6-aabbc647c6f8"
},
"participants": [
{
"first_name": "Jean",
"last_name": "Dupont",
"email": "jean.dupont@gmail.com",
"birth_date": "1970-05-04",
"phone_number": "+3366998855",
"language": "fr",
"specific_data": [
{
"id": "0c7934fe-7c88-4e83-a1d2-b4382533894c",
"value": "35"
},
],
"ticket": {
"price": 50,
"price_variation_id":"5858a8ef-1102-474d-8660-029dc1a98613"
},
"accessories": [
{
"id": "TSHIRT",
"quantity": 1,
"price": {
"unit_price": 30
}
}
]
}
]
}
]
}
]
}
}