Skip to main content

Send Warranty with Invoice

You can send warranties with invoice information using this service. This is the most flexible endpoint that allows creating products on-the-fly and supports extended warranties.

Important - externalLineId

The externalLineId should be a unique value in your system for each line item.

Customer Information

The email and phone values are not mandatory, but it's recommended to provide at least one. If neither is provided, the system will generate unique values for the customer record.

Serial Number

If serialNumber is provided, the combination of merchantCode, productCode, and serialNumber must be unique. Duplicate submissions will result in an error.

Product Creation Logic
  1. If productCode is provided and exists → warranty is created for existing product
  2. If productCode is provided but doesn't exist → new product is created, then warranty
  3. If no productCode but brand and name provided → new product is created with defaults
  4. If none of the above → error is returned
  5. If insuranceId is not provided → extended warranty will not be created

Request

curl --location --request POST '<BASE_URL>/individual-customers/warranty/invoice/with-product-code' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <jwtToken>' \
--data '{
"externalOrderId": "ORD-12345",
"customer": {
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"phone": "+905551234567",
"birthDate": "15-06-1990",
"identificationNumber": "12345678901",
"countryCode": "TR",
"additionalText": "VIP Customer"
},
"products": [
{
"productCode": "PRD-001",
"name": "iPhone 15 Pro",
"brand": "Apple",
"externalLineId": "LINE-001",
"productPrice": 49999.99,
"purchaseDate": "15-01-2024 10:30",
"warrantyExpireDate": "15-01-2026 10:30",
"extendedWarranties": [
{
"insuranceId": 1,
"insuranceName": "2 Year Extended Warranty",
"insurancePrice": 999.99,
"storeCode": "STR-001",
"storeName": "Tech Store Istanbul",
"personalName": "John Smith",
"personalCode": "EMP-123",
"taxNo": "1234567890",
"refId": "REF-001"
}
]
},
{
"productCode": "PRD-002",
"name": "AirPods Pro",
"brand": "Apple",
"externalLineId": "LINE-002",
"productPrice": 7999.99,
"purchaseDate": "15-01-2024 10:30"
}
]
}'
Phone Number Formats

Acceptable formats:

  • 544 333 22 11
  • 5443332211
  • +905443332211
  • 905443332211
  • 05443332211
Date Formats
  • purchaseDate and warrantyExpireDate: dd-MM-yyyy HH:mm (e.g., 01-01-2023 00:00)
  • birthDate: dd-MM-yyyy (e.g., 01-01-1990)

Default behaviors:

  • If purchaseDate is not provided → today's date
  • If warrantyExpireDate is not provided → calculated from product's warranty period
  • If birthDate is not provided → current date

Request Body

Root Object
ParameterTypeRequired
Description
externalOrderIdStringYesExternal order ID (e.g., "ORD-12345")
customerObjectYesCustomer information object
productsArrayYesArray of product objects (1-50 items)
Customer Object
ParameterTypeRequired
Description
firstNameStringYesCustomer first name (e.g., "John")
lastNameStringYesCustomer last name (e.g., "Doe")
emailStringNoCustomer email (e.g., "john.doe@example.com")
phoneStringNoCustomer phone (e.g., "+905551234567")
countryCodeEnumNoCountry code (e.g., "TR")
identificationNumberStringNoNational ID number (e.g., "12345678901")
birthDateStringNoBirth date (format: dd-MM-yyyy)
additionalTextStringNoAdditional notes about customer
Product Object
ParameterTypeRequired
Description
productCodeStringNo*Unique product code (e.g., "PRD-001")
nameStringNo*Product name (e.g., "iPhone 15 Pro")
brandStringNo*Brand name (e.g., "Apple")
serialNumberStringNoProduct serial number (e.g., "SN123456789")
externalLineIdStringNoLine item ID (e.g., "LINE-001")
productPriceDoubleNoProduct price (e.g., 49999.99)
purchaseDateStringNoPurchase date (format: dd-MM-yyyy HH:mm)
warrantyExpireDateStringNoWarranty expiration (format: dd-MM-yyyy HH:mm)
extendedWarrantiesArrayNoArray of extended warranty objects

*Either productCode OR (name AND brand) is required.

Extended Warranty Object
ParameterTypeRequired
Description
insuranceIdIntegerNo*Insurance plan ID (required for extended warranty)
insuranceNameStringNoPlan name (e.g., "2 Year Extended Warranty")
insurancePriceDoubleNoPlan price (e.g., 999.99)
storeCodeStringNoStore code (e.g., "STR-001")
storeNameStringNoStore name (e.g., "Tech Store Istanbul")
personalNameStringNoSalesperson name (e.g., "John Smith")
personalCodeStringNoSalesperson code (e.g., "EMP-123")
taxNoStringNoTax number (e.g., "1234567890")
refIdStringNoReference ID (e.g., "REF-001")

*If insuranceId is not provided, extended warranty will not be created.

Country Code Enum
TR  // Turkey
US // United States
DE // Germany
GB // United Kingdom
AE // United Arab Emirates
NL // Netherlands
FR // France
UZ // Uzbekistan

Response

{
"individualCustomerProductResponseList": [
{
"id": 12345,
"lineId": "LINE-001"
},
{
"id": 12346,
"lineId": "LINE-002"
}
]
}

Example - Simple Invoice

{
"externalOrderId": "INV-2024-0001",
"customer": {
"firstName": "Ahmet",
"lastName": "Yilmaz",
"email": "ahmet@example.com",
"phone": "5321234567",
"countryCode": "TR"
},
"products": [
{
"productCode": "LAPTOP-001",
"externalLineId": "L1",
"productPrice": 25000.00,
"purchaseDate": "20-01-2024 14:30"
}
]
}

Example - Invoice with Extended Warranty

{
"externalOrderId": "INV-2024-0002",
"customer": {
"firstName": "Ayse",
"lastName": "Demir",
"email": "ayse@example.com",
"phone": "5339876543",
"countryCode": "TR",
"identificationNumber": "98765432101"
},
"products": [
{
"productCode": "TV-SAMSUNG-55",
"name": "Samsung 55 inch 4K TV",
"brand": "Samsung",
"externalLineId": "L1",
"productPrice": 35000.00,
"extendedWarranties": [
{
"insuranceId": 5,
"insuranceName": "3 Year Protection Plan",
"insurancePrice": 2500.00,
"storeCode": "STORE-IST-01",
"storeName": "MediaMarkt Istinye"
}
]
}
]
}