> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.mycargoextra.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.mycargoextra.com/_mcp/server.

# Authorize.net Invoice Payment With Saved Card

POST http://localhost:9000/api/v1/billing/authorize/pay/profile
Content-Type: application/json

Pays an invoice with a saved Authorize.net card.

Required body fields: `invoiceNo`, `amount`, `cloneId`, `customerPaymentProfileId`. Optional: `partPaymentFromWalletBalance` when the customer is combining wallet balance with card payment.

Response fields: `status` (`success` or `pending`), `authorizePayStatus` (1 approved, 0 held, -1 declined/error), `transactionId`, `amount`, `invoice`.

Possible errors:
- 404: Invoice not found - invoice number does not belong to the customer.
- 400: Bad Invoice - invoice already paid or in invalid payment state.
- 400: Clone not found - `cloneId` is invalid or does not match invoice.
- 400: Invalid Amount - amount paid does not match expected amount.
- 400: Invalid Currency - invoice currency no longer resolves.
- 400: Payment method is disabled - Authorize.net is not active for the currency.
- 400: Please set your billing address to continue - customer billing address is required.
- 404: Billing address not found - saved billing address reference is invalid.
- 404: Saved card not found - saved card profile is missing or inactive.
- 400: Authorize.net transaction failed - card declined, held, or gateway returned an error.
- 400: Missing One or More Required Parameters - required body/query fields were not supplied.
- 401: Unauthorized - token is missing, expired, invalid, or the account/token pair was not found.
- 403: Access denied - gateway traffic guard/rate policy blocked the request.
- 429: Too many requests - gateway rate limit exceeded.
- 500: Unexpected Error - unhandled gateway or downstream service failure.

Reference: https://docs.mycargoextra.com/cargo-extra-gateway-api-copy/billing/authorize/billing-authorize-pay/billing-authorize-billing-authorize-pay-profile/authorize-net-invoice-payment-with-saved-card

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /api/v1/billing/authorize/pay/profile:
    post:
      operationId: authorize-net-invoice-payment-with-saved-card
      summary: Authorize.net Invoice Payment With Saved Card
      description: >-
        Pays an invoice with a saved Authorize.net card.


        Required body fields: `invoiceNo`, `amount`, `cloneId`,
        `customerPaymentProfileId`. Optional: `partPaymentFromWalletBalance`
        when the customer is combining wallet balance with card payment.


        Response fields: `status` (`success` or `pending`), `authorizePayStatus`
        (1 approved, 0 held, -1 declined/error), `transactionId`, `amount`,
        `invoice`.


        Possible errors:

        - 404: Invoice not found - invoice number does not belong to the
        customer.

        - 400: Bad Invoice - invoice already paid or in invalid payment state.

        - 400: Clone not found - `cloneId` is invalid or does not match invoice.

        - 400: Invalid Amount - amount paid does not match expected amount.

        - 400: Invalid Currency - invoice currency no longer resolves.

        - 400: Payment method is disabled - Authorize.net is not active for the
        currency.

        - 400: Please set your billing address to continue - customer billing
        address is required.

        - 404: Billing address not found - saved billing address reference is
        invalid.

        - 404: Saved card not found - saved card profile is missing or inactive.

        - 400: Authorize.net transaction failed - card declined, held, or
        gateway returned an error.

        - 400: Missing One or More Required Parameters - required body/query
        fields were not supplied.

        - 401: Unauthorized - token is missing, expired, invalid, or the
        account/token pair was not found.

        - 403: Access denied - gateway traffic guard/rate policy blocked the
        request.

        - 429: Too many requests - gateway rate limit exceeded.

        - 500: Unexpected Error - unhandled gateway or downstream service
        failure.
      tags:
        - >-
          subpackage_billing.subpackage_billing/authorize.subpackage_billing/authorize/billingAuthorizePay.subpackage_billing/authorize/billingAuthorizePay/billingAuthorizeBillingAuthorizePayProfile
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/billing_authorize_billing > authorize >
                  pay_billing > authorize > billing > authorize > pay >
                  profile_Authorize.net Invoice Payment With Saved
                  Card_Response_200
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PostApiV1BillingAuthorizePayProfileRequestBadRequestError
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PostApiV1BillingAuthorizePayProfileRequestUnauthorizedError
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PostApiV1BillingAuthorizePayProfileRequestForbiddenError
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PostApiV1BillingAuthorizePayProfileRequestNotFoundError
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PostApiV1BillingAuthorizePayProfileRequestTooManyRequestsError
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PostApiV1BillingAuthorizePayProfileRequestInternalServerError
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                amount:
                  type: integer
                cloneId:
                  type: string
                invoiceNo:
                  type: integer
                customerPaymentProfileId:
                  type: string
                partPaymentFromWalletBalance:
                  $ref: >-
                    #/components/schemas/ApiV1BillingAuthorizePayProfilePostRequestBodyContentApplicationJsonSchemaPartPaymentFromWalletBalance
              required:
                - amount
                - cloneId
                - invoiceNo
                - customerPaymentProfileId
                - partPaymentFromWalletBalance
