Create Pay by link
The first step is to create a Pay by link via server-side call to Nemuru's Pay by link API. Make sure to get an access token before calling the POST Create Pay by link, as this request requires authentication.
POST
Create Pay by link
Request
Depending on the sector, there are different article attributes that might be relevant for the lender's credit decisioning. Highlighted lines in the following code blocks point out the main differences between one type of article and another.
POST /order/
Authorization: Bearer access_token
Content-Type: application/json
Check the API Reference for all the details about this request / response.
- Online product
- Accommodation
- Service
{
"product": "instalments",
"period": 3,
"onboarding_fulfilled_by": "pay_by_link",
"merchant": {
"order_reference_1": "7QuHQ5WVQQqyWVPW",
"order_reference_2": "14-922-1039",
"notification_url": "https://nemuru.free.beeceptor.com/callback",
"notification_auth": {
"authorization_header": "Basic bG9sOnNlY3VyZQ==",
"content_type": "application/json"
},
"notification_additional_payload": {
"cart": "h12837hg="
}
},
"customer": {
"first_name": "Alba",
"last_name": "Martinez Laguna",
"title": "ms",
"email": "alba.martinez@gmail.com",
"phone_number": "+34659723349",
"document_number": "55593310X",
"document_expiration_date": "2024-02-27T12:00:00+01:00",
"birth_date": "1982-11-03T12:00:00+01:00",
"nationality": "ESP",
"logged_in": false,
"locale": "es-ES",
"ip_address": "192.0.2.146",
"user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36"
},
"cart": {
"reference": "76t7y7sau8y398y",
"total_price_with_tax": 1500,
"currency": "EUR",
"items": [
{
"article": {
"name": "KIVIK 3-seat sofa",
// highlight-next-line
"type": "product",
"category": "physical",
"reference": "4912345678904",
"unit_price_with_tax": 875,
"description": "3-seat sofa, with chaise longue/Hillared anthracite",
"brand": "the-ikea-brand",
"mpn": "AD6654412-334.22",
"url": "https://www.ikea.com/ie/en/p/kivik-3-seat-sofa-with-chaise-longue-hillared-anthracite-s89193665/",
"image_url": "https://www.ikea.com/ie/en/p/kivik-3-seat-sofa-with-chaise-longue-hillared-anthracite-s89193665/"
},
"units": 1,
"total_discount": 0,
"total_price_with_tax": 875,
"auto_shipping": true
},
{
"article": {
"name": "EKEDALEN / EKEDALEN Bar table and 4 bar stools",
// highlight-next-line
"type": "product",
"category": "physical",
"reference": "5930423178914",
"unit_price_with_tax": 625,
"description": "Bar table and 4 bar stools, white/Ramna light grey120 cm"
},
"units": 1,
"total_discount": 0,
"total_price_with_tax": 625
}
]
},
"billing": {
"first_name": "Alba",
"last_name": "Martinez",
"email": "alba.martinez@gmail.com",
"phone_number": "+34659723349",
"company": "EL DON TRESILLO CATALAN SL",
"corporate_id_number": "A35628221",
"address": {
"street_address": "Pl. de Pau Vila, 1",
"street_address_2": "Planta 1A",
"postal_code": "08003",
"city": "Barcelona",
"country": "ESP"
}
}
}
{
"product": "split_pay",
"onboarding_fulfilled_by": "pay_by_link",
"merchant": {
"order_reference_1": "d2e45d83-b2f1-40ae-9587-fa4222587ecf",
"order_reference_2": "14-922-1039",
"notification_url": "https://nemuru.free.beeceptor.com/callback",
"notification_auth": {
"authorization_header": "Basic bG9sOnNlY3VyZQ==",
"content_type": "application/json"
},
"notification_additional_payload": {
"cart": "h12837hg="
}
},
"customer": {
"first_name": "Alberto",
"last_name": "Pérez Ortiz",
"title": "mr",
"email": "alberto.perez@gmail.com",
"phone_number": "+34659723349",
"document_number": "43918281B",
"document_expiration_date": "2025-02-27T12:00:00+01:00",
"birth_date": "1990-11-03T12:00:00+01:00",
"nationality": "ESP",
"logged_in": false,
"locale": "es-ES",
"ip_address": "192.0.2.146",
"user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36"
},
"cart": {
"reference": "75019830hh1i2h38",
"total_price_with_tax": 420.0,
"currency": "EUR",
"items": [
{
"article": {
"name": "Sol Port Cambrils",
// highlight-next-line
"type": "accommodation",
"category": "physical",
"reference": "591234557679812",
"unit_price_with_tax": 420.0,
"description": "Sol Port Cambrils - 1x HABITACIÓN STANDARD (3 noches, 2 adultos)",
// highlight-start
"checkin_date": "2022-05-01T12:00:00+00:00",
"checkout_date": "2022-05-04T12:00:00+00:00",
"establishment_name": "Sol Port Cambrils",
"address": {
"street_address": "Rambla Regueral, 11",
"street_address_2": null,
"postal_code": "43850",
"city": "Cambrils",
"country": "ESP"
},
"guests": 2,
// highlight-end
"url": "https://www.melia.com/es/hoteles/espana/cambrils/sol-port-cambrils/habitacion-tryp.htm",
"image_url": "https://www.melia.com/dam/jcr:a96dbc18-d758-41e0-a…6d/11atrypportcambrils-tryproomdouble1600x785.jpg"
},
"units": 1,
"total_discount": 0,
"total_price_with_tax": 420.0,
"auto_shipping": true
}
]
}
}
{
"product": "split_pay",
"onboarding_fulfilled_by": "pay_by_link",
"merchant": {
"order_reference_1": "fcfd5fd2-f07b-11ec-8ea0-0242ac120002",
"order_reference_2": "9479598725",
"notification_url": "https://nemuru.free.beeceptor.com/callback",
"notification_auth": {
"authorization_header": "Basic bG9sOnNlY3VyZQ==",
"content_type": "application/json"
}
},
"customer": {
"first_name": "Marina",
"last_name": "Montero Espejo",
"title": "ms",
"email": "marinamos12@gmail.com",
"phone_number": "+34659123199",
"nationality": "ESP",
"logged_in": false,
"locale": "es-ES",
"ip_address": "192.0.2.146",
"user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36"
},
"cart": {
"reference": "947959872517391",
"total_price_with_tax": 325.0,
"currency": "EUR",
"items": [
{
"article": {
"name": "Servicio de mantenimiento anual",
// highlight-next-line
"type": "service",
"category": "physical",
"reference": "9479598725",
"unit_price_with_tax": 325.0,
"description": "Servicio de mantenimiento anual",
// highlight-start
"start_date": "2023-12-25T14:25:00+01:00",
"end_date": "2024-06-25T16:45:00+01:00"
// highlight-end
},
"units": 1,
"total_discount": 0,
"total_price_with_tax": 325.0,
"auto_shipping": true
}
]
}
}
Response
Response Headers
Date: Thu, 24 Mar 2022 18:20:46 GMT
Content-Type: application/json
...
Id: 41c325c0-161c-43d6-bb4f-65f6b50b9ba0
Url: https://pay.nemuru.com?id=41c325c0-161c-43d6-bb4f-65f6b50b9ba0
It is important to save the order id returned within the header of a successful response (key Id
). This order id should be used in subsequent requests to link them to this particular order; this id will also be included in the notifications that Nemuru sends to your system (notification_url
) for order status changes, etc. Additionally, the key Url
contains the payment url that you could share or redirect your customer to.