Manual Payments
Out of the box, we are able to support payment gateways using the Manual Payments API.
warning
The manual gateway currently supports the authorize
and capture
methods only.
POST
Authorize payment
https://api.moltin.com/v2/orders/:orderId/payments
Path Parameters:
Name | Required | Type | Description |
---|---|---|---|
orderId | Required | string | The Universally Unique Identifier (UUID) of the order for which you want to authorize payment. |
Headers:
Name | Required | Type | Description |
---|---|---|---|
Authorization | Required | string | The Bearer token to grant access to the API. |
Body:
Name | Required | Type | Description |
---|---|---|---|
method | Required | string | The payment method. In this example, it is authorize . |
gateway | Required | string | This is manual for the manual payment gateway. |
201 Created
{
"data": {
"id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"type": "transaction",
"reference": "manual",
"gateway": "manual",
"amount": 100,
"currency": "USD",
"transaction-type": "authorize",
"status": "complete",
"relationships": {
"order": {
"data": {
"type": "order",
"id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
}
},
"meta": {
"display_price": {
"amount": 100,
"currency": "USD",
"formatted": "$100.00"
},
"created_at": "2019-01-31T17:20:39.378Z"
}
}
}
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"
}
}'
const MoltinGateway = require('@moltin/sdk').gateway
const Moltin = MoltinGateway({
client_id: 'X'
})
const orderId = 'XXXX'
const payment = {
gateway: 'manual',
method: 'authorize'
}
Moltin.Orders.Payment(orderId, payment).then(() => {
// Do something
})
POST
Capture transaction
https://api.moltin.com/v2/orders/:orderId/transactions/:transactionId/capture
Path Parameters:
Name | Required | Type | Description |
---|---|---|---|
transactionId | Required | string | The UUID of the previously-authorized transaction. |
orderId | Required | string | The UUID of the order you want to capture. |
Headers:
Name | Required | Type | Description |
---|---|---|---|
Authorization | Required | string | The Bearer token to grant access to the API. |
Body:
Name | Required | Type | Description |
---|---|---|---|
method | Required | string | The payment method. In this example, it is capture . |
gateway | Required | string | This is manual for the manual payment gateway. |
201 Created
{
"data": {
"id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"type": "transaction",
"reference": "manual",
"gateway": "manual",
"amount": 100,
"currency": "USD",
"transaction-type": "capture",
"status": "complete",
"relationships": {
"order": {
"data": {
"type": "order",
"id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
}
},
"meta": {
"display_price": {
"amount": 100,
"currency": "USD",
"formatted": "$100.00"
},
"created_at": "2019-01-31T17:20:39.378Z"
}
}
}
warning
The capture
method requires client_credentials authentication.
curl -X POST https://api.moltin.com/v2/orders/:orderId/transactions/:transactionId/capture \
-H "Authorization: Bearer XXXX" \
-H "Content-Type: application/json" \
-d $'{
"data": {
"gateway": "manual",
"method": "capture"
}
}'
const MoltinGateway = require('@moltin/sdk').gateway
const Moltin = MoltinGateway({
client_id: 'X',
client_secret: 'X'
})
const orderId = 'XXXX'
const transactionId = 'XXXX'
Moltin.Transactions.Capture({
order: orderId,
transaction: transactionId
}).then(() => {
// Do something
})