Welcome to Zuora Product Documentation

Explore our rich library of product information

Examples

This document provides examples for the Payment Method, Payment, and Refund objects, illustrating their requests and responses.

Here are three examples for the Payment Method, Payment, and Refund objects.

Payment Method object

Request 
{
    "billingAccount": {
        "accountNumber": "A-1621965929897",
        "currency": "USD"
    },
    "operation": "Validate",
    "paymentGatewayName": "UPCTokenGateway1621965929867",
    "paymentMethod": {
        "authAmount": "1",
        "currency": "USD",
        "type": "AmazonPay__c_12368",
        "upcTokenData": {
            "AmazonAccount": "SampleAmazonAccount",
            "AmazonToken": "3sample54cf04113e3f1595951874003",
            "AmazonTokenType": "Digital",
            "ShopperEmail": "sample@testmail.com",
            "ShoppingDate": ""
        }
    }, 
    "tenantId": "12368"
}
Response (HTTP code: 200)
{
    "gatewayResponseCode": "601",
    "gatewayResponseMessage": "The transaction has been approved.",
    "gatewaySecondTransactionId": "735788334",
    "gatewayTransactionId": "383315250",
    "responseCode": "Approved",
    "upcTokenData": "{ \"ShopperEmail\": \"sample@testmail.com\"}"
}

Payment object

Request
{
    "billingAccount": {
        "accountNumber": "A00000004",
        "currency": "USD"
    },
    "operation": "Payment",
    "payment": {
        "amount": "200",
        "currency": "USD",
        "id": "4028818579a43c3f0179aba917410419",
        "paymentNumber": "P-00000011"
    },
    "paymentGatewayName": "UPC_Token",
    "paymentMethod": {
        "id": "4028818579a43c3f0179aba2808103e8",
        "type": "AmazonPay__c_12368",
        "upcTokenData": {
            "AmazonAccount": "SampleAmazonAccount",
            "AmazonToken": "3sample54cf04113e3f1595951874003",
            "AmazonTokenType": "Digital",
            "ShopperEmail": "sample@testmail.com",
            "ShoppingDate": ""
        }
    },
    "tenantId": "12368"
}
Response  (HTTP code: 200)
{
    "gatewayResponseCode": "601",
    "gatewayResponseMessage": "The transaction has been approved.",
    "gatewaySecondTransactionId": "20998810",
    "gatewayTransactionId": "180404672",
    "responseCode": "Approved",
    "upcTokenData": "{ \"ShopperEmail\": \"sample@testmail.com\"}"
}

Refund object

Request 
{
    "billingAccount": {
        "accountNumber": "A00000004",
        "currency": "USD"
    },
    "operation": "Refund",
    "paymentGatewayName": "UPC_Token",
    "paymentMethod": {
        "id": "4028818579a43c3f0179aba2808103e8",
        "type": "AmazonPay__c_12368",
        "upcTokenData": {
            "AmazonAccount": "SampleAmazonAccount",
            "AmazonToken": "3sample54cf04113e3f1595951874003",
            "AmazonTokenType": "Digital",
            "ShopperEmail": "sample@testmail.com",
            "ShoppingDate": ""
        }
    },
    "refund": {
        "amount": "200",
        "id": "4028818579a43c3f0179aba6ebfb040d",
        "paymentId": "4028818579a43c3f0179aba2b14a03ea",
        "referenceId": "166435652",
        "refundNumber": "R-00000005"
    },
    "tenantId": "12368"
}
Response (HTTP code: 200)
{
    "gatewayResponseCode": "601",
    "gatewayResponseMessage": "The transaction has been approved.",
    "gatewaySecondTransactionId": "687106060",
    "gatewayTransactionId": "760690295",
    "responseCode": "Approved"
}

Overview of integrating your custom payment gateways and payment methods