Afterpay
App · 11 actions
Create checkout sessions and read Afterpay orders and payment limits.
Actions
| Action | What it does |
|---|---|
| Authorize and capture payment | Authorize and capture the full amount of a standard checkout in one call. |
| Authorize payment | Authorize a standard checkout token for later capture. |
| Capture authorized payment | Capture part or all of a previously authorized order amount. |
| Create checkout | Create a standard checkout session and return the URL you can send the customer to. |
| Get checkout | Read the details of a checkout session by token. |
| Get payment | Read an Afterpay order by its order ID. |
| Get payment by checkout token | Read an Afterpay order by its checkout token. |
| Get payment limits | Read the minimum and maximum order amount for your merchant account. |
| List payments | Read a page of Afterpay orders with payment state and an optional date range. |
| Refund payment | Refund a captured amount on an Afterpay payment. |
| Void payment | Release the remaining authorization on a payment. |
Authorize and capture payment
Authorize and capture the full amount of a standard checkout in one call.
Inputs
- Token
tokentextRequired - Token.
- Merchant reference
merchant_referencetext - Merchant reference.
Outputs
dataobject- The response from Afterpay.
Example output
{
"data": {
"created": "example",
"id": "example",
"merchantReference": "example",
"originalAmount": {
"amount": "example",
"currency": "example"
},
"paymentEvents": [
{}
],
"paymentState": "example",
"refunds": [
{}
],
"status": "APPROVED",
"token": "example"
}
}Authorize payment
Authorize a standard checkout token for later capture.
Inputs
- Token
tokentextRequired - Token.
- Merchant reference
merchant_referencetext - Merchant reference.
Outputs
dataobject- The response from Afterpay.
Example output
{
"data": {
"created": "example",
"id": "example",
"merchantReference": "example",
"originalAmount": {
"amount": "example",
"currency": "example"
},
"paymentEvents": [
{}
],
"paymentState": "example",
"refunds": [
{}
],
"status": "APPROVED",
"token": "example"
}
}Capture authorized payment
Capture part or all of a previously authorized order amount.
Inputs
- Order
order_idtextRequired - Order ID.
- Amount
amounttextRequired - A decimal amount in the order currency, such as 35.00.
- Currency
currencytextRequired - Currency.One of:
AUD,CAD,GBP,NZD,USD. - Request ID
request_idtext - A unique request ID to reuse if you repeat this operation.
Outputs
dataobject- The response from Afterpay.
Example output
{
"data": {
"created": "example",
"id": "example",
"merchantReference": "example",
"originalAmount": {
"amount": "example",
"currency": "example"
},
"paymentEvents": [
{}
],
"paymentState": "example",
"refunds": [
{}
],
"status": "APPROVED",
"token": "example"
}
}Create checkout
Create a standard checkout session and return the URL you can send the customer to.
Inputs
- Amount
amounttextRequired - The amount as a decimal, such as 35.00.
- Currency
currencytextRequired - Currency.One of:
AUD,CAD,GBP,NZD,USD. - Email
emailtextRequired - Email.
- First name
first_nametextRequired - First name.
- Last name
last_nametextRequired - Last name.
- Phone
phonetext - Phone.
- Confirmation URL
confirmation_urltextRequired - Confirmation URL.
- Cancellation URL
cancellation_urltextRequired - Cancellation URL.
- Merchant reference
merchant_referencetext - Merchant reference.
Outputs
dataobject- The response from Afterpay.
Example output
{
"data": {
"expires": "example",
"redirectCheckoutUrl": "example",
"token": "example"
}
}Get checkout
Read the details of a checkout session by token.
Inputs
- Token
tokentextRequired - Token.
Outputs
dataobject- The response from Afterpay.
Example output
{
"data": {
"amount": {
"amount": "example",
"currency": "example"
},
"consumer": {},
"expires": "example",
"merchantReference": "example",
"token": "example"
}
}Get payment
Read an Afterpay order by its order ID.
Inputs
- Order
order_idtextRequired - Order ID.
Outputs
dataobject- The response from Afterpay.
Example output
{
"data": {
"created": "example",
"id": "example",
"merchantReference": "example",
"originalAmount": {
"amount": "example",
"currency": "example"
},
"paymentEvents": [
{}
],
"paymentState": "example",
"refunds": [
{}
],
"status": "APPROVED",
"token": "example"
}
}Get payment by checkout token
Read an Afterpay order by its checkout token.
Inputs
- Token
tokentextRequired - Token.
Outputs
dataobject- The response from Afterpay.
Example output
{
"data": {
"created": "example",
"id": "example",
"merchantReference": "example",
"originalAmount": {
"amount": "example",
"currency": "example"
},
"paymentEvents": [
{}
],
"paymentState": "example",
"refunds": [
{}
],
"status": "APPROVED",
"token": "example"
}
}Get payment limits
Read the minimum and maximum order amount for your merchant account.
Inputs
None.
Outputs
dataobject- The response from Afterpay.
Example output
{
"data": {
"maximumAmount": {
"amount": "example",
"currency": "example"
},
"minimumAmount": {
"amount": "example",
"currency": "example"
}
}
}List payments
Read a page of Afterpay orders with payment state and an optional date range.
Inputs
- Start date
start_datedate and time - Start date.
- End date
end_datedate and time - End date.
- Statuses
statuseslist - Statuses.One or more of:
APPROVED,DECLINED. - Order IDS
order_idslist - Order IDS.
- Merchant references
merchant_referenceslist - Merchant references.
- Tokens
tokenslist - Tokens.
- Order by
order_bytext - Order by.One of:
createdAt,id,amount,merchantReference,email. - Ascending
ascendingtrue/false - Ascending.
- Limit
limitnumber - Limit.From 1 to 250.
- Offset
offsetnumber - Offset.At least 0.
Outputs
dataobject- The response from Afterpay.
Example output
{
"data": {
"limit": 1,
"nextPageUrl": "example",
"offset": 1,
"results": [
{
"created": "example",
"id": "example",
"merchantReference": "example",
"originalAmount": {
"amount": "example",
"currency": "example"
},
"paymentEvents": [
{}
],
"paymentState": "example",
"refunds": [
{}
],
"status": "APPROVED",
"token": "example"
}
],
"totalResults": 1
}
}Refund payment
Refund a captured amount on an Afterpay payment.
Inputs
- Order
order_idtextRequired - Order ID.
- Amount
amounttextRequired - A decimal amount in the order currency, such as 35.00.
- Currency
currencytextRequired - Currency.One of:
AUD,CAD,GBP,NZD,USD. - Merchant reference
merchant_referencetextRequired - Merchant reference.
- Request ID
request_idtextRequired - A unique request ID to reuse if you repeat this operation.
Outputs
dataobject- The response from Afterpay.
Example output
{
"data": {
"amount": {
"amount": "example",
"currency": "example"
},
"merchantReference": "example",
"refundId": "example",
"refundedAt": "example",
"requestId": "example"
}
}Void payment
Release the remaining authorization on a payment.
Inputs
- Order
order_idtextRequired - Order ID.
- Request ID
request_idtext - Request ID.
Outputs
dataobject- The response from Afterpay.
Example output
{
"data": {
"created": "example",
"id": "example",
"merchantReference": "example",
"originalAmount": {
"amount": "example",
"currency": "example"
},
"paymentEvents": [
{}
],
"paymentState": "example",
"refunds": [
{}
],
"status": "APPROVED",
"token": "example"
}
}