openapi: 3.1.0 info: title: Commerce Layer addresses refunds API version: 7.10.1 contact: name: API Support url: https://commercelayer.io email: support@commercelayer.io description: Headless Commerce for Global Brands. servers: - url: https://{your_organization_slug}.commercelayer.io/api description: API - url: https://core.commercelayer.io/users/sign_in description: Sign in - url: https://docs.commercelayer.io/api description: API reference security: - bearerAuth: [] tags: - name: refunds description: resource type paths: /captures/{captureId}/refunds: get: operationId: GET/captureId/refunds summary: Retrieve the refunds associated to the capture description: Retrieve the refunds associated to the capture tags: - refunds parameters: - name: captureId in: path schema: type: string required: true description: The resource's id responses: '200': description: The refunds associated to the capture /orders/{orderId}/refunds: get: operationId: GET/orderId/refunds summary: Retrieve the refunds associated to the order description: Retrieve the refunds associated to the order tags: - refunds parameters: - name: orderId in: path schema: type: string required: true description: The resource's id responses: '200': description: The refunds associated to the order /refunds: get: operationId: GET/refunds summary: List all refunds description: List all refunds tags: - refunds responses: '200': description: A list of refund objects content: application/vnd.api+json: schema: $ref: '#/components/schemas/refundResponseList' /refunds/{refundId}: get: operationId: GET/refunds/refundId summary: Retrieve a refund description: Retrieve a refund tags: - refunds parameters: - name: refundId in: path schema: type: string required: true description: The resource's id responses: '200': description: The refund object content: application/vnd.api+json: schema: $ref: '#/components/schemas/refundResponse' patch: operationId: PATCH/refunds/refundId summary: Update a refund description: Update a refund tags: - refunds parameters: - name: refundId in: path schema: type: string required: true description: The resource's id requestBody: required: true content: application/vnd.api+json: schema: $ref: '#/components/schemas/refundUpdate' responses: '200': description: The updated refund object content: application/vnd.api+json: schema: $ref: '#/components/schemas/refundResponse' /returns/{returnId}/reference_refund: get: operationId: GET/returnId/reference_refund summary: Retrieve the reference refund associated to the return description: Retrieve the reference refund associated to the return tags: - refunds parameters: - name: returnId in: path schema: type: string required: true description: The resource's id responses: '200': description: The reference_refund associated to the return components: schemas: refundUpdate: required: - data type: object properties: data: type: object required: - type - id - attributes properties: type: type: string description: The resource's type enum: - refunds id: type: string description: Unique identifier for the resource (hash). example: XAyRWNUzyN attributes: type: object properties: succeeded: type: boolean description: Indicates if the transaction is successful. example: false nullable: false _forward: type: boolean description: Send this attribute if you want to forward a stuck transaction to succeeded and update associated order states accordingly. example: true nullable: false reference: type: string description: A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever. example: ANY-EXTERNAL-REFEFERNCE nullable: true reference_origin: type: string description: Any identifier of the third party system that defines the reference code. example: ANY-EXTERNAL-REFEFERNCE-ORIGIN nullable: true metadata: type: object description: Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format. example: foo: bar nullable: true relationships: type: object properties: {} refundResponse: type: object properties: data: type: object properties: id: type: string description: Unique identifier for the resource (hash). example: XAyRWNUzyN type: type: string description: The resource's type enum: - refunds links: type: object properties: self: type: string description: URL attributes: $ref: '#/components/schemas/refund/properties/data/properties/attributes' relationships: type: object properties: order: type: object properties: links: type: object properties: self: type: string description: URL related: type: string description: URL data: type: object properties: type: type: string description: The resource's type enum: - order id: type: string description: The resource ID payment_source: type: object properties: links: type: object properties: self: type: string description: URL related: type: string description: URL data: type: object properties: type: type: string description: The resource's type enum: - payment_source id: type: string description: The resource ID attachments: type: object properties: links: type: object properties: self: type: string description: URL related: type: string description: URL data: type: object properties: type: type: string description: The resource's type enum: - attachments id: type: string description: The resource ID events: type: object properties: links: type: object properties: self: type: string description: URL related: type: string description: URL data: type: object properties: type: type: string description: The resource's type enum: - events id: type: string description: The resource ID event_stores: type: object properties: links: type: object properties: self: type: string description: URL related: type: string description: URL data: type: object properties: type: type: string description: The resource's type enum: - event_stores id: type: string description: The resource ID reference_capture: type: object properties: links: type: object properties: self: type: string description: URL related: type: string description: URL data: type: object properties: type: type: string description: The resource's type enum: - reference_capture id: type: string description: The resource ID return: type: object properties: links: type: object properties: self: type: string description: URL related: type: string description: URL data: type: object properties: type: type: string description: The resource's type enum: - return id: type: string description: The resource ID refundResponseList: type: object properties: data: type: array items: $ref: '#/components/schemas/refundResponse/properties/data' refund: properties: data: properties: attributes: type: object properties: number: type: string description: The transaction number, auto generated. example: 42/T/001 nullable: false type: type: string description: The transaction's type. example: authorizations nullable: false enum: - authorizations - voids - captures - refunds payment_method_type: type: string description: Information about the payment method used in the transaction. example: credit card nullable: true currency_code: type: string description: The international 3-letter currency code as defined by the ISO 4217 standard, inherited from the associated order. example: EUR nullable: false amount_cents: type: integer description: The transaction amount, in cents. example: 1500 nullable: false amount_float: type: number description: The transaction amount, float. example: 15.0 nullable: false formatted_amount: type: string description: The transaction amount, formatted. example: €15,00 nullable: false succeeded: type: boolean description: Indicates if the transaction is successful. example: false nullable: false message: type: string description: The message returned by the payment gateway. example: Accepted nullable: true error_code: type: string description: The error code, if any, returned by the payment gateway. example: '00001' nullable: true error_detail: type: string description: The error detail, if any, returned by the payment gateway. example: Already settled nullable: true token: type: string description: The token identifying the transaction, returned by the payment gateway. example: xxxx-yyyy-zzzz nullable: true gateway_transaction_id: type: string description: The ID identifying the transaction, returned by the payment gateway. example: xxxx-yyyy-zzzz nullable: true created_at: type: string description: Time at which the resource was created. example: '2018-01-01T12:00:00.000Z' nullable: false updated_at: type: string description: Time at which the resource was last updated. example: '2018-01-01T12:00:00.000Z' nullable: false reference: type: string description: A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever. example: ANY-EXTERNAL-REFEFERNCE nullable: true reference_origin: type: string description: Any identifier of the third party system that defines the reference code. example: ANY-EXTERNAL-REFEFERNCE-ORIGIN nullable: true metadata: type: object description: Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format. example: foo: bar nullable: true securitySchemes: bearerAuth: type: http scheme: bearer bearerFormat: JWT