servers:
  - url: http://localhost:9000
    description: http://localhost:9000
components:
  schemas:
    ApiV1BillingAuthorizePayProfilePostRequestBodyContentApplicationJsonSchemaPartPaymentFromWalletBalance:
      type: object
      properties:
        currency:
          type: string
        exchangeRate:
          type: integer
        chargeTotalBefore:
          type: integer
        chargeTotalCurrent:
          type: integer
      required:
        - currency
        - exchangeRate
        - chargeTotalBefore
        - chargeTotalCurrent
      title: >-
        ApiV1BillingAuthorizePayProfilePostRequestBodyContentApplicationJsonSchemaPartPaymentFromWalletBalance
    billing_authorize_billing > authorize > pay_billing > authorize > billing > authorize > pay > profile_Authorize.net Invoice Payment With Saved Card_Response_200:
      type: object
      properties:
        key_0:
          type: integer
        key_1:
          type: string
        key_2:
          type: number
          format: double
        key_3:
          type: string
        key_4:
          type: boolean
      required:
        - key_0
        - key_1
        - key_2
        - key_3
        - key_4
      title: >-
        billing_authorize_billing > authorize > pay_billing > authorize >
        billing > authorize > pay > profile_Authorize.net Invoice Payment With
        Saved Card_Response_200
    PostApiV1BillingAuthorizePayProfileRequestBadRequestError:
      type: object
      properties:
        message:
          type: string
      required:
        - message
      title: PostApiV1BillingAuthorizePayProfileRequestBadRequestError
    PostApiV1BillingAuthorizePayProfileRequestUnauthorizedError:
      type: object
      properties:
        message:
          type: string
      required:
        - message
      title: PostApiV1BillingAuthorizePayProfileRequestUnauthorizedError
    PostApiV1BillingAuthorizePayProfileRequestForbiddenError:
      type: object
      properties:
        message:
          type: string
      required:
        - message
      title: PostApiV1BillingAuthorizePayProfileRequestForbiddenError
    PostApiV1BillingAuthorizePayProfileRequestNotFoundError:
      type: object
      properties:
        message:
          type: string
      required:
        - message
      title: PostApiV1BillingAuthorizePayProfileRequestNotFoundError
    PostApiV1BillingAuthorizePayProfileRequestTooManyRequestsError:
      type: object
      properties:
        message:
          type: string
      required:
        - message
      title: PostApiV1BillingAuthorizePayProfileRequestTooManyRequestsError
    PostApiV1BillingAuthorizePayProfileRequestInternalServerError:
      type: object
      properties:
        message:
          type: string
      required:
        - message
      title: PostApiV1BillingAuthorizePayProfileRequestInternalServerError

```

## Examples



**Request**

```json
{
  "amount": 150,
  "cloneId": "64f0a1b2c3d4e5f678901234",
  "invoiceNo": 100456,
  "customerPaymentProfileId": "cusp_7890abcd1234efgh5678",
  "partPaymentFromWalletBalance": {
    "currency": "USD",
    "exchangeRate": 1,
    "chargeTotalBefore": 200,
    "chargeTotalCurrent": 50
  }
}
```

**Response**

```json
{
  "key_0": 1,
  "key_1": "TXN1234567890",
  "key_2": 150,
  "key_3": "100456",
  "key_4": true
}
```

**SDK Code**

```python billing_authorize_billing > authorize > pay_billing > authorize > billing > authorize > pay > profile_Authorize.net Invoice Payment With Saved Card_example
import requests

url = "http://localhost:9000/api/v1/billing/authorize/pay/profile"

