Transactions

The transaction object

Get all transactions

GET https://api.moltin.com/v2/orders/:orderId/transactions

Path Parameters

Headers

{
    "data": [
        {
            "id": "015a3452-29a2-45b4-8b0d-0d697b224d45",
            "type": "transaction",
            "reference": "manual",
            "gateway": "manual",
            "amount": 19000,
            "currency": "USD",
            "transaction_type": "capture",
            "status": "complete",
            "relationships": {
                "order": {
                    "data": {
                        "type": "order",
                        "id": "24f17926-af4b-439c-ae3c-13aa371bce77"
                    }
                }
            },
            "meta": {
                "display_price": {
                    "amount": 19000,
                    "currency": "USD",
                    "formatted": "$190.00"
                },
				"timestamps": {
					"created_at": "2018-12-17T16:19:53.379Z",
					"updated_at": "2018-12-17T16:19:53.379Z"
				}
            }
        }
    ]
}
curl -X GET https://api.moltin.com/v2/orders/:orderId/transactions \
     -H "Authorization: Bearer XXXX"

Authorize payment

POST https://api.moltin.com/v2/orders/:orderId/payments

This endpoint is for those who wish to authorize payments using the manual gateway.

Path Parameters

Headers

Request Body

curl -X POST https://api.moltin.com/v2/orders/:orderId/payments \
     -H "Authorization: Bearer XXXX" \
     -H "Content-Type: application/json" \
     -d $'{
       "data": {
         "gateway": "manual",
         "method": "authorize"
       }
     }'

Capture payment

POST https://api.moltin.com/v2/orders/:orderId/transactions/:transactionId/capture

Use this endpoint to capture a previously authorized payment. You will use this endpoint when you invoke the Manual Payments API. In this step you can also pass in a custom reference, such as the payment reference from your chosen gateway.

Path Parameters

Headers

Request Body

{
    "data": {
        "id": "bcafac29-c8ca-4293-822c-d1213e085c7c",
        "type": "transaction",
        "reference": "manual",
        "custom_reference": "my_custom_reference",
        "gateway": "manual",
        "amount": 60000,
        "currency": "GBP",
        "transaction_type": "capture",
        "status": "complete",
        "relationships": {
            "order": {
                "data": {
                    "type": "order",
                    "id": "239f104c-0b56-433c-a5f8-b73349196269"
                }
            }
        },
        "meta": {
            "display_price": {
                "amount": 60000,
                "currency": "GBP",
                "formatted": "£600.00"
            },
            "timestamps": {
                "created_at": "2020-02-17T13:24:42Z",
                "updated_at": "2020-02-17T13:24:45Z"
            }
        }
    }
}
curl -X POST https://api.moltin.com/v2/orders/:orderId/transactions/:transaction_id/capture \
     -H "Authorization: Bearer XXXX"

Refund payment

POST https://api.moltin.com/v2/orders/:orderId/transactions/:transactionId/refund

You can mark a transaction as refunded. You will need to handle the actual refund on your side with your payment provider.

Path Parameters

Headers

{
    "data": {
        "id": "78cf43c3-b8fa-4b84-9444-d2adf81ed8bd",
        "type": "transaction",
        "reference": "manual",
        "gateway": "manual",
        "amount": 59992,
        "currency": "USD",
        "transaction_type": "refund",
        "status": "complete",
        "relationships": {
            "order": {
                "data": {
                    "type": "order",
                    "id": "a15894b0-7e6c-49e8-aad0-85b92e6501d4"
                }
            }
        }
    }
}

You will need to handle the actual refund with your payment provider

curl -X POST https://api.moltin.com/v2/orders/:orderId/transactions/:transactionId/refund \
     -H "Authorization: Bearer XXXX"

Confirm payment intent

POST https://api.moltin.com/v2/orders/:orderId/transactions/:transactionId/confirm

Path Parameters

Headers

Request Body

{
    "data": {
        "id": "b07c45c7-cd6d-466b-9ed9-bf44dd80696f",
        "type": "transaction",
        "reference": "pi_1FCnB5CTrBHFHKc35eHmhqnF",
        "gateway": "stripe_payment_intents",
        "amount": 5499,
        "currency": "USD",
        "transaction_type": "purchase",
        "status": "complete",
        "payment_intent": {
            "client_secret": "pi_1FCnB5CTrBHFHKc35eHmhqnF_secret_netgkKN9Cs9U4P98BG1T6esPa",
            "status": "requires_action"
        },
        "relationships": {
            "order": {
                "data": {
                    "type": "order",
                    "id": "a37e7229-3539-4acb-95b9-9705da42d20e"
                }
            }
        },
        "meta": {
            "display_price": {
                "amount": 5499,
                "currency": "USD",
                "formatted": "$54.99"
            },
            "timestamps": {
                "created_at": "2019-08-29T12:56:39Z",
                "updated_at": "2019-08-29T12:56:43Z"
            }
        }
    }
}
curl -X POST https://api.moltin.com/v2/orders/:orderId/transactions/:transactionId/confirm \
     -H "Authorization: Bearer XXXX" \
     -d $'{
        "data": {
          "gateway": "stripe_payment_intents",
          "method": "purchase",
          "payment": "pm_card_threeDSecureRequired"
        }
      }'

Last updated