sayren Docs
상점 설정

PG 사용 여부·샌드박스 스위치·간편결제 변경

PG를 켜거나 끄고(`enabled`), 샌드박스 스위치(`sandboxMode`)와 이 PG로 받는 간편결제사(`easyPayProviders`)를 바꾼다. 셋 중 하나 이상을 보낸다. 켠 간편결제사마다 스토어프론트 결제 옵션이 생긴다. 끈 PG는 새 결제에 쓰이지 않지만, 이미 그 PG로 승인된 결제의 취소·환불은 계속 그 PG로 처리된다. `sandboxMode: false`(라이브 전환)는 `liveGate.conditions`를 모두 충족해야 한다 — 테스트 키 연결 테스트 성공, 지금 테스트 키로 샌드박스 결제 1건 승인, 그 결제의 환불 1건 성공, 라이브 키 연결 테스트 성공, 플랫폼 실결제 허용. `sandboxMode: true`는 언제든 허용되고 바로 실결제가 멈춘다. 사용 중인 PG 중 하나라도 라이브면 구매자 결제는 라이브 PG로만 진행되고 샌드박스 PG는 쓰이지 않는다. 상점 플랫폼에 로그인한 **OWNER 전용**이다. ADMIN·STAFF, API 토큰(PAT), M2M 클라이언트, 3rd-party 앱이 위임받은 토큰은 스코프가 있어도 `403 INSUFFICIENT_ROLE`이다.

PATCH
/v1/store/payment-providers/{provider}

PG를 켜거나 끄고(enabled), 샌드박스 스위치(sandboxMode)와 이 PG로 받는 간편결제사(easyPayProviders)를 바꾼다. 셋 중 하나 이상을 보낸다. 켠 간편결제사마다 스토어프론트 결제 옵션이 생긴다. 끈 PG는 새 결제에 쓰이지 않지만, 이미 그 PG로 승인된 결제의 취소·환불은 계속 그 PG로 처리된다. sandboxMode: false(라이브 전환)는 liveGate.conditions를 모두 충족해야 한다 — 테스트 키 연결 테스트 성공, 지금 테스트 키로 샌드박스 결제 1건 승인, 그 결제의 환불 1건 성공, 라이브 키 연결 테스트 성공, 플랫폼 실결제 허용. sandboxMode: true는 언제든 허용되고 바로 실결제가 멈춘다. 사용 중인 PG 중 하나라도 라이브면 구매자 결제는 라이브 PG로만 진행되고 샌드박스 PG는 쓰이지 않는다. 상점 플랫폼에 로그인한 OWNER 전용이다. ADMIN·STAFF, API 토큰(PAT), M2M 클라이언트, 3rd-party 앱이 위임받은 토큰은 스코프가 있어도 403 INSUFFICIENT_ROLE이다.

Authorization

accessToken
headerAuthorizationBearer <token>

Sayren 계정 토큰(로그인 토큰 또는 개인 액세스 토큰, RFC 9068 JWT)

Path Parameters

provider*string

Header Parameters

X-Store-Id*string

대상 상점 id. 토큰의 상점 범위 밖이면 403 STORE_NOT_GRANTED, 없으면 400 STORE_ID_REQUIRED다

Request Body

application/json
  1. body
enabled?boolean

사용 여부. 켜려면 활성 환경(샌드박스면 TEST, 아니면 LIVE) 자격 증명이 모두 저장돼 있어야 한다(PAYMENT_PROVIDER_INCOMPLETE)

sandboxMode?boolean

샌드박스 스위치. true면 새 결제에 TEST 세트를 쓴다(항상 허용). false(라이브 전환)는 라이브 개방 조건을 모두 충족해야 한다(LIVE_GATE_NOT_MET)

easyPayProviders?array<>

이 PG로 받는 간편결제사 — 통째로 바꾼다. PG 계약(포트원은 채널)에 추가한 간편결제만 켠다. 켠 간편결제사마다 스토어프론트 결제 옵션이 하나씩 생긴다(포트원은 간편결제를 받는 채널이 있어야 한다)

Itemsitems <= 4

Response Body

성공

application/json
  1. response
meta*
data*
error*|null
curl -X PATCH 'https://api.sayren.io/v1/store/payment-providers/string' \  -H 'X-Store-Id: string' \  -H 'Content-Type: application/json' \  -d '{}'
{  "meta": {    "status": 200,    "code": "OK",    "message": "OK",    "isSuccess": true  },  "data": {    "provider": "tosspayments",    "displayName": "string",    "connected": true,    "enabled": true,    "priority": 0,    "environment": "TEST",    "publicConfig": {      "clientKey": "string"    },    "secrets": [      {        "field": "string",        "configured": true,        "masked": "string"      }    ],    "lastVerification": {      "result": "SUCCESS",      "message": "string",      "checkedAt": "string"    },    "updatedAt": "string",    "sandboxMode": true,    "credentialSets": {      "TEST": {        "environment": "TEST",        "publicConfig": {          "clientKey": "string"        },        "secrets": [          {            "field": "string",            "configured": true,            "masked": "string"          }        ],        "lastVerification": {          "result": "SUCCESS",          "message": "string",          "checkedAt": "string"        },        "updatedAt": "string"      },      "LIVE": {        "environment": "TEST",        "publicConfig": {          "clientKey": "string"        },        "secrets": [          {            "field": "string",            "configured": true,            "masked": "string"          }        ],        "lastVerification": {          "result": "SUCCESS",          "message": "string",          "checkedAt": "string"        },        "updatedAt": "string"      }    },    "liveGate": {      "status": "LOCKED",      "conditions": [        {          "code": "TEST_CONNECTION",          "met": true,          "message": "string"        }      ],      "openedAt": "string"    },    "easyPayProviders": [      "string"    ],    "retiredCredentialCount": 0,    "routingExclusion": null  },  "error": null}