복잡한 시나리오
예제 #1
이 시나리오에서 카트 항목은 만료 타이머와 함께 생성됩니다. 예를 들어 모바일 앱 기능에 대한 임시 액세스가 될 수 있습니다. 그런 다음 고객은 임시 타이머가 만료되기 전에 PRO 버전으로 업그레이드하려고 합니다. PRO 버전은 기능을 무제한으로 사용할 수 있음을 의미합니다. 이를 달성하는 한 가지 방법은 항목 타이머를 중지하고 무제한 타이머가 있는 새 카트를 등록하는 것입니다.
init
(타이머를 설정하다)
- 요청
- 응답
{
"cartId": "6f891edb-1e1f-48bb-b042-2cb790a0f402",
"customerId": "8d7d8181-b4bf-49bb-b732-d498d15dc5cc",
"currency": "XAU",
"items": [
{
"bloodlust": {
"amount": 100,
"enableTimer": true,
"timer": {
"triggerEvent": "completed",
"value": 259200
}
}
}
],
"paymentForm": {
"deliveryOption": "redirect",
"value": "https://test.com/payment"
}
}
{
"cartId": "6f891edb-1e1f-48bb-b042-2cb790a0f402",
"code": "000000",
"message": "Success",
"timestamp": "2025-04-23T18:25:43.511Z"
}
status
(선택 과목)
- 요청
- 응답
curl -L 'https://api.omnicart.scripsi.io/status/:6f891edb-1e1f-48bb-b042-2cb790a0f402' \
-H 'Accept: application/json' \
-H 'Api-Access-Token: <Api-Access-Token>'
{
"data": {
"cartId": "6f891edb-1e1f-48bb-b042-2cb790a0f402",
"customerId": "8d7d8181-b4bf-49bb-b732-d498d15dc5cc",
"currency": "XAU",
"totalAmounts": {
"initiated": 100,
"captured": 100,
"refunded": 0,
"current": 100
},
"items": [
{
"bloodlust": {
"paymentStatus": "completed",
"itemAmounts": {
"initiated": 100,
"captured": 100,
"refunded": 0,
"current": 100
},
"paymentSnapshot": {
"amount": 100
},
"timerSnapshot": {
"triggerEvent": "completed",
"timerStatus": "started",
"remainingSecs": 169387
}
}
}
]
},
"code": "000000",
"message": "Success",
"timestamp": "2025-04-23T18:25:43.511Z"
}
modify
(타이머를 멈추다)
- 요청
- 응답
{
"cartId": "6f891edb-1e1f-48bb-b042-2cb790a0f402",
"modifyBox": {
"customerId": "8d7d8181-b4bf-49bb-b732-d498d15dc5cc",
"items": [
{
"bloodlust": {
"modifyTimer": {
"manualAction": "stop"
}
}
}
]
}
}
{
"code": "000000",
"message": "Success",
"timestamp": "2025-04-23T18:25:43.511Z"
}
init
(새로운 타이머를 설정하다
- 요청
- 응답
{
"cartId": "998090f3-e1a3-446b-b503-c41ad9ee546a",
"customerId": "8d7d8181-b4bf-49bb-b732-d498d15dc5cc",
"currency": "XAU",
"items": [
{
"bloodlust": {
"amount": 10000,
"enableTimer": true,
"timer": {
"triggerEvent": "completed",
"value": 0
}
}
}
],
"paymentForm": {
"deliveryOption": "redirect",
"value": "https://test.com/payment"
}
}
{
"cartId": "998090f3-e1a3-446b-b503-c41ad9ee546a",
"code": "000000",
"message": "Success",
"timestamp": "2025-04-23T18:25:43.511Z"
}
예제 #2
이 시나리오에는 승인 후 태그를 재할당하고, 선택한 항목을 캡처하고, 캡처 기간이 만료되고, 부분 환불이 포함됩니다.
init
- 요청
- 응답
{
"cartId": "6f891edb-1e1f-48bb-b042-2cb790a0f402",
"currency": "XAU",
"scope": {
"cart": {
"paymentBox": {
"amountMode": "calculated",
"capture": true,
"captureSettings": {
"autoAction": "complete",
"value": 172800
}
}
},
},
"items": [
{
"marksman": {
"tag": "shield",
"amount": 150,
"quantity": 18
}
},
{
"zealot": {
"tag": "shield",
"amount": 450,
"quantity": 6
}
{
"archangel": {
"tag": "shield",
"amount": 5000,
"quantity": 2
}
}
],
"paymentForm": {
"deliveryOption": "redirect",
"value": "https://test.com/payment"
}
}
{
"cartId": "6f891edb-1e1f-48bb-b042-2cb790a0f402",
"code": "000000",
"message": "Success",
"timestamp": "2025-04-23T18:25:43.511Z"
}
status
(선택 과목)
- 요청
- 응답
curl -L 'https://api.omnicart.scripsi.io/status/:6f891edb-1e1f-48bb-b042-2cb790a0f402' \
-H 'Accept: application/json' \
-H 'Api-Access-Token: <Api-Access-Token>'
{
"data": {
"cartId": "6f891edb-1e1f-48bb-b042-2cb790a0f402",
"currency": "XAU",
"totalAmounts": {
"initiated": 15400,
"captured": 0,
"refunded": 0,
"current": 15400
},
"items": [
{
"marksman": {
"paymentStatus": "authorized",
"itemAmounts": {
"initiated": 2700,
"captured": 0,
"refunded": 0,
"current": 2700
},
"tag": "shield",
"paymentSnapshot": {
"amount": 150,
"amountMode": "calculated",
"quantity": 18,
}
}
},
{
"zealot": {
"paymentStatus": "authorized",
"itemAmounts": {
"initiated": 2700,
"captured": 0,
"refunded": 0,
"current": 2700
},
"tag": "shield",
"paymentSnapshot": {
"amount": 450,
"amountMode": "calculated",
"quantity": 6,
}
}
},
{
"archangel": {
"paymentStatus": "authorized",
"itemAmounts": {
"initiated": 10000,
"captured": 0,
"refunded": 0,
"current": 10000
},
"tag": "shield",
"paymentSnapshot": {
"amount": 5000,
"amountMode": "calculated",
"quantity": 2,
}
}
}
]
},
"code": "000000",
"message": "Success",
"timestamp": "2025-04-23T18:25:43.511Z"
}
status
(선택 과목)
- 요청
- 응답
curl -L 'https://api.omnicart.scripsi.io/status/:6f891edb-1e1f-48bb-b042-2cb790a0f402' \
-H 'Accept: application/json' \
-H 'Api-Access-Token: <Api-Access-Token>'
{
"data": {
"cartId": "6f891edb-1e1f-48bb-b042-2cb790a0f402",
"currency": "XAU",
"totalAmounts": {
"initiated": 15400,
"captured": 0,
"refunded": 0,
"current": 15400
},
"items": [
{
"marksman": {
"paymentStatus": "authorized",
"itemAmounts": {
"initiated": 2700,
"captured": 0,
"refunded": 0,
"current": 2700
},
"tag": "slow",
"paymentSnapshot": {
"amount": 150,
"amountMode": "calculated",
"quantity": 18,
}
}
},
{
"zealot": {
"paymentStatus": "authorized",
"itemAmounts": {
"initiated": 2700,
"captured": 0,
"refunded": 0,
"current": 2700
},
"tag": "shield",
"paymentSnapshot": {
"amount": 450,
"amountMode": "calculated",
"quantity": 6,
}
}
},
{
"archangel": {
"paymentStatus": "authorized",
"itemAmounts": {
"initiated": 10000,
"captured": 0,
"refunded": 0,
"current": 10000
},
"tag": "shield",
"paymentSnapshot": {
"amount": 5000,
"amountMode": "calculated",
"quantity": 2,
}
}
}
]
},
"code": "000000",
"message": "Success",
"timestamp": "2025-04-23T18:25:43.511Z"
}
status
(선택 과목)
- 요청
- 응답
curl -L 'https://api.omnicart.scripsi.io/status/:6f891edb-1e1f-48bb-b042-2cb790a0f402' \
-H 'Accept: application/json' \
-H 'Api-Access-Token: <Api-Access-Token>'
{
"data": {
"cartId": "6f891edb-1e1f-48bb-b042-2cb790a0f402",
"currency": "XAU",
"totalAmounts": {
"initiated": 15400,
"captured": 12700,
"refunded": 0,
"current": 0
},
"items": [
{
"marksman": {
"paymentStatus": "canceled",
"itemAmounts": {
"initiated": 2700,
"captured": 0,
"refunded": 0,
"current": 0
},
"tag": "slow",
"paymentSnapshot": {
"amount": 150,
"amountMode": "calculated",
"quantity": 18,
}
}
},
{
"zealot": {
"paymentStatus": "completed",
"itemAmounts": {
"initiated": 2700,
"captured": 0,
"refunded": 0,
"current": 2700
},
"tag": "shield",
"paymentSnapshot": {
"amount": 450,
"amountMode": "calculated",
"quantity": 6,
}
}
},
{
"archangel": {
"paymentStatus": "completed",
"itemAmounts": {
"initiated": 10000,
"captured": 0,
"refunded": 0,
"current": 10000
},
"tag": "shield",
"paymentSnapshot": {
"amount": 5000,
"amountMode": "calculated",
"quantity": 2,
}
}
}
]
},
"code": "000000",
"message": "Success",
"timestamp": "2025-04-23T18:25:43.511Z"
}
modify
(부분 환불)
- 요청
- 응답
{
"cartId": "6f891edb-1e1f-48bb-b042-2cb790a0f402",
"modifyBox": {
"items": [
{
"archangel": {
"tag": "anti-magic",
}
},
{
"zealot": {
"tag": "armageddon",
"modifyAmount": {
"quantity": 1
}
}
}
]
}
}
{
"data": {
"modifiedAmounts": [
"zealot"
]
},
"code": "000000",
"message": "Success",
"timestamp": "2025-04-23T18:25:43.511Z"
}
status
(선택 과목)
- 요청
- 응답
curl -L 'https://api.omnicart.scripsi.io/status/:6f891edb-1e1f-48bb-b042-2cb790a0f402' \
-H 'Accept: application/json' \
-H 'Api-Access-Token: <Api-Access-Token>'
{
"data": {
"cartId": "6f891edb-1e1f-48bb-b042-2cb790a0f402",
"currency": "XAU",
"totalAmounts": {
"initiated": 15400,
"captured": 12700,
"refunded": 2250,
"current": 10450
},
"items": [
{
"marksman": {
"paymentStatus": "canceled",
"itemAmounts": {
"initiated": 2700,
"captured": 0,
"refunded": 0,
"current": 0
},
"tag": "slow",
"paymentSnapshot": {
"amount": 150,
"amountMode": "calculated",
"quantity": 18,
}
}
},
{
"zealot": {
"paymentStatus": "completed",
"itemAmounts": {
"initiated": 2700,
"captured": 2700,
"refunded": 2250,
"current": 450
},
"tag": "armageddon",
"paymentSnapshot": {
"amount": 450,
"amountMode": "calculated",
"quantity": 1,
}
}
},
{
"archangel": {
"paymentStatus": "completed",
"itemAmounts": {
"initiated": 10000,
"captured": 0,
"refunded": 0,
"current": 10000
},
"tag": "anti-magic",
"paymentSnapshot": {
"amount": 5000,
"amountMode": "calculated",
"quantity": 2,
}
}
}
]
},
"code": "000000",
"message": "Success",
"timestamp": "2025-04-23T18:25:43.511Z"
}