Payment

Payment Flow

LINE NEXT ➡️ PG

결제 생성 요청

post

결제 생성 요청 API입니다.

Authorizations
X-Authorization-HmacstringRequired

HMAC 생성 방식: BASE64( HMACSHA256(appSecret, {HTTP_METHOD}{URI}{X-API-Key}{X-Timestamp}{REQUEST_BODY}) )

  • 아래 서명값 대상을 문자열로 합쳐 PG사 측에 사전 발급된 appSecret으로 SHA256으로 서명값 생성 서명값 대상
  • HTTP_METHOD: 요청시 지정한 대문자 HTTP Method (ex: GET, POST, PUT 등)
  • URI: 요청한 URI (ex: /api/v1/payment)
  • HEADER: 요청 header 중 아래 값 포함
  • X-API-Key: PG사 측에 사전 발급된 api key (ex: X-API-Key: "f3248c3e-881c-42bd-abe7-1232023fe896") 
    
  • X-Timestamp: 요청시 밀리초단위 timestamp 값 (ex: X-Timestamp: 1773017787000) 단, 현재 시각과 5분 이상 차이가 나면 요청 거부
    
  • REQUESET_BODY: 요청시 request body
Header parameters
X-AppIdstringRequired

PG사에 사전 발급된 appId

X-TimestampstringRequired

요청 시 밀리초단위 timestamp 값

Body
orderIdstringRequired

PG 측 거래에 대한 ID 정보

storeIdstringRequired

PG 측이 제공하는 가맹점 ID

requestIdstringRequired

PG 측 Transaction 요청에 대한 고유 식별자

returnUrlstringRequired

결제 완료 후 복귀 페이지 returnUrl?transactionId=<Unifi Pay 측 생성 ID>

callbackUrlstringRequired

결제 완료 후 Unifi Pay에서 결과 전송 시 PG 측 수신 받는 주소

countryCodestringRequired

3글자 국가코드 (ISO Alpha-3 Country Code)

orderCurrencyCodestringRequired

화폐 코드 (ISO 4217) "USD"로 고정

Responses
chevron-right
200

The request was successful, and the server has returned the requested resource in the response body.

application/json
startPageUrlstringRequired

PG 측에서 유저에게 리다이렉션할 URL

transactionIdstringRequired

생성한 거래

post
/api/v1/payment
200

The request was successful, and the server has returned the requested resource in the response body.

결제 상태 확인

get

결제 상태 확인 API입니다.

Authorizations
X-Authorization-HmacstringRequired

HMAC 생성 방식: BASE64( HMACSHA256(appSecret, {HTTP_METHOD}{URI}{X-API-Key}{X-Timestamp}{REQUEST_BODY}) )

  • 아래 서명값 대상을 문자열로 합쳐 PG사 측에 사전 발급된 appSecret으로 SHA256으로 서명값 생성 서명값 대상
  • HTTP_METHOD: 요청시 지정한 대문자 HTTP Method (ex: GET, POST, PUT 등)
  • URI: 요청한 URI (ex: /api/v1/payment)
  • HEADER: 요청 header 중 아래 값 포함
  • X-API-Key: PG사 측에 사전 발급된 api key (ex: X-API-Key: "f3248c3e-881c-42bd-abe7-1232023fe896") 
    
  • X-Timestamp: 요청시 밀리초단위 timestamp 값 (ex: X-Timestamp: 1773017787000) 단, 현재 시각과 5분 이상 차이가 나면 요청 거부
    
  • REQUESET_BODY: 요청시 request body
Path parameters
transactionIdstringRequired
Header parameters
X-AppIdstringRequired

PG사에 사전 발급된 appId

X-TimestampstringRequired

요청 시 밀리초단위 timestamp 값

Responses
chevron-right
200

The request was successful, and the server has returned the requested resource in the response body.

application/json
statusstringRequired

결제 상태값

  • CONFIRMED
  • FAILED
orderIdstringRequired

PG 측 거래에 대한 ID 정보

storeIdstringRequired

PG 측이 제공하는 가맹점 ID

payAmountnumberRequired

실제 결제된 수량

orderAmountstringRequired

주문한 수량

transactionIdstringRequired

Unifi Pay에서 생성한 거래 번호

discountAmountnumberRequired

할인된 수량

payCurrencyCodestringRequired

"USD"로 고정

orderCurrencyCodestringRequired

화폐 코드 (ISO 4217) "USD"로 고정

get
/api/v1/payment/{transactionId}
200

The request was successful, and the server has returned the requested resource in the response body.

Last updated