If you are currently using the legacy Younited Pay API, this guide will help you to migrate to the new API.
You now need to provide maturity parameter.
POST/api/1.0/BestPrices
Query parameters: -
Body:
{ "borrowedAmount": 2500, "shopCode": "Shop" }
200
[ { "requestedAmount": 2500, "annualPercentageRate": 0.099, "annualDebitRate": 0.094, "monthlyInstallmentAmount": 274.75, "creditTotalAmount": 2500, "creditAmountToFund": 2500, "maturityInMonths": 10, "interestsTotalAmount": 247.5 } ]
GET/personal-loans/offers
Query parameters:
Body:
[ { "requestedAmount": 1115.99, "characteristics": { "amount": 1115.99, "maturityInMonths": 12, "interestRate": 0.05, "downPaymentAmount": 0, "feesAmount": 0 }, "details": { "annualPercentageRate": 0.05, "monthlyInstallmentAmount": 100.14, "interestsAmount": 12.57, "totalDueAmount": 1200.57 } } ]
POST/api/1.0/Contract
Query parameters: -
Body:
{ "requestedMaturity": 10, "personalInformation": { "firstName": "Dale", "lastName": "Stephens", "genderCode": "MALE", "emailAddress": "customerEmailAddress@somemail.com", "cellPhoneNumber": "+33611223344", "birthDate": "1990-02-20T00:00:00", "address": { "streetNumber": "21", "streetName": "rue de chateaudun", "additionalAddress": "not necessary", "city": "Paris", "postalCode": "75009", "countryCode": "FR" } }, "basket": { "basketAmount": 2500, "items": [ { "itemName": "Expensive item", "quantity": 1, "unitPrice": 2500 } ] }, "merchantUrls": { "onGrantedWebhookUrl": "https://www.notifyMeHere.com/granted", "onCanceledWebhookUrl": "https://www.notifyMeHere.com/canceled", "onWithdrawnWebhookUrl": "https://www.notifyMeHere.com/withdrawn", "onApplicationSucceededRedirectUrl": "https://www.redirectMeHere.com/success", "onApplicationFailedRedirectUrl": "https://www.redirectMeHere.com/failure", "onActivateWebhookUrl": "https://www.notifyMeHere.com/activate" }, "merchantOrderContext": { "channel": "ONLINE", "shopCode": "ONLINE", "agentEmailAddress": "merchantEmailAddress@somemail.com", "merchantReference": "merchantInternalReference" } }
200
{ "contractReference": "CFR20211231CP4NYRZ", "redirectUrl": "https://clafr.younited-pay.com/start?requestId=xxxxxxxxxxxxx" }
POST/payments/personal-loan
Query parameters: -
Body:
{ "loanRequest": { "requestedAmount": 1015.99, "requestedMaturityInMonths": 12 }, "basketDescription": { "items": [ { "name": "Cellphone", "quantity": 1, "unitPrice": 1115.99 }, { "name": "Membership Discount", "quantity": 1, "unitPrice": -100 } ] }, "customerInformation": { "firstName": "John", "lastName": "Doe", "emailAddress": "customer@email.com", "mobilePhoneNumber": null, "birthDate": null, "postalAddress": null }, "merchantContext": { "shopCode": "SHOP-123456", "merchantReference": "MERCHANT-123456", "salesClerkContactEmailAddress": null }, "technicalInformation": { "webhookNotificationUrl": "https://merchant.com/webhook", "apiVersion": "2024-01-01" }, "customExperience": { "customerRedirectUrl":"https://www.redirectMeHere.com/" }, "riskInsights": null }
200
{ "paymentId": "YPAY_49f3b63d-7521-44a4-88b8-0575059e5cb7", "paymentLink": "https://payment.younited.com?token=xxxxxxxxxxxxx" }
GET/api/1.0/Contract/{contractReference}
Query parameters:
Body:
200
{ "reference": "CFR20211231CP4NYRZ", "status": "GRANTED", "applicationSucceeded": true, "offer": { "requestedAmount": 2500, "annualPercentageRate": 0.099, "annualDebitRate": 0.094, "monthlyInstallmentAmount": 274.75, "creditTotalAmount": 2500, "creditAmountToFund": 2500, "maturityInMonths": 10, "interestsTotalAmount": 247.5 }, "basket": { "basketAmount": 2500, "items": [ { "itemName": "Expensive item", "quantity": 1, "unitPrice": 2500 } ] }, "merchantOrderContext": { "channel": "ONLINE", "shopCode": "ONLINE", "agentEmailAddress": "agentEmailAddress@fromInitializePayload.com", "merchantReference": "merchantReferenceFromInitializePayload" }, "personalInformation": { "firstName": "Kevin", "lastName": "Last", "genderCode": "MALE", "emailAddress": "mail@mail.com", "cellPhoneNumber": "0605040302", "birthDate": "2000-07-01T00:00:00", "address": { "streetNumber": "1", "streetName": "rue de paris", "city": "Paris", "postalCode": "75020", "countryCode": "FR" } } }
GET/payments/{paymentId}
Query parameters:
Body:
200
{ "id": "YPAY_3de5d1dd-93dd-4ae9-8c76-434900e24cbf", "type": "PersonalLoan", "status": "Approved", "amount": 1000, "personalLoanPaymentDetails": { "loanReference": "CFR20211010XXXXXX" }, "createdAt": "2021-10-10T11:11:12Z", "executableUntil": null, "refundedAmount": 50, "isRefunded": null, "executedAt": null, "refundableUntil": null }
Legacy status | New API status | Note |
---|---|---|
INITIALIZED | Initialized | |
REJECTED | Failed | |
CANCELED | Cancelled | |
GRANTED | Accepted | |
CONFIRMED | - | This notion no longer exists. A legacy 'Confirmed' contract will be in 'Accepted' status on the new API. |
FINANCED | Executed | |
WITHDRAWN | Executed | A payment status will remained `Executed` when fully refunded. You can get the refunded amount with the `GetPayment` endpoint. |
DELETE/api/1.0/Contract/{contractReference}
Query parameters:
Body:
204
POST/payments/{paymentId}/cancel
Query parameters:
Body:
204
POST/api/1.0/Contract/{contractReference}/activate
Query parameters:
Body:
204
POST/payments/{paymentId}/execute
Query parameters:
Body:
204
PATCH/api/1.0/Contract/{contractReference}/withdraw
Query parameters:
Body:
{ "amount": 0 }
204
POST/refunds
Query parameters: -
Body:
{ "paymentId": "YPAY_0197613d-c0fd-4237-968a-19e25467d963", "idempotencyKey": "REFUND_ID_123456", "amount": 1400.56 }
204
POSTonCanceledWebhookUrl
POSTonGrantedWebhookUrl
POSTonActivateWebhookUrl
Headers parameters:
Body:
{ "contractReference": "string", "merchantReference": "string", "merchantOrderId": "string", "eventDate": "2019-08-24T14:15:22Z" }
POSTwebhookNotificationUrl
Headers parameters:
Body:
{ "type": "payment.updated", "notificationId": "5ef9f8e6-2bc0-456b-82d7-f028be989b33", "data": { "type": "payment", "paymentId": "YPAY_e99376c0-4d41-4155-b773-5f61b68bef6d", "status": "Executed", "updatedAt": "2024-12-26T18:39:42.9927602" }, "createdAt": "2024-12-26T18:39:47.3428149Z" }
POSTonWithdrawnWebhookUrl
Headers parameters:
Payload:
{ "contractReference": "string", "merchantReference": "string", "merchantOrderId": "string", "eventDate": "2019-08-24T14:15:22Z" }
POSTwebhookNotificationUrl
Headers parameters:
Payload:
{ "type": "refund.created", "notificationId": "5ef9f8e6-2bc0-456b-82d7-f028be989b33", "data": { "type": "refund", "paymentId": "YPAY_e99376c0-4d41-4155-b773-5f61b68bef6d", "reference": "CFR20241226RXG5R92_12345", "amount": 1500, "createdAt": "2024-12-26T18:39:54.7174841" }, "createdAt": "2024-12-26T18:39:47.3428149Z" }