payload = {
    "amount": 150,
    "cloneId": "64f0a1b2c3d4e5f678901234",
    "invoiceNo": 100456,
    "customerPaymentProfileId": "cusp_7890abcd1234efgh5678",
    "partPaymentFromWalletBalance": {
        "currency": "USD",
        "exchangeRate": 1,
        "chargeTotalBefore": 200,
        "chargeTotalCurrent": 50
    }
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript billing_authorize_billing > authorize > pay_billing > authorize > billing > authorize > pay > profile_Authorize.net Invoice Payment With Saved Card_example
const url = 'http://localhost:9000/api/v1/billing/authorize/pay/profile';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"amount":150,"cloneId":"64f0a1b2c3d4e5f678901234","invoiceNo":100456,"customerPaymentProfileId":"cusp_7890abcd1234efgh5678","partPaymentFromWalletBalance":{"currency":"USD","exchangeRate":1,"chargeTotalBefore":200,"chargeTotalCurrent":50}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go billing_authorize_billing > authorize > pay_billing > authorize > billing > authorize > pay > profile_Authorize.net Invoice Payment With Saved Card_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "http://localhost:9000/api/v1/billing/authorize/pay/profile"

	payload := strings.NewReader("{\n  \"amount\": 150,\n  \"cloneId\": \"64f0a1b2c3d4e5f678901234\",\n  \"invoiceNo\": 100456,\n  \"customerPaymentProfileId\": \"cusp_7890abcd1234efgh5678\",\n  \"partPaymentFromWalletBalance\": {\n    \"currency\": \"USD\",\n    \"exchangeRate\": 1,\n    \"chargeTotalBefore\": 200,\n    \"chargeTotalCurrent\": 50\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby billing_authorize_billing > authorize > pay_billing > authorize > billing > authorize > pay > profile_Authorize.net Invoice Payment With Saved Card_example
require 'uri'
require 'net/http'

url = URI("http://localhost:9000/api/v1/billing/authorize/pay/profile")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"amount\": 150,\n  \"cloneId\": \"64f0a1b2c3d4e5f678901234\",\n  \"invoiceNo\": 100456,\n  \"customerPaymentProfileId\": \"cusp_7890abcd1234efgh5678\",\n  \"partPaymentFromWalletBalance\": {\n    \"currency\": \"USD\",\n    \"exchangeRate\": 1,\n    \"chargeTotalBefore\": 200,\n    \"chargeTotalCurrent\": 50\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java billing_authorize_billing > authorize > pay_billing > authorize > billing > authorize > pay > profile_Authorize.net Invoice Payment With Saved Card_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("http://localhost:9000/api/v1/billing/authorize/pay/profile")
  .header("Content-Type", "application/json")
  .body("{\n  \"amount\": 150,\n  \"cloneId\": \"64f0a1b2c3d4e5f678901234\",\n  \"invoiceNo\": 100456,\n  \"customerPaymentProfileId\": \"cusp_7890abcd1234efgh5678\",\n  \"partPaymentFromWalletBalance\": {\n    \"currency\": \"USD\",\n    \"exchangeRate\": 1,\n    \"chargeTotalBefore\": 200,\n    \"chargeTotalCurrent\": 50\n  }\n}")
  .asString();
```

```php billing_authorize_billing > authorize > pay_billing > authorize > billing > authorize > pay > profile_Authorize.net Invoice Payment With Saved Card_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'http://localhost:9000/api/v1/billing/authorize/pay/profile', [
  'body' => '{
  "amount": 150,
  "cloneId": "64f0a1b2c3d4e5f678901234",
  "invoiceNo": 100456,
  "customerPaymentProfileId": "cusp_7890abcd1234efgh5678",
  "partPaymentFromWalletBalance": {
    "currency": "USD",
    "exchangeRate": 1,
    "chargeTotalBefore": 200,
    "chargeTotalCurrent": 50
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp billing_authorize_billing > authorize > pay_billing > authorize > billing > authorize > pay > profile_Authorize.net Invoice Payment With Saved Card_example
using RestSharp;

var client = new RestClient("http://localhost:9000/api/v1/billing/authorize/pay/profile");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"amount\": 150,\n  \"cloneId\": \"64f0a1b2c3d4e5f678901234\",\n  \"invoiceNo\": 100456,\n  \"customerPaymentProfileId\": \"cusp_7890abcd1234efgh5678\",\n  \"partPaymentFromWalletBalance\": {\n    \"currency\": \"USD\",\n    \"exchangeRate\": 1,\n    \"chargeTotalBefore\": 200,\n    \"chargeTotalCurrent\": 50\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift billing_authorize_billing > authorize > pay_billing > authorize > billing > authorize > pay > profile_Authorize.net Invoice Payment With Saved Card_example
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "amount": 150,
  "cloneId": "64f0a1b2c3d4e5f678901234",
  "invoiceNo": 100456,
  "customerPaymentProfileId": "cusp_7890abcd1234efgh5678",
  "partPaymentFromWalletBalance": [
    "currency": "USD",
    "exchangeRate": 1,
    "chargeTotalBefore": 200,
    "chargeTotalCurrent": 50
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:9000/api/v1/billing/authorize/pay/profile")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```