# Northstar Payments API Create and retrieve payments in the Northstar sandbox. OpenAPI 3.1.0 · Версия 2.4.0 https://sandbox-api.northstar.example Sandbox [OpenAPI](/examples/payments-openapi.json) [Источник](/docs/payments#overview) # List payments GET /v1/payments operationId listPayments ## Ответы ### 200 A paginated list of payments ## cURL curl --request GET \ --url 'https://sandbox-api.northstar.example/v1/payments' [Источник](/docs/payments#listpayments-1) # Create a payment POST /v1/payments Creates a payment and returns its current processing state. operationId createPayment ## Обязательное тело запроса application/json Схема { "type": "object", "required": [ "amount", "currency" ], "properties": { "amount": { "type": "integer", "minimum": 1, "description": "Amount in the currency's minor unit." }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$" }, "reference": { "type": "string", "maxLength": 128 } } } Пример { "amount": 4200, "currency": "USD", "reference": "order_1048" } ## Ответы ### 201 Payment created application/json Схема { "type": "object", "required": [ "id", "amount", "currency", "status", "created_at" ], "properties": { "id": { "type": "string", "example": "pay_01JQ4Z8K7VMG2" }, "amount": { "type": "integer", "example": 4200 }, "currency": { "type": "string", "example": "USD" }, "status": { "type": "string", "enum": [ "pending", "succeeded", "failed", "refunded" ] }, "created_at": { "type": "string", "format": "date-time" } } } Пример { "id": "pay_01JQ4Z8K7VMG2", "amount": 4200, "currency": "USD", "status": "pending", "created_at": "2026-01-01T00:00:00Z" } ### 400 Invalid request ### 401 Missing or invalid credentials ## cURL curl --request POST \ --url 'https://sandbox-api.northstar.example/v1/payments' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "amount": 4200, "currency": "USD", "reference": "order_1048" }' [Источник](/docs/payments#createpayment-2) # Retrieve a payment GET /v1/payments/{paymentId} operationId getPayment ## Параметры path · paymentId · string · обязательный ## Ответы ### 200 Payment found application/json Схема { "type": "object", "required": [ "id", "amount", "currency", "status", "created_at" ], "properties": { "id": { "type": "string", "example": "pay_01JQ4Z8K7VMG2" }, "amount": { "type": "integer", "example": 4200 }, "currency": { "type": "string", "example": "USD" }, "status": { "type": "string", "enum": [ "pending", "succeeded", "failed", "refunded" ] }, "created_at": { "type": "string", "format": "date-time" } } } Пример { "id": "pay_01JQ4Z8K7VMG2", "amount": 4200, "currency": "USD", "status": "pending", "created_at": "2026-01-01T00:00:00Z" } ### 404 Payment not found ## cURL curl --request GET \ --url 'https://sandbox-api.northstar.example/v1/payments/string' [Источник](/docs/payments#getpayment-3) # Refund a payment POST /v1/payments/{paymentId}/refunds operationId refundPayment ## Ответы ### 201 Refund created ## cURL curl --request POST \ --url 'https://sandbox-api.northstar.example/v1/payments/{paymentId}/refunds' [Источник](/docs/payments#refundpayment-4) # CreatePaymentRequest ## Обязательные свойства amount currency ## Определение OpenAPI { "type": "object", "required": [ "amount", "currency" ], "properties": { "amount": { "type": "integer", "minimum": 1, "description": "Amount in the currency's minor unit." }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$" }, "reference": { "type": "string", "maxLength": 128 } } } [OpenAPI](/examples/payments-openapi.json) [Источник](/docs/payments#schema-createpaymentrequest-1) # Payment ## Обязательные свойства id amount currency status created_at ## Определение OpenAPI { "type": "object", "required": [ "id", "amount", "currency", "status", "created_at" ], "properties": { "id": { "type": "string", "example": "pay_01JQ4Z8K7VMG2" }, "amount": { "type": "integer", "example": 4200 }, "currency": { "type": "string", "example": "USD" }, "status": { "type": "string", "enum": [ "pending", "succeeded", "failed", "refunded" ] }, "created_at": { "type": "string", "format": "date-time" } } } [OpenAPI](/examples/payments-openapi.json) [Источник](/docs/payments#schema-payment-2)