create_refund_link
POST  -- Create a refund link for a payment
| Argument | Description | Type - Length | Example | Mandatory |
|---|---|---|---|---|
| reference | Refund reference | String - 32 | YES | |
| shop_reference | Campaign reference | String - 32 | YES | |
| campaign_reference | Campaign reference | String - 32 | NO | |
| safedebit_consumer_reference | Safedebit consumer reference | String - 35 | NO *** | |
| last_name | Consumer last name | String - 64 | NO | |
| first_name | Consumer first name | String - 64 | NO | |
| Consumer e-mail | String - 64 | YES * | ||
| phone_number | Consumer phone | String - 64 | YES * | |
| amount | Amount (in cents) | String - 11 | YES | |
| motif | Reason of levy | String - 64 | NO | |
| street_number | Street number | String - 5 | NO | |
| street_name | Road name | String - 64 | NO | |
| postal_code | Zip code | String - 5 | NO | |
| city | Town/place | String - 64 | NO | |
| country | Country | String - 64 | NO | |
| sms_template | Text received by the consumer on his phone | String - 64 | YES ** | |
| email_template | Text received by the consumer by mail | String - 64 | YES ** | |
| send_by_email | Text received by the consumer by mail | Integer - 1 |
Options for sending refund link by e-mail (1: yes, 0: no) |
YES * |
| send_by_sms | Text received by the consumer by mail | Integer - 1 |
Options for sending SMS refund link (1: yes, 0: no) |
YES * |
** Must be filled if sending
*** The Safedebit consumer reference is generated once the customer is created in our system. Once created, you can use the Safedebit consumer reference directly instead of entering all the customer information.
Request
POST /xxxx/create_refund_link HTTP/1.1
Host: xxx.xxxxxxxx.fr
Authorization: Basic JQheySHkalSNuakkmSmm==
Content-Type: application/json
Accept: application/json
{
"reference": "TEST-1",
"shop_reference": "SHOP-123",
"campaign_reference": "CAMPAING-1",
"last_name": "Foo",
"first_name": "Bar",
"mail": "foo.bar@mail.com",
"phone_number": "0600000000",
"amount": "1000",
"motif": "Remboursement",
"street_number": "25",
"street_name": "Rue Louis Legrand",
"postal_code": "75002",
"city": "Paris",
"country": "FR",
"sms_template": "Hello, this is the link : ",
"email_template": "Bonjour, voici le lien : "}
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"result": false,
"link": "https://xxxxxxxx.fr/xxxxx",
"safedebit_consumer_reference": "xxxxxx"
}
Response
HTTP/1.1 400
Content-Type: application/json
{
"result": false,
"errors": {
"reference": "Un paiement de remboursement avec la référence TEST-1 existe déjà.",
"amount": "Le champ amount est manquant dans le tableau de données."
}
}