> For the complete documentation index, see [llms.txt](https://developers-apps-in-toss.toss.im/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers-apps-in-toss.toss.im/api/zh/iap.md).

# 应用内支付

## 查询支付状态

> 可以查询已生成支付单的交易状态和交易流水。根据情况，即使未收到批准响应时也可使用。\
> \
> \### 业务错误码\
> \
> 以下错误与 HTTP 200 一起 \`resultType: FAIL\`返回。\
> \
> \| errorCode | 说明            |\
> \| --------- | ------------- |\
> \| \`4095\`    | 超出请求限额。请稍后再试。 |\
> \
> \*\*请求限额\*\*: 每个 App 每分钟 3,000 次

```json
{"openapi":"3.1.0","info":{"title":"Apps in Toss 合作伙伴 API","version":"1.0.0"},"tags":[{"description":"这是处理与应用内支付相关请求的 API。","name":"iap"}],"servers":[{"description":"运营（简易登录·消息发送·Toss 积分发放等）","url":"https://apps-in-toss-api.toss.im"}],"security":[{"mutualTLS":[]}],"components":{"securitySchemes":{"mutualTLS":{"description":"这是基于发给合作伙伴的客户端证书的 mTLS 认证。通过证书的 CN 识别迷你应用。证书签发·管理方法请参考 [使用服务器 API](https://developers-apps-in-toss.toss.im/documentation/integration/server-api) 文档。","type":"mutualTLS"}},"schemas":{"GetOrderRequest":{"description":"这是应用内支付订单状态查询请求体。","properties":{"orderId":{"description":"这是要查询的应用内支付订单 ID。","type":"string"}},"required":["orderId"]},"TossApiSuccessGetIapOrderPartnerStatusResult":{"description":"这是成功响应封装。","properties":{"resultType":{"description":"这是处理结果。成功时 `SUCCESS`。","enum":["SUCCESS"],"type":"string"},"success":{"$ref":"#/components/schemas/GetIapOrderPartnerStatusResult"}},"required":["resultType","success"],"type":"object"},"GetIapOrderPartnerStatusResult":{"description":"这是合作伙伴查询到的应用内支付订单状态信息。","properties":{"orderId":{"description":"这是查询到的订单唯一标识符。与请求中使用的 orderId 相同。","type":"string"},"reason":{"description":"这是对 status 值的人类可读补充说明。根据 status 不同，文案会变化。","type":"string"},"sku":{"description":"这是与订单关联的商品 SKU。如果无法确定订单状态（即 status 为 MINIAPP\\_MISMATCH、NOT\\_FOUND、ERROR 时），则不会返回。","type":"string"},"status":{"description":"订单状态。MINIAPP\\_MISMATCH：不是请求的迷你应用订单，NOT\\_FOUND：找不到订单，ORDER\\_IN\\_PROGRESS：订单仍在进行中，PAYMENT\\_COMPLETED：支付已完成，PURCHASED：购买已完成，FAILED：购买失败，REFUNDED：订单已退款，ERROR：因目录查询失败等导致超出正常范围的状态。","enum":["MINIAPP_MISMATCH","NOT_FOUND","ORDER_IN_PROGRESS","PAYMENT_COMPLETED","PURCHASED","FAILED","REFUNDED","ERROR"],"type":"string"},"statusDeterminedAt":{"description":"这是订单状态最后一次确定的时间。如果无法确定订单状态（即 status 为 MINIAPP\\_MISMATCH、NOT\\_FOUND、ERROR 时），则不会返回。","format":"date-time","type":"string"}},"required":["orderId","reason","status"]},"TossApiFail":{"description":"这是失败响应封装。业务错误会以 HTTP 200 返回，所以 `resultType`请务必确认。","properties":{"error":{"$ref":"#/components/schemas/TossApiError"},"resultType":{"description":"这是处理结果。 `SUCCESS`除 SUCCESS 之外的值都请视为失败处理。通常 `FAIL`。","enum":["FAIL","HTTP_TIMEOUT","NETWORK_ERROR","EXECUTION_FAIL","INTERRUPTED","INTERNAL_ERROR"],"type":"string"},"success":{"description":"失败时始终为 null。"}},"required":["error","resultType"],"type":"object"},"TossApiError":{"description":"这是错误详细信息。","properties":{"data":{"description":"这是错误附加信息。请求限额超出时 `retryAfterSeconds`会包含其中。","type":"object"},"errorCode":{"description":"这是错误代码。请参考各 API 的业务错误代码表。","type":"string"},"errorType":{"description":"这是内部错误分类值。错误区分时 `errorCode`请用于错误区分。","format":"int32","type":"integer"},"reason":{"description":"这是人类可读的错误说明。","type":"string"},"title":{"description":"这是错误标题。大多为 null。","type":"string"}},"required":["errorCode","reason"],"type":"object"},"TossApiValidationFail":{"description":"这是请求字段验证失败时的响应。","properties":{"error":{"$ref":"#/components/schemas/TossApiValidationFailError"},"resultType":{"description":"这是处理结果。 `SUCCESS`除 SUCCESS 之外的值都请视为失败处理。通常 `FAIL`。","enum":["FAIL","HTTP_TIMEOUT","NETWORK_ERROR","EXECUTION_FAIL","INTERRUPTED","INTERNAL_ERROR"],"type":"string"},"success":{"description":"失败时始终为 null。"}},"required":["error","resultType"],"type":"object"},"TossApiValidationFailError":{"description":"这是错误详细信息。","properties":{"data":{"description":"这是错误附加信息。请求限额超出时 `retryAfterSeconds`会包含其中。","properties":{"errorDetails":{"description":"这是按字段划分的验证失败详情列表。","items":{"$ref":"#/components/schemas/TossApiFieldError"},"type":"array"}},"type":"object"},"errorCode":{"description":"这是错误代码。请参考各 API 的业务错误代码表。","type":"string"},"errorType":{"description":"这是内部错误分类值。错误区分时 `errorCode`请用于错误区分。","format":"int32","type":"integer"},"reason":{"description":"这是人类可读的错误说明。","type":"string"},"title":{"description":"这是错误标题。大多为 null。","type":"string"}},"required":["errorCode","reason"],"type":"object"},"TossApiFieldError":{"description":"这是按字段划分的验证失败详情列表。","properties":{"field":{"description":"这是验证失败的字段名。","type":"string"},"message":{"description":"这是验证失败原因。","type":"string"},"rejectedValue":{"description":"这是被拒绝的输入值。"}},"type":"object"}}},"paths":{"/api-partner/v1/apps-in-toss/order/get-order-status":{"post":{"description":"可以查询已生成支付单的交易状态和交易流水。根据情况，即使未收到批准响应时也可使用。\n\n### 业务错误码\n\n以下错误与 HTTP 200 一起 `resultType: FAIL`返回。\n\n| errorCode | 说明            |\n| --------- | ------------- |\n| `4095`    | 超出请求限额。请稍后再试。 |\n\n**请求限额**: 每个 App 每分钟 3,000 次","operationId":"getIapOrderStatus","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetOrderRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"discriminator":{"mapping":{"FAIL":"#/components/schemas/TossApiFail","SUCCESS":"#/components/schemas/TossApiSuccessGetIapOrderPartnerStatusResult"},"propertyName":"resultType"},"oneOf":[{"$ref":"#/components/schemas/TossApiSuccessGetIapOrderPartnerStatusResult"},{"$ref":"#/components/schemas/TossApiFail"}]}}},"description":"已成功查询应用内支付状态"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TossApiValidationFail"}}},"description":"请求正文格式不正确。 `error.data.errorDetails`请在此查看各字段详情。"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TossApiFail"}}},"description":"分类未明的服务器错误。若持续失败，请联系合作伙伴支持渠道。"}},"summary":"查询支付状态","tags":["iap"]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developers-apps-in-toss.toss.im/api/zh/iap.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
