ArgusDocs
English Türkçe

Customers and order details

On this page

Tell us who pays and what they buy: billing details, saved customers, the shipping address and line items.

Billing details

Every card payment needs billing details, unless your payment institution has exempted your account. Send them in payment_method_data.billing_details when you create or confirm a payment. The required fields are name, address.line1, address.city and address.country (ISO 3166 alpha-2, for example TR).

{
  "name": "Ayşe Yılmaz",
  "email": "ayse.yilmaz@example.com",
  "phone": "+905321234567",
  "address": {
    "line1": "Caferağa Mah. Moda Cad. No:12",
    "city": "Kadıköy",
    "state": "İstanbul",
    "postal_code": "34710",
    "country": "TR"
  }
}

For Turkish addresses, state is the province (il) and city the district (ilçe). On live, a payment without the required fields is refused with 400 billing_details_required. In the sandbox it goes through, and the request gets a warning on the Logs page in the Developers menu.

Customers

Save the people who buy from you more than once, and reuse their details on later payments.

{
  "email": "ayse.yilmaz@example.com",
  "name": "Ayşe Yılmaz",
  "phone": "+905321234567",
  "address": {
    "line1": "Caferağa Mah. Moda Cad. No:12",
    "city": "Kadıköy",
    "state": "İstanbul",
    "postal_code": "34710",
    "country": "TR"
  },
  "tax_id": "10000000146",
  "preferred_locales": ["tr-TR"],
  "metadata": {"crm_id": "C-2210"}
}
curl -X POST https://api.pf.organizer.tr/v1/customers \
  -H "Authorization: Bearer sk_sandbox_YOUR_KEY" \
  -H "Idempotency-Key: customer-C-2210" \
  -H "Content-Type: application/json" \
  -d '{"email": "ayse.yilmaz@example.com", "name": "Ayşe Yılmaz"}'
{
  "id": "cus_01J9ZQ9D3F5H7K9M2P4R6T8W1Y",
  "object": "customer",
  "email": "ayse.yilmaz@example.com",
  "name": "Ayşe Yılmaz",
  "phone": "+905321234567",
  "address": {
    "line1": "Caferağa Mah. Moda Cad. No:12",
    "city": "Kadıköy",
    "state": "İstanbul",
    "postal_code": "34710",
    "country": "TR"
  },
  "tax_id": {"type": "tr_tckn", "masked": "*********46"},
  "preferred_locales": ["tr-TR"],
  "metadata": {"crm_id": "C-2210"},
  "created": 1795167000
}

Shipping

Add the delivery address when you ship goods:

{
  "name": "Ayşe Yılmaz",
  "phone": "+905321234567",
  "address": {"line1": "Caferağa Mah. Moda Cad. No:12", "city": "Kadıköy", "state": "İstanbul", "country": "TR"},
  "carrier": "Yurtiçi Kargo",
  "tracking_number": "YK1234567890"
}

Line items

Line items describe the basket. Each item is a product from your catalog (/v1/products) or an inline price_data, with a quantity. The items must add up to the payment's amount. You can send up to 100 items. Your payment institution can require line items on live: a payment without them is then refused with 400 line_items_required. In the sandbox it only adds a warning to the request log.

{
  "amount": 35000,
  "currency": "try",
  "confirm": true,
  "customer": "cus_01J9ZQ9D3F5H7K9M2P4R6T8W1Y",
  "billing_details_from_customer": true,
  "payment_method": "pm_01J9ZQA2B4C6D8E1F3G5H7J9K2",
  "return_url": "https://modakitabevi.com.tr/odeme/sonuc",
  "line_items": [
    {"price_data": {"unit_amount": 10000, "product_data": {"name": "Ajanda 2027", "type": "physical", "category": "Kırtasiye", "sku": "KRT-0107"}}, "quantity": 2},
    {"product": "prod_01J9ZQB5C7D9F2H4K6M8P1R3T5", "quantity": 1}
  ],
  "shipping": {
    "name": "Ayşe Yılmaz",
    "address": {"line1": "Caferağa Mah. Moda Cad. No:12", "city": "Kadıköy", "country": "TR"}
  },
  "metadata": {"order_id": "SIP-2026-10458"}
}

Here 2 × 10000 + 1 × 15000 (the product's price) = 35000. If the sum does not match amount, the call returns 400 line_items_amount_mismatch. Read the items back with GET /v1/payment_intents/{id}/line_items.

Metadata

Payments, refunds, customers, products, payment links, top-ups and payouts take metadata. You can store up to 50 keys of up to 40 characters each. Values are strings of up to 500 characters. Use it for your own ids, never for card or personal data.

In the API reference

Next: Create payments for a customer with Card payments and 3D Secure, or ask for a payment with Payment links.