API: refunds

GET /orders/{token}/refunds

This method returns all refunds for a specific order.

Resource URL

GET https://app.snipcart.com/api/v1/orders/{token}/refunds

Headers

Name Value Required? Description
Accept application/json Yes Our API only accepts application/json content type, so you must always specify Accept: application/json header in each request you make.

Parameters

Name Required? Type Description
token Yes Guid The order's unique identifier.

Example request

curl -H "Accept: application/json" \
    https://app.snipcart.com/api/v1/orders/4243490d-87c1-480e-b413-51db0b419313/refunds \
    -u {API_KEY}:

Example response

[
    {
        "id": "2223490d-84c1-480c-b713-50cb0b819313",
        "amount": 300.00,
        "comment": "A comment",
        "refundedByPaymentGateway: true
    },
    ...
]

GET /orders/{token}/refunds/{id}

This method returns a particular refund.

Resource URL

GET https://app.snipcart.com/api/v1/orders/{token}/refunds/{id}

Headers

Name Value Required? Description
Accept application/json Yes Our API only accepts application/json content type, so you must always specify Accept: application/json header in each request you make.

Parameters

Name Required? Type Description
token Yes Guid The order's unique identifier.
id Yes Guid The refund's unique identifier.

Example request

curl -H "Accept: application/json" \
    https://app.snipcart.com/api/v1/orders/4243490d-87c1-480e-b413-51db0b419313/refunds/2223490d-84c1-480c-b713-50cb0b819313 \
    -u {API_KEY}:

Example response

{
    "id": "2223490d-84c1-480c-b713-50cb0b819313",
    "amount": 300.00,
    "comment": "A comment",
    "refundedByPaymentGateway: true
}

POST /orders/{token}/refunds

This method creates a new discount.

Resource URL

POST https://app.snipcart.com/api/v1/orders/{token}/refunds

Headers

Name Value Required? Description
Accept application/json Yes Our API only accepts application/json content type, so you must always specify Accept: application/json header in each request you make.
Content-Type application/json Yes The request body needs to be JSON, so we specify the content type.

Parameters

Name Required? Type Description
token Yes Guid The order's unique identifier.
amount Yes decimal The amount of the refund.
comment No string The reason for the refund.

Example request

curl https://app.snipcart.com/api/v1/orders/4243490d-87c1-480e-b413-51db0b419313/refunds \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -u {YOUR_API_KEY}: \
  -d "{ amount: 200.50,
        comment: 'Reason for refund'
      }"

Example response

{
    "id": "2573490e-81d2-110c-b713-51ab0d823513",
    "amount": 200.50,
    "comment": "Reason for refund",
    "refundedByPaymentGateway: true
}

Was this article helpful?