MutacjaBetaMutation.createOrderPayment
Records a payment received for an order, in the order currency. Does not change Order.paymentStatus: set it with updateOrder when the order is paid. Refused for an archived order.
| Wymagany zakres | orders:write |
|---|---|
| Dostępne od | Prynt 0.28.0 |
| Stabilność | Beta (co to znaczy) |
| Ponawianie | Wysyłaj nagłówek Idempotency-Key, żeby ponowienie nie wykonało zapisu drugi raz. Zapisy i idempotencja |
Argumenty
| Nazwa | Typ | Opis |
|---|---|---|
inputwymagane | CreateOrderPaymentInput! | The payment and the order it is for. |
Zwraca
Przykład
mutation RecordPayment($input: CreateOrderPaymentInput!) { createOrderPayment(input: $input) { id orderId method reference paidAt }}{ "input": { "orderId": "4b0d2a63-8e5f-4c9b-8f32-6d7e8f9a0b12", "amount": 553.5, "method": "ONLINE_PREPAID", "reference": "P24-2026-10-05-77812", "paidAt": "2026-10-05T09:38:00Z" }}IDEMPOTENCY_KEY=$(uuidgen) # ponawiaj z tym samym kluczem
curl -sS https://twoja-drukarnia.prynt.pl/api/v1/graphql \ -H "Authorization: Bearer $PRYNT_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $IDEMPOTENCY_KEY" \ --data-binary @- <<'JSON'{ "query": "mutation RecordPayment($input: CreateOrderPaymentInput!) {\n createOrderPayment(input: $input) {\n id\n orderId\n method\n reference\n paidAt\n }\n}", "variables": { "input": { "orderId": "4b0d2a63-8e5f-4c9b-8f32-6d7e8f9a0b12", "amount": 553.5, "method": "ONLINE_PREPAID", "reference": "P24-2026-10-05-77812", "paidAt": "2026-10-05T09:38:00Z" } }}JSON{ "data": { "createOrderPayment": { "id": "cf6b82a3-5e70-4b92-8dbe-3f4a5b6c7d85", "orderId": "4b0d2a63-8e5f-4c9b-8f32-6d7e8f9a0b12", "method": "ONLINE_PREPAID", "reference": "P24-2026-10-05-77812", "paidAt": "2026-10-05T09:38:00.000Z" } }}