Ödemeyi başlat
POST
/api/payments/orders/{id}/session
const url = 'https://api.petanqueai.com/api/payments/orders/example/session';const options = { method: 'POST', headers: { 'x-storefront-token': '<x-storefront-token>', 'Content-Type': 'application/json' }, body: '{"buyer":{"name":"example","surname":"example","identityNumber":"example","email":"hello@example.com","gsmNumber":"example","registrationAddress":"example","city":"example","country":"example","zipCode":"example"},"shippingAddress":{"contactName":"example","address":"example","city":"example","country":"example","zipCode":"example"},"billingAddress":{"contactName":"example","address":"example","city":"example","country":"example","zipCode":"example"},"returnUrl":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.petanqueai.com/api/payments/orders/example/session \ --header 'Content-Type: application/json' \ --header 'x-storefront-token: <x-storefront-token>' \ --data '{ "buyer": { "name": "example", "surname": "example", "identityNumber": "example", "email": "hello@example.com", "gsmNumber": "example", "registrationAddress": "example", "city": "example", "country": "example", "zipCode": "example" }, "shippingAddress": { "contactName": "example", "address": "example", "city": "example", "country": "example", "zipCode": "example" }, "billingAddress": { "contactName": "example", "address": "example", "city": "example", "country": "example", "zipCode": "example" }, "returnUrl": "example" }'AWAITING_PAYMENT durumundaki bir sipariş için iyzico ödeme formu açar. Tutar her zaman siparişten gelir. Formu checkoutFormContent’i (base64 HTML) sayfaya gömerek ya da paymentPageUrl’e yönlendirerek gösterin; oturum yaklaşık 30 dakikada sona erer.
Ödemeden sonra iyzico müşteriyi sonuna ?orderId=… eklenmiş returnUrl’inize geri gönderir. Kökeni izin verilen kökenleriniz arasında olmalıdır. Bu adres sonucu taşımaz: sonucu Ödeme durumunu getir ile okuyun.
Bunu yeniden çağırmak yeni bir oturum açar; reddedilen bir kart böyle yeniden denenir. Sipariş zaten ödenmişse 409; iyzico reddederse sebebi mesajda olan 422.
Yetkilendirmeler
Bölüm başlığı “Authorizations”Parametreler
Bölüm başlığı “Parameters”Yol parametreleri
Bölüm başlığı “Path Parameters”id
zorunlu
string
İstek gövdesizorunlu
Bölüm başlığı “Request Bodyrequired”object
buyer
zorunlu
object
name
zorunlu
string
surname
zorunlu
string
identityNumber
zorunlu
string
email
zorunlu
string biçim: email
gsmNumber
zorunlu
string
registrationAddress
zorunlu
string
city
zorunlu
string
country
string
zipCode
string
shippingAddress
zorunlu
object
contactName
zorunlu
string
address
zorunlu
string
city
zorunlu
string
country
string
zipCode
string
billingAddress
object
contactName
zorunlu
string
address
zorunlu
string
city
zorunlu
string
country
string
zipCode
string
returnUrl
string
Example generated
{ "buyer": { "name": "example", "surname": "example", "identityNumber": "example", "email": "hello@example.com", "gsmNumber": "example", "registrationAddress": "example", "city": "example", "country": "example", "zipCode": "example" }, "shippingAddress": { "contactName": "example", "address": "example", "city": "example", "country": "example", "zipCode": "example" }, "billingAddress": { "contactName": "example", "address": "example", "city": "example", "country": "example", "zipCode": "example" }, "returnUrl": "example"}object
buyer
zorunlu
object
name
zorunlu
string
surname
zorunlu
string
identityNumber
zorunlu
string
email
zorunlu
string biçim: email
gsmNumber
zorunlu
string
registrationAddress
zorunlu
string
city
zorunlu
string
country
string
zipCode
string
shippingAddress
zorunlu
object
contactName
zorunlu
string
address
zorunlu
string
city
zorunlu
string
country
string
zipCode
string
billingAddress
object
contactName
zorunlu
string
address
zorunlu
string
city
zorunlu
string
country
string
zipCode
string
returnUrl
string
Example generated
name=example&surname=example&identityNumber=example&email=hello%40example.com&gsmNumber=example®istrationAddress=example&city=example&country=example&zipCode=example&contactName=example&address=example&city=example&country=example&zipCode=example&contactName=example&address=example&city=example&country=example&zipCode=example&returnUrl=exampleobject
buyer
zorunlu
object
name
zorunlu
string
surname
zorunlu
string
identityNumber
zorunlu
string
email
zorunlu
string biçim: email
gsmNumber
zorunlu
string
registrationAddress
zorunlu
string
city
zorunlu
string
country
string
zipCode
string
shippingAddress
zorunlu
object
contactName
zorunlu
string
address
zorunlu
string
city
zorunlu
string
country
string
zipCode
string
billingAddress
object
contactName
zorunlu
string
address
zorunlu
string
city
zorunlu
string
country
string
zipCode
string
returnUrl
string