주문 플로우
플로우 만들기
`presetKey`를 주면 프리셋을 복사해 초안을 연다(설치 뒤 프리셋과 연결되지 않는다). 키가 겹치면 409 `FLOW_KEY_TAKEN`.
POST
presetKey를 주면 프리셋을 복사해 초안을 연다(설치 뒤 프리셋과 연결되지 않는다). 키가 겹치면 409 FLOW_KEY_TAKEN.
accessTokenheader
AuthorizationBearer <token>Sayren 계정 토큰(로그인 토큰 또는 개인 액세스 토큰, RFC 9068 JWT)
X-Store-Id*string대상 상점 id. 토큰의 상점 범위 밖이면 403 STORE_NOT_GRANTED, 없으면 400 STORE_ID_REQUIRED다
application/json- body
key*string상점 안 유일한 키(소문자·숫자·하이픈)
Match
^[a-z][a-z0-9-]{1,48}$name?stringLength
1 <= length <= 60presetKey?string출발한 프리셋(출처로 남는다). 없으면 빈 플로우
graph?편집기에서 고친 그래프(#115). 없으면 프리셋 그래프 그대로, 프리셋도 없으면 빈 흐름(결제 완료 노드 하나)이다
definition?흐름 설정 requires(progression·groupClaim·fulfillmentMethods). 없으면 프리셋의 설정
variables?쓰지 않는다(무시). 값은 그래프의 노드 설정 안에 있다(#115)
성공
application/json- response
meta*data*error*|nullcurl -X POST 'https://api.sayren.io/v1/commerce-flows' \ -H 'X-Store-Id: string' \ -H 'Content-Type: application/json' \ -d '{ "key": "string"}'{ "meta": { "status": 201, "code": "OK", "message": "OK", "isSuccess": true }, "data": { "flowId": "string", "key": "string", "name": "string", "progression": "ITEM", "fulfillmentMethods": [ "string" ], "presetKey": "string", "presetVersion": 0, "activeVersion": 0, "defaultFor": "SHIPPING", "archivedAt": "string", "createdAt": "string", "updatedAt": "string", "draft": { "version": 0, "status": "DRAFT", "revision": 0, "graph": { "property1": null, "property2": null }, "definition": { "property1": null, "property2": null }, "variables": { "property1": null, "property2": null }, "publishedAt": "string" }, "active": { "version": 0, "status": "DRAFT", "revision": 0, "graph": { "property1": null, "property2": null }, "definition": { "property1": null, "property2": null }, "variables": { "property1": null, "property2": null }, "publishedAt": "string" }, "versions": [ { "version": 0, "status": "DRAFT", "publishedAt": "string", "inProgress": 0 } ] }, "error": null}