Create an ACH Return

Add an ACH Return for a transaction.

Accepts an ACHReturnRequest object.

Returns an ACHReturnResponse object.

Examples

  • require 'uri'
    require 'net/http'
    
    url = URI("https://api.opentransact.com/v1/ach-returns")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Post.new(url)
    request["authorization"] = "Bearer #{API_KEY}"
    request["content-type"] = 'application/vnd.api+json'
    request.body = {
    	"data": {
    		"type": "ach-returns",
    		"attributes": {
    			"code": "R08",
    			"metadata": {}
    		},
    		"relationships": {
    			"ach-batch-entry": {
    				"data": {
    					"type": "ach-batch-entries",
    					"id": ach_batch_entry_id
    				}
    			}
    		}
    	}
    }.to_json
    
    response = http.request(request)
    puts response.read_body
    
  • curl --request POST \
      --url https://api.opentransact.com/v1/ach-returns \
      --header 'authorization: Bearer $API_KEY' \
      --header 'content-type: application/vnd.api+json' \
      --data '{
    	"data": {
    		"type": "ach-returns",
    		"attributes": {
    			"code": "R08",
    			"metadata": {}
    		},
    		"relationships": {
    			"ach-batch-entry": {
    				"data": {
    					"type": "ach-batch-entries",
    					"id": $ACH_BATCH_ENTRY_ID
    				}
    			}
    		}
    	}
    }'