1 /**
2 * @oas [post] /admin/payment-collections
3 * operationId: PostPaymentCollections
4 * summary: Create Payment Collection
5 * description: Create a payment collection.
6 * x-authenticated: true
7 * parameters:
8 * - name: fields
9 * in: query
10 * description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default
11 * fields. without prefix it will replace the entire default fields.
12 * required: false
13 * schema:
14 * type: string
15 * title: fields
16 * description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default
17 * fields. without prefix it will replace the entire default fields.
18 * externalDocs:
19 * url: "#select-fields-and-relations"
20 * security:
21 * - api_token: []
22 * - cookie_auth: []
23 * - jwt_token: []
24 * requestBody:
25 * content:
26 * application/json:
27 * schema:
28 * $ref: "#/components/schemas/AdminCreatePaymentCollection"
29 * x-codeSamples:
30 * - lang: JavaScript
31 * label: JS SDK
32 * source: |-
33 * import Medusa from "@medusajs/js-sdk"
34 *
35 * export const sdk = new Medusa({
36 * baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
37 * debug: import.meta.env.DEV,
38 * auth: {
39 * type: "session",
40 * },
41 * })
42 *
43 * sdk.admin.paymentCollection.create({
44 * order_id: "order_123"
45 * })
46 * .then(({ payment_collection }) => {
47 * console.log(payment_collection)
48 * })
49 * - lang: Shell
50 * label: cURL
51 * source: |-
52 * curl -X POST '{backend_url}/admin/payment-collections' \
53 * -H 'Authorization: Bearer {jwt_token}' \
54 * -H 'Content-Type: application/json' \
55 * --data-raw '{
56 * "order_id": "{value}"
57 * }'
58 * tags:
59 * - Payment Collections
60 * responses:
61 * "200":
62 * description: OK
63 * content:
64 * application/json:
65 * schema:
66 * $ref: "#/components/schemas/AdminPaymentCollectionResponse"
67 * "400":
68 * $ref: "#/components/responses/400_error"
69 * "401":
70 * $ref: "#/components/responses/unauthorized"
71 * "404":
72 * $ref: "#/components/responses/not_found_error"
73 * "409":
74 * $ref: "#/components/responses/invalid_state_error"
75 * "422":
76 * $ref: "#/components/responses/invalid_request_error"
77 * "500":
78 * $ref: "#/components/responses/500_error"
79 * x-workflow: createOrderPaymentCollectionWorkflow
80 * x-events: []
81 *
82 */
83