The POST /payments/{id}/cancel call allows your platform to cancel a payment.
id required | string or null ID of the payment, generated by WePay when the payment is created. | ||||||
resource required | string Helps organize information by identifying the resource type of the object data.
| ||||||
path required | string The HTTP path of the resource. The path can be used to retrieve details about the resource and perform actions on it. | ||||||
required | object or null Details the owner resource and owner path. | ||||||
create_time required | integer <int64> >= 0 The UNIX timestamp for when the object was created. | ||||||
status required | string Status of the payment. Possible values include:
| ||||||
amount required | integer Amount in the lowest denomination. | ||||||
amount_refunded required | integer | ||||||
amount_disputed required | integer | ||||||
currency required | string ISO 4217 currency code. Possible values include:
| ||||||
required | object | ||||||
initiated_by required | string Indicates who initiated a payment. Possible values include:
| ||||||
reference_id required | string or null [ 1 .. 255 ] characters A custom reference ID for your platform to track the object. It can be any string. | ||||||
capture_at required | integer or null <int64> >= 0 For payments with a credit card payment method, designate the time at which this payment will capture using a UNIX epoch timestamp. The capture time cannot be more than 7 days in the future. Note that epoch timestamps use the UTC timezone. | ||||||
authorization_code required | string or null Authorization code returned from the card issuer after a credit card payment is authorized | ||||||
api_version | string | ||||||
auto_capture | boolean For payments with a credit card payment method, set to | ||||||
object or null Any custom data your platform chooses to attach to this resource. The custom data must be key-value pairs and not contain any personally identifiable information (PII) or payment card (PCI) data. | |||||||
object or null | |||||||
fee_amount | integer Specifies the fee amount your platform will collect from the payment. The amount should be in the lowest denomination. Note: Platforms leveraging the blended rate pricing model should use this parameter. This parameter is not applicable to platforms leveraging the Merchant IC+ pricing model. | ||||||
object or null The resource ID and path for the Order that your app created and associated with the payment. | |||||||
Array of objects or null Explains why this payment is pending and may contain an array of reasons. | |||||||
object or null Fetch this transaction record to account for the portion of this transaction which impact your application balance. | |||||||
object or null Fetch this transaction record to account for the merchant's portion of this transaction. |
INVALID_PARAMS, PAYMENT_CANNOT_BE_CANCELED
NOT_AUTHORIZED
UNEXPECTED_ERROR
{- "cancel_reason": "item(s) delayed - cannot fulfill order"
}
{- "amount": 1000,
- "amount_refunded": 1000,
- "amount_disputed": 1000,
- "auto_capture": false,
- "capture_at": null,
- "create_time": 1510080179,
- "currency": "USD",
- "custom_data": null,
- "failure_reason": null,
- "fee_amount": 0,
- "id": "00000000-0000-0000-0000-0000767bf5cd",
- "order": null,
- "owner": {
- "id": "be2b42e5-b808-40ae-9bbe-3291ab493f57",
- "path": "/accounts/be2b42e5-b808-40ae-9bbe-3291ab493f57",
- "resource": "accounts"
}, - "path": "/payments/00000000-0000-0000-0000-0000767bf5cd",
- "payment_method": {
- "id": "00000000-6363-0000-0000-000008b93a6e",
- "path": "/payment_methods/00000000-6363-0000-0000-000008b93a6e",
- "resource": "payment_methods"
}, - "pending_reasons": [
- {
- "details": [ ],
- "reason_code": "PENDING_CAPTURE",
- "reason_message": "Payment pending capture."
}
], - "resource": "payments",
- "status": "canceled",
- "authorization_code": "0224241",
- "txnr_app_fee": null,
- "txnr_merchant": null,
- "initiated_by": "none",
- "api_version": "3.0",
- "reference_id": "d6a60610-3a7e-4b9d-b56f-9005b9cd18ac"